Compare commits
1 Commits
1129/Fengm
...
master
Author | SHA1 | Date |
---|---|---|
|
b6c4a790d7 |
|
@ -1,38 +0,0 @@
|
||||||
{
|
|
||||||
"活动ID": "Long",
|
|
||||||
"商品规格List": [
|
|
||||||
{
|
|
||||||
"规格id":"Logn"
|
|
||||||
"规格SKU": "String",
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"活动状态":"String"
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{
|
|
||||||
"商品ID": "Long",
|
|
||||||
"商品图片": "String",
|
|
||||||
"活动名称": "String",
|
|
||||||
"活动简介": "String",
|
|
||||||
"商品单位": "String",
|
|
||||||
"商品的轮播图": [
|
|
||||||
"String", "String"
|
|
||||||
],
|
|
||||||
"活动时间": "date",
|
|
||||||
"策略类型": "String",
|
|
||||||
"策略ID": "Long",
|
|
||||||
"商品规格List": [
|
|
||||||
{
|
|
||||||
"规格SKU": "String",
|
|
||||||
"拼团价格": "BigDecimal",
|
|
||||||
"拼团库存": "Long"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"排序": "Integer",
|
|
||||||
"详情": "String"
|
|
||||||
}
|
|
21
doc/策略.md
21
doc/策略.md
|
@ -1,21 +0,0 @@
|
||||||
# 拼团策略功能划分
|
|
||||||
# 1 拼团列表
|
|
||||||
策略列表:
|
|
||||||
5人团
|
|
||||||
百人团
|
|
||||||
团长免单团
|
|
||||||
# 2. 点击拼团 进入商品列表
|
|
||||||
# 3. 拼团详情
|
|
||||||
# 4. 拼团成功
|
|
||||||
# 5 支付订单
|
|
||||||
# 6. 拼团失败
|
|
||||||
# 7 重新加入拼团
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 商品列表
|
|
||||||
# 参团列表
|
|
||||||
# 购买
|
|
||||||
# 评论
|
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.221.28.250:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.221.28.250:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class IpUtils {
|
||||||
ip = request.getRemoteAddr();
|
ip = request.getRemoteAddr();
|
||||||
}
|
}
|
||||||
|
|
||||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "124.221.28.250" : getMultistageReverseProxyIp(ip);
|
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : getMultistageReverseProxyIp(ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -70,7 +70,7 @@ public class IpUtils {
|
||||||
*/
|
*/
|
||||||
public static boolean internalIp (String ip) {
|
public static boolean internalIp (String ip) {
|
||||||
byte[] addr = textToNumericFormatV4(ip);
|
byte[] addr = textToNumericFormatV4(ip);
|
||||||
return internalIp(addr) || "124.221.28.250".equals(ip);
|
return internalIp(addr) || "127.0.0.1".equals(ip);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -197,7 +197,7 @@ public class IpUtils {
|
||||||
return InetAddress.getLocalHost().getHostAddress();
|
return InetAddress.getLocalHost().getHostAddress();
|
||||||
} catch (UnknownHostException e) {
|
} catch (UnknownHostException e) {
|
||||||
}
|
}
|
||||||
return "124.221.28.250";
|
return "127.0.0.1";
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,58 +0,0 @@
|
||||||
package com.muyu.gateway.config;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import org.springframework.http.HttpHeaders;
|
|
||||||
import org.springframework.http.HttpMethod;
|
|
||||||
import org.springframework.http.HttpStatus;
|
|
||||||
import org.springframework.http.server.reactive.ServerHttpRequest;
|
|
||||||
import org.springframework.http.server.reactive.ServerHttpResponse;
|
|
||||||
import org.springframework.web.cors.reactive.CorsUtils;
|
|
||||||
import org.springframework.web.server.ServerWebExchange;
|
|
||||||
import org.springframework.web.server.WebFilter;
|
|
||||||
import org.springframework.web.server.WebFilterChain;
|
|
||||||
import reactor.core.publisher.Mono;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 跨域配置
|
|
||||||
*
|
|
||||||
* @author ruoyi
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
public class CorsConfig
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* 这里为支持的请求头,如果有自定义的header字段请自己添加
|
|
||||||
*/
|
|
||||||
private static final String ALLOWED_HEADERS = "X-Requested-With, Content-Type, Authorization, credential, X-XSRF-TOKEN, token, Admin-Token, App-Token";
|
|
||||||
private static final String ALLOWED_METHODS = "GET,POST,PUT,DELETE,OPTIONS,HEAD";
|
|
||||||
private static final String ALLOWED_ORIGIN = "*";
|
|
||||||
private static final String ALLOWED_EXPOSE = "*";
|
|
||||||
private static final String MAX_AGE = "18000L";
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public WebFilter corsFilter()
|
|
||||||
{
|
|
||||||
return (ServerWebExchange ctx, WebFilterChain chain) -> {
|
|
||||||
ServerHttpRequest request = ctx.getRequest();
|
|
||||||
if (CorsUtils.isCorsRequest(request))
|
|
||||||
{
|
|
||||||
ServerHttpResponse response = ctx.getResponse();
|
|
||||||
HttpHeaders headers = response.getHeaders();
|
|
||||||
headers.add("Access-Control-Allow-Headers", ALLOWED_HEADERS);
|
|
||||||
headers.add("Access-Control-Allow-Methods", ALLOWED_METHODS);
|
|
||||||
headers.add("Access-Control-Allow-Origin", ALLOWED_ORIGIN);
|
|
||||||
headers.add("Access-Control-Expose-Headers", ALLOWED_EXPOSE);
|
|
||||||
headers.add("Access-Control-Max-Age", MAX_AGE);
|
|
||||||
headers.add("Access-Control-Allow-Credentials", "true");
|
|
||||||
if (request.getMethod() == HttpMethod.OPTIONS)
|
|
||||||
{
|
|
||||||
response.setStatusCode(HttpStatus.OK);
|
|
||||||
return Mono.empty();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return chain.filter(ctx);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.221.28.250:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.221.28.250:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
@ -33,7 +33,7 @@ spring:
|
||||||
datasource:
|
datasource:
|
||||||
ds1:
|
ds1:
|
||||||
nacos:
|
nacos:
|
||||||
server-addr: 124.221.28.250:8848
|
server-addr: 127.0.0.1:8848
|
||||||
dataId: sentinel-muyu-gateway
|
dataId: sentinel-muyu-gateway
|
||||||
groupId: DEFAULT_GROUP
|
groupId: DEFAULT_GROUP
|
||||||
data-type: json
|
data-type: json
|
||||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.221.28.250:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.221.28.250: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.221.28.250:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.221.28.250: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.221.28.250:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.221.28.250:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -88,7 +88,6 @@ public class ActivityTeamInfo extends BaseEntity {
|
||||||
.unit(activityTeamInfoAddModel.getUnit())
|
.unit(activityTeamInfoAddModel.getUnit())
|
||||||
.imageList(activityTeamInfoAddModel.getImageList())
|
.imageList(activityTeamInfoAddModel.getImageList())
|
||||||
.endTime(activityTeamInfoAddModel.getEndTime())
|
.endTime(activityTeamInfoAddModel.getEndTime())
|
||||||
.remark(activityTeamInfoAddModel.getRemark())
|
|
||||||
.sort(activityTeamInfoAddModel.getSort())
|
.sort(activityTeamInfoAddModel.getSort())
|
||||||
.content(activityTeamInfoAddModel.getContent())
|
.content(activityTeamInfoAddModel.getContent())
|
||||||
.status(activityTeamInfoAddModel.getStatus())
|
.status(activityTeamInfoAddModel.getStatus())
|
||||||
|
|
|
@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@ -74,4 +76,13 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuInfo updModelBuild(ActivityTeamProductSkuUpdModel teamProductSkuUpdModel){
|
||||||
|
return ActivityTeamProductSkuInfo.builder()
|
||||||
|
.id(teamProductSkuUpdModel.getId())
|
||||||
|
.teamPrice(teamProductSkuUpdModel.getTeamPrice())
|
||||||
|
.teamStock(teamProductSkuUpdModel.getTeamStock())
|
||||||
|
.remainStock(teamProductSkuUpdModel.getTeamStock())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,48 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ActivityTeamAddSkuInfo
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhen_xiong_feng
|
|
||||||
* @Date 2024/11/27 20:30
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@SuperBuilder
|
|
||||||
public class ActivityTeamAddSkuInfo {
|
|
||||||
// "添加商品规格List": [
|
|
||||||
// "商品SKU": "String",
|
|
||||||
// "商品价格": "BigDecimal",
|
|
||||||
// "拼团价格": "BigDecimal",
|
|
||||||
// "拼团库存": "Long"
|
|
||||||
// ]
|
|
||||||
/**
|
|
||||||
* 商品SKU
|
|
||||||
*/
|
|
||||||
private String productSku;
|
|
||||||
/**
|
|
||||||
* 拼团价格
|
|
||||||
*/
|
|
||||||
private BigDecimal teamPrice;
|
|
||||||
/**
|
|
||||||
* 拼团库存
|
|
||||||
*/
|
|
||||||
private Long teamStock;
|
|
||||||
|
|
||||||
public static ActivityTeamAddSkuInfo addSkuInfo(ActivityTeamProductSkuInfo activityTeamProductSkuInfo){
|
|
||||||
return ActivityTeamAddSkuInfo.builder()
|
|
||||||
.productSku(activityTeamProductSkuInfo.getProductSku())
|
|
||||||
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
|
||||||
.teamStock(activityTeamProductSkuInfo.getTeamStock())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -2,10 +2,11 @@ package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||||
import lombok.*;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -17,12 +18,11 @@ import java.util.function.Supplier;
|
||||||
* @author DongZeLiang
|
* @author DongZeLiang
|
||||||
* @date 2024-11-26 09:38
|
* @date 2024-11-26 09:38
|
||||||
*/
|
*/
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ActivityTeamInfoAddModel extends BaseEntity {
|
public class ActivityTeamInfoAddModel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团名称
|
* 拼团名称
|
||||||
|
@ -58,7 +58,7 @@ public class ActivityTeamInfoAddModel extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
@ -90,7 +90,6 @@ public class ActivityTeamInfoAddModel extends BaseEntity {
|
||||||
.imageList(activityTeamInfoSaveReq.getImageList())
|
.imageList(activityTeamInfoSaveReq.getImageList())
|
||||||
.endTime(activityTeamInfoSaveReq.getEndTime())
|
.endTime(activityTeamInfoSaveReq.getEndTime())
|
||||||
.sort(activityTeamInfoSaveReq.getSort())
|
.sort(activityTeamInfoSaveReq.getSort())
|
||||||
.remark(activityTeamInfoSaveReq.getRemark())
|
|
||||||
.content(activityTeamInfoSaveReq.getContent())
|
.content(activityTeamInfoSaveReq.getContent())
|
||||||
.status(activityTeamInfoSaveReq.getStatus())
|
.status(activityTeamInfoSaveReq.getStatus())
|
||||||
.strategyType(activityTeamInfoSaveReq.getStrategyType())
|
.strategyType(activityTeamInfoSaveReq.getStrategyType())
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
|
||||||
import com.muyu.common.core.web.model.QueryModel;
|
import com.muyu.common.core.web.model.QueryModel;
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
|
@ -17,10 +16,10 @@ import java.util.function.Function;
|
||||||
* @date 2024-11-20 14:18:10
|
* @date 2024-11-20 14:18:10
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class ActivityTeamInfoListModel extends BaseEntity {
|
public class ActivityTeamInfoListModel {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团活动ID
|
* 拼团活动ID
|
||||||
|
@ -34,10 +33,6 @@ public class ActivityTeamInfoListModel extends BaseEntity {
|
||||||
* 参团人数
|
* 参团人数
|
||||||
*/
|
*/
|
||||||
private Long addTeamNumber;
|
private Long addTeamNumber;
|
||||||
/**
|
|
||||||
* 商品简介
|
|
||||||
*/
|
|
||||||
private String introduction;
|
|
||||||
/**
|
/**
|
||||||
* 拼团人数
|
* 拼团人数
|
||||||
*/
|
*/
|
||||||
|
@ -74,15 +69,21 @@ public class ActivityTeamInfoListModel extends BaseEntity {
|
||||||
* 团购库存
|
* 团购库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
private String remark;
|
|
||||||
|
|
||||||
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModel.ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) {
|
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModel.ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) {
|
||||||
ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
||||||
.id(activityTeamInfo.getId())
|
.id(activityTeamInfo.getId())
|
||||||
.name(activityTeamInfo.getName())
|
.name(activityTeamInfo.getName())
|
||||||
.remark(activityTeamInfo.getRemark())
|
// .openTeamNumber(teamOpenTypeNumber)
|
||||||
|
// .addTeamNumber(teamInTypeNumber)
|
||||||
|
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||||
|
.endTime(activityTeamInfo.getEndTime())
|
||||||
.productImage(activityTeamInfo.getProductImage())
|
.productImage(activityTeamInfo.getProductImage())
|
||||||
.introduction(activityTeamInfo.getIntroduction())
|
// .teamPrice(discountPrice.getTeamPrice())
|
||||||
|
// .productPrice(discountPrice.getProductPrice())
|
||||||
|
// .teamStock(teamProductStockModel.getTeamStock())
|
||||||
|
// .remainStock(teamProductStockModel.getRemainStock())
|
||||||
.status(activityTeamInfo.getStatus())
|
.status(activityTeamInfo.getStatus())
|
||||||
.build();
|
.build();
|
||||||
return function.apply(
|
return function.apply(
|
||||||
|
@ -92,8 +93,6 @@ public class ActivityTeamInfoListModel extends BaseEntity {
|
||||||
.endTime(activityTeamInfo.getEndTime())
|
.endTime(activityTeamInfo.getEndTime())
|
||||||
.productImage(activityTeamInfo.getProductImage())
|
.productImage(activityTeamInfo.getProductImage())
|
||||||
.status(activityTeamInfo.getStatus())
|
.status(activityTeamInfo.getStatus())
|
||||||
.introduction(activityTeamInfo.getIntroduction())
|
|
||||||
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
|
||||||
import com.muyu.common.core.web.model.QueryModel;
|
import com.muyu.common.core.web.model.QueryModel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -29,9 +28,5 @@ public class ActivityTeamInfoListQueryModel extends QueryModel<ActivityTeamInfoL
|
||||||
* 活动状态
|
* 活动状态
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
/**
|
|
||||||
* 商品简介
|
|
||||||
*/
|
|
||||||
public String introduction;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,6 +82,7 @@ public class ActivityTeamInfoSaveModel {
|
||||||
.unit(activityTeamInfoAddModel.getUnit())
|
.unit(activityTeamInfoAddModel.getUnit())
|
||||||
.imageList(activityTeamInfoAddModel.getImageList())
|
.imageList(activityTeamInfoAddModel.getImageList())
|
||||||
.endTime(activityTeamInfoAddModel.getEndTime())
|
.endTime(activityTeamInfoAddModel.getEndTime())
|
||||||
|
.sort(activityTeamInfoAddModel.getSort())
|
||||||
.content(activityTeamInfoAddModel.getContent())
|
.content(activityTeamInfoAddModel.getContent())
|
||||||
.status(activityTeamInfoAddModel.getStatus())
|
.status(activityTeamInfoAddModel.getStatus())
|
||||||
.strategyType(activityTeamInfoAddModel.getStrategyType())
|
.strategyType(activityTeamInfoAddModel.getStrategyType())
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
||||||
|
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
||||||
|
import com.muyu.marketing.domain.req.TeamProjectSkuInfoUpdReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -33,7 +37,7 @@ public class ActivityTeamInfoUpdModel {
|
||||||
private String status;
|
private String status;
|
||||||
private String strategyType;
|
private String strategyType;
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
private List<ActivityTeamProductSkuReqModel> activityTeamProductSkuModelList;
|
private ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel;
|
||||||
|
|
||||||
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
return ActivityTeamInfoUpdModel.builder()
|
return ActivityTeamInfoUpdModel.builder()
|
||||||
|
@ -50,7 +54,12 @@ public class ActivityTeamInfoUpdModel {
|
||||||
.status(activityTeamInfoUpdReq.getStatus())
|
.status(activityTeamInfoUpdReq.getStatus())
|
||||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||||
.activityTeamProductSkuModelList(activityTeamInfoUpdReq.getActivityTeamProductSkuList().stream().map(ActivityTeamProductSkuReqModel::activityTeamProductSkuReqModelBuild).toList())
|
.activityTeamProductSkuSettingModel(
|
||||||
|
ActivityTeamProductSkuSettingModel.settingReqModel(
|
||||||
|
activityTeamInfoUpdReq.getActivityTeamProductSkuSettingReq(),
|
||||||
|
activityTeamInfoUpdReq::getProductId
|
||||||
|
)
|
||||||
|
)
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,35 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ActivityTeamProductListMode
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhen_xiong_feng
|
|
||||||
* @Date 2024/12/3 15:01
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Builder
|
|
||||||
public class ActivityTeamProductListMode {
|
|
||||||
/**
|
|
||||||
* 商品id
|
|
||||||
*/
|
|
||||||
private Long productId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动结束时间
|
|
||||||
*/
|
|
||||||
private Date endTime;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ActivityTeamProductSkuDelModel
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhen_xiong_feng
|
|
||||||
* @Date 2024/11/27 19:00
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@SuperBuilder
|
|
||||||
public class ActivityTeamProductSkuDelModel {
|
|
||||||
/**
|
|
||||||
* 活动id
|
|
||||||
*/
|
|
||||||
private Integer productSkuId;
|
|
||||||
}
|
|
|
@ -1,55 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ActivityTeamProductSkuEchoModel
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhen_xiong_feng
|
|
||||||
* @Date 2024/11/26 19:35
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@SuperBuilder
|
|
||||||
public class ActivityTeamProductSkuEchoModel {
|
|
||||||
/**
|
|
||||||
* ID
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品ID
|
|
||||||
*/
|
|
||||||
private Long teamId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 规格SKU
|
|
||||||
*/
|
|
||||||
private String sku;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团价格
|
|
||||||
*/
|
|
||||||
private BigDecimal teamPrice;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团库存
|
|
||||||
*/
|
|
||||||
private Long teamStock;
|
|
||||||
|
|
||||||
public static ActivityTeamProductSkuEchoModel modelBuild(ActivityTeamProductSkuInfo activityTeamProductSkuInfo){
|
|
||||||
return ActivityTeamProductSkuEchoModel.builder()
|
|
||||||
.teamId(activityTeamProductSkuInfo.getTeamId())
|
|
||||||
.sku(activityTeamProductSkuInfo.getProductSku())
|
|
||||||
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
|
||||||
.teamStock(activityTeamProductSkuInfo.getRemainStock())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.req.ActivityTeamProductSkuSettingReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购商品规格一键设置
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-28 11:15
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamProductSkuSettingModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动ID
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除的ID集合
|
||||||
|
*/
|
||||||
|
private List<Long> removeIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加的规格集合
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改的规格集合
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList;
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuSettingModel settingReqModel(ActivityTeamProductSkuSettingReq activityTeamProductSkuSettingReq, Supplier<Long> productId) {
|
||||||
|
return ActivityTeamProductSkuSettingModel.builder()
|
||||||
|
.removeIds(activityTeamProductSkuSettingReq.getRemoveIds())
|
||||||
|
.activityTeamProductSkuAddModelList(
|
||||||
|
activityTeamProductSkuSettingReq.getTeamProjectSkuInfoAddReqList().stream()
|
||||||
|
.map(teamProjectSkuInfoAddReq -> ActivityTeamProductSkuAddModel.addReqBuild(teamProjectSkuInfoAddReq, productId))
|
||||||
|
.toList()
|
||||||
|
)
|
||||||
|
.activityTeamProductSkuUpdModelList(
|
||||||
|
activityTeamProductSkuSettingReq.getTeamProjectSkuInfoUpdReqList().stream()
|
||||||
|
.map(ActivityTeamProductSkuUpdModel::updReqBuild)
|
||||||
|
.toList()
|
||||||
|
).build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package com.muyu.marketing.domain.model;
|
package com.muyu.marketing.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.req.TeamProjectSkuInfoUpdReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -34,4 +35,12 @@ public class ActivityTeamProductSkuUpdModel {
|
||||||
* 团购库存
|
* 团购库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuUpdModel updReqBuild(TeamProjectSkuInfoUpdReq teamProjectSkuInfoUpdReq){
|
||||||
|
return ActivityTeamProductSkuUpdModel.builder()
|
||||||
|
.id(teamProjectSkuInfoUpdReq.getId())
|
||||||
|
.teamStock(teamProjectSkuInfoUpdReq.getTeamStock())
|
||||||
|
.teamPrice(teamProjectSkuInfoUpdReq.getTeamPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,81 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import org.apache.commons.math3.stat.descriptive.summary.Product;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ActivityTeamUpdModel
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhen_xiong_feng
|
|
||||||
* @Date 2024/11/27 22:22
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Builder
|
|
||||||
public class ActivityTeamUpdModel {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
/**
|
|
||||||
* 商品ID
|
|
||||||
*/
|
|
||||||
private Long productId;
|
|
||||||
/**
|
|
||||||
* 商品活动图
|
|
||||||
*/
|
|
||||||
private String productImage;
|
|
||||||
/**
|
|
||||||
* 活动简介
|
|
||||||
*/
|
|
||||||
private String introduction;
|
|
||||||
/**
|
|
||||||
* 单位
|
|
||||||
*/
|
|
||||||
|
|
||||||
private String unit;
|
|
||||||
/**
|
|
||||||
* 轮播图
|
|
||||||
*/
|
|
||||||
|
|
||||||
private String imageList;
|
|
||||||
/**
|
|
||||||
* 活动结束时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
|
||||||
private Date endTime;
|
|
||||||
/**
|
|
||||||
* 活动排序
|
|
||||||
*/
|
|
||||||
private Integer sort;
|
|
||||||
/**
|
|
||||||
* 商品SkU对象
|
|
||||||
*/
|
|
||||||
private ProductSkuModel productSkuModel;
|
|
||||||
/**
|
|
||||||
* 活动详情
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
/**
|
|
||||||
* 活动状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
/**
|
|
||||||
* 策略类型
|
|
||||||
*/
|
|
||||||
private String strategyType;
|
|
||||||
/**
|
|
||||||
* 策略ID
|
|
||||||
*/
|
|
||||||
private Long strategyId;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,35 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ProductSkuModel
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhen_xiong_feng
|
|
||||||
* @Date 2024/11/27 22:24
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@Builder
|
|
||||||
public class ProductSkuModel {
|
|
||||||
/**
|
|
||||||
* 修改商品规格List
|
|
||||||
*/
|
|
||||||
private List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
*删除商品规格IdList
|
|
||||||
*/
|
|
||||||
private List<Long> productIdList;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加商品规格List
|
|
||||||
*/
|
|
||||||
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
|
|
||||||
}
|
|
|
@ -1,92 +0,0 @@
|
||||||
package com.muyu.marketing.domain.model;
|
|
||||||
|
|
||||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName TeamEchoModel
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhen_xiong_feng
|
|
||||||
* @Date 2024/11/26 22:14
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@SuperBuilder
|
|
||||||
public class TeamEchoModel {
|
|
||||||
/**
|
|
||||||
* 活动ID
|
|
||||||
*/
|
|
||||||
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;
|
|
||||||
|
|
||||||
|
|
||||||
public static TeamEchoModel echoModelBuild(ActivityTeamInfo teamEchoModel) {
|
|
||||||
return TeamEchoModel.builder()
|
|
||||||
.id(teamEchoModel.getId())
|
|
||||||
.name(teamEchoModel.getName())
|
|
||||||
.productId(teamEchoModel.getProductId())
|
|
||||||
.productImage(teamEchoModel.getProductImage())
|
|
||||||
.introduction(teamEchoModel.getIntroduction())
|
|
||||||
.unit(teamEchoModel.getUnit())
|
|
||||||
.imageList(teamEchoModel.getImageList())
|
|
||||||
.endTime(teamEchoModel.getEndTime())
|
|
||||||
.sort(teamEchoModel.getSort())
|
|
||||||
.content(teamEchoModel.getContent())
|
|
||||||
.strategyType(teamEchoModel.getStrategyType())
|
|
||||||
.strategyId(teamEchoModel.getStrategyId())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -51,7 +51,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 活动排序
|
* 活动排序
|
||||||
*/
|
*/
|
||||||
private Integer sort;
|
private Long sort;
|
||||||
/**
|
/**
|
||||||
* 商品SkU集合
|
* 商品SkU集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -32,5 +32,5 @@ public class ActivityTeamInfoUpdReq {
|
||||||
private String status;
|
private String status;
|
||||||
private String strategyType;
|
private String strategyType;
|
||||||
private Long strategyId;
|
private Long strategyId;
|
||||||
private List<ActivityTeamProductSkuReq> activityTeamProductSkuList;
|
private ActivityTeamProductSkuSettingReq activityTeamProductSkuSettingReq;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,37 @@
|
||||||
|
package com.muyu.marketing.domain.req;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购商品规格设置
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-28 11:27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamProductSkuSettingReq {
|
||||||
|
/**
|
||||||
|
* 删除的ID集合
|
||||||
|
*/
|
||||||
|
private List<Long> removeIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加的规格集合
|
||||||
|
*/
|
||||||
|
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加的规格集合
|
||||||
|
*/
|
||||||
|
private List<TeamProjectSkuInfoUpdReq> teamProjectSkuInfoUpdReqList;
|
||||||
|
}
|
|
@ -21,10 +21,7 @@ public class TeamInfoListReq extends PageDomain {
|
||||||
* 活动状态
|
* 活动状态
|
||||||
*/
|
*/
|
||||||
private String status;
|
private String status;
|
||||||
/**
|
|
||||||
* 活动介绍
|
|
||||||
*/
|
|
||||||
private String introduction;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过当前对象构建业务查询模型
|
* 通过当前对象构建业务查询模型
|
||||||
|
@ -34,7 +31,6 @@ public class TeamInfoListReq extends PageDomain {
|
||||||
return ActivityTeamInfoListQueryModel.builder()
|
return ActivityTeamInfoListQueryModel.builder()
|
||||||
.keyWord(this.keyWord)
|
.keyWord(this.keyWord)
|
||||||
.status(this.status)
|
.status(this.status)
|
||||||
.introduction(this.introduction)
|
|
||||||
.build()
|
.build()
|
||||||
.domainBuild(this);
|
.domainBuild(this);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
package com.muyu.marketing.domain.req;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -8,24 +8,18 @@ import lombok.experimental.SuperBuilder;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName TeamProjectSkuInfoEchoResp
|
* 添加的
|
||||||
* @Description 描述
|
|
||||||
* @Author zhen_xiong_feng
|
|
||||||
* @Date 2024/11/26 15:59
|
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class TeamProjectSkuInfoEchoResp {
|
public class TeamProjectSkuInfoUpdReq {
|
||||||
/**
|
|
||||||
* 规格id
|
|
||||||
*/
|
|
||||||
private Long productSkuId;
|
|
||||||
/**
|
/**
|
||||||
* 规格SKU
|
* 规格SKU
|
||||||
*/
|
*/
|
||||||
private String sku;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 拼团价格
|
* 拼团价格
|
|
@ -1,85 +0,0 @@
|
||||||
package com.muyu.marketing.domain.resp;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName TeamInfoEcho
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhen_xiong_feng
|
|
||||||
* @Date 2024/11/26 15:57
|
|
||||||
*/
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@SuperBuilder
|
|
||||||
public class TeamInfoEcho extends BaseEntity {
|
|
||||||
/**
|
|
||||||
* 活动ID
|
|
||||||
*/
|
|
||||||
private Long teamId;
|
|
||||||
/**
|
|
||||||
* 拼团名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
/**
|
|
||||||
* 商品ID
|
|
||||||
*/
|
|
||||||
private Long productId;
|
|
||||||
/**
|
|
||||||
* 商品活动图
|
|
||||||
*/
|
|
||||||
private String productImage;
|
|
||||||
/**
|
|
||||||
* 活动简介
|
|
||||||
*/
|
|
||||||
private String introduction;
|
|
||||||
/**
|
|
||||||
* 单位
|
|
||||||
*/
|
|
||||||
|
|
||||||
private String unit;
|
|
||||||
/**
|
|
||||||
* 轮播图
|
|
||||||
*/
|
|
||||||
|
|
||||||
private String imageList;
|
|
||||||
/**
|
|
||||||
* 活动结束时间
|
|
||||||
*/
|
|
||||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
|
||||||
private Date endTime;
|
|
||||||
/**
|
|
||||||
* 活动排序
|
|
||||||
*/
|
|
||||||
private Integer sort;
|
|
||||||
/**
|
|
||||||
* 商品SkU集合
|
|
||||||
*/
|
|
||||||
private List<TeamProjectSkuInfoEchoResp> teamProjectSkuInfoEchoList;
|
|
||||||
/**
|
|
||||||
* 活动详情
|
|
||||||
*/
|
|
||||||
private String content;
|
|
||||||
/**
|
|
||||||
* 活动状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
/**
|
|
||||||
* 策略类型
|
|
||||||
*/
|
|
||||||
private String strategyType;
|
|
||||||
/**
|
|
||||||
* 策略ID
|
|
||||||
*/
|
|
||||||
private Long strategyId;
|
|
||||||
}
|
|
|
@ -2,6 +2,7 @@ package com.muyu.marketing.domain.resp;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
||||||
|
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
|
@ -64,10 +64,7 @@ public class TeamInfoListResp {
|
||||||
* 团购库存
|
* 团购库存
|
||||||
*/
|
*/
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
/**
|
|
||||||
* 团购介绍
|
|
||||||
*/
|
|
||||||
private String introduction;
|
|
||||||
/**
|
/**
|
||||||
* 列表查询结果,构建为响应对象
|
* 列表查询结果,构建为响应对象
|
||||||
* @param activityTeamInfoListModel 列表数据查询结果
|
* @param activityTeamInfoListModel 列表数据查询结果
|
||||||
|
@ -82,7 +79,6 @@ public class TeamInfoListResp {
|
||||||
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
||||||
.attendNumber(activityTeamInfoListModel.getAttendNumber())
|
.attendNumber(activityTeamInfoListModel.getAttendNumber())
|
||||||
.endTime(activityTeamInfoListModel.getEndTime())
|
.endTime(activityTeamInfoListModel.getEndTime())
|
||||||
.introduction(activityTeamInfoListModel.getIntroduction())
|
|
||||||
.teamPrice(activityTeamInfoListModel.getTeamPrice())
|
.teamPrice(activityTeamInfoListModel.getTeamPrice())
|
||||||
.productImage(activityTeamInfoListModel.getProductImage())
|
.productImage(activityTeamInfoListModel.getProductImage())
|
||||||
.productPrice(activityTeamInfoListModel.getProductPrice())
|
.productPrice(activityTeamInfoListModel.getProductPrice())
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
package com.muyu.marketing.remote.product;
|
|
||||||
|
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ProductInfoRemote
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhen_xiong_feng
|
|
||||||
* @Date 2024/12/3 14:32
|
|
||||||
*/
|
|
||||||
|
|
||||||
@FeignClient("muyu-product")
|
|
||||||
public interface ProductInfoRemote {
|
|
||||||
/**
|
|
||||||
* 获取商品信息详细信息
|
|
||||||
*/
|
|
||||||
;
|
|
||||||
}
|
|
|
@ -5,6 +5,6 @@ import com.muyu.marketing.domain.TeamStrategyHundred;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyHundred> {
|
public interface TeamStrategyHundredMapper extends BaseMapper<TeamStrategyHundred> {
|
||||||
|
|
||||||
}
|
}
|
|
@ -5,6 +5,6 @@ import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface TeamStrategyExemptionOrdinaryMapper extends BaseMapper<TeamStrategyOrdinary> {
|
public interface TeamStrategyOrdinaryMapper extends BaseMapper<TeamStrategyOrdinary> {
|
||||||
|
|
||||||
}
|
}
|
|
@ -35,10 +35,5 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
*/
|
*/
|
||||||
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据商品ID查询团购活动信息
|
|
||||||
* @param productId
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
public ActivityTeamProductListMode findProductList(Long productId);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,4 +47,27 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
||||||
|
|
||||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 业务模型 进行 团购商品修改
|
||||||
|
* @param activityTeamProductSkuUpdModel 修改业务模型
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 业务模型 进行 团购商品批量修改
|
||||||
|
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一键设置
|
||||||
|
* @param activityTeamProductSkuSettingModel 整体修改模型
|
||||||
|
*/
|
||||||
|
public default void setting(ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel){
|
||||||
|
this.batchSave(activityTeamProductSkuSettingModel.getActivityTeamProductSkuAddModelList());
|
||||||
|
this.batchUpdate(activityTeamProductSkuSettingModel.getActivityTeamProductSkuUpdModelList());
|
||||||
|
this.removeByIds(activityTeamProductSkuSettingModel.getRemoveIds());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,5 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 免单
|
||||||
|
*/
|
||||||
public interface TeamStrategyExemptionService extends ActivityTeamStrategy, IService<TeamStrategyExemption> {
|
public interface TeamStrategyExemptionService extends ActivityTeamStrategy, IService<TeamStrategyExemption> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,5 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
import com.muyu.marketing.domain.TeamStrategyHundred;
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 百人
|
||||||
|
*/
|
||||||
public interface TeamStrategyHundredService extends ActivityTeamStrategy, IService<TeamStrategyHundred> {
|
public interface TeamStrategyHundredService extends ActivityTeamStrategy, IService<TeamStrategyHundred> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,5 +4,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 普通
|
||||||
|
*/
|
||||||
public interface TeamStrategyOrdinaryService extends ActivityTeamStrategy, IService<TeamStrategyOrdinary> {
|
public interface TeamStrategyOrdinaryService extends ActivityTeamStrategy, IService<TeamStrategyOrdinary> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,6 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getKeyWord()), ActivityTeamInfo::getName, activityTeamInfoListQueryModel.getKeyWord());
|
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getKeyWord()), ActivityTeamInfo::getName, activityTeamInfoListQueryModel.getKeyWord());
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getStatus()), ActivityTeamInfo::getStatus, activityTeamInfoListQueryModel.getStatus());
|
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getStatus()), ActivityTeamInfo::getStatus, activityTeamInfoListQueryModel.getStatus());
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getIntroduction()),ActivityTeamInfo::getIntroduction,activityTeamInfoListQueryModel.getIntroduction());
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Object<T> -> 创建对象的时候进行的占用
|
* Object<T> -> 创建对象的时候进行的占用
|
||||||
|
@ -102,15 +101,8 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
@Override
|
@Override
|
||||||
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||||
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
||||||
io.jsonwebtoken.lang.Assert.isTrue(update,"修改失败");
|
Assert.isTrue(update,"修改失败");
|
||||||
activityTeamProductSkuInfoService.updateBath(activityTeamInfoUpdModel.getActivityTeamProductSkuModelList());
|
activityTeamProductSkuInfoService.setting(activityTeamInfoUpdModel.getActivityTeamProductSkuSettingModel());
|
||||||
return update;
|
return update;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public ActivityTeamProductListMode findProductList(Long productId) {
|
|
||||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.eq(ActivityTeamInfo::getProductId,productId);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
package com.muyu.marketing.team.service.impl;
|
package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||||
|
@ -13,6 +14,10 @@ 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 java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
|
@ -96,4 +101,38 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
||||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList) {
|
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList) {
|
||||||
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 业务模型 进行 团购商品修改
|
||||||
|
*
|
||||||
|
* @param activityTeamProductSkuUpdModel 修改业务模型
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
||||||
|
// update set where
|
||||||
|
LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
// 字段=值
|
||||||
|
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock,activityTeamProductSkuUpdModel.getTeamStock());
|
||||||
|
updateWrapper.set(ActivityTeamProductSkuInfo::getRemainStock,activityTeamProductSkuUpdModel.getTeamStock());
|
||||||
|
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice,activityTeamProductSkuUpdModel.getTeamPrice());
|
||||||
|
// id=?
|
||||||
|
updateWrapper.eq(ActivityTeamProductSkuInfo::getId,activityTeamProductSkuUpdModel.getId());
|
||||||
|
return this.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据 业务模型 进行 团购商品批量修改
|
||||||
|
*
|
||||||
|
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
||||||
|
* @return 修改结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
||||||
|
return this.updateBatchById(
|
||||||
|
activityTeamProductSkuUpdModelList.stream()
|
||||||
|
.map(ActivityTeamProductSkuInfo::updModelBuild)
|
||||||
|
.toList()
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,32 +7,57 @@ import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service("team-strategy-exemption")
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
|
@Service("team-strategy-exemption")
|
||||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||||
implements TeamStrategyExemptionService {
|
implements TeamStrategyExemptionService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开团
|
||||||
|
*
|
||||||
|
* @param activityTeamId 团购活动ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void openTeam(Long activityTeamId) {
|
public void openTeam(Long activityTeamId) {
|
||||||
log.info("参加-免单团-[{}]",activityTeamId);
|
log.info("参加 - 免单团 - [{}]", activityTeamId);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请加团
|
||||||
|
*
|
||||||
|
* @param teamId 团ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void applyFor(Long teamId) {
|
public void applyTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参团
|
||||||
|
*
|
||||||
|
* @param teamId 加团ID
|
||||||
|
* @param orderNumber 订单编号
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
public void addTeam(Long teamId, String orderNumber) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退团
|
||||||
|
*
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void backTeam(Long teamId) {
|
public void backTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算团
|
||||||
|
*
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void settle(Long teamId) {
|
public void settle(Long teamId) {
|
||||||
|
|
||||||
|
|
|
@ -2,36 +2,63 @@ package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.marketing.domain.TeamStrategyHundred;
|
import com.muyu.marketing.domain.TeamStrategyHundred;
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
import com.muyu.marketing.team.mapper.TeamStrategyHundredMapper;
|
||||||
import com.muyu.marketing.team.service.TeamStrategyHundredService;
|
import com.muyu.marketing.team.service.TeamStrategyHundredService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service("team--strategy-hundred")
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
public class TeamStrategyHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyHundred>
|
@Service("team-strategy-hundred")
|
||||||
|
public class TeamStrategyHundredServiceImpl extends ServiceImpl<TeamStrategyHundredMapper, TeamStrategyHundred>
|
||||||
implements TeamStrategyHundredService {
|
implements TeamStrategyHundredService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开团
|
||||||
|
*
|
||||||
|
* @param activityTeamId 团购活动ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void openTeam(Long activityTeamId) {
|
public void openTeam(Long activityTeamId) {
|
||||||
log.info("参加-百人团-[{}]",activityTeamId);
|
|
||||||
|
log.info("参加 - 百人团 - [{}]", activityTeamId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请加团
|
||||||
|
*
|
||||||
|
* @param teamId 团ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void applyFor(Long teamId) {
|
public void applyTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参团
|
||||||
|
*
|
||||||
|
* @param teamId 加团ID
|
||||||
|
* @param orderNumber 订单编号
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
public void addTeam(Long teamId, String orderNumber) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退团
|
||||||
|
*
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void backTeam(Long teamId) {
|
public void backTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算团
|
||||||
|
*
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void settle(Long teamId) {
|
public void settle(Long teamId) {
|
||||||
|
|
||||||
|
|
|
@ -2,37 +2,63 @@ package com.muyu.marketing.team.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
import com.muyu.marketing.domain.TeamStrategyOrdinary;
|
||||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionOrdinaryMapper;
|
import com.muyu.marketing.team.mapper.TeamStrategyOrdinaryMapper;
|
||||||
import com.muyu.marketing.team.service.TeamStrategyOrdinaryService;
|
import com.muyu.marketing.team.service.TeamStrategyOrdinaryService;
|
||||||
import lombok.extern.log4j.Log4j2;
|
import lombok.extern.log4j.Log4j2;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
@Service("team-strategy-ordinary")
|
|
||||||
@Log4j2
|
@Log4j2
|
||||||
public class TeamStrategyOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyOrdinary>
|
@Service("team-strategy-ordinary")
|
||||||
|
public class TeamStrategyOrdinaryServiceImpl extends ServiceImpl<TeamStrategyOrdinaryMapper, TeamStrategyOrdinary>
|
||||||
implements TeamStrategyOrdinaryService {
|
implements TeamStrategyOrdinaryService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开团
|
||||||
|
*
|
||||||
|
* @param activityTeamId 团购活动ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void openTeam(Long activityTeamId) {
|
public void openTeam(Long activityTeamId) {
|
||||||
log.info("参加-普通团-[{}]",activityTeamId);
|
|
||||||
|
|
||||||
|
log.info("参加 - 普通团 - [{}]", activityTeamId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请加团
|
||||||
|
*
|
||||||
|
* @param teamId 团ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void applyFor(Long teamId) {
|
public void applyTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参团
|
||||||
|
*
|
||||||
|
* @param teamId 加团ID
|
||||||
|
* @param orderNumber 订单编号
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
public void addTeam(Long teamId, String orderNumber) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退团
|
||||||
|
*
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void backTeam(Long teamId) {
|
public void backTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算团
|
||||||
|
*
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void settle(Long teamId) {
|
public void settle(Long teamId) {
|
||||||
|
|
||||||
|
|
|
@ -1,30 +1,34 @@
|
||||||
package com.muyu.marketing.team.strategy;
|
package com.muyu.marketing.team.strategy;
|
||||||
|
|
||||||
|
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName ActivityTeamStrategy
|
* 团活动策略
|
||||||
* @Description 描述
|
*
|
||||||
* @Author zhen_xiong_feng
|
* @author DongZeLiang
|
||||||
* @Date 2024/11/29 17:11
|
* @date 2024-11-29 15:03
|
||||||
*/
|
*/
|
||||||
public interface ActivityTeamStrategy {
|
public interface ActivityTeamStrategy {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 开团
|
* 开团
|
||||||
* @param activityTeamId 活动团id
|
* @param activityTeamId 团购活动ID
|
||||||
*/
|
*/
|
||||||
public void openTeam(Long activityTeamId);
|
public void openTeam(Long activityTeamId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 申请参团
|
* 申请加团
|
||||||
* @param teamId 团id
|
* @param teamId 团ID
|
||||||
*/
|
*/
|
||||||
public void applyFor(Long teamId);
|
public void applyTeam(Long teamId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 参团
|
* 参团
|
||||||
* @param teamId 团id
|
* @param teamId 加团ID
|
||||||
* @param orderNumber 订单号
|
* @param orderNumber 订单编号
|
||||||
*/
|
*/
|
||||||
public void addTeam(Long teamId,String orderNumber);
|
public void addTeam(Long teamId, String orderNumber);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 退团
|
* 退团
|
||||||
|
@ -34,7 +38,7 @@ public interface ActivityTeamStrategy {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 结算团
|
* 结算团
|
||||||
* @param teamId
|
* @param teamId 团购ID
|
||||||
*/
|
*/
|
||||||
public void settle(Long teamId);
|
public void settle(Long teamId);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,50 +1,83 @@
|
||||||
package com.muyu.marketing.team.strategy.impl;
|
package com.muyu.marketing.team.strategy.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
|
import com.muyu.common.core.utils.SpringUtils;
|
||||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||||
import org.springframework.context.annotation.Primary;
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName ActivityTeamStrategyImpl
|
* 团购执行器
|
||||||
* @Description 描述
|
*
|
||||||
* @Author zhen_xiong_feng
|
* @author DongZeLiang
|
||||||
* @Date 2024/11/29 17:22
|
* @date 2024-11-29 15:28
|
||||||
*/
|
*/
|
||||||
@Service
|
@Service
|
||||||
@Primary
|
@Primary
|
||||||
public class ActivityTeamStrategyImpl implements ActivityTeamStrategy {
|
public class ActivityTeamStrategyImpl implements ActivityTeamStrategy {
|
||||||
|
/**
|
||||||
|
* 开团
|
||||||
|
*
|
||||||
|
* @param activityTeamId 团购活动ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void openTeam(Long activityTeamId) {
|
public void openTeam(Long activityTeamId) {
|
||||||
String activityTeamType=null;
|
// 假设这里是通过方法获取的type,activityTeamId.toString()
|
||||||
if (activityTeamId==null){
|
// "team-strategy-exemption"
|
||||||
throw new RuntimeException("activityTeamId is null");
|
// "team-strategy-hundred"
|
||||||
} else if (activityTeamId==0) {
|
// "team-strategy-ordinary"
|
||||||
//团长免单
|
|
||||||
|
String activityTeamType = null;
|
||||||
|
if (activityTeamId == null) {
|
||||||
|
throw new ServiceException("activityTeamId is null");
|
||||||
|
}else if (activityTeamId == 0) {
|
||||||
activityTeamType = "team-strategy-exemption";
|
activityTeamType = "team-strategy-exemption";
|
||||||
} else if (activityTeamId == 1) {
|
}else if (activityTeamId == 1) {
|
||||||
//普通团
|
activityTeamType = "team-strategy-hundred";
|
||||||
|
}else if (activityTeamId == 2) {
|
||||||
activityTeamType = "team-strategy-ordinary";
|
activityTeamType = "team-strategy-ordinary";
|
||||||
} else if (activityTeamId == 2) {
|
|
||||||
//百人团
|
|
||||||
activityTeamType = "team--strategy-hundred";
|
|
||||||
}
|
}
|
||||||
|
ActivityTeamStrategy activityTeamStrategy = SpringUtils.getBean(activityTeamType);
|
||||||
|
activityTeamStrategy.openTeam(activityTeamId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请加团
|
||||||
|
*
|
||||||
|
* @param teamId 团ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void applyFor(Long teamId) {
|
public void applyTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参团
|
||||||
|
*
|
||||||
|
* @param teamId 加团ID
|
||||||
|
* @param orderNumber 订单编号
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void addTeam(Long teamId, String orderNumber) {
|
public void addTeam(Long teamId, String orderNumber) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退团
|
||||||
|
*
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void backTeam(Long teamId) {
|
public void backTeam(Long teamId) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算团
|
||||||
|
*
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void settle(Long teamId) {
|
public void settle(Long teamId) {
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ server:
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-activity
|
name: muyu-buy
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
@ -14,10 +14,10 @@ spring:
|
||||||
nacos:
|
nacos:
|
||||||
discovery:
|
discovery:
|
||||||
# 服务注册地址
|
# 服务注册地址
|
||||||
server-addr: 124.221.28.250:8848
|
server-addr: 127.0.0.1:8848
|
||||||
config:
|
config:
|
||||||
# 配置中心地址
|
# 配置中心地址
|
||||||
server-addr: 124.221.28.250:8848
|
server-addr: 127.0.0.1:8848
|
||||||
# 配置文件格式
|
# 配置文件格式
|
||||||
file-extension: yml
|
file-extension: yml
|
||||||
# 共享配置
|
# 共享配置
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.muyu.test;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.marketing.MuYuMarketIngApplication;
|
||||||
|
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 测试
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-29 15:40
|
||||||
|
*/
|
||||||
|
@SpringBootTest(classes = MuYuMarketIngApplication.class)
|
||||||
|
public class TeamStrategyTest {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ActivityTeamStrategy activityTeamStrategy;
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testStrategy() {
|
||||||
|
activityTeamStrategy.openTeam(0L);
|
||||||
|
activityTeamStrategy.openTeam(1L);
|
||||||
|
activityTeamStrategy.openTeam(2L);
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,21 +23,5 @@
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>muyu-common-core</artifactId>
|
<artifactId>muyu-common-core</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>io.springfox</groupId>
|
|
||||||
<artifactId>springfox-swagger2</artifactId>
|
|
||||||
<version>3.0.0</version>
|
|
||||||
<scope>compile</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.glassfish.jaxb</groupId>
|
|
||||||
<artifactId>jaxb-runtime</artifactId>
|
|
||||||
<version>2.3.4</version>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
|
||||||
<groupId>io.springfox</groupId>
|
|
||||||
<artifactId>springfox-oas</artifactId>
|
|
||||||
<version>3.0.0</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -49,9 +49,6 @@ public class AttributeGroup extends BaseEntity {
|
||||||
@ApiModelProperty(name = "状态", value = "状态", required = true)
|
@ApiModelProperty(name = "状态", value = "状态", required = true)
|
||||||
private String states;
|
private String states;
|
||||||
|
|
||||||
@ApiModelProperty(name = "备注" ,value = "状态" ,required = true)
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询构造器
|
* 查询构造器
|
||||||
|
@ -70,7 +67,6 @@ public class AttributeGroup extends BaseEntity {
|
||||||
return AttributeGroup.builder()
|
return AttributeGroup.builder()
|
||||||
.name(attributeGroupSaveReq.getName())
|
.name(attributeGroupSaveReq.getName())
|
||||||
.states(attributeGroupSaveReq.getStates())
|
.states(attributeGroupSaveReq.getStates())
|
||||||
.remark(attributeGroupSaveReq.getRemark())
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -82,7 +78,6 @@ public class AttributeGroup extends BaseEntity {
|
||||||
.id(id)
|
.id(id)
|
||||||
.name(attributeGroupEditReq.getName())
|
.name(attributeGroupEditReq.getName())
|
||||||
.states(attributeGroupEditReq.getStates())
|
.states(attributeGroupEditReq.getStates())
|
||||||
.remark(attributeGroupEditReq.getRemark())
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ import com.muyu.product.domain.req.CategoryInfoEditReq;
|
||||||
import com.muyu.common.core.web.domain.TreeEntity;
|
import com.muyu.common.core.web.domain.TreeEntity;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
|
@ -63,56 +62,6 @@ public class CategoryInfo extends TreeEntity {
|
||||||
@ApiModelProperty(name = "介绍", value = "介绍")
|
@ApiModelProperty(name = "介绍", value = "介绍")
|
||||||
private String introduction;
|
private String introduction;
|
||||||
|
|
||||||
@ApiModelProperty(name = "备注", value = "备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Long getParentId() {
|
|
||||||
return super.getParentId() != null ? super.getParentId() : 0L;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 安全地获取父级ID
|
|
||||||
*/
|
|
||||||
public Long getSafeParentId() {
|
|
||||||
return Optional.ofNullable(super.getParentId()).orElse(0L);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 判断是否有父级
|
|
||||||
*/
|
|
||||||
public boolean hasParent() {
|
|
||||||
Long parentId = getParentId();
|
|
||||||
return parentId != null && parentId != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 修改构造器方法,添加对 parentId 的安全处理
|
|
||||||
public static CategoryInfo saveBuild(CategoryInfoSaveReq categoryInfoSaveReq, Supplier<String> supplier) {
|
|
||||||
return CategoryInfo.builder()
|
|
||||||
.name(categoryInfoSaveReq.getName())
|
|
||||||
.image(categoryInfoSaveReq.getImage())
|
|
||||||
.start(categoryInfoSaveReq.getStart())
|
|
||||||
.remark(categoryInfoSaveReq.getRemark())
|
|
||||||
.introduction(categoryInfoSaveReq.getIntroduction())
|
|
||||||
.parentId(Optional.ofNullable(categoryInfoSaveReq.getParentId()).orElse(0L))
|
|
||||||
.createBy(supplier.get())
|
|
||||||
.createTime(new Date())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CategoryInfo saveModelBuild(CategoryInfoSaveModel categoryInfoSaveModel) {
|
|
||||||
return CategoryInfo.builder()
|
|
||||||
.name(categoryInfoSaveModel.getName())
|
|
||||||
.image(categoryInfoSaveModel.getImage())
|
|
||||||
.start(categoryInfoSaveModel.getStart())
|
|
||||||
.remark(categoryInfoSaveModel.getRemark())
|
|
||||||
.introduction(categoryInfoSaveModel.getIntroduction())
|
|
||||||
.parentId(Optional.ofNullable(categoryInfoSaveModel.getParentId()).orElse(0L))
|
|
||||||
.createBy(categoryInfoSaveModel.getCreateBy())
|
|
||||||
.createTime(new Date())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询构造器
|
* 查询构造器
|
||||||
*/
|
*/
|
||||||
|
@ -125,15 +74,43 @@ public class CategoryInfo extends TreeEntity {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加构造器
|
||||||
|
*/
|
||||||
|
public static CategoryInfo saveBuild(CategoryInfoSaveReq categoryInfoSaveReq, Supplier<String> supplier){
|
||||||
|
return CategoryInfo.builder()
|
||||||
|
.name(categoryInfoSaveReq.getName())
|
||||||
|
.image(categoryInfoSaveReq.getImage())
|
||||||
|
.start(categoryInfoSaveReq.getStart())
|
||||||
|
.introduction(categoryInfoSaveReq.getIntroduction())
|
||||||
|
.parentId(categoryInfoSaveReq.getParentId())
|
||||||
|
.createBy(supplier.get())
|
||||||
|
.createTime(new Date())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改构造器
|
||||||
|
*/
|
||||||
public static CategoryInfo editBuild(Long id, CategoryInfoEditReq categoryInfoEditReq){
|
public static CategoryInfo editBuild(Long id, CategoryInfoEditReq categoryInfoEditReq){
|
||||||
return CategoryInfo.builder()
|
return CategoryInfo.builder()
|
||||||
.id(id)
|
.id(id)
|
||||||
.name(categoryInfoEditReq.getName())
|
.name(categoryInfoEditReq.getName())
|
||||||
.image(categoryInfoEditReq.getImage())
|
.image(categoryInfoEditReq.getImage())
|
||||||
.remark(categoryInfoEditReq.getRemark())
|
|
||||||
.start(categoryInfoEditReq.getStart())
|
.start(categoryInfoEditReq.getStart())
|
||||||
.introduction(categoryInfoEditReq.getIntroduction())
|
.introduction(categoryInfoEditReq.getIntroduction())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static CategoryInfo saveModelBuild(CategoryInfoSaveModel categoryInfoSaveModel) {
|
||||||
|
return CategoryInfo.builder()
|
||||||
|
.name(categoryInfoSaveModel.getName())
|
||||||
|
.image(categoryInfoSaveModel.getImage())
|
||||||
|
.start(categoryInfoSaveModel.getStart())
|
||||||
|
.introduction(categoryInfoSaveModel.getIntroduction())
|
||||||
|
.parentId(categoryInfoSaveModel.getParentId())
|
||||||
|
.createBy(categoryInfoSaveModel.getCreateBy())
|
||||||
|
.createTime(new Date())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,10 +91,6 @@ public class ProjectInfo extends BaseEntity {
|
||||||
@ApiModelProperty(name = "品牌", value = "品牌")
|
@ApiModelProperty(name = "品牌", value = "品牌")
|
||||||
private Long brandId;
|
private Long brandId;
|
||||||
|
|
||||||
@ApiModelProperty(name = "备注", value = "备注")
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询构造器
|
* 查询构造器
|
||||||
*/
|
*/
|
||||||
|
@ -152,17 +148,4 @@ public class ProjectInfo extends BaseEntity {
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean equals(Object o) {
|
|
||||||
if (this == o) return true;
|
|
||||||
if (o == null || getClass() != o.getClass()) return false;
|
|
||||||
ProjectInfo that = (ProjectInfo) o;
|
|
||||||
// 需要先判断 id 是否为 null
|
|
||||||
return (id != null && id.equals(that.id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int hashCode() {
|
|
||||||
return id != null ? id.hashCode() : 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,21 +66,16 @@ public class ProjectSkuInfo extends BaseEntity {
|
||||||
@ApiModelProperty(name = "规格图片", value = "规格图片", required = true)
|
@ApiModelProperty(name = "规格图片", value = "规格图片", required = true)
|
||||||
private String image;
|
private String image;
|
||||||
|
|
||||||
@Excel(name = "规格值")
|
|
||||||
@ApiModelProperty(name = "规格值", value = "规格值")
|
|
||||||
private String specValues;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询构造器
|
* 查询构造器
|
||||||
*/
|
*/
|
||||||
public static ProjectSkuInfo queryBuild(ProjectSkuInfoQueryReq projectSkuInfoQueryReq){
|
public static ProjectSkuInfo queryBuild( ProjectSkuInfoQueryReq projectSkuInfoQueryReq){
|
||||||
return ProjectSkuInfo.builder()
|
return ProjectSkuInfo.builder()
|
||||||
.projectId(projectSkuInfoQueryReq.getProjectId())
|
.projectId(projectSkuInfoQueryReq.getProjectId())
|
||||||
.sku(projectSkuInfoQueryReq.getSku())
|
.sku(projectSkuInfoQueryReq.getSku())
|
||||||
.stock(projectSkuInfoQueryReq.getStock())
|
.stock(projectSkuInfoQueryReq.getStock())
|
||||||
.price(projectSkuInfoQueryReq.getPrice())
|
.price(projectSkuInfoQueryReq.getPrice())
|
||||||
.image(projectSkuInfoQueryReq.getImage())
|
.image(projectSkuInfoQueryReq.getImage())
|
||||||
.specValues(projectSkuInfoQueryReq.getSpecValues())
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +89,6 @@ public class ProjectSkuInfo extends BaseEntity {
|
||||||
.stock(projectSkuInfoSaveReq.getStock())
|
.stock(projectSkuInfoSaveReq.getStock())
|
||||||
.price(projectSkuInfoSaveReq.getPrice())
|
.price(projectSkuInfoSaveReq.getPrice())
|
||||||
.image(projectSkuInfoSaveReq.getImage())
|
.image(projectSkuInfoSaveReq.getImage())
|
||||||
.specValues(projectSkuInfoSaveReq.getSpecValues())
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +103,6 @@ public class ProjectSkuInfo extends BaseEntity {
|
||||||
.stock(projectSkuInfoEditReq.getStock())
|
.stock(projectSkuInfoEditReq.getStock())
|
||||||
.price(projectSkuInfoEditReq.getPrice())
|
.price(projectSkuInfoEditReq.getPrice())
|
||||||
.image(projectSkuInfoEditReq.getImage())
|
.image(projectSkuInfoEditReq.getImage())
|
||||||
.specValues(projectSkuInfoEditReq.getSpecValues())
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +113,6 @@ public class ProjectSkuInfo extends BaseEntity {
|
||||||
.image(productSkuModel.getImage())
|
.image(productSkuModel.getImage())
|
||||||
.stock(productSkuModel.getStock())
|
.stock(productSkuModel.getStock())
|
||||||
.price(productSkuModel.getPrice())
|
.price(productSkuModel.getPrice())
|
||||||
.specValues(productSkuModel.getSpecValues())
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -51,8 +51,11 @@ public class RuleInfo 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;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询构造器
|
* 查询构造器
|
||||||
*/
|
*/
|
||||||
|
@ -60,7 +63,6 @@ public class RuleInfo extends BaseEntity {
|
||||||
return RuleInfo.builder()
|
return RuleInfo.builder()
|
||||||
.name(ruleInfoQueryReq.getName())
|
.name(ruleInfoQueryReq.getName())
|
||||||
.status(ruleInfoQueryReq.getStatus())
|
.status(ruleInfoQueryReq.getStatus())
|
||||||
.remark(ruleInfoQueryReq.getRemark())
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -70,7 +72,6 @@ public class RuleInfo extends BaseEntity {
|
||||||
public static RuleInfo saveBuild(RuleInfoSaveReq ruleInfoSaveReq){
|
public static RuleInfo saveBuild(RuleInfoSaveReq ruleInfoSaveReq){
|
||||||
return RuleInfo.builder()
|
return RuleInfo.builder()
|
||||||
.name(ruleInfoSaveReq.getName())
|
.name(ruleInfoSaveReq.getName())
|
||||||
.remark(ruleInfoSaveReq.getRemark())
|
|
||||||
.status(ruleInfoSaveReq.getStatus())
|
.status(ruleInfoSaveReq.getStatus())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
@ -83,19 +84,21 @@ public class RuleInfo extends BaseEntity {
|
||||||
.id(id)
|
.id(id)
|
||||||
.name(ruleInfoEditReq.getName())
|
.name(ruleInfoEditReq.getName())
|
||||||
.status(ruleInfoEditReq.getStatus())
|
.status(ruleInfoEditReq.getStatus())
|
||||||
.remark(ruleInfoEditReq.getRemark())
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RuleInfo addModelBuild(RuleInfoAddModel model, Supplier<String> userNameSupplier) {
|
/**
|
||||||
RuleInfo ruleInfo = new RuleInfo();
|
*
|
||||||
ruleInfo.setName(model.getName());
|
* @param ruleInfoAddModel 添加模型
|
||||||
ruleInfo.setRemark(model.getRemark());
|
* @param createBy 创建者
|
||||||
ruleInfo.setStatus(model.getStatus()); // 设置状态
|
* @return 规格对象
|
||||||
ruleInfo.setCreateBy(userNameSupplier.get());
|
*/
|
||||||
ruleInfo.setCreateTime(new Date());
|
public static RuleInfo addModelBuild (RuleInfoAddModel ruleInfoAddModel, Supplier<String> createBy) {
|
||||||
ruleInfo.setUpdateBy(userNameSupplier.get());
|
return RuleInfo.builder()
|
||||||
ruleInfo.setUpdateTime(new Date());
|
.name(ruleInfoAddModel.getName())
|
||||||
return ruleInfo;
|
.status(ruleInfoAddModel.getStatus())
|
||||||
|
.createBy(createBy.get())
|
||||||
|
.createTime(new Date())
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,63 +0,0 @@
|
||||||
package com.muyu.product.domain.base;
|
|
||||||
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.context.annotation.Configuration;
|
|
||||||
import springfox.documentation.builders.ApiInfoBuilder;
|
|
||||||
import springfox.documentation.builders.PathSelectors;
|
|
||||||
import springfox.documentation.builders.RequestHandlerSelectors;
|
|
||||||
import springfox.documentation.oas.annotations.EnableOpenApi;
|
|
||||||
import springfox.documentation.service.ApiInfo;
|
|
||||||
import springfox.documentation.spi.DocumentationType;
|
|
||||||
import springfox.documentation.spring.web.plugins.Docket;
|
|
||||||
import springfox.documentation.swagger2.annotations.EnableSwagger2;
|
|
||||||
import java.util.Collections;
|
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName SwaggerConfig
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhang
|
|
||||||
* @Date 2024/11/19 22:02
|
|
||||||
*/
|
|
||||||
@Configuration
|
|
||||||
@EnableOpenApi
|
|
||||||
public class SwaggerConfig {
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public Docket publicApi() {
|
|
||||||
return new Docket(DocumentationType.OAS_30)
|
|
||||||
.groupName("public-api")
|
|
||||||
.apiInfo(apiInfo())
|
|
||||||
.select()
|
|
||||||
.apis(RequestHandlerSelectors.basePackage("com.muyu.controller"))
|
|
||||||
.paths(PathSelectors.any())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Bean
|
|
||||||
public Docket adminApi() {
|
|
||||||
return new Docket(DocumentationType.OAS_30)
|
|
||||||
.groupName("admin-api")
|
|
||||||
.apiInfo(adminApiInfo())
|
|
||||||
.select()
|
|
||||||
.apis(RequestHandlerSelectors.basePackage("com.muyu.admin"))
|
|
||||||
.paths(PathSelectors.any())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
private ApiInfo apiInfo() {
|
|
||||||
return new ApiInfoBuilder()
|
|
||||||
.title("公共API")
|
|
||||||
.description("公共接口文档")
|
|
||||||
.version("1.0")
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
|
|
||||||
private ApiInfo adminApiInfo() {
|
|
||||||
return new ApiInfoBuilder()
|
|
||||||
.title("管理API")
|
|
||||||
.description("管理接口文档")
|
|
||||||
.version("1.0")
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -43,8 +43,6 @@ public class CategoryInfoSaveModel extends TreeEntity {
|
||||||
/** 介绍 */
|
/** 介绍 */
|
||||||
private String introduction;
|
private String introduction;
|
||||||
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品属性组关联ID
|
* 商品属性组关联ID
|
||||||
*/
|
*/
|
||||||
|
@ -67,7 +65,6 @@ public class CategoryInfoSaveModel extends TreeEntity {
|
||||||
.name(categoryInfoSaveReq.getName())
|
.name(categoryInfoSaveReq.getName())
|
||||||
.image(categoryInfoSaveReq.getImage())
|
.image(categoryInfoSaveReq.getImage())
|
||||||
.start(categoryInfoSaveReq.getStart())
|
.start(categoryInfoSaveReq.getStart())
|
||||||
.remark(categoryInfoSaveReq.getRemark())
|
|
||||||
.introduction(categoryInfoSaveReq.getIntroduction())
|
.introduction(categoryInfoSaveReq.getIntroduction())
|
||||||
.parentId(categoryInfoSaveReq.getParentId())
|
.parentId(categoryInfoSaveReq.getParentId())
|
||||||
.attributeGroupIdList(categoryInfoSaveReq.getAttributeGroupIdList())
|
.attributeGroupIdList(categoryInfoSaveReq.getAttributeGroupIdList())
|
||||||
|
|
|
@ -1,17 +1,12 @@
|
||||||
package com.muyu.product.domain.model;
|
package com.muyu.product.domain.model;
|
||||||
|
|
||||||
import com.muyu.common.core.annotation.Excel;
|
import com.muyu.common.core.annotation.Excel;
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import javax.validation.constraints.DecimalMin;
|
|
||||||
import javax.validation.constraints.Min;
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -23,92 +18,21 @@ import java.math.BigDecimal;
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@ApiModel(value = "商品SKU模型", description = "商品SKU信息")
|
|
||||||
public class ProductSkuModel {
|
public class ProductSkuModel {
|
||||||
|
|
||||||
/** SKU编码 */
|
/** sku */
|
||||||
@NotBlank(message = "SKU编码不能为空")
|
@ApiModelProperty(name = "sku", value = "sku", required = true)
|
||||||
@Excel(name = "SKU编码")
|
|
||||||
@ApiModelProperty(name = "sku", value = "SKU编码", required = true, example = "SP123456")
|
|
||||||
private String sku;
|
private String sku;
|
||||||
|
|
||||||
/** 商品库存 */
|
/** 商品库存 */
|
||||||
@NotNull(message = "商品库存不能为空")
|
@ApiModelProperty(name = "商品库存", value = "商品库存", required = true)
|
||||||
@Min(value = 0, message = "商品库存不能小于0")
|
|
||||||
@Excel(name = "商品库存")
|
|
||||||
@ApiModelProperty(name = "stock", value = "商品库存", required = true, example = "100")
|
|
||||||
private Long stock;
|
private Long stock;
|
||||||
|
|
||||||
/** 销售价格 */
|
/** 商品价格 */
|
||||||
@NotNull(message = "销售价格不能为空")
|
@ApiModelProperty(name = "商品价格", value = "商品价格", required = true)
|
||||||
@DecimalMin(value = "0.01", message = "销售价格必须大于0")
|
|
||||||
@Excel(name = "销售价格")
|
|
||||||
@ApiModelProperty(name = "price", value = "销售价格", required = true, example = "99.99")
|
|
||||||
private BigDecimal price;
|
private BigDecimal price;
|
||||||
|
|
||||||
/** 市场价格 */
|
|
||||||
@Excel(name = "市场价格")
|
|
||||||
@ApiModelProperty(name = "marketPrice", value = "市场价格", example = "129.99")
|
|
||||||
private BigDecimal marketPrice;
|
|
||||||
|
|
||||||
/** 成本价格 */
|
|
||||||
@Excel(name = "成本价格")
|
|
||||||
@ApiModelProperty(name = "costPrice", value = "成本价格", example = "59.99")
|
|
||||||
private BigDecimal costPrice;
|
|
||||||
|
|
||||||
/** 规格图片 */
|
/** 规格图片 */
|
||||||
@NotBlank(message = "规格图片不能为空")
|
@ApiModelProperty(name = "规格图片", value = "规格图片", required = true)
|
||||||
@Excel(name = "规格图片")
|
|
||||||
@ApiModelProperty(name = "image", value = "规格图片", required = true)
|
|
||||||
private String image;
|
private String image;
|
||||||
|
|
||||||
/** 规格值JSON */
|
|
||||||
@ApiModelProperty(name = "specValues", value = "规格值JSON", example = "{\"颜色\":\"红色\",\"尺寸\":\"XL\"}")
|
|
||||||
private String specValues;
|
|
||||||
|
|
||||||
/** 商品条形码 */
|
|
||||||
@Excel(name = "商品条形码")
|
|
||||||
@ApiModelProperty(name = "barcode", value = "商品条形码")
|
|
||||||
private String barcode;
|
|
||||||
|
|
||||||
/** 预警库存 */
|
|
||||||
@Min(value = 0, message = "预警库存不能小于0")
|
|
||||||
@Excel(name = "预警库存")
|
|
||||||
@ApiModelProperty(name = "lowStock", value = "预警库存", example = "10")
|
|
||||||
private Integer lowStock;
|
|
||||||
|
|
||||||
/** 锁定库存 */
|
|
||||||
@Excel(name = "锁定库存")
|
|
||||||
@ApiModelProperty(name = "lockStock", value = "锁定库存", example = "0")
|
|
||||||
private Integer lockStock;
|
|
||||||
|
|
||||||
/** 销量 */
|
|
||||||
@Excel(name = "销量")
|
|
||||||
@ApiModelProperty(name = "sales", value = "销量", example = "0")
|
|
||||||
private Integer sales;
|
|
||||||
|
|
||||||
/** 状态(0-禁用 1-启用) */
|
|
||||||
@Excel(name = "状态", readConverterExp = "0=禁用,1=启用")
|
|
||||||
@ApiModelProperty(name = "status", value = "状态(0-禁用 1-启用)", example = "1")
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
/** SKU名称 */
|
|
||||||
@Excel(name = "SKU名称")
|
|
||||||
@ApiModelProperty(name = "skuName", value = "SKU名称")
|
|
||||||
private String skuName;
|
|
||||||
|
|
||||||
/** 重量(克) */
|
|
||||||
@Excel(name = "重量(克)")
|
|
||||||
@ApiModelProperty(name = "weight", value = "重量(克)")
|
|
||||||
private Double weight;
|
|
||||||
|
|
||||||
/** 体积(cm³) */
|
|
||||||
@Excel(name = "体积(cm³)")
|
|
||||||
@ApiModelProperty(name = "volume", value = "体积(cm³)")
|
|
||||||
private Double volume;
|
|
||||||
|
|
||||||
/** 排序号 */
|
|
||||||
@Excel(name = "排序号")
|
|
||||||
@ApiModelProperty(name = "sort", value = "排序号", example = "1")
|
|
||||||
private Integer sort;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,16 +1,10 @@
|
||||||
package com.muyu.product.domain.model;
|
package com.muyu.product.domain.model;
|
||||||
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import com.muyu.product.domain.ProjectInfo;
|
|
||||||
import com.muyu.product.domain.req.ProjectInfoEditReq;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.*;
|
import lombok.*;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author DongZl
|
||||||
* @description: 商品添加模型
|
* @description: 商品添加模型
|
||||||
|
@ -23,97 +17,43 @@ import java.util.List;
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class ProjectAddModel extends BaseEntity {
|
public class ProjectAddModel extends BaseEntity {
|
||||||
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/** 商品名称 */
|
/** 商品名称 */
|
||||||
@NotBlank(message = "商品名称不能为空")
|
@ApiModelProperty(name = "商品名称", value = "商品名称")
|
||||||
@ApiModelProperty(name = "name", value = "商品名称", required = true)
|
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/** 商品描述 */
|
/** 商品描述 */
|
||||||
@ApiModelProperty(name = "introduction", value = "商品描述")
|
@ApiModelProperty(name = "商品描述", value = "商品描述")
|
||||||
private String introduction;
|
private String introduction;
|
||||||
|
|
||||||
/** 主类型 */
|
/** 主类型 */
|
||||||
@ApiModelProperty(name = "mianType", value = "主类型")
|
@ApiModelProperty(name = "主类型", value = "主类型")
|
||||||
private Long mianType;
|
private Long mianType;
|
||||||
|
|
||||||
/** 父类型 */
|
/** 父类型 */
|
||||||
@ApiModelProperty(name = "parentType", value = "父类型")
|
@ApiModelProperty(name = "父类型", value = "父类型")
|
||||||
private Long parentType;
|
private Long parentType;
|
||||||
|
|
||||||
/** 商品类型 */
|
/** 商品类型 */
|
||||||
@NotNull(message = "商品类型不能为空")
|
@ApiModelProperty(name = "商品类型", value = "商品类型")
|
||||||
@ApiModelProperty(name = "type", value = "商品类型", required = true)
|
|
||||||
private Long type;
|
private Long type;
|
||||||
|
|
||||||
/** 商品主图 */
|
/** 商品图片 */
|
||||||
@NotBlank(message = "商品主图不能为空")
|
@ApiModelProperty(name = "商品图片", value = "商品图片")
|
||||||
@ApiModelProperty(name = "image", value = "商品主图", required = true)
|
|
||||||
private String image;
|
private String image;
|
||||||
|
|
||||||
/** 商品轮播图 */
|
/** 商品轮播图 */
|
||||||
@ApiModelProperty(name = "carouselImages", value = "商品轮播图(多个图片用逗号分隔)")
|
@ApiModelProperty(name = "商品轮播图", value = "商品轮播图")
|
||||||
private String carouselImages;
|
private String carouselImages;
|
||||||
|
|
||||||
/** 商品状态(0-下架 1-上架) */
|
/** 商品状态 */
|
||||||
@ApiModelProperty(name = "status", value = "商品状态(0-下架 1-上架)")
|
@ApiModelProperty(name = "商品状态", value = "商品状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
/** 规格ID */
|
/** 规格 */
|
||||||
@ApiModelProperty(name = "ruleId", value = "规格ID")
|
@ApiModelProperty(name = "规格", value = "规格")
|
||||||
private Long ruleId;
|
private Long ruleId;
|
||||||
|
|
||||||
/** 品牌ID */
|
/** 品牌 */
|
||||||
@ApiModelProperty(name = "brandId", value = "品牌ID")
|
@ApiModelProperty(name = "品牌", value = "品牌")
|
||||||
private Long brandId;
|
private Long brandId;
|
||||||
|
|
||||||
/** SKU列表 */
|
|
||||||
@ApiModelProperty(name = "skuList", value = "SKU列表")
|
|
||||||
private List<ProductSkuModel> skuList;
|
|
||||||
|
|
||||||
/** 销售价格 */
|
|
||||||
@ApiModelProperty(name = "salePrice", value = "销售价格")
|
|
||||||
private Double salePrice;
|
|
||||||
|
|
||||||
/** 市场价格 */
|
|
||||||
@ApiModelProperty(name = "marketPrice", value = "市场价格")
|
|
||||||
private Double marketPrice;
|
|
||||||
|
|
||||||
/** 库存数量 */
|
|
||||||
@ApiModelProperty(name = "stock", value = "库存数量")
|
|
||||||
private Integer stock;
|
|
||||||
|
|
||||||
/** 排序号 */
|
|
||||||
@ApiModelProperty(name = "sort", value = "排序号")
|
|
||||||
private Integer sort;
|
|
||||||
|
|
||||||
/** 是否推荐(0-否 1-是) */
|
|
||||||
@ApiModelProperty(name = "isRecommend", value = "是否推荐(0-否 1-是)")
|
|
||||||
private String isRecommend;
|
|
||||||
|
|
||||||
/** 商品详情 */
|
|
||||||
@ApiModelProperty(name = "detail", value = "商品详情")
|
|
||||||
private String detail;
|
|
||||||
|
|
||||||
/** 规格属性JSON */
|
|
||||||
@ApiModelProperty(name = "specJson", value = "规格属性JSON")
|
|
||||||
private String specJson;
|
|
||||||
|
|
||||||
|
|
||||||
public static ProjectInfo editBuild(Long id, ProjectInfoEditReq projectInfoEditReq){
|
|
||||||
return ProjectInfo.builder()
|
|
||||||
.id(id)
|
|
||||||
.name(projectInfoEditReq.getProjectAddModel().getName())
|
|
||||||
.introduction(projectInfoEditReq.getProjectAddModel().getIntroduction())
|
|
||||||
.mianType(projectInfoEditReq.getProjectAddModel().getMianType())
|
|
||||||
.parentType(projectInfoEditReq.getProjectAddModel().getParentType())
|
|
||||||
.type(projectInfoEditReq.getProjectAddModel().getType())
|
|
||||||
.image(projectInfoEditReq.getProjectAddModel().getImage())
|
|
||||||
.carouselImages(projectInfoEditReq.getProjectAddModel().getCarouselImages())
|
|
||||||
.status(projectInfoEditReq.getProjectAddModel().getStatus())
|
|
||||||
.ruleId(projectInfoEditReq.getProjectAddModel().getRuleId())
|
|
||||||
.brandId(projectInfoEditReq.getProjectAddModel().getBrandId())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
package com.muyu.product.domain.model;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ProjectModel
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhang
|
|
||||||
* @Date 2024/11/19 21:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ProjectModel {
|
|
||||||
private Long id;
|
|
||||||
private String value;
|
|
||||||
}
|
|
|
@ -1,25 +0,0 @@
|
||||||
package com.muyu.product.domain.model;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ProjectSKUModel
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhang
|
|
||||||
* @Date 2024/11/19 21:45
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class ProjectSKUModel {
|
|
||||||
private String sku;
|
|
||||||
private Long stock;
|
|
||||||
private BigDecimal price;
|
|
||||||
private String image;
|
|
||||||
}
|
|
|
@ -33,16 +33,8 @@ public class RuleAttrAddModel extends BaseEntity {
|
||||||
/**
|
/**
|
||||||
* 规格属性值集合
|
* 规格属性值集合
|
||||||
*/
|
*/
|
||||||
|
|
||||||
private String attrValue;
|
|
||||||
|
|
||||||
private String status = "Y";
|
|
||||||
|
|
||||||
|
|
||||||
private List<String> valueList;
|
private List<String> valueList;
|
||||||
|
|
||||||
// private List<RuleAttrAddModel> ruleAttrList;
|
|
||||||
|
|
||||||
public static RuleAttrAddModel infoBuild (RuleAttrInfo ruleAttrInfo) {
|
public static RuleAttrAddModel infoBuild (RuleAttrInfo ruleAttrInfo) {
|
||||||
return RuleAttrAddModel.builder()
|
return RuleAttrAddModel.builder()
|
||||||
.name(ruleAttrInfo.getName())
|
.name(ruleAttrInfo.getName())
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
package com.muyu.product.domain.model;
|
|
||||||
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
|
||||||
import com.muyu.product.domain.RuleAttrInfo;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName RuleAttrAssModel
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhang
|
|
||||||
* @Date 2024/11/14 16:03
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class RuleAttrAssModel extends BaseEntity {
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private List<String> valueList;
|
|
||||||
|
|
||||||
public static RuleAttrAddModel infoBuild (RuleAttrInfo ruleAttrInfo) {
|
|
||||||
return RuleAttrAddModel.builder()
|
|
||||||
.name(ruleAttrInfo.getName())
|
|
||||||
.valueList(Arrays.stream(ruleAttrInfo.getAttrValue().split(",")).toList())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -23,16 +23,12 @@ import java.util.List;
|
||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class RuleInfoAddModel extends BaseEntity {
|
public class RuleInfoAddModel extends BaseEntity {
|
||||||
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
/** 规格名称 */
|
/** 规格名称 */
|
||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/** 规格状态 */
|
/** 规格状态 */
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格属性集合
|
* 规格属性集合
|
||||||
*/
|
*/
|
||||||
|
@ -42,7 +38,6 @@ public class RuleInfoAddModel extends BaseEntity {
|
||||||
return RuleInfoAddModel.builder()
|
return RuleInfoAddModel.builder()
|
||||||
.name(req.getName())
|
.name(req.getName())
|
||||||
.status(req.getStatus())
|
.status(req.getStatus())
|
||||||
.remark(req.getRemark())
|
|
||||||
.ruleAttrList(req.getRuleAttrList())
|
.ruleAttrList(req.getRuleAttrList())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,8 +35,6 @@ public class TemplateAttributeModel extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String code;
|
private String code;
|
||||||
|
|
||||||
private String value;
|
|
||||||
|
|
||||||
public static TemplateAttributeModel attributeInfoBuild(AttributeInfo attributeInfo){
|
public static TemplateAttributeModel attributeInfoBuild(AttributeInfo attributeInfo){
|
||||||
return TemplateAttributeModel.builder()
|
return TemplateAttributeModel.builder()
|
||||||
.id(attributeInfo.getId())
|
.id(attributeInfo.getId())
|
||||||
|
|
|
@ -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.AttributeInfo;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
@ -36,10 +33,5 @@ public class AttributeGroupEditReq extends BaseEntity {
|
||||||
@ApiModelProperty(name = "状态", value = "状态", required = true)
|
@ApiModelProperty(name = "状态", value = "状态", required = true)
|
||||||
private String states;
|
private String states;
|
||||||
|
|
||||||
@ApiModelProperty(name = "备注", value = "备注", required = true)
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
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,10 +1,5 @@
|
||||||
package com.muyu.product.domain.req;
|
package com.muyu.product.domain.req;
|
||||||
|
|
||||||
import com.muyu.product.domain.ProjectInfo;
|
|
||||||
import com.muyu.product.domain.ProjectSkuInfo;
|
|
||||||
import com.muyu.product.domain.model.ProjectAddModel;
|
|
||||||
import com.muyu.product.domain.model.ProjectModel;
|
|
||||||
import com.muyu.product.domain.model.ProjectSKUModel;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
@ -13,10 +8,6 @@ import lombok.experimental.SuperBuilder;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品信息对象 project_info
|
* 商品信息对象 project_info
|
||||||
*
|
*
|
||||||
|
@ -72,34 +63,4 @@ public class ProjectInfoEditReq extends BaseEntity {
|
||||||
@ApiModelProperty(name = "品牌", value = "品牌")
|
@ApiModelProperty(name = "品牌", value = "品牌")
|
||||||
private Long brandId;
|
private Long brandId;
|
||||||
|
|
||||||
|
|
||||||
@ApiModelProperty(value = "商品信息", required = true)
|
|
||||||
@NotNull(message = "商品信息不能为空")
|
|
||||||
private ProjectInfo projectInfo;
|
|
||||||
|
|
||||||
@ApiModelProperty("SKU列表")
|
|
||||||
private List<ProjectSkuInfo> skuList;
|
|
||||||
|
|
||||||
// 添加非空校验注解
|
|
||||||
@NotNull(message = "商品信息不能为空")
|
|
||||||
public ProjectInfo getProjectInfo() {
|
|
||||||
return projectInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<ProjectSkuInfo> getSkuList() {
|
|
||||||
return skuList != null ? skuList : new ArrayList<>();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setProjectInfo(ProjectInfo projectInfo) {
|
|
||||||
this.projectInfo = projectInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSkuList(List<ProjectSkuInfo> skuList) {
|
|
||||||
this.skuList = skuList;
|
|
||||||
}
|
|
||||||
|
|
||||||
private ProjectAddModel projectAddModel;
|
|
||||||
private List<ProjectModel> attrValueList;
|
|
||||||
private List<ProjectSKUModel> productSkuList;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package com.muyu.product.domain.req;
|
package com.muyu.product.domain.req;
|
||||||
|
|
||||||
import com.muyu.product.domain.ProjectInfo;
|
|
||||||
import com.muyu.product.domain.ProjectSkuInfo;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
@ -10,8 +8,6 @@ import lombok.experimental.SuperBuilder;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品信息对象 project_info
|
* 商品信息对象 project_info
|
||||||
*
|
*
|
||||||
|
@ -67,10 +63,4 @@ public class ProjectInfoQueryReq extends BaseEntity {
|
||||||
@ApiModelProperty(name = "品牌", value = "品牌")
|
@ApiModelProperty(name = "品牌", value = "品牌")
|
||||||
private Long brandId;
|
private Long brandId;
|
||||||
|
|
||||||
@ApiModelProperty(name = "商品信息", value = "商品信息")
|
|
||||||
private ProjectInfo projectInfo;
|
|
||||||
|
|
||||||
@ApiModelProperty(name = "商品SKU", value = "商品SKU")
|
|
||||||
private List<ProjectSkuInfo> skuList;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package com.muyu.product.domain.req;
|
package com.muyu.product.domain.req;
|
||||||
|
|
||||||
import com.muyu.product.domain.ProjectInfo;
|
|
||||||
import com.muyu.product.domain.ProjectSkuInfo;
|
|
||||||
import com.muyu.product.domain.model.AttrValueModel;
|
import com.muyu.product.domain.model.AttrValueModel;
|
||||||
import com.muyu.product.domain.model.ProductSkuModel;
|
import com.muyu.product.domain.model.ProductSkuModel;
|
||||||
import com.muyu.product.domain.model.ProjectAddModel;
|
import com.muyu.product.domain.model.ProjectAddModel;
|
||||||
|
@ -45,10 +43,4 @@ public class ProjectInfoSaveReq extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private List<ProductSkuModel> productSkuList;
|
private List<ProductSkuModel> productSkuList;
|
||||||
|
|
||||||
@ApiModelProperty(name = "规格值", value = "规格值")
|
|
||||||
private String specValues;
|
|
||||||
|
|
||||||
private ProjectInfo projectInfo;
|
|
||||||
private List<ProjectSkuInfo> skuList;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,6 @@
|
||||||
package com.muyu.product.domain.req;
|
package com.muyu.product.domain.req;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import com.muyu.product.domain.ProjectInfo;
|
|
||||||
import com.muyu.product.domain.ProjectSkuInfo;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
@ -47,10 +43,5 @@ public class ProjectSkuInfoEditReq extends BaseEntity {
|
||||||
/** 规格图片 */
|
/** 规格图片 */
|
||||||
@ApiModelProperty(name = "规格图片", value = "规格图片", required = true)
|
@ApiModelProperty(name = "规格图片", value = "规格图片", required = true)
|
||||||
private String image;
|
private String image;
|
||||||
@ApiModelProperty(name = "规格值", value = "规格值")
|
|
||||||
private String specValues;
|
|
||||||
|
|
||||||
private ProjectInfo projectInfo;
|
|
||||||
private List<ProjectSkuInfo> skuList;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,7 +44,4 @@ public class ProjectSkuInfoQueryReq extends BaseEntity {
|
||||||
@ApiModelProperty(name = "规格图片", value = "规格图片")
|
@ApiModelProperty(name = "规格图片", value = "规格图片")
|
||||||
private String image;
|
private String image;
|
||||||
|
|
||||||
@ApiModelProperty(name = "规格值", value = "规格值")
|
|
||||||
private String specValues;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,4 @@ public class ProjectSkuInfoSaveReq extends BaseEntity {
|
||||||
@ApiModelProperty(name = "规格图片", value = "规格图片", required = true)
|
@ApiModelProperty(name = "规格图片", value = "规格图片", required = true)
|
||||||
private String image;
|
private String image;
|
||||||
|
|
||||||
@ApiModelProperty(name = "规格值", value = "规格值")
|
|
||||||
private String specValues;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +0,0 @@
|
||||||
package com.muyu.product.domain.req;
|
|
||||||
|
|
||||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName RuleAttrInfoReq
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhang
|
|
||||||
* @Date 2024/11/14 16:28
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class RuleAttrInfoReq {
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
|
|
||||||
private List<RuleAttrAddModel> ruleAttrList;
|
|
||||||
}
|
|
|
@ -7,9 +7,6 @@ import lombok.AllArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import org.hibernate.validator.constraints.Length;
|
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格详情对象 rule_attr_info
|
* 规格详情对象 rule_attr_info
|
||||||
|
@ -46,8 +43,4 @@ public class RuleAttrInfoSaveReq extends BaseEntity {
|
||||||
@ApiModelProperty(name = "规格值", value = "规格值")
|
@ApiModelProperty(name = "规格值", value = "规格值")
|
||||||
private String attrValue;
|
private String attrValue;
|
||||||
|
|
||||||
@NotBlank(message = "规格名称不能为空")
|
|
||||||
@Length(max = 50, message = "规格名称长度不能超过50个字符")
|
|
||||||
private String attrName;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,31 +0,0 @@
|
||||||
package com.muyu.product.domain.req;
|
|
||||||
|
|
||||||
import com.muyu.product.domain.RuleAttrInfo;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Builder;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName RuleGroupUpdResp
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhang
|
|
||||||
* @Date 2024/11/13 22:24
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@NoArgsConstructor
|
|
||||||
@AllArgsConstructor
|
|
||||||
public class RuleGroupUpdResp {
|
|
||||||
|
|
||||||
private Long id;
|
|
||||||
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
private List<RuleAttrInfo> ruleAttrList;
|
|
||||||
|
|
||||||
}
|
|
|
@ -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;
|
||||||
|
@ -34,7 +35,14 @@ public class RuleInfoEditReq extends BaseEntity {
|
||||||
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
|
/** 规格状态 */
|
||||||
|
@Excel(name = "规格描述")
|
||||||
|
@ApiModelProperty(name = "规格描述", value = "规格描述")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格属性集合
|
||||||
|
*/
|
||||||
private List<RuleAttrAddModel> ruleAttrList;
|
private List<RuleAttrAddModel> ruleAttrList;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,8 +35,6 @@ public class AttributeGroupPageResp extends BaseEntity {
|
||||||
/** 状态 */
|
/** 状态 */
|
||||||
private String states;
|
private String states;
|
||||||
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 属性对象集合
|
* 属性对象集合
|
||||||
*/
|
*/
|
||||||
|
@ -50,11 +48,11 @@ 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())
|
||||||
.name(attributeGroup.getName())
|
.name(attributeGroup.getName())
|
||||||
.remark(attributeGroup.getRemark())
|
|
||||||
.states(attributeGroup.getStates())
|
.states(attributeGroup.getStates())
|
||||||
.attributeInfoList(function.apply(attributeGroup.getId()))
|
.attributeInfoList(function.apply(attributeGroup.getId()))
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -9,16 +9,14 @@ import lombok.NoArgsConstructor;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName AttributeGroupUpdateResp
|
* 修改回显的详细信息
|
||||||
* @Description 描述
|
|
||||||
* @Author zhang
|
|
||||||
* @Date 2024/11/13 13:58
|
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
@Builder
|
@Builder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
public class AttributeGroupUpdateResp {
|
public class AttributeGroupUpdResp {
|
||||||
|
|
||||||
/** 属性组编号 */
|
/** 属性组编号 */
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@ -27,8 +25,9 @@ public class AttributeGroupUpdateResp {
|
||||||
|
|
||||||
/** 状态 */
|
/** 状态 */
|
||||||
private String states;
|
private String states;
|
||||||
private String remark;
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 属性ID集合
|
||||||
|
*/
|
||||||
private List<AttributeInfo> attributeList;
|
private List<AttributeInfo> attributeList;
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,46 +0,0 @@
|
||||||
package com.muyu.product.domain.resp;
|
|
||||||
|
|
||||||
import com.muyu.common.core.utils.bean.BeanUtils;
|
|
||||||
import com.muyu.product.domain.CategoryInfo;
|
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName CategoryInfoDetailResp
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhang
|
|
||||||
* @Date 2024/11/14 23:34
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
@ApiModel(value = "CategoryInfoDetailResp",description = "品类信息详情响应")
|
|
||||||
public class CategoryInfoDetailResp extends CategoryInfo {
|
|
||||||
@ApiModelProperty("关联的属性ID列表")
|
|
||||||
private List<Long> attributeIdList;
|
|
||||||
|
|
||||||
@ApiModelProperty("关联的属性组ID列表")
|
|
||||||
private List<Long> attributeGroupIdList;
|
|
||||||
|
|
||||||
@ApiModelProperty("关联的品牌ID列表")
|
|
||||||
private List<Long> brandIdList;
|
|
||||||
|
|
||||||
@ApiModelProperty("父级品类名称")
|
|
||||||
private String parentName;
|
|
||||||
|
|
||||||
public static CategoryInfoDetailResp of(CategoryInfo categoryInfo, String parentName) {
|
|
||||||
CategoryInfoDetailResp resp = new CategoryInfoDetailResp();
|
|
||||||
// 复制基本属性
|
|
||||||
BeanUtils.copyProperties(categoryInfo, resp);
|
|
||||||
// 设置父级名称
|
|
||||||
resp.setParentName(parentName);
|
|
||||||
return resp;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static CategoryInfoDetailResp of(CategoryInfo categoryInfo) {
|
|
||||||
return of(categoryInfo, null);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -61,6 +61,4 @@ public class ProjectDetailResp {
|
||||||
* 属性组集合
|
* 属性组集合
|
||||||
*/
|
*/
|
||||||
private List<TemplateAttributeGroupModel> attributeGroupList;
|
private List<TemplateAttributeGroupModel> attributeGroupList;
|
||||||
|
|
||||||
private List<ProjectSkuInfo> skuList;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,23 +32,17 @@ public class RuleInfoResp extends BaseEntity {
|
||||||
/** 规格状态 */
|
/** 规格状态 */
|
||||||
private String status;
|
private String status;
|
||||||
|
|
||||||
private String remark;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格属性集合
|
* 规格属性集合
|
||||||
*/
|
*/
|
||||||
private List<RuleAttrAddModel> ruleAttrList;
|
private List<RuleAttrAddModel> ruleAttrList;
|
||||||
|
|
||||||
private Boolean isUsed;
|
public static RuleInfoResp infoBuild (RuleInfo ruleInfo, Function<Long, List<RuleAttrAddModel>> ruleAttrList) {
|
||||||
|
|
||||||
public static RuleInfoResp infoBuild(RuleInfo ruleInfo, Function<Long, List<RuleAttrAddModel>> ruleAttrList, Function<Long, Boolean> isUsedFunc) {
|
|
||||||
return RuleInfoResp.builder()
|
return RuleInfoResp.builder()
|
||||||
.id(ruleInfo.getId())
|
.id(ruleInfo.getId())
|
||||||
.name(ruleInfo.getName())
|
.name(ruleInfo.getName())
|
||||||
.remark(ruleInfo.getRemark())
|
|
||||||
.status(ruleInfo.getStatus())
|
.status(ruleInfo.getStatus())
|
||||||
.ruleAttrList(ruleAttrList.apply(ruleInfo.getId()))
|
.ruleAttrList(ruleAttrList.apply(ruleInfo.getId()))
|
||||||
.isUsed(isUsedFunc.apply(ruleInfo.getId()))
|
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.muyu.product.domain.resp;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.muyu.common.core.annotation.Excel;
|
||||||
|
import com.muyu.product.domain.model.RuleAttrAddModel;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格修改响应对象
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class RuleInfoUpdResp {
|
||||||
|
|
||||||
|
/** 主键 */
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
@ApiModelProperty(name = "主键", value = "主键")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 规格名称 */
|
||||||
|
@Excel(name = "规格名称")
|
||||||
|
@ApiModelProperty(name = "规格名称", value = "规格名称")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 规格状态 */
|
||||||
|
@Excel(name = "规格状态")
|
||||||
|
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 规格状态 */
|
||||||
|
@Excel(name = "规格描述")
|
||||||
|
@ApiModelProperty(name = "规格描述", value = "规格描述")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格属性集合
|
||||||
|
*/
|
||||||
|
private List<RuleAttrAddModel> ruleAttrList;
|
||||||
|
}
|
|
@ -1,39 +0,0 @@
|
||||||
package com.muyu.product.domain.vo;
|
|
||||||
|
|
||||||
import com.muyu.product.domain.AttributeGroup;
|
|
||||||
import com.muyu.product.domain.AttributeInfo;
|
|
||||||
import com.muyu.product.domain.ProjectSkuInfo;
|
|
||||||
import lombok.Data;
|
|
||||||
|
|
||||||
import javax.management.Attribute;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @ClassName ProductVo
|
|
||||||
* @Description 描述
|
|
||||||
* @Author zhang
|
|
||||||
* @Date 2024/11/22 16:06
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
public class ProductVo {
|
|
||||||
private Long id;
|
|
||||||
private String name; // 商品名称
|
|
||||||
private String introduction; // 商品描述
|
|
||||||
private String mainType; // 主类型
|
|
||||||
private String parentType; // 父类型
|
|
||||||
private String type; // 商品类型
|
|
||||||
private String image; // 商品图片
|
|
||||||
private String carouselImages; // 轮播图
|
|
||||||
private String status; // 商品状态
|
|
||||||
private Long ruleId; // 规格ID
|
|
||||||
private Long brandId; // 品牌ID
|
|
||||||
private String remark; // 备注
|
|
||||||
|
|
||||||
// 属性相关
|
|
||||||
private List<AttributeGroup> templateAttributeGroupList; // 属性组列表
|
|
||||||
private List<AttributeInfo> templateAttributeList; // 模板属性
|
|
||||||
private List<AttributeInfo> attributeList; // 自定义属性
|
|
||||||
|
|
||||||
// SKU相关
|
|
||||||
private List<ProjectSkuInfo> skuList; // SKU列表
|
|
||||||
}
|
|
|
@ -90,11 +90,6 @@
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>muyu-common-swagger</artifactId>
|
<artifactId>muyu-common-swagger</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.springdoc</groupId>
|
|
||||||
<artifactId>springdoc-openapi-ui</artifactId>
|
|
||||||
<version>1.6.15</version>
|
|
||||||
</dependency>
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -5,14 +5,12 @@ import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import springfox.documentation.oas.annotations.EnableOpenApi;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DongZl
|
* @author DongZl
|
||||||
* @description: 商品启动类
|
* @description: 商品启动类
|
||||||
* @Date 2024-2-26 下午 04:07
|
* @Date 2024-2-26 下午 04:07
|
||||||
*/
|
*/
|
||||||
@EnableOpenApi
|
|
||||||
@EnableCustomConfig
|
@EnableCustomConfig
|
||||||
@EnableCustomSwagger2
|
@EnableCustomSwagger2
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients
|
||||||
|
@ -23,4 +21,3 @@ public class MuYuProductApplication {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||||
import com.muyu.product.domain.resp.AttributeGroupUpdateResp;
|
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||||
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;
|
||||||
|
@ -75,8 +75,8 @@ public class AttributeGroupController extends BaseController {
|
||||||
@RequiresPermissions("product:attributeGroup:query")
|
@RequiresPermissions("product:attributeGroup:query")
|
||||||
@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<AttributeGroupUpdateResp> 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,11 +100,9 @@ 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.updateAttributeGroup(id,attributeGroupEditReq));
|
return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq)));
|
||||||
return attributeGroupService.updateAttributeGroup2(id,attributeGroupEditReq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除属性组
|
* 删除属性组
|
||||||
*/
|
*/
|
||||||
|
@ -116,23 +114,4 @@ public class AttributeGroupController extends BaseController {
|
||||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||||
return toAjax(attributeGroupService.removeBatchByIds(ids));
|
return toAjax(attributeGroupService.removeBatchByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 修改状态
|
|
||||||
*/
|
|
||||||
@PutMapping("/{id}/status/{status}")
|
|
||||||
@ApiOperation("修改规格状态")
|
|
||||||
@ApiImplicitParams({
|
|
||||||
@ApiImplicitParam(name = "id", value = "规格id", required = true, dataType = "Long", paramType = "path"),
|
|
||||||
@ApiImplicitParam(name = "status", value = "状态(Y/N)", required = true, dataType = "String", paramType = "path")
|
|
||||||
})
|
|
||||||
public Result<String> UpdateStatus(@PathVariable("id") Long id, @PathVariable("status") String status) {
|
|
||||||
AttributeGroup attributeGroup = new AttributeGroup();
|
|
||||||
attributeGroup.setId(id);
|
|
||||||
attributeGroup.setStates(status);
|
|
||||||
return toAjax(attributeGroupService.updateById(attributeGroup));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
package com.muyu.product.controller;
|
package com.muyu.product.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
@ -11,7 +10,6 @@ import com.muyu.product.domain.AttributeInfo;
|
||||||
import com.muyu.product.domain.BrandInfo;
|
import com.muyu.product.domain.BrandInfo;
|
||||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||||
import com.muyu.product.domain.resp.CategoryInfoDetailResp;
|
|
||||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
@ -54,39 +52,33 @@ public class CategoryInfoController extends BaseController {
|
||||||
@ApiOperation("获取品类信息列表")
|
@ApiOperation("获取品类信息列表")
|
||||||
@RequiresPermissions("product:category:list")
|
@RequiresPermissions("product:category:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<List<CategoryInfoDetailResp>> list(CategoryInfo categoryInfo) {
|
public Result<List<CategoryInfo>> list(CategoryInfo categoryInfo) {
|
||||||
try {
|
List<CategoryInfo> list = categoryInfoService.list(categoryInfo);
|
||||||
categoryInfo = Optional.ofNullable(categoryInfo).orElse(new CategoryInfo());
|
|
||||||
List<CategoryInfoDetailResp> list = categoryInfoService.listWithParent(categoryInfo);
|
|
||||||
return Result.success(list);
|
return Result.success(list);
|
||||||
} catch (Exception e) {
|
|
||||||
return Result.error(e.getMessage());
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出品类信息列表
|
* 导出品类信息列表
|
||||||
*/
|
*/
|
||||||
// @ApiOperation("导出品类信息列表")
|
@ApiOperation("导出品类信息列表")
|
||||||
// @RequiresPermissions("product:category:export")
|
@RequiresPermissions("product:category:export")
|
||||||
// @Log(title = "品类信息", businessType = BusinessType.EXPORT)
|
@Log(title = "品类信息", businessType = BusinessType.EXPORT)
|
||||||
// @PostMapping("/export")
|
@PostMapping("/export")
|
||||||
// public void export(HttpServletResponse response, CategoryInfo categoryInfo) {
|
public void export(HttpServletResponse response, CategoryInfo categoryInfo) {
|
||||||
// List<CategoryInfo> list = categoryInfoService.list(categoryInfo);
|
List<CategoryInfo> list = categoryInfoService.list(categoryInfo);
|
||||||
// ExcelUtil<CategoryInfo> util = new ExcelUtil<CategoryInfo>(CategoryInfo.class);
|
ExcelUtil<CategoryInfo> util = new ExcelUtil<CategoryInfo>(CategoryInfo.class);
|
||||||
// util.exportExcel(response, list, "品类信息数据");
|
util.exportExcel(response, list, "品类信息数据");
|
||||||
// }
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取品类信息详细信息
|
* 获取品类信息详细信息
|
||||||
*/
|
*/
|
||||||
@GetMapping(value = "/{id}")
|
|
||||||
@ApiOperation("获取品类信息详细信息")
|
@ApiOperation("获取品类信息详细信息")
|
||||||
@RequiresPermissions("product:category:query")
|
@RequiresPermissions("product:category:query")
|
||||||
|
@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<CategoryInfoDetailResp> getInfo(@PathVariable("id") Long id) {
|
public Result<CategoryInfo> getInfo(@PathVariable("id") Long id) {
|
||||||
return Result.success(categoryInfoService.getDetailById(id));
|
return Result.success(categoryInfoService.getById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -116,37 +108,26 @@ public class CategoryInfoController extends BaseController {
|
||||||
/**
|
/**
|
||||||
* 修改品类信息
|
* 修改品类信息
|
||||||
*/
|
*/
|
||||||
@PutMapping("/{id}")
|
|
||||||
@ApiOperation("修改品类信息")
|
|
||||||
@RequiresPermissions("product:category:edit")
|
@RequiresPermissions("product:category:edit")
|
||||||
@Log(title = "品类信息", businessType = BusinessType.UPDATE)
|
@Log(title = "品类信息", businessType = BusinessType.UPDATE)
|
||||||
public Result<String> edit(@PathVariable Long id, @RequestBody CategoryInfoSaveModel updateModel) {
|
@PutMapping("/{id}")
|
||||||
return toAjax(categoryInfoService.updateCategoryInfo(id, updateModel));
|
@ApiOperation("修改品类信息")
|
||||||
|
public Result<String> edit(@PathVariable Long id, @RequestBody CategoryInfoEditReq categoryInfoEditReq) {
|
||||||
|
return toAjax(categoryInfoService.updateById(CategoryInfo.editBuild(id,categoryInfoEditReq)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 删除品类信息
|
* 删除品类信息
|
||||||
*/
|
*/
|
||||||
// @RequiresPermissions("product:category:remove")
|
|
||||||
// @Log(title = "品类信息", businessType = BusinessType.DELETE)
|
|
||||||
// @DeleteMapping("/{ids}")
|
|
||||||
// @ApiOperation("删除品类信息")
|
|
||||||
// @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) {
|
|
||||||
// return toAjax(categoryInfoService.removeBatchByIds(ids));
|
|
||||||
// }
|
|
||||||
@RequiresPermissions("product:category:remove")
|
@RequiresPermissions("product:category:remove")
|
||||||
@Log(title = "品类信息", businessType = BusinessType.DELETE)
|
@Log(title = "品类信息", businessType = BusinessType.DELETE)
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
@ApiOperation("删除品类信息")
|
@ApiOperation("删除品类信息")
|
||||||
@ApiImplicitParam(name = "ids", 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) {
|
||||||
try {
|
return toAjax(categoryInfoService.removeBatchByIds(ids));
|
||||||
return toAjax(categoryInfoService.removeCategories(ids));
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
return Result.error(e.getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过品类ID获取父级以上的属性、属性组、品牌集合
|
* 通过品类ID获取父级以上的属性、属性组、品牌集合
|
||||||
* @param categoryId 品类ID
|
* @param categoryId 品类ID
|
||||||
|
@ -160,5 +141,4 @@ public class CategoryInfoController extends BaseController {
|
||||||
) {
|
) {
|
||||||
return Result.success(categoryInfoService.parentCommonElement(categoryId));
|
return Result.success(categoryInfoService.parentCommonElement(categoryId));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,6 @@ import com.muyu.product.domain.req.ProjectInfoSaveReq;
|
||||||
import com.muyu.product.domain.req.ProjectInfoEditReq;
|
import com.muyu.product.domain.req.ProjectInfoEditReq;
|
||||||
import com.muyu.product.service.ProjectInfoService;
|
import com.muyu.product.service.ProjectInfoService;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import springfox.documentation.annotations.ApiIgnore;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品信息Controller
|
* 商品信息Controller
|
||||||
|
@ -42,20 +41,21 @@ public class ProjectInfoController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
private ProjectInfoService projectInfoService;
|
private ProjectInfoService projectInfoService;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private ProjectInfoCache projectInfoCache;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询商品信息列表
|
* 查询商品信息列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "获取商品信息列表")
|
@ApiOperation("获取商品信息列表")
|
||||||
@ApiImplicitParams({
|
|
||||||
@ApiImplicitParam(name = "projectInfoQueryReq", value = "查询参数", paramType = "query", dataTypeClass = ProjectInfoQueryReq.class)
|
|
||||||
})
|
|
||||||
@RequiresPermissions("product:info:list")
|
@RequiresPermissions("product:info:list")
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
public Result<TableDataInfo<ProjectInfo>> list(@ApiIgnore ProjectInfoQueryReq projectInfoQueryReq) {
|
public Result<TableDataInfo<ProjectInfo>> list(ProjectInfoQueryReq projectInfoQueryReq) {
|
||||||
startPage();
|
startPage();
|
||||||
List<ProjectInfo> list = projectInfoService.list(ProjectInfo.queryBuild(projectInfoQueryReq));
|
List<ProjectInfo> list = projectInfoService.list(ProjectInfo.queryBuild(projectInfoQueryReq));
|
||||||
return getDataTable(list);
|
return getDataTable(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 导出商品信息列表
|
* 导出商品信息列表
|
||||||
*/
|
*/
|
||||||
|
@ -77,8 +77,7 @@ public class ProjectInfoController 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<ProjectInfo> getInfo(@PathVariable("id") Long id) {
|
public Result<ProjectInfo> getInfo(@PathVariable("id") Long id) {
|
||||||
ProjectInfo byId = projectInfoService.getById(id);
|
return Result.success(projectInfoCache.get(id));
|
||||||
return Result.success(byId);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -122,9 +121,7 @@ public class ProjectInfoController extends BaseController {
|
||||||
@PutMapping("/{id}")
|
@PutMapping("/{id}")
|
||||||
@ApiOperation("修改商品信息")
|
@ApiOperation("修改商品信息")
|
||||||
public Result<String> edit(@PathVariable Long id, @RequestBody ProjectInfoEditReq projectInfoEditReq) {
|
public Result<String> edit(@PathVariable Long id, @RequestBody ProjectInfoEditReq projectInfoEditReq) {
|
||||||
System.out.println("---------"+projectInfoEditReq);
|
return toAjax(projectInfoService.updateById(ProjectInfo.editBuild(id,projectInfoEditReq)));
|
||||||
// return toAjax(projectInfoService.updateById(ProjectInfo.editBuild(id,projectInfoEditReq)));
|
|
||||||
return projectInfoService.UpdProjectInfo(id,projectInfoEditReq);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -138,7 +135,4 @@ public class ProjectInfoController extends BaseController {
|
||||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||||
return toAjax(projectInfoService.removeBatchByIds(ids));
|
return toAjax(projectInfoService.removeBatchByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,10 +4,9 @@ import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.muyu.common.core.text.Convert;
|
import com.muyu.common.core.text.Convert;
|
||||||
import com.muyu.product.domain.RuleAttrInfo;
|
|
||||||
import com.muyu.product.domain.model.RuleInfoAddModel;
|
import com.muyu.product.domain.model.RuleInfoAddModel;
|
||||||
import com.muyu.product.domain.req.*;
|
|
||||||
import com.muyu.product.domain.resp.RuleInfoResp;
|
import com.muyu.product.domain.resp.RuleInfoResp;
|
||||||
|
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;
|
||||||
|
@ -25,6 +24,9 @@ import com.muyu.common.log.annotation.Log;
|
||||||
import com.muyu.common.log.enums.BusinessType;
|
import com.muyu.common.log.enums.BusinessType;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.product.domain.RuleInfo;
|
import com.muyu.product.domain.RuleInfo;
|
||||||
|
import com.muyu.product.domain.req.RuleInfoQueryReq;
|
||||||
|
import com.muyu.product.domain.req.RuleInfoSaveReq;
|
||||||
|
import com.muyu.product.domain.req.RuleInfoEditReq;
|
||||||
import com.muyu.product.service.RuleInfoService;
|
import com.muyu.product.service.RuleInfoService;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
|
@ -76,7 +78,7 @@ public class RuleInfoController extends BaseController {
|
||||||
@RequiresPermissions("product:rule:query")
|
@RequiresPermissions("product:rule:query")
|
||||||
@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<RuleInfoResp> getInfo(@PathVariable("id") Long id) {
|
public Result<RuleInfoUpdResp> getInfo(@PathVariable("id") Long id) {
|
||||||
return Result.success(ruleInfoService.getUpdById(id));
|
return Result.success(ruleInfoService.getUpdById(id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -98,10 +100,9 @@ public class RuleInfoController extends BaseController {
|
||||||
@Log(title = "商品规格", businessType = BusinessType.UPDATE)
|
@Log(title = "商品规格", businessType = BusinessType.UPDATE)
|
||||||
@PutMapping("/{id}")
|
@PutMapping("/{id}")
|
||||||
@ApiOperation("修改商品规格")
|
@ApiOperation("修改商品规格")
|
||||||
public Result<String> edit(@PathVariable Long id, @RequestBody RuleAttrInfoReq 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)));
|
||||||
ruleInfoService.edit3(id,ruleInfoEditReq);
|
return toAjax(ruleInfoService.updateById(id, ruleInfoEditReq));
|
||||||
return Result.success();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,19 +116,4 @@ public class RuleInfoController extends BaseController {
|
||||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||||
return toAjax(ruleInfoService.removeBatchByIds(ids));
|
return toAjax(ruleInfoService.removeBatchByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@PutMapping("/{id}/status/{status}")
|
|
||||||
@ApiOperation("修改规格状态")
|
|
||||||
@ApiImplicitParams({
|
|
||||||
@ApiImplicitParam(name = "id", value = "规格ID", required = true, dataType = "Long", paramType = "path"),
|
|
||||||
@ApiImplicitParam(name = "status", value = "状态(Y/N)", required = true, dataType = "String", paramType = "path")
|
|
||||||
})
|
|
||||||
public Result<String> updateStatus(@PathVariable("id") Long id, @PathVariable("status") String status) {
|
|
||||||
RuleInfo ruleInfo = new RuleInfo();
|
|
||||||
ruleInfo.setId(id);
|
|
||||||
ruleInfo.setStatus(status);
|
|
||||||
return toAjax(ruleInfoService.updateById(ruleInfo));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,8 +3,6 @@ package com.muyu.product.mapper;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.product.domain.AsAttributeGroup;
|
import com.muyu.product.domain.AsAttributeGroup;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 属性与组中间Mapper接口
|
* 属性与组中间Mapper接口
|
||||||
|
@ -12,11 +10,6 @@ import org.apache.ibatis.annotations.Param;
|
||||||
* @author DongZeLiang
|
* @author DongZeLiang
|
||||||
* @date 2024-02-27
|
* @date 2024-02-27
|
||||||
*/
|
*/
|
||||||
@Mapper
|
|
||||||
public interface AsAttributeGroupMapper extends BaseMapper<AsAttributeGroup> {
|
public interface AsAttributeGroupMapper extends BaseMapper<AsAttributeGroup> {
|
||||||
|
|
||||||
void shanchu(Long id);
|
|
||||||
|
|
||||||
void insertBatch(@Param("id") Long id, @Param("id1") Long id1);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.muyu.product.mapper;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.product.domain.AttributeGroup;
|
import com.muyu.product.domain.AttributeGroup;
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 属性组Mapper接口
|
* 属性组Mapper接口
|
||||||
|
@ -13,5 +12,4 @@ import org.apache.ibatis.annotations.Param;
|
||||||
*/
|
*/
|
||||||
public interface AttributeGroupMapper extends BaseMapper<AttributeGroup> {
|
public interface AttributeGroupMapper extends BaseMapper<AttributeGroup> {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.muyu.product.mapper;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.product.domain.ProjectInfo;
|
import com.muyu.product.domain.ProjectInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品信息Mapper接口
|
* 商品信息Mapper接口
|
||||||
|
@ -11,7 +10,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
* @author DongZeLiang
|
* @author DongZeLiang
|
||||||
* @date 2024-02-27
|
* @date 2024-02-27
|
||||||
*/
|
*/
|
||||||
@Mapper
|
|
||||||
public interface ProjectInfoMapper extends BaseMapper<ProjectInfo> {
|
public interface ProjectInfoMapper extends BaseMapper<ProjectInfo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ package com.muyu.product.mapper;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.product.domain.ProjectSkuInfo;
|
import com.muyu.product.domain.ProjectSkuInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品SKUMapper接口
|
* 商品SKUMapper接口
|
||||||
|
@ -11,7 +10,6 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
* @author DongZeLiang
|
* @author DongZeLiang
|
||||||
* @date 2024-02-27
|
* @date 2024-02-27
|
||||||
*/
|
*/
|
||||||
@Mapper
|
|
||||||
public interface ProjectSkuInfoMapper extends BaseMapper<ProjectSkuInfo> {
|
public interface ProjectSkuInfoMapper extends BaseMapper<ProjectSkuInfo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,12 +3,6 @@ package com.muyu.product.mapper;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.product.domain.RuleAttrInfo;
|
import com.muyu.product.domain.RuleAttrInfo;
|
||||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
|
||||||
import com.muyu.product.domain.req.RuleAttrInfoReq;
|
|
||||||
import com.muyu.product.domain.req.RuleInfoEditReq;
|
|
||||||
import com.muyu.product.domain.resp.RuleInfoResp;
|
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格详情Mapper接口
|
* 规格详情Mapper接口
|
||||||
|
@ -16,15 +10,6 @@ import org.apache.ibatis.annotations.Param;
|
||||||
* @author DongZeLiang
|
* @author DongZeLiang
|
||||||
* @date 2024-02-27
|
* @date 2024-02-27
|
||||||
*/
|
*/
|
||||||
@Mapper
|
|
||||||
public interface RuleAttrInfoMapper extends BaseMapper<RuleAttrInfo> {
|
public interface RuleAttrInfoMapper extends BaseMapper<RuleAttrInfo> {
|
||||||
|
|
||||||
void updRule(@Param("id") Long id,@Param("req") RuleAttrInfoReq req);
|
|
||||||
|
|
||||||
void deleteRule(@Param("id") Long id);
|
|
||||||
|
|
||||||
List<RuleAttrAddModel> getRuleAttrInfo(@Param("id") Long id);
|
|
||||||
RuleInfoResp getRuleAttrInfo2(@Param("id") Long id);
|
|
||||||
|
|
||||||
void addRuleAttrModel(@Param("id")Long id,@Param("name")String name,@Param("valueData") String substring);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,16 +19,4 @@ public interface AsAttributeGroupService extends IService<AsAttributeGroup> {
|
||||||
*/
|
*/
|
||||||
public List<AsAttributeGroup> list(AsAttributeGroup asAttributeGroup);
|
public List<AsAttributeGroup> list(AsAttributeGroup asAttributeGroup);
|
||||||
|
|
||||||
/**
|
|
||||||
* 删除属性与组中间
|
|
||||||
* @param id
|
|
||||||
*/
|
|
||||||
void delete(Long id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加中间表
|
|
||||||
* @param id
|
|
||||||
* @param id1
|
|
||||||
*/
|
|
||||||
void insertBath(Long id,Long id1);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,15 +2,13 @@ package com.muyu.product.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.product.domain.AttributeGroup;
|
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.AttributeGroupUpdateResp;
|
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 属性组Service接口
|
* 属性组Service接口
|
||||||
|
@ -43,14 +41,9 @@ public interface AttributeGroupService extends IService<AttributeGroup> {
|
||||||
public Boolean save(AttributeGroupSaveModel attributeGroupSaveModel);
|
public Boolean save(AttributeGroupSaveModel attributeGroupSaveModel);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询属性组的修改
|
* 根据ID查询属性组的修改
|
||||||
* @param id
|
* @param id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
AttributeGroupUpdateResp getUpdateById(Long id);
|
AttributeGroupUpdResp getUpdById(Long id);
|
||||||
|
|
||||||
// public Boolean updateAttributeGroup(Long id, AttributeGroupEditReq editReq);
|
|
||||||
|
|
||||||
|
|
||||||
Result<String> updateAttributeGroup2(Long id, AttributeGroupEditReq attributeGroupEditReq);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,6 @@ import com.muyu.product.domain.CategoryInfo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||||
import com.muyu.product.domain.resp.CategoryInfoDetailResp;
|
|
||||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -25,8 +24,7 @@ public interface CategoryInfoService extends IService<CategoryInfo> {
|
||||||
* @param categoryInfo 品类信息
|
* @param categoryInfo 品类信息
|
||||||
* @return 品类信息集合
|
* @return 品类信息集合
|
||||||
*/
|
*/
|
||||||
List<CategoryInfoDetailResp> listWithParent(CategoryInfo categoryInfo);
|
public List<CategoryInfo> list(CategoryInfo categoryInfo);
|
||||||
// public List<CategoryInfo> list(CategoryInfo categoryInfo);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存
|
* 保存
|
||||||
|
@ -71,12 +69,4 @@ public interface CategoryInfoService extends IService<CategoryInfo> {
|
||||||
CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId);
|
CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId);
|
||||||
|
|
||||||
public <T, AS> List<T> getCommon (Long categoryId, IService<AS> iService, IService<T> bsiService);
|
public <T, AS> List<T> getCommon (Long categoryId, IService<AS> iService, IService<T> bsiService);
|
||||||
|
|
||||||
|
|
||||||
// 添加新方法
|
|
||||||
CategoryInfoDetailResp getDetailById(Long id);
|
|
||||||
|
|
||||||
boolean updateCategoryInfo(Long id, CategoryInfoSaveModel updateModel);
|
|
||||||
|
|
||||||
boolean removeCategories(List<Long> ids);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,8 @@
|
||||||
package com.muyu.product.service;
|
package com.muyu.product.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.product.domain.ProjectInfo;
|
import com.muyu.product.domain.ProjectInfo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.product.domain.req.ProjectInfoEditReq;
|
|
||||||
import com.muyu.product.domain.req.ProjectInfoSaveReq;
|
import com.muyu.product.domain.req.ProjectInfoSaveReq;
|
||||||
import com.muyu.product.domain.resp.ProjectDetailResp;
|
import com.muyu.product.domain.resp.ProjectDetailResp;
|
||||||
|
|
||||||
|
@ -37,7 +34,4 @@ public interface ProjectInfoService extends IService<ProjectInfo> {
|
||||||
* @return 商品详情
|
* @return 商品详情
|
||||||
*/
|
*/
|
||||||
ProjectDetailResp getDetailInfo (Long id);
|
ProjectDetailResp getDetailInfo (Long id);
|
||||||
|
|
||||||
|
|
||||||
Result UpdProjectInfo(Long id, ProjectInfoEditReq projectInfoEditReq);
|
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue