yudaoyang
parent
dac1bbfddb
commit
1b31c2e7c8
|
@ -0,0 +1,22 @@
|
||||||
|
{
|
||||||
|
"商品ID": "Long",
|
||||||
|
"商品图片": "String",
|
||||||
|
"活动名称": "String",
|
||||||
|
"活动简介": "String",
|
||||||
|
"商品单位": "String",
|
||||||
|
"商品的轮播图": [
|
||||||
|
"String", "String"
|
||||||
|
],
|
||||||
|
"活动时间": "date",
|
||||||
|
"策略类型": "String",
|
||||||
|
"策略ID": "Long",
|
||||||
|
"商品规格List": [
|
||||||
|
{
|
||||||
|
"规格SKU": "String",
|
||||||
|
"拼团价格": "BigDecimal",
|
||||||
|
"拼团库存": "Long"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"排序": "Integer",
|
||||||
|
"详情": "String"
|
||||||
|
}
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
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;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询模型
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-20 14:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class QueryModel<T> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 当前记录起始索引
|
||||||
|
*/
|
||||||
|
private Integer pageNum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每页显示记录数
|
||||||
|
*/
|
||||||
|
private Integer pageSize;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序列
|
||||||
|
*/
|
||||||
|
private String orderByColumn;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 排序的方向desc或者asc
|
||||||
|
*/
|
||||||
|
private boolean isAsc = true;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建模型分页对象
|
||||||
|
* @param pageDomain 分页参数
|
||||||
|
* @return 模型分页对象
|
||||||
|
*/
|
||||||
|
public T domainBuild(PageDomain pageDomain) {
|
||||||
|
this.pageNum = pageDomain.getPageNum();
|
||||||
|
this.pageSize = pageDomain.getPageSize();
|
||||||
|
this.orderByColumn = pageDomain.getOrderByColumn();
|
||||||
|
this.isAsc = "asc".equals(pageDomain.getIsAsc());
|
||||||
|
return (T) this;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构建查询分页对象
|
||||||
|
* @return 查询分页对象
|
||||||
|
*/
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,12 +1,20 @@
|
||||||
package com.muyu.common.core.web.page;
|
package com.muyu.common.core.web.page;
|
||||||
|
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页数据
|
* 分页数据
|
||||||
*
|
*
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class PageDomain {
|
public class PageDomain {
|
||||||
/**
|
/**
|
||||||
* 当前记录起始索引
|
* 当前记录起始索引
|
||||||
|
@ -40,33 +48,6 @@ public class PageDomain {
|
||||||
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
return StringUtils.toUnderScoreCase(orderByColumn) + " " + isAsc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getPageNum () {
|
|
||||||
return pageNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPageNum (Integer pageNum) {
|
|
||||||
this.pageNum = pageNum;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Integer getPageSize () {
|
|
||||||
return pageSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPageSize (Integer pageSize) {
|
|
||||||
this.pageSize = pageSize;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getOrderByColumn () {
|
|
||||||
return orderByColumn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setOrderByColumn (String orderByColumn) {
|
|
||||||
this.orderByColumn = orderByColumn;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getIsAsc () {
|
|
||||||
return isAsc;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setIsAsc (String isAsc) {
|
public void setIsAsc (String isAsc) {
|
||||||
if (StringUtils.isNotEmpty(isAsc)) {
|
if (StringUtils.isNotEmpty(isAsc)) {
|
||||||
|
@ -87,7 +68,4 @@ public class PageDomain {
|
||||||
return reasonable;
|
return reasonable;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setReasonable (Boolean reasonable) {
|
|
||||||
this.reasonable = reasonable;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
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.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
|
||||||
|
@Configuration
|
||||||
|
public class MybatisPlusConfig {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加分页插件
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
|
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL)); // 如果配置多个插件, 切记分页最后添加
|
||||||
|
// 如果有多数据源可以不配具体类型, 否则都建议配上具体的 DbType
|
||||||
|
return interceptor;
|
||||||
|
}
|
||||||
|
}
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-marketing</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<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>
|
|
@ -0,0 +1,73 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName(value = "activity_team_info", autoResultMap = true)
|
||||||
|
public class ActivityTeamInfo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private long productId;
|
||||||
|
/**
|
||||||
|
* 商品活动图
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 轮播图
|
||||||
|
*/
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 活动排序
|
||||||
|
*/
|
||||||
|
private long sort;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private long strategyId;
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName(value = "activity_team_product_sku_info", autoResultMap = true)
|
||||||
|
public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private long id;
|
||||||
|
/**
|
||||||
|
* 活动ID
|
||||||
|
*/
|
||||||
|
private long teamId;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品SKU
|
||||||
|
*/
|
||||||
|
private String productSku;
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
/**
|
||||||
|
* 剩余库存
|
||||||
|
*/
|
||||||
|
private Long remainStock;
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
}
|
|
@ -0,0 +1,55 @@
|
||||||
|
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", autoResultMap = true)
|
||||||
|
public class TeamStrategyExemption extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键
|
||||||
|
*/
|
||||||
|
@TableId(value = "id", type = IdType.AUTO)
|
||||||
|
private long id;
|
||||||
|
/**
|
||||||
|
* 持续时间
|
||||||
|
*/
|
||||||
|
private long duration;
|
||||||
|
/**
|
||||||
|
* 免单人数
|
||||||
|
*/
|
||||||
|
private long exemptionNumber;
|
||||||
|
/**
|
||||||
|
* 最大购买量
|
||||||
|
*/
|
||||||
|
private long maxBuy;
|
||||||
|
/**
|
||||||
|
* 单次购买量
|
||||||
|
*/
|
||||||
|
private long oneBuy;
|
||||||
|
/**
|
||||||
|
* 虚拟人数
|
||||||
|
*/
|
||||||
|
private long virtualNumber;
|
||||||
|
/**
|
||||||
|
* 面单类型
|
||||||
|
*/
|
||||||
|
private String type;
|
||||||
|
/**
|
||||||
|
* 返款阶梯
|
||||||
|
*/
|
||||||
|
private String ruleInfo;
|
||||||
|
/**
|
||||||
|
* 策略状态
|
||||||
|
*/
|
||||||
|
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 TeamStrategyExemptionHundred 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 TeamStrategyExemptionOrdinary 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;
|
||||||
|
}
|
|
@ -0,0 +1,99 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
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.util.Date;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动雷彪查询结果模型
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-20 14:18:10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamInfoListModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 参团人数
|
||||||
|
*/
|
||||||
|
private Long addTeamNumber;
|
||||||
|
/**
|
||||||
|
* 拼团人数
|
||||||
|
*/
|
||||||
|
private Long attendNumber;
|
||||||
|
/**
|
||||||
|
* 团购结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 开团人数
|
||||||
|
*/
|
||||||
|
private Long openTeamNumber;
|
||||||
|
/**
|
||||||
|
* 拼团商品图片
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 商品价格
|
||||||
|
*/
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
/**
|
||||||
|
* 剩余库存
|
||||||
|
*/
|
||||||
|
private Long remainStock;
|
||||||
|
/**
|
||||||
|
* 团购状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
/**
|
||||||
|
* 团购库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
|
||||||
|
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())
|
||||||
|
.name(activityTeamInfo.getName())
|
||||||
|
.endTime(activityTeamInfo.getEndTime())
|
||||||
|
.productImage(activityTeamInfo.getProductImage())
|
||||||
|
.status(activityTeamInfo.getStatus())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.common.core.web.model.QueryModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动雷彪查询模型
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-20 14:18:10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ActivityTeamInfoListQueryModel extends QueryModel<ActivityTeamInfoListQueryModel> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索关键词
|
||||||
|
*/
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
|
@ -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) {
|
||||||
|
TeamProductDiscountPriceModel.builder()
|
||||||
|
.productPrice(productPrice)
|
||||||
|
.teamPrice(teamPrice)
|
||||||
|
.discount(
|
||||||
|
productPrice.subtract(teamPrice).divide(productPrice, 2, RoundingMode.HALF_UP).doubleValue()
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购商品库存模型
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-21 14:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TeamProductStockModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团总库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团剩余库存
|
||||||
|
*/
|
||||||
|
private Long remainStock;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.marketing.domain.req;
|
||||||
|
|
||||||
|
import com.muyu.common.core.web.page.PageDomain;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class TeamInfoListReq extends PageDomain {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索关键词
|
||||||
|
*/
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过当前对象构建业务查询模型
|
||||||
|
* @return 业务查询模型
|
||||||
|
*/
|
||||||
|
public ActivityTeamInfoListQueryModel buildQueryModel() {
|
||||||
|
return ActivityTeamInfoListQueryModel.builder()
|
||||||
|
.keyWord(this.keyWord)
|
||||||
|
.status(this.status)
|
||||||
|
.build()
|
||||||
|
.domainBuild(this);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,90 @@
|
||||||
|
package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
|
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TeamInfoListResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 参团人数
|
||||||
|
*/
|
||||||
|
private Long addTeamNumber;
|
||||||
|
/**
|
||||||
|
* 拼团人数
|
||||||
|
*/
|
||||||
|
private Long attendNumber;
|
||||||
|
/**
|
||||||
|
* 团购结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 开团人数
|
||||||
|
*/
|
||||||
|
private Long openTeamNumber;
|
||||||
|
/**
|
||||||
|
* 拼团商品图片
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 商品价格
|
||||||
|
*/
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
/**
|
||||||
|
* 剩余库存
|
||||||
|
*/
|
||||||
|
private Long remainStock;
|
||||||
|
/**
|
||||||
|
* 团购状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
/**
|
||||||
|
* 团购库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询结果,构建为响应对象
|
||||||
|
* @param activityTeamInfoListModel 列表数据查询结果
|
||||||
|
* @return 响应对象
|
||||||
|
*/
|
||||||
|
public static TeamInfoListResp listModelBuild(ActivityTeamInfoListModel activityTeamInfoListModel) {
|
||||||
|
return TeamInfoListResp.builder()
|
||||||
|
.id(activityTeamInfoListModel.getId())
|
||||||
|
.name(activityTeamInfoListModel.getName())
|
||||||
|
.openTeamNumber(activityTeamInfoListModel.getOpenTeamNumber())
|
||||||
|
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
||||||
|
.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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,26 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-marketing</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>marketing-remote</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>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>marketing-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</project>
|
|
@ -0,0 +1,124 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-marketing</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>marketing-server</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>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Nacos Config -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringCloud Alibaba Sentinel -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
|
<artifactId>spring-cloud-starter-alibaba-sentinel</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- SpringBoot Actuator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Swagger UI -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-swagger-ui</artifactId>
|
||||||
|
<version>${swagger.fox.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- Mysql Connector -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataSource -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-datasource</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common DataScope -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-datascope</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Log -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-log</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MuYu Common Swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-common-swagger</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.dtflys.forest</groupId>
|
||||||
|
<artifactId>forest-spring-boot-starter</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 远程调用 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>marketing-remote</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 商品服务 缓存依赖 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-product-cache</artifactId>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<finalName>${project.artifactId}</finalName>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<goals>
|
||||||
|
<goal>repackage</goal>
|
||||||
|
</goals>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
|
<!-- 加入maven deploy插件,当在deploy时,忽略些model-->
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<skip>true</skip>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
</project>
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.muyu.marketing;
|
||||||
|
|
||||||
|
import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
|
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 系统模块
|
||||||
|
*
|
||||||
|
* @author muyu
|
||||||
|
*/
|
||||||
|
@EnableCustomConfig
|
||||||
|
@EnableCustomSwagger2
|
||||||
|
@EnableMyFeignClients
|
||||||
|
@SpringBootApplication
|
||||||
|
public class MuYuMarketIngApplication {
|
||||||
|
public static void main (String[] args) {
|
||||||
|
SpringApplication.run(MuYuMarketIngApplication.class, args);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
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.model.ActivityTeamInfoListModel;
|
||||||
|
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||||
|
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.PostMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
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());
|
||||||
|
}}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,12 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ActivityTeamOpenInfoMapper extends BaseMapper<ActivityTeamOpenInfo> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface ActivityTeamProductSkuInfoMapper extends BaseMapper<ActivityTeamProductSkuInfo> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyExemptionHundred> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TeamStrategyExemptionMapper extends BaseMapper<TeamStrategyExemption> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
package com.muyu.marketing.team.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
|
@Mapper
|
||||||
|
public interface TeamStrategyExemptionOrdinaryMapper extends BaseMapper<TeamStrategyExemptionOrdinary> {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过查询模型查询团购活动列表
|
||||||
|
* @param activityTeamInfoListQueryModel 团购活动查询模型
|
||||||
|
* @return 团购活动列表
|
||||||
|
*/
|
||||||
|
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
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.ActivityTeamProductSkuInfo;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
||||||
|
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
||||||
|
|
||||||
|
public default List<ActivityTeamProductSkuInfo> getActivityTeamProductSkuInfoByTeamId(Long teamId){
|
||||||
|
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId, teamId);
|
||||||
|
return this.list(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过团购活动ID获取团购中最优惠的价格
|
||||||
|
* @param teamId 团购ID
|
||||||
|
* @return 优惠价格
|
||||||
|
*/
|
||||||
|
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过活动ID获取 剩余库存
|
||||||
|
* @param teamId 活动ID
|
||||||
|
* @return 库存
|
||||||
|
*/
|
||||||
|
public TeamProductStockModel getStock(Long teamId);
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
|
||||||
|
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred> {
|
||||||
|
}
|
|
@ -0,0 +1,7 @@
|
||||||
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
|
||||||
|
public interface TeamStrategyExemptionOrdinaryService extends IService<TeamStrategyExemptionOrdinary> {
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package com.muyu.marketing.team.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
|
||||||
|
public interface TeamStrategyExemptionService extends IService<TeamStrategyExemption> {
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||||
|
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.ActivityTeamInfoListModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||||
|
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
||||||
|
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||||
|
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 java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
|
||||||
|
@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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,29 @@
|
||||||
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,67 @@
|
||||||
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
||||||
|
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||||
|
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 org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo>
|
||||||
|
implements ActivityTeamProductSkuInfoService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProjectSkuCache projectSkuCache;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过团购活动ID获取团购中最优惠的价格
|
||||||
|
*
|
||||||
|
* @param teamId 团购ID
|
||||||
|
* @return 优惠价格
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId) {
|
||||||
|
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||||
|
|
||||||
|
// 优惠模型集合
|
||||||
|
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());
|
||||||
|
|
||||||
|
if (discountPriceModelOptional.isEmpty()){
|
||||||
|
throw new ServiceException("团购活动下没有商品绑定");
|
||||||
|
}
|
||||||
|
return discountPriceModelOptional.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过活动ID获取 剩余库存
|
||||||
|
*
|
||||||
|
* @param teamId 活动ID
|
||||||
|
* @return 库存
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TeamProductStockModel getStock(Long teamId) {
|
||||||
|
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||||
|
return TeamProductStockModel.builder()
|
||||||
|
.teamStock(teamProductSkuInfoList.stream().map(ActivityTeamProductSkuInfo::getTeamStock).reduce(0L, Long::sum))
|
||||||
|
.remainStock(teamProductSkuInfoList.stream().map(ActivityTeamProductSkuInfo::getRemainStock).reduce(0L, Long::sum))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||||
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
||||||
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||||
|
import com.muyu.marketing.team.service.TeamStrategyExemptionHundredService;
|
||||||
|
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred>
|
||||||
|
implements TeamStrategyExemptionHundredService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionOrdinaryMapper;
|
||||||
|
import com.muyu.marketing.team.service.TeamStrategyExemptionOrdinaryService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary>
|
||||||
|
implements TeamStrategyExemptionOrdinaryService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,13 @@
|
||||||
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
|
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||||
|
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
@Service
|
||||||
|
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||||
|
implements TeamStrategyExemptionService {
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,2 @@
|
||||||
|
Spring Boot Version: ${spring-boot.version}
|
||||||
|
Spring Application Name: ${spring.application.name}
|
|
@ -0,0 +1,28 @@
|
||||||
|
# Tomcat
|
||||||
|
server:
|
||||||
|
port: 9209
|
||||||
|
|
||||||
|
# Spring
|
||||||
|
spring:
|
||||||
|
application:
|
||||||
|
# 应用名称
|
||||||
|
name: muyu-marketing
|
||||||
|
profiles:
|
||||||
|
# 环境配置
|
||||||
|
active: dev
|
||||||
|
cloud:
|
||||||
|
nacos:
|
||||||
|
discovery:
|
||||||
|
# 服务注册地址
|
||||||
|
server-addr: 127.0.0.1:8848
|
||||||
|
config:
|
||||||
|
# 配置中心地址
|
||||||
|
server-addr: 127.0.0.1:8848
|
||||||
|
# 配置文件格式
|
||||||
|
file-extension: yml
|
||||||
|
# 共享配置
|
||||||
|
shared-configs:
|
||||||
|
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||||
|
logging:
|
||||||
|
level:
|
||||||
|
com.muyu.marketing.mapper: DEBUG
|
|
@ -0,0 +1,74 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<configuration scan="true" scanPeriod="60 seconds" debug="false">
|
||||||
|
<!-- 日志存放路径 -->
|
||||||
|
<property name="log.path" value="logs/muyu-system"/>
|
||||||
|
<!-- 日志输出格式 -->
|
||||||
|
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"/>
|
||||||
|
|
||||||
|
<!-- 控制台输出 -->
|
||||||
|
<appender name="console" class="ch.qos.logback.core.ConsoleAppender">
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统日志输出 -->
|
||||||
|
<appender name="file_info" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/info.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/info.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>INFO</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<appender name="file_error" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||||
|
<file>${log.path}/error.log</file>
|
||||||
|
<!-- 循环政策:基于时间创建日志文件 -->
|
||||||
|
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||||
|
<!-- 日志文件名格式 -->
|
||||||
|
<fileNamePattern>${log.path}/error.%d{yyyy-MM-dd}.log</fileNamePattern>
|
||||||
|
<!-- 日志最大的历史 60天 -->
|
||||||
|
<maxHistory>60</maxHistory>
|
||||||
|
</rollingPolicy>
|
||||||
|
<encoder>
|
||||||
|
<pattern>${log.pattern}</pattern>
|
||||||
|
</encoder>
|
||||||
|
<filter class="ch.qos.logback.classic.filter.LevelFilter">
|
||||||
|
<!-- 过滤的级别 -->
|
||||||
|
<level>ERROR</level>
|
||||||
|
<!-- 匹配时的操作:接收(记录) -->
|
||||||
|
<onMatch>ACCEPT</onMatch>
|
||||||
|
<!-- 不匹配时的操作:拒绝(不记录) -->
|
||||||
|
<onMismatch>DENY</onMismatch>
|
||||||
|
</filter>
|
||||||
|
</appender>
|
||||||
|
|
||||||
|
<!-- 系统模块日志级别控制 -->
|
||||||
|
<logger name="com.muyu" level="info"/>
|
||||||
|
<!-- Spring日志级别控制 -->
|
||||||
|
<logger name="org.springframework" level="warn"/>
|
||||||
|
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="console"/>
|
||||||
|
</root>
|
||||||
|
|
||||||
|
<!--系统操作日志-->
|
||||||
|
<root level="info">
|
||||||
|
<appender-ref ref="file_info"/>
|
||||||
|
<appender-ref ref="file_error"/>
|
||||||
|
</root>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<parent>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-modules</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
</parent>
|
||||||
|
<packaging>pom</packaging>
|
||||||
|
<modules>
|
||||||
|
<module>marketing-common</module>
|
||||||
|
<module>marketing-remote</module>
|
||||||
|
<module>marketing-server</module>
|
||||||
|
</modules>
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<artifactId>muyu-marketing</artifactId>
|
||||||
|
|
||||||
|
<description>
|
||||||
|
muyu-marketing营销模块
|
||||||
|
</description>
|
||||||
|
</project>
|
|
@ -50,6 +50,8 @@ public class RuleInfo extends BaseEntity {
|
||||||
@Excel(name = "规格状态")
|
@Excel(name = "规格状态")
|
||||||
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/** 规格状态 */
|
||||||
@Excel(name = "规格描述")
|
@Excel(name = "规格描述")
|
||||||
@ApiModelProperty(name = "规格描述", value = "规格描述")
|
@ApiModelProperty(name = "规格描述", value = "规格描述")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
package com.muyu.product.domain.req;
|
package com.muyu.product.domain.req;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
@ -35,6 +32,6 @@ public class AttributeGroupEditReq extends BaseEntity {
|
||||||
/** 状态 */
|
/** 状态 */
|
||||||
@ApiModelProperty(name = "状态", value = "状态", required = true)
|
@ApiModelProperty(name = "状态", value = "状态", required = true)
|
||||||
private String states;
|
private String states;
|
||||||
private List<AttributeInfoSaveReq> attributeList;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import lombok.experimental.SuperBuilder;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import com.muyu.common.core.web.domain.TreeEntity;
|
import com.muyu.common.core.web.domain.TreeEntity;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -43,6 +44,7 @@ public class CategoryInfoSaveReq extends TreeEntity {
|
||||||
/** 是否启用 */
|
/** 是否启用 */
|
||||||
|
|
||||||
@ApiModelProperty(name = "是否启用", value = "是否启用", required = true)
|
@ApiModelProperty(name = "是否启用", value = "是否启用", required = true)
|
||||||
|
@NotNull()
|
||||||
private String start;
|
private String start;
|
||||||
|
|
||||||
/** 介绍 */
|
/** 介绍 */
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.muyu.product.domain.req;
|
package com.muyu.product.domain.req;
|
||||||
|
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
import com.muyu.product.domain.model.RuleAttrAddModel;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
|
@ -33,9 +34,15 @@ public class RuleInfoEditReq extends BaseEntity {
|
||||||
/** 规格状态 */
|
/** 规格状态 */
|
||||||
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
||||||
private String status;
|
private String status;
|
||||||
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
|
||||||
|
/** 规格状态 */
|
||||||
|
@Excel(name = "规格描述")
|
||||||
|
@ApiModelProperty(name = "规格描述", value = "规格描述")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格属性集合
|
||||||
|
*/
|
||||||
private List<RuleAttrAddModel> ruleAttrList;
|
private List<RuleAttrAddModel> ruleAttrList;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ public class AttributeGroupPageResp extends BaseEntity {
|
||||||
.attributeInfoList(attributeInfos)
|
.attributeInfoList(attributeInfos)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static AttributeGroupPageResp groupFunBuild (AttributeGroup attributeGroup, Function<Long,List<AttributeInfo> > function) {
|
public static AttributeGroupPageResp groupFunBuild (AttributeGroup attributeGroup, Function<Long,List<AttributeInfo> > function) {
|
||||||
return AttributeGroupPageResp.builder()
|
return AttributeGroupPageResp.builder()
|
||||||
.id(attributeGroup.getId())
|
.id(attributeGroup.getId())
|
||||||
|
|
|
@ -7,16 +7,27 @@ import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改回显的详细信息
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Builder
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class AttributeGroupUpdResp {
|
public class AttributeGroupUpdResp {
|
||||||
|
|
||||||
|
/** 属性组编号 */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/** 组名称 */
|
/** 组名称 */
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/** 状态 */
|
/** 状态 */
|
||||||
private String states;
|
private String states;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 属性ID集合
|
||||||
|
*/
|
||||||
private List<AttributeInfo> attributeList;
|
private List<AttributeInfo> attributeList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.muyu.product.domain.resp;
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.muyu.common.core.annotation.Excel;
|
import com.muyu.common.core.annotation.Excel;
|
||||||
import com.muyu.product.domain.AttributeInfo;
|
|
||||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
import com.muyu.product.domain.model.RuleAttrAddModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -13,11 +12,16 @@ import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格修改响应对象
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
public class RuleInfoUpdResp {
|
public class RuleInfoUpdResp {
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
@TableId(value = "id",type = IdType.AUTO)
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
@ApiModelProperty(name = "主键", value = "主键")
|
@ApiModelProperty(name = "主键", value = "主键")
|
||||||
private Long id;
|
private Long id;
|
||||||
|
@ -32,11 +36,13 @@ public class RuleInfoUpdResp {
|
||||||
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/** 规格状态 */
|
||||||
@Excel(name = "规格描述")
|
@Excel(name = "规格描述")
|
||||||
@ApiModelProperty(name = "规格描述", value = "规格描述")
|
@ApiModelProperty(name = "规格描述", value = "规格描述")
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格属性集合
|
||||||
|
*/
|
||||||
private List<RuleAttrAddModel> ruleAttrList;
|
private List<RuleAttrAddModel> ruleAttrList;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class AttributeGroupController extends BaseController {
|
||||||
@GetMapping(value = "/{id}")
|
@GetMapping(value = "/{id}")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||||
public Result<AttributeGroupUpdResp> getInfo(@PathVariable("id") Long id) {
|
public Result<AttributeGroupUpdResp> getInfo(@PathVariable("id") Long id) {
|
||||||
return Result.success(attributeGroupService.getUpdateById(id));
|
return Result.success(attributeGroupService.getUpdById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -100,8 +100,7 @@ public class AttributeGroupController extends BaseController {
|
||||||
@PutMapping("/{id}")
|
@PutMapping("/{id}")
|
||||||
@ApiOperation("修改属性组")
|
@ApiOperation("修改属性组")
|
||||||
public Result<String> edit(@PathVariable Long id, @RequestBody AttributeGroupEditReq attributeGroupEditReq) {
|
public Result<String> edit(@PathVariable Long id, @RequestBody AttributeGroupEditReq attributeGroupEditReq) {
|
||||||
//return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq)));
|
return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq)));
|
||||||
return toAjax(attributeGroupService.updateById(id,attributeGroupEditReq));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -125,15 +125,7 @@ public class CategoryInfoController extends BaseController {
|
||||||
@ApiOperation("删除品类信息")
|
@ApiOperation("删除品类信息")
|
||||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||||
List<CategoryInfo> categoryInfos = categoryInfoService.listByIds(ids);
|
return toAjax(categoryInfoService.removeBatchByIds(ids));
|
||||||
String a="";
|
|
||||||
for (CategoryInfo categoryInfo : categoryInfos) {
|
|
||||||
a+=categoryInfo.getId();
|
|
||||||
}
|
|
||||||
if(a!=null && a!=""){
|
|
||||||
return toAjax(categoryInfoService.removeBatchByIds(ids));
|
|
||||||
}
|
|
||||||
return Result.error("子节点存在不能删除");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.muyu.product.controller;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.muyu.product.domain.resp.RuleInfoUpdResp;
|
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
|
|
@ -101,8 +101,8 @@ public class RuleInfoController extends BaseController {
|
||||||
@PutMapping("/{id}")
|
@PutMapping("/{id}")
|
||||||
@ApiOperation("修改商品规格")
|
@ApiOperation("修改商品规格")
|
||||||
public Result<String> edit(@PathVariable Long id, @RequestBody RuleInfoEditReq ruleInfoEditReq) {
|
public Result<String> edit(@PathVariable Long id, @RequestBody RuleInfoEditReq ruleInfoEditReq) {
|
||||||
//return toAjax(ruleInfoService.updateById(RuleInfo.editBuild(id,ruleInfoEditReq)));
|
// return toAjax(ruleInfoService.updateById(RuleInfo.editBuild(id,ruleInfoEditReq)));
|
||||||
return toAjax(ruleInfoService.updateById(id,ruleInfoEditReq));
|
return toAjax(ruleInfoService.updateById(id, ruleInfoEditReq));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
package com.muyu.product.mapper;
|
|
||||||
|
|
||||||
import com.muyu.product.domain.AsAttributeGroup;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
@Mapper
|
|
||||||
public interface AddAsAttributeGroupMapper {
|
|
||||||
void deleteGroup(@Param("id") Long id);
|
|
||||||
void addGroup(AsAttributeGroup asAttributeGroup);
|
|
||||||
}
|
|
|
@ -1,8 +0,0 @@
|
||||||
package com.muyu.product.service;
|
|
||||||
|
|
||||||
import com.muyu.product.domain.AsAttributeGroup;
|
|
||||||
|
|
||||||
public interface AddAsAttributeGroupService {
|
|
||||||
void deleteGroup(Long id);
|
|
||||||
void addGroup(AsAttributeGroup asAttributeGroup);
|
|
||||||
}
|
|
|
@ -7,7 +7,6 @@ import com.muyu.product.domain.AttributeGroup;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.product.domain.AttributeInfo;
|
import com.muyu.product.domain.AttributeInfo;
|
||||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||||
import com.muyu.product.domain.req.AttributeGroupEditReq;
|
|
||||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||||
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||||
|
|
||||||
|
@ -42,13 +41,9 @@ public interface AttributeGroupService extends IService<AttributeGroup> {
|
||||||
public Boolean save(AttributeGroupSaveModel attributeGroupSaveModel);
|
public Boolean save(AttributeGroupSaveModel attributeGroupSaveModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
* 根据ID查询属性组的修改
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
AttributeGroupUpdResp getUpdById(Long id);
|
||||||
AttributeGroupUpdResp getUpdateById(Long id);
|
|
||||||
|
|
||||||
boolean updateById(Long id, AttributeGroupEditReq attributeGroupEditReq);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.muyu.product.service;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.muyu.product.domain.RuleAttrInfo;
|
import com.muyu.product.domain.RuleAttrInfo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.product.domain.resp.RuleInfoUpdResp;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格详情Service接口
|
* 规格详情Service接口
|
||||||
|
@ -26,5 +25,4 @@ public interface RuleAttrInfoService extends IService<RuleAttrInfo> {
|
||||||
* @return 规格详情集合
|
* @return 规格详情集合
|
||||||
*/
|
*/
|
||||||
List<RuleAttrInfo> getInfoByRuleId (Long ruleId);
|
List<RuleAttrInfo> getInfoByRuleId (Long ruleId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,8 +35,18 @@ public interface RuleInfoService extends IService<RuleInfo> {
|
||||||
|
|
||||||
TableDataInfo<RuleInfoResp> queryList (RuleInfoQueryReq ruleInfoQueryReq);
|
TableDataInfo<RuleInfoResp> queryList (RuleInfoQueryReq ruleInfoQueryReq);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过规格ID获取规格修改详细信息
|
||||||
|
* @param id 规格ID
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
RuleInfoUpdResp getUpdById(Long id);
|
RuleInfoUpdResp getUpdById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过ID修改规格属性
|
||||||
|
* @param id ID
|
||||||
|
* @param ruleInfoEditReq 请求对象
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
boolean updateById(Long id, RuleInfoEditReq ruleInfoEditReq);
|
boolean updateById(Long id, RuleInfoEditReq ruleInfoEditReq);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.muyu.product.service.impl;
|
|
||||||
|
|
||||||
import com.muyu.product.domain.AsAttributeGroup;
|
|
||||||
import com.muyu.product.mapper.AddAsAttributeGroupMapper;
|
|
||||||
import com.muyu.product.service.AddAsAttributeGroupService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class AddAsAttributeGroupServiceImpl implements AddAsAttributeGroupService {
|
|
||||||
@Autowired
|
|
||||||
AddAsAttributeGroupMapper addAsAttributeGroupMapper;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void deleteGroup(Long id) {
|
|
||||||
addAsAttributeGroupMapper.deleteGroup(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void addGroup(AsAttributeGroup asAttributeGroup) {
|
|
||||||
addAsAttributeGroupMapper.addGroup(asAttributeGroup);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,15 +5,10 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.github.pagehelper.PageInfo;
|
import com.github.pagehelper.PageInfo;
|
||||||
import com.muyu.common.core.utils.ObjUtils;
|
import com.muyu.common.core.utils.ObjUtils;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
|
||||||
import com.muyu.product.domain.AsAttributeGroup;
|
import com.muyu.product.domain.AsAttributeGroup;
|
||||||
import com.muyu.product.domain.AttributeGroup;
|
import com.muyu.product.domain.AttributeGroup;
|
||||||
import com.muyu.product.domain.AttributeInfo;
|
import com.muyu.product.domain.AttributeInfo;
|
||||||
import com.muyu.product.domain.RuleAttrInfo;
|
|
||||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
|
||||||
import com.muyu.product.domain.req.AttributeGroupEditReq;
|
|
||||||
import com.muyu.product.domain.req.AttributeInfoSaveReq;
|
|
||||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||||
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||||
import com.muyu.product.mapper.AttributeGroupMapper;
|
import com.muyu.product.mapper.AttributeGroupMapper;
|
||||||
|
@ -25,10 +20,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import javax.management.AttributeNotFoundException;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Function;
|
|
||||||
import java.util.stream.Stream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 属性组Service业务层处理
|
* 属性组Service业务层处理
|
||||||
|
@ -116,45 +108,22 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AttributeGroupUpdResp getUpdateById(Long id) {
|
public AttributeGroupUpdResp getUpdById(Long id) {
|
||||||
AttributeGroup byId = this.getById(id);
|
AttributeGroup attributeGroup = this.getById(id);
|
||||||
LambdaQueryWrapper<AsAttributeGroup> asAttributeGroupLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
asAttributeGroupLambdaQueryWrapper.eq(AsAttributeGroup::getGroupId,id);
|
LambdaQueryWrapper<AsAttributeGroup> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
List<Long> list = asAttributeGroupService.list(asAttributeGroupLambdaQueryWrapper).stream()
|
queryWrapper.eq(AsAttributeGroup::getGroupId, id);
|
||||||
|
List<AsAttributeGroup> asAttributeGroupList = asAttributeGroupService.list(queryWrapper);
|
||||||
|
List<Long> attributeIdList = asAttributeGroupList.stream()
|
||||||
.map(AsAttributeGroup::getAttributeId)
|
.map(AsAttributeGroup::getAttributeId)
|
||||||
.toList();
|
.toList();
|
||||||
List<AttributeInfo> attributeInfos = attributeInfoService.listByIds(list);
|
List<AttributeInfo> attributeInfoList = attributeInfoService.listByIds(attributeIdList);
|
||||||
|
|
||||||
return AttributeGroupUpdResp.builder()
|
return AttributeGroupUpdResp.builder()
|
||||||
.id(byId.getId())
|
.id(attributeGroup.getId())
|
||||||
.name(byId.getName())
|
.name(attributeGroup.getName())
|
||||||
.states(byId.getStates())
|
.states(attributeGroup.getStates())
|
||||||
.attributeList(attributeInfos)
|
.attributeList(attributeInfoList)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* LambdaQueryWrapper<RuleAttrInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
* queryWrapper.eq(RuleAttrInfo::getRuleId,id);
|
|
||||||
* this.ruleAttrInfoService.remove(queryWrapper);
|
|
||||||
* ruleAttrInfoService.saveBatch(
|
|
||||||
* ruleInfoEditReq.getRuleAttrList().stream()
|
|
||||||
* .map(ruleAttrAddModel -> RuleAttrInfo.addModelBuild(ruleAttrAddModel,() ->{return id;},SecurityUtils::getUsername)).toList()
|
|
||||||
* );
|
|
||||||
* @param id
|
|
||||||
* @param attributeGroupEditReq
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public boolean updateById(Long id, AttributeGroupEditReq attributeGroupEditReq) {
|
|
||||||
boolean b = this.updateById(id, attributeGroupEditReq);
|
|
||||||
if(b){
|
|
||||||
LambdaQueryWrapper<AttributeInfoSaveReq> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(AttributeInfoSaveReq::getId,id);
|
|
||||||
this.asAttributeGroupService.removeById(queryWrapper);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
return b;
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,9 +5,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.muyu.common.core.utils.ObjUtils;
|
import com.muyu.common.core.utils.ObjUtils;
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.product.service.AddAsAttributeGroupService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.muyu.product.mapper.BrandInfoMapper;
|
import com.muyu.product.mapper.BrandInfoMapper;
|
||||||
import com.muyu.product.domain.BrandInfo;
|
import com.muyu.product.domain.BrandInfo;
|
||||||
|
@ -24,8 +22,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class BrandInfoServiceImpl extends ServiceImpl<BrandInfoMapper, BrandInfo> implements BrandInfoService {
|
public class BrandInfoServiceImpl extends ServiceImpl<BrandInfoMapper, BrandInfo> implements BrandInfoService {
|
||||||
@Autowired
|
|
||||||
AddAsAttributeGroupService addAsAttributeGroupService;
|
|
||||||
/**
|
/**
|
||||||
* 查询品牌信息列表
|
* 查询品牌信息列表
|
||||||
*
|
*
|
||||||
|
@ -65,7 +62,6 @@ public class BrandInfoServiceImpl extends ServiceImpl<BrandInfoMapper, BrandInfo
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean updateById(BrandInfo entity) {
|
public boolean updateById(BrandInfo entity) {
|
||||||
|
|
||||||
entity.setUpdateBy(SecurityUtils.getUsername());
|
entity.setUpdateBy(SecurityUtils.getUsername());
|
||||||
entity.setUpdateTime(new Date());
|
entity.setUpdateTime(new Date());
|
||||||
return super.updateById(entity);
|
return super.updateById(entity);
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
import java.util.function.Supplier;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import com.github.pagehelper.PageHelper;
|
import com.github.pagehelper.PageHelper;
|
||||||
|
@ -114,7 +115,7 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
|
||||||
public RuleInfoUpdResp getUpdById(Long id) {
|
public RuleInfoUpdResp getUpdById(Long id) {
|
||||||
RuleInfo ruleInfo = this.getById(id);
|
RuleInfo ruleInfo = this.getById(id);
|
||||||
LambdaQueryWrapper<RuleAttrInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<RuleAttrInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(RuleAttrInfo::getRuleId,id);
|
queryWrapper.eq(RuleAttrInfo::getRuleId, id);
|
||||||
List<RuleAttrInfo> ruleAttrInfoList = this.ruleAttrInfoService.list(queryWrapper);
|
List<RuleAttrInfo> ruleAttrInfoList = this.ruleAttrInfoService.list(queryWrapper);
|
||||||
return RuleInfoUpdResp.builder()
|
return RuleInfoUpdResp.builder()
|
||||||
.id(ruleInfo.getId())
|
.id(ruleInfo.getId())
|
||||||
|
@ -128,13 +129,14 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
|
||||||
@Override
|
@Override
|
||||||
public boolean updateById(Long id, RuleInfoEditReq ruleInfoEditReq) {
|
public boolean updateById(Long id, RuleInfoEditReq ruleInfoEditReq) {
|
||||||
boolean update = this.updateById(RuleInfo.editBuild(id, ruleInfoEditReq));
|
boolean update = this.updateById(RuleInfo.editBuild(id, ruleInfoEditReq));
|
||||||
if(update){
|
if (update) {
|
||||||
LambdaQueryWrapper<RuleAttrInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<RuleAttrInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.eq(RuleAttrInfo::getRuleId,id);
|
queryWrapper.eq(RuleAttrInfo::getRuleId, id);
|
||||||
this.ruleAttrInfoService.remove(queryWrapper);
|
this.ruleAttrInfoService.remove(queryWrapper);
|
||||||
ruleAttrInfoService.saveBatch(
|
ruleAttrInfoService.saveBatch(
|
||||||
ruleInfoEditReq.getRuleAttrList().stream()
|
ruleInfoEditReq.getRuleAttrList().stream()
|
||||||
.map(ruleAttrAddModel -> RuleAttrInfo.addModelBuild(ruleAttrAddModel,() ->{return id;},SecurityUtils::getUsername)).toList()
|
.map(ruleAttrAddModel -> RuleAttrInfo.addModelBuild(ruleAttrAddModel, () -> id, SecurityUtils::getUsername))
|
||||||
|
.toList()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return update;
|
return update;
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" ?>
|
|
||||||
<!DOCTYPE mapper
|
|
||||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
||||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
||||||
<mapper namespace="com.muyu.product.mapper.AddAsAttributeGroupMapper">
|
|
||||||
|
|
||||||
<insert id="addGroup">
|
|
||||||
INSERT INTO
|
|
||||||
as_attribute_group
|
|
||||||
( group_id,
|
|
||||||
attribute_id,
|
|
||||||
remark)
|
|
||||||
VALUES
|
|
||||||
(#{groupId},
|
|
||||||
#{attributeId},
|
|
||||||
#{remark})
|
|
||||||
</insert>
|
|
||||||
<delete id="deleteGroup">
|
|
||||||
delete from as_attribute_group where id=#{id}
|
|
||||||
</delete>
|
|
||||||
</mapper>
|
|
|
@ -16,10 +16,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
<module>muyu-file</module>
|
<module>muyu-file</module>
|
||||||
<module>muyu-product</module>
|
<module>muyu-product</module>
|
||||||
<module>muyu-shop-cart</module>
|
<module>muyu-shop-cart</module>
|
||||||
|
<module>muyu-marketing</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
<artifactId>muyu-modules</artifactId>
|
<artifactId>muyu-modules</artifactId>
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.223.70.108:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
18
pom.xml
18
pom.xml
|
@ -263,6 +263,22 @@
|
||||||
<version>${muyu.version}</version>
|
<version>${muyu.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 营销服务 公共 模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>marketing-common</artifactId>
|
||||||
|
<version>${muyu.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<!-- 营销服务 远调 模块 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>marketing-remote</artifactId>
|
||||||
|
<version>${muyu.version}</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
@ -314,7 +330,7 @@
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-source-plugin</artifactId>
|
<artifactId>maven-source-plugin</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.1</version>
|
||||||
<configuration>1
|
<configuration>
|
||||||
<attach>true</attach>
|
<attach>true</attach>
|
||||||
</configuration>
|
</configuration>
|
||||||
<executions>
|
<executions>
|
||||||
|
|
|
@ -490,7 +490,7 @@ CREATE TABLE `qrtz_triggers` (
|
||||||
-- Records of qrtz_triggers
|
-- Records of qrtz_triggers
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
|
|
||||||
-- ---------------------------
|
-- ----------------------------
|
||||||
-- Table structure for sys_config
|
-- Table structure for sys_config
|
||||||
-- ----------------------------
|
-- ----------------------------
|
||||||
DROP TABLE IF EXISTS `sys_config`;
|
DROP TABLE IF EXISTS `sys_config`;
|
||||||
|
|
Loading…
Reference in New Issue