Compare commits
20 Commits
master
...
1127/cheng
Author | SHA1 | Date |
---|---|---|
|
7eaf458690 | |
|
f91f2c5340 | |
|
ce1b8f30bd | |
|
341383d398 | |
|
517f694ec2 | |
|
d1d9109b43 | |
|
c02afc9a93 | |
|
e4580e8bd1 | |
|
46a7e2e8db | |
|
0a636c4728 | |
|
f10ee15063 | |
|
31a678e88e | |
|
0d177ec339 | |
|
46a56bd7aa | |
|
0b3fc8cd50 | |
|
0514f04a43 | |
|
f5d50ce2cf | |
|
2855601c13 | |
|
d3a93de52b | |
|
f9384d3b16 |
|
@ -0,0 +1,21 @@
|
|||
# 拼团活动列表(活动页面)
|
||||
|
||||
# 拼团详情(展示活动页面)
|
||||
#优惠券
|
||||
# 开团/加团(用户拼团页面)
|
||||
#选择商品(选择拼团的商品页面)
|
||||
#拼团中 (等待拼团页面)
|
||||
#品团 成功
|
||||
# 订单
|
||||
# 支付 成功/失败
|
||||
# 拼团
|
||||
|
||||
商品详情
|
||||
拼团活动详情
|
||||
拼团类型
|
||||
评论
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"拼团":{
|
||||
"活动id": "Long",
|
||||
"商品ID": "Long",
|
||||
"商品图片": "String",
|
||||
"活动名称": "String",
|
||||
"活动简介": "String",
|
||||
"商品单位": "String",
|
||||
"商品的轮播图": [
|
||||
"String",
|
||||
"String"
|
||||
],
|
||||
"活动状态": "String",
|
||||
"排序": "Integer",
|
||||
"详情": "String",
|
||||
"团购策略": "String",
|
||||
"团购类型": "String",
|
||||
"活动时间": "date"
|
||||
},
|
||||
|
||||
"商品规格List": [
|
||||
{
|
||||
"策略ID": "Long",
|
||||
"规格主键": "Long",
|
||||
"规格SKU": "String",
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
},
|
||||
{
|
||||
"策略ID": "Long",
|
||||
"规格主键": "Long",
|
||||
"规格SKU": "String",
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -19,8 +19,10 @@
|
|||
"拼团库存": "Long"
|
||||
}
|
||||
],
|
||||
"删除商品规格IdList" : ["Long", "Long"],
|
||||
"添加商品规格List": [
|
||||
"删除商品规格IdList" : [
|
||||
"Long", "Long"
|
||||
],
|
||||
"添加商品规格List": [ //
|
||||
"商品SKU": "String",
|
||||
"商品价格": "BigDecimal",
|
||||
"拼团价格": "BigDecimal",
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.common.core.web.page;
|
|||
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
@ -19,12 +20,12 @@ public class PageDomain {
|
|||
/**
|
||||
* 当前记录起始索引
|
||||
*/
|
||||
private Integer pageNum;
|
||||
private Integer pageNum=1;
|
||||
|
||||
/**
|
||||
* 每页显示记录数
|
||||
*/
|
||||
private Integer pageSize;
|
||||
private Integer pageSize=3;
|
||||
|
||||
/**
|
||||
* 排序列
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
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:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
@ -28,12 +28,12 @@ spring:
|
|||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 127.0.0.1:8718
|
||||
dashboard: 60.204.150.30:8718
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
dataId: sentinel-muyu-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -19,6 +19,11 @@
|
|||
|
||||
<dependencies>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.cloud</groupId>
|
||||
<artifactId>spring-cloud-loadbalancer</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 系统公共core -->
|
||||
<dependency>
|
||||
<groupId>com.muyu</groupId>
|
||||
|
|
|
@ -5,13 +5,17 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSaveModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品拼团信息
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
@ -32,7 +36,8 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private long productId;
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
|
@ -95,38 +100,4 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ActivityTeamInfo teamSaveBuild(ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
||||
return ActivityTeamInfo.builder()
|
||||
.name(activityTeamInfoSaveModel.getName())
|
||||
.productId(activityTeamInfoSaveModel.getProductId())
|
||||
.productImage(activityTeamInfoSaveModel.getProductImage())
|
||||
.introduction(activityTeamInfoSaveModel.getIntroduction())
|
||||
.unit(activityTeamInfoSaveModel.getUnit())
|
||||
.imageList(activityTeamInfoSaveModel.getImageList())
|
||||
.endTime(activityTeamInfoSaveModel.getEndTime())
|
||||
.sort(activityTeamInfoSaveModel.getSort())
|
||||
.content(activityTeamInfoSaveModel.getContent())
|
||||
.status(activityTeamInfoSaveModel.getStatus())
|
||||
.strategyType(activityTeamInfoSaveModel.getStrategyType())
|
||||
.strategyId(activityTeamInfoSaveModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
public static ActivityTeamInfo TeamUpdateBuild (ActivityTeamInfoUpdModel activityTeamInfoUpdModel){
|
||||
return ActivityTeamInfo.builder()
|
||||
.id(activityTeamInfoUpdModel.getId())
|
||||
.name(activityTeamInfoUpdModel.getName())
|
||||
.productId(activityTeamInfoUpdModel.getProductId())
|
||||
.productImage(activityTeamInfoUpdModel.getProductImage())
|
||||
.introduction(activityTeamInfoUpdModel.getIntroduction())
|
||||
.unit(activityTeamInfoUpdModel.getUnit())
|
||||
.imageList(activityTeamInfoUpdModel.getImageList())
|
||||
.endTime(activityTeamInfoUpdModel.getEndTime())
|
||||
.sort(activityTeamInfoUpdModel.getSort())
|
||||
.content(activityTeamInfoUpdModel.getContent())
|
||||
.status(activityTeamInfoUpdModel.getStatus())
|
||||
.strategyType(activityTeamInfoUpdModel.getStrategyType())
|
||||
.strategyId(activityTeamInfoUpdModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,16 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 团购活动执行表
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
@ -45,7 +50,7 @@ public class ActivityTeamOpenInfo extends BaseEntity {
|
|||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
|
|
|
@ -5,14 +5,18 @@ import com.baomidou.mybatisplus.annotation.TableId;
|
|||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品拼团规格信息表
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
@ -51,6 +55,7 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
|
||||
/**
|
||||
* 通过模型钢构件对象
|
||||
* @param activityTeamProductSkuAddModel 模型
|
||||
|
@ -61,12 +66,11 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
.productId(activityTeamProductSkuAddModel.getProductId())
|
||||
.teamId(activityTeamProductSkuAddModel.getTeamId())
|
||||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.productSku(activityTeamProductSkuAddModel.getSku())
|
||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
public static ActivityTeamProductSkuInfo updateModelBuild(ActivityTeamProductSkuReqModel activityTeamProductSkuReqModel) {
|
||||
|
||||
public static ActivityTeamProductSkuInfo updateModelBuild(ActivityTeamProductSkuUpdModel activityTeamProductSkuReqModel) {
|
||||
return ActivityTeamProductSkuInfo.builder()
|
||||
.id(activityTeamProductSkuReqModel.getId())
|
||||
.productId(activityTeamProductSkuReqModel.getProductId())
|
||||
|
@ -75,14 +79,4 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
.teamPrice(activityTeamProductSkuReqModel.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ActivityTeamProductSkuInfo updModelBuild(ActivityTeamProductSkuUpdModel teamProductSkuUpdModel){
|
||||
return ActivityTeamProductSkuInfo.builder()
|
||||
.id(teamProductSkuUpdModel.getId())
|
||||
.teamPrice(teamProductSkuUpdModel.getTeamPrice())
|
||||
.teamStock(teamProductSkuUpdModel.getTeamStock())
|
||||
.remainStock(teamProductSkuUpdModel.getTeamStock())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,9 +4,14 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 拼团免单策略
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
|
|
@ -4,9 +4,16 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
|
||||
/**
|
||||
* 百人策略
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
|
|
@ -4,9 +4,15 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 普通策略
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
|
|
@ -1,102 +0,0 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 活动回显总模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 16:00
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamDetailModel {
|
||||
/**
|
||||
* 拼团id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ActivityTeamProductSkuModel> projectSkuInfoAddReqList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
public static ActivityTeamDetailModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
||||
Function<ActivityTeamDetailModel.ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
||||
return function.apply(ActivityTeamDetailModel.builder()
|
||||
.id(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
||||
.productId(activityTeamInfo.getProductId())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
.introduction(activityTeamInfo.getIntroduction())
|
||||
.unit(activityTeamInfo.getUnit())
|
||||
.imageList(activityTeamInfo.getImageList())
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.sort(activityTeamInfo.getSort())
|
||||
.content(activityTeamInfo.getContent())
|
||||
.status(activityTeamInfo.getStatus())
|
||||
.strategyType(activityTeamInfo.getStrategyType())
|
||||
.strategyId(activityTeamInfo.getStrategyId())
|
||||
);
|
||||
}
|
||||
}
|
|
@ -10,7 +10,6 @@ import lombok.NoArgsConstructor;
|
|||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 团购活动添加模型
|
||||
|
@ -101,4 +100,6 @@ public class ActivityTeamInfoAddModel {
|
|||
.toList()
|
||||
).build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.common.core.web.model.QueryModel;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
|
@ -49,6 +49,8 @@ public class ActivityTeamInfoListModel {
|
|||
* 拼团商品图片
|
||||
*/
|
||||
private String productImage;
|
||||
/** 商品id*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
|
@ -71,21 +73,21 @@ public class ActivityTeamInfoListModel {
|
|||
private Long teamStock;
|
||||
|
||||
|
||||
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModel.ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) {
|
||||
ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
||||
.id(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
||||
// .openTeamNumber(teamOpenTypeNumber)
|
||||
// .addTeamNumber(teamInTypeNumber)
|
||||
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
// .teamPrice(discountPrice.getTeamPrice())
|
||||
// .productPrice(discountPrice.getProductPrice())
|
||||
// .teamStock(teamProductStockModel.getTeamStock())
|
||||
// .remainStock(teamProductStockModel.getRemainStock())
|
||||
.status(activityTeamInfo.getStatus())
|
||||
.build();
|
||||
public static ActivityTeamInfoListModel infoBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModelBuilder, ActivityTeamInfoListModel> function) {
|
||||
// ActivityTeamInfoListModel activityTeamInfoListModel = ActivityTeamInfoListModel.builder()
|
||||
// .id(activityTeamInfo.getId())
|
||||
// .name(activityTeamInfo.getName())
|
||||
//// .openTeamNumber(teamOpenTypeNumber)
|
||||
//// .addTeamNumber(teamInTypeNumber)
|
||||
//// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||
// .endTime(activityTeamInfo.getEndTime())
|
||||
// .productImage(activityTeamInfo.getProductImage())
|
||||
//// .teamPrice(discountPrice.getTeamPrice())
|
||||
//// .productPrice(discountPrice.getProductPrice())
|
||||
//// .teamStock(teamProductStockModel.getTeamStock())
|
||||
//// .remainStock(teamProductStockModel.getRemainStock())
|
||||
// .status(activityTeamInfo.getStatus())
|
||||
// .build();
|
||||
return function.apply(
|
||||
ActivityTeamInfoListModel.builder()
|
||||
.id(activityTeamInfo.getId())
|
||||
|
|
|
@ -1,92 +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 lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 添加活动模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 10:59
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamInfoSaveModel {
|
||||
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
public static ActivityTeamInfoSaveModel activityTeamInfoSaveModelBuild (ActivityTeamInfoAddModel activityTeamInfoAddModel){
|
||||
return ActivityTeamInfoSaveModel.builder()
|
||||
.name(activityTeamInfoAddModel.getName())
|
||||
.productId(activityTeamInfoAddModel.getProductId())
|
||||
.productImage(activityTeamInfoAddModel.getProductImage())
|
||||
.introduction(activityTeamInfoAddModel.getIntroduction())
|
||||
.unit(activityTeamInfoAddModel.getUnit())
|
||||
.imageList(activityTeamInfoAddModel.getImageList())
|
||||
.endTime(activityTeamInfoAddModel.getEndTime())
|
||||
.sort(activityTeamInfoAddModel.getSort())
|
||||
.content(activityTeamInfoAddModel.getContent())
|
||||
.status(activityTeamInfoAddModel.getStatus())
|
||||
.strategyType(activityTeamInfoAddModel.getStrategyType())
|
||||
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,110 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* 团购活动查询模型
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-26 09:38
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoSelectModel {
|
||||
|
||||
/**
|
||||
* 拼团活动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 Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ActivityTeamProductSkuModel> activityTeamProductSkuModels;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
private Long remainStock;
|
||||
|
||||
|
||||
/** 回显 构造 ActivityTeamInfoSelectModel*/
|
||||
|
||||
public static ActivityTeamInfoSelectModel getTeamInfoSelectModel(ActivityTeamInfo activityTeamInfo,
|
||||
Function<ActivityTeamInfoSelectModel.ActivityTeamInfoSelectModelBuilder, ActivityTeamInfoSelectModel> function) {
|
||||
return function.apply(
|
||||
ActivityTeamInfoSelectModel.builder()
|
||||
.teamId(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
||||
.productId(activityTeamInfo.getProductId())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
.introduction(activityTeamInfo.getIntroduction())
|
||||
.unit(activityTeamInfo.getUnit())
|
||||
.imageList(activityTeamInfo.getImageList())
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.sort(activityTeamInfo.getSort())
|
||||
.content(activityTeamInfo.getContent())
|
||||
.status(activityTeamInfo.getStatus())
|
||||
.strategyType(activityTeamInfo.getStrategyType())
|
||||
.strategyId(activityTeamInfo.getStrategyId())
|
||||
);
|
||||
}
|
||||
}
|
|
@ -1,65 +1,102 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
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 com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuInfoUpdReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 活动商品规格修改模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 19:25
|
||||
**/
|
||||
* 团购活动修改模型
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-26 09:38
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoUpdModel {
|
||||
private Long id;
|
||||
private String name;
|
||||
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;
|
||||
private Long strategyId;
|
||||
private ActivityTeamProductSkuSettingModel activityTeamProductSkuSettingModel;
|
||||
|
||||
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private ActivityTeamProductUpdCheckModel skuList;
|
||||
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
/** 拼团活动req 构造 model*/
|
||||
public static ActivityTeamInfoUpdModel reqConvertModel(ActivityTeamProductSkuInfoUpdReq skuInfoUpdReq){
|
||||
return ActivityTeamInfoUpdModel.builder()
|
||||
.id(activityTeamInfoUpdReq.getId())
|
||||
.name(activityTeamInfoUpdReq.getName())
|
||||
.productId(activityTeamInfoUpdReq.getProductId())
|
||||
.productImage(activityTeamInfoUpdReq.getProductImage())
|
||||
.introduction(activityTeamInfoUpdReq.getIntroduction())
|
||||
.unit(activityTeamInfoUpdReq.getUnit())
|
||||
.imageList(activityTeamInfoUpdReq.getImageList())
|
||||
.endTime(activityTeamInfoUpdReq.getEndTime())
|
||||
.sort(activityTeamInfoUpdReq.getSort())
|
||||
.content(activityTeamInfoUpdReq.getContent())
|
||||
.status(activityTeamInfoUpdReq.getStatus())
|
||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||
.activityTeamProductSkuSettingModel(
|
||||
ActivityTeamProductSkuSettingModel.settingReqModel(
|
||||
activityTeamInfoUpdReq.getActivityTeamProductSkuSettingReq(),
|
||||
activityTeamInfoUpdReq::getProductId
|
||||
)
|
||||
)
|
||||
.teamId(skuInfoUpdReq.getTeamId())
|
||||
.productId(skuInfoUpdReq.getProductId())
|
||||
.name(skuInfoUpdReq.getName())
|
||||
.introduction(skuInfoUpdReq.getIntroduction())
|
||||
.content(skuInfoUpdReq.getContent())
|
||||
.unit(skuInfoUpdReq.getUnit())
|
||||
.imageList(skuInfoUpdReq.getImageList())
|
||||
.endTime(skuInfoUpdReq.getEndTime())
|
||||
.strategyType(skuInfoUpdReq.getStrategyType())
|
||||
.skuList(ActivityTeamProductUpdCheckModel
|
||||
.reqConvertModel(skuInfoUpdReq.getSukList())) //req skuList 构造 model
|
||||
.status(skuInfoUpdReq.getStatus())
|
||||
.strategyId(skuInfoUpdReq.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,12 +8,10 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 团购spu库存添加模型
|
||||
*
|
||||
* 团购sku库存添加模型
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-26 09:36
|
||||
*/
|
||||
|
@ -52,7 +50,7 @@ public class ActivityTeamProductSkuAddModel {
|
|||
return ActivityTeamProductSkuAddModel.builder()
|
||||
.productId(productId.get())
|
||||
.sku(teamProjectSkuInfoAddReq.getSku())
|
||||
.teamStock(teamProjectSkuInfoAddReq.getTeamStock())
|
||||
// .teamStock(teamProjectSkuInfoAddReq.getTeamStock())
|
||||
.teamPrice(teamProjectSkuInfoAddReq.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.resp.ProjectFindSkuInfoResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -10,8 +9,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 回显sku模型
|
||||
*回显sku模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 16:03
|
||||
**/
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: sku修改模型
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 19:45
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamProductSkuReqModel {
|
||||
private Long id;
|
||||
private Long teamId;
|
||||
private Long productId;
|
||||
private String productSku;
|
||||
private Long teamStock;
|
||||
private Long remainStock;
|
||||
private BigDecimal teamPrice;
|
||||
public static ActivityTeamProductSkuReqModel activityTeamProductSkuReqModelBuild(ActivityTeamProductSkuReq activityTeamProductSkuReq){
|
||||
return ActivityTeamProductSkuReqModel.builder()
|
||||
.id(activityTeamProductSkuReq.getId())
|
||||
.productId(activityTeamProductSkuReq.getProductId())
|
||||
.teamId(activityTeamProductSkuReq.getTeamId())
|
||||
.productSku(activityTeamProductSkuReq.getProductSku())
|
||||
.remainStock(activityTeamProductSkuReq.getRemainStock())
|
||||
.teamStock(activityTeamProductSkuReq.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuReq.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,14 +1,12 @@
|
|||
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;
|
||||
|
||||
/**
|
||||
* 团购商品规格一键设置
|
||||
|
@ -42,18 +40,4 @@ public class ActivityTeamProductSkuSettingModel {
|
|||
*/
|
||||
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,7 +1,7 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 拼团活动商品SKU
|
||||
* 拼团活动商品SKU修改模型
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-27 14:18
|
||||
|
@ -22,25 +22,46 @@ import java.math.BigDecimal;
|
|||
public class ActivityTeamProductSkuUpdModel {
|
||||
|
||||
/**
|
||||
* 商品规格ID
|
||||
* 拼团规格信息ID
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String productSku;
|
||||
/**
|
||||
* 团购价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
private Long teamStock;
|
||||
/**
|
||||
* 剩余库存
|
||||
*/
|
||||
private Long remainStock;
|
||||
/**
|
||||
* 团购库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
public static ActivityTeamProductSkuUpdModel updReqBuild(TeamProjectSkuInfoUpdReq teamProjectSkuInfoUpdReq){
|
||||
/**拼团活动SkuReq 构造 model */
|
||||
public static ActivityTeamProductSkuUpdModel activityTeamProductSkuReqModelBuild(ActivityTeamProductSkuReq activityTeamProductSkuReq) {
|
||||
return ActivityTeamProductSkuUpdModel.builder()
|
||||
.id(teamProjectSkuInfoUpdReq.getId())
|
||||
.teamStock(teamProjectSkuInfoUpdReq.getTeamStock())
|
||||
.teamPrice(teamProjectSkuInfoUpdReq.getTeamPrice())
|
||||
.id(activityTeamProductSkuReq.getId())
|
||||
.productId(activityTeamProductSkuReq.getProductId())
|
||||
.teamId(activityTeamProductSkuReq.getTeamId())
|
||||
.productSku(activityTeamProductSkuReq.getProductSku())
|
||||
.remainStock(activityTeamProductSkuReq.getRemainStock())
|
||||
.teamStock(activityTeamProductSkuReq.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuReq.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,46 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductUpdCheckReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* (团购活动修改SKU操作模型)
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-27 14:18
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductUpdCheckModel {
|
||||
|
||||
/**
|
||||
* 修改商品规格List
|
||||
*/
|
||||
private List<ActivityTeamProductSkuUpdModel> skuUpdateList;
|
||||
/**
|
||||
* 删除商品规格IdList
|
||||
*/
|
||||
private List<Long> skuByIdDeleteList;
|
||||
/**
|
||||
* 添加商品规格List
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> skuAddList;
|
||||
|
||||
|
||||
/** skuListReq 构造 skuListModel */
|
||||
public static ActivityTeamProductUpdCheckModel reqConvertModel(ActivityTeamProductUpdCheckReq sukListReq) {
|
||||
return ActivityTeamProductUpdCheckModel.builder()
|
||||
.skuUpdateList(sukListReq.getSkuUpdateList())
|
||||
.skuByIdDeleteList(sukListReq.getSkuByIdDeleteList())
|
||||
.skuAddList(sukListReq.getSkuAddList())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,8 +1,11 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
/**
|
||||
* 添加拼团活动
|
||||
*/
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
@ -11,6 +14,10 @@ import lombok.experimental.SuperBuilder;
|
|||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 添加ActivityTeamInfo的Req
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 活动商品规格修改入参
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 19:25
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamInfoUpdReq {
|
||||
private Long id;
|
||||
private String name;
|
||||
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;
|
||||
private Long strategyId;
|
||||
private ActivityTeamProductSkuSettingReq activityTeamProductSkuSettingReq;
|
||||
}
|
|
@ -1,26 +1,23 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ActivityTeamDetailResp extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 团购ID
|
||||
* 活动商品规格修改入参
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class ActivityTeamProductSkuInfoUpdReq {
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
|
@ -61,7 +58,7 @@ public class ActivityTeamDetailResp extends BaseEntity {
|
|||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ActivityTeamProjectSkuResp> activityTeamProjectSkuList;
|
||||
private ActivityTeamProductUpdCheckReq sukList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
|
@ -78,4 +75,5 @@ public class ActivityTeamDetailResp extends BaseEntity {
|
|||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
}
|
|
@ -8,8 +8,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: sku修改入参
|
||||
*sku修改入参
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 19:45
|
||||
**/
|
||||
|
@ -18,11 +17,22 @@ import java.math.BigDecimal;
|
|||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamProductSkuReq {
|
||||
|
||||
/** 主键*/
|
||||
private Long id;
|
||||
/** 活动ID*/
|
||||
private Long teamId;
|
||||
/** 商品ID*/
|
||||
private Long productId;
|
||||
/** 商品SKU*/
|
||||
private String productSku;
|
||||
/** 拼团库存*/
|
||||
private Long teamStock;
|
||||
/** 剩余库存*/
|
||||
private Long remainStock;
|
||||
/** 拼团价格*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*(团购活动修改SKU参数)
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-27 14:18
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductUpdCheckReq {
|
||||
|
||||
/**
|
||||
* 修改商品规格List
|
||||
*/
|
||||
private List<ActivityTeamProductSkuUpdModel> skuUpdateList;
|
||||
/**
|
||||
* 删除商品规格IdList
|
||||
*/
|
||||
private List<Long> skuByIdDeleteList;
|
||||
/**
|
||||
* 添加商品规格List
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> skuAddList;
|
||||
|
||||
}
|
|
@ -2,7 +2,10 @@ package com.muyu.marketing.domain.req;
|
|||
|
||||
import com.muyu.common.core.web.page.PageDomain;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import lombok.*;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
|
@ -25,6 +28,7 @@ public class TeamInfoListReq extends PageDomain {
|
|||
|
||||
/**
|
||||
* 通过当前对象构建业务查询模型
|
||||
*
|
||||
* @return 业务查询模型
|
||||
*/
|
||||
public ActivityTeamInfoListQueryModel buildQueryModel() {
|
||||
|
|
|
@ -8,7 +8,7 @@ import lombok.experimental.SuperBuilder;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 添加的
|
||||
* 添加的req
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
|
@ -16,6 +16,11 @@ import java.math.BigDecimal;
|
|||
@NoArgsConstructor
|
||||
public class TeamProjectSkuInfoAddReq {
|
||||
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
private Long ruleId;
|
||||
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
/**
|
||||
* 添加拼团活动
|
||||
*/
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoSelectModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 查询拼团活动信息
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class ActivityTeamInfoResp extends BaseEntity {
|
||||
|
||||
|
||||
/**
|
||||
* 拼团活动id
|
||||
*/
|
||||
private Long teamId;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品价格
|
||||
*/
|
||||
private BigDecimal productPrice;
|
||||
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ProjectFindSkuInfoResp> projectFindSkuInfoResps;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
/** 构造ActivityTeamInfoResp */
|
||||
public static ActivityTeamInfoResp teamInfoFindByIdBuild(ActivityTeamInfoSelectModel teamSelectModel) {
|
||||
|
||||
return ActivityTeamInfoResp.builder()
|
||||
.teamId(teamSelectModel.getTeamId())
|
||||
.name(teamSelectModel.getName())
|
||||
.productId(teamSelectModel.getProductId())
|
||||
.productImage(teamSelectModel.getProductImage())
|
||||
.introduction(teamSelectModel.getIntroduction())
|
||||
.unit(teamSelectModel.getUnit())
|
||||
.imageList(teamSelectModel.getImageList())
|
||||
.endTime(teamSelectModel.getEndTime())
|
||||
.sort(teamSelectModel.getSort())
|
||||
.projectFindSkuInfoResps(
|
||||
teamSelectModel.getActivityTeamProductSkuModels()
|
||||
.stream().map(ProjectFindSkuInfoResp::projectFindSkuInfoBuild).toList())
|
||||
.content(teamSelectModel.getContent())
|
||||
.status(teamSelectModel.getStatus())
|
||||
.strategyType(teamSelectModel.getStrategyType())
|
||||
.strategyId(teamSelectModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
|
||||
/** 构造 */
|
||||
public static ActivityTeamInfoResp client(ActivityTeamInfo activityTeamInfo) {
|
||||
return ActivityTeamInfoResp.builder()
|
||||
.teamId(activityTeamInfo.getId())
|
||||
.name(activityTeamInfo.getName())
|
||||
.productId(activityTeamInfo.getProductId())
|
||||
.productImage(activityTeamInfo.getProductImage())
|
||||
.introduction(activityTeamInfo.getIntroduction())
|
||||
.unit(activityTeamInfo.getUnit())
|
||||
.imageList(activityTeamInfo.getImageList())
|
||||
.endTime(activityTeamInfo.getEndTime())
|
||||
.sort(activityTeamInfo.getSort())
|
||||
.content(activityTeamInfo.getContent())
|
||||
.status(activityTeamInfo.getStatus())
|
||||
.strategyType(activityTeamInfo.getStrategyType())
|
||||
.strategyId(activityTeamInfo.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -8,7 +8,7 @@ import lombok.experimental.SuperBuilder;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 添加的
|
||||
* 添加的resp
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
|
@ -11,7 +9,7 @@ import lombok.experimental.SuperBuilder;
|
|||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 回显resp
|
||||
* 回显 Sku resp
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
|
|
|
@ -1,107 +0,0 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamDetailModel;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: 2204a-cloud-server
|
||||
* @description: 团购活动回显响应
|
||||
* @author: AoCi Tian
|
||||
* @create: 2024-11-26 15:19
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class TeamInfoFindByIdResp {
|
||||
/**
|
||||
* 拼团id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ProjectFindSkuInfoResp> projectSkuInfoAddList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
public static TeamInfoFindByIdResp teamInfoFindByIdBuild (ActivityTeamDetailModel activityTeamDetailModel){
|
||||
return TeamInfoFindByIdResp.builder()
|
||||
.id(activityTeamDetailModel.getId())
|
||||
.name(activityTeamDetailModel.getName())
|
||||
.productId(activityTeamDetailModel.getProductId())
|
||||
.productImage(activityTeamDetailModel.getProductImage())
|
||||
.introduction(activityTeamDetailModel.getIntroduction())
|
||||
.unit(activityTeamDetailModel.getUnit())
|
||||
.imageList(activityTeamDetailModel.getImageList())
|
||||
.endTime(activityTeamDetailModel.getEndTime())
|
||||
.sort(activityTeamDetailModel.getSort())
|
||||
.projectSkuInfoAddList(activityTeamDetailModel.getProjectSkuInfoAddReqList().stream().map(ProjectFindSkuInfoResp::projectFindSkuInfoBuild).toList())
|
||||
// .projectSkuInfoAddList(
|
||||
// teamInfoFindByIdRespModel.getProjectSkuInfoAddReqList().stream().map(activityTeamProductSkuModel ->
|
||||
// ProjectFindSkuInfoResp.projectFindSkuInfoBuild(activityTeamProductSkuModel)).toList()
|
||||
// )
|
||||
.content(activityTeamDetailModel.getContent())
|
||||
.status(activityTeamDetailModel.getStatus())
|
||||
.strategyType(activityTeamDetailModel.getStrategyType())
|
||||
.strategyId(activityTeamDetailModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
|
@ -10,6 +9,9 @@ import lombok.NoArgsConstructor;
|
|||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 拼团活动展示Resp
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
|
@ -87,4 +89,5 @@ public class TeamInfoListResp {
|
|||
.teamStock(activityTeamInfoListModel.getTeamStock())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 查询 拼团活动的商品规格
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TeamProjectSkuInfoResp {
|
||||
|
||||
/**
|
||||
*规格id
|
||||
*/
|
||||
private Long ruleId;
|
||||
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
/** 构造 回显拼团活动SKU*/
|
||||
public static TeamProjectSkuInfoResp getSkuInfoResp(ActivityTeamProductSkuInfo skuInfo) {
|
||||
return TeamProjectSkuInfoResp.builder()
|
||||
.ruleId(skuInfo.getId())
|
||||
.sku(skuInfo.getProductSku())
|
||||
.teamPrice(skuInfo.getTeamPrice())
|
||||
.teamStock(skuInfo.getTeamStock())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +1,17 @@
|
|||
package com.muyu.marketing.team.controller;
|
||||
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.PageUtils;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoUpdModel;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoFindByIdResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -17,6 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 营销团购活动控制层
|
||||
*
|
||||
|
@ -30,6 +33,20 @@ public class ActivityTeamController {
|
|||
@Autowired
|
||||
private ActivityTeamInfoService activityTeamInfoService;;
|
||||
|
||||
|
||||
/**
|
||||
* 客户端拼团列表
|
||||
*/
|
||||
@PostMapping("/clientList")
|
||||
public Result<PageInfo<ActivityTeamInfoResp>> clientList(@RequestBody TeamInfoListReq teamInfoListReq){
|
||||
PageUtils.startPage(teamInfoListReq.getPageNum(),teamInfoListReq.getPageSize());
|
||||
List<ActivityTeamInfoResp> activityTeamInfoRespList=activityTeamInfoService.clientList(teamInfoListReq);
|
||||
PageInfo<ActivityTeamInfoResp> pageInfo = new PageInfo<>(activityTeamInfoRespList);
|
||||
return Result.success(pageInfo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询营销团购活动列表
|
||||
* @param teamInfoListReq 活动查询入参
|
||||
|
@ -53,19 +70,34 @@ public class ActivityTeamController {
|
|||
* @param activityTeamInfoSaveReq 添加请求对象
|
||||
* @return 结果集
|
||||
*/
|
||||
@PostMapping
|
||||
@PostMapping("/add")
|
||||
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
@PostMapping("/findById/{id}")
|
||||
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
||||
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
||||
|
||||
/**
|
||||
* 回显拼团活动
|
||||
* @teamId 拼团活动id
|
||||
*/
|
||||
@GetMapping("/getById/{teamId}")
|
||||
public Result<ActivityTeamInfoResp> getTeamInfo(@PathVariable("teamId") Long teamId){
|
||||
return Result.success(ActivityTeamInfoResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(teamId)));
|
||||
}
|
||||
@PutMapping("/updateByTeamId")
|
||||
public Result updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||
|
||||
|
||||
/** 修改拼团活动*/
|
||||
@PutMapping
|
||||
private Result<String> update(ActivityTeamProductSkuInfoUpdReq activityTeamProductSkuInfoUpdReq){
|
||||
//转换拼团修改Model
|
||||
ActivityTeamInfoUpdModel activityTeamInfoUpdModel = ActivityTeamInfoUpdModel.reqConvertModel(activityTeamProductSkuInfoUpdReq);
|
||||
|
||||
activityTeamInfoService.updateTeamInfo(activityTeamInfoUpdModel);
|
||||
|
||||
return Result.success();
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.muyu.marketing.team.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
|
|
@ -4,7 +4,14 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 拼团活动
|
||||
*/
|
||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||
|
||||
|
||||
|
@ -26,14 +33,17 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
|||
* @param id 团购活动ID
|
||||
* @return 团购详情
|
||||
*/
|
||||
ActivityTeamDetailModel findDetailById(Long id);
|
||||
ActivityTeamInfoSelectModel findDetailById(Long id);
|
||||
// public ActivityTeamInfoSelectModel selectTeamInfo(Long teamId);
|
||||
|
||||
/**
|
||||
* 修改团购活动信息
|
||||
* @param activityTeamInfoUpdModel 团购活动信息
|
||||
* @return 是否成功
|
||||
* 修改活动
|
||||
*/
|
||||
boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||
void updateTeamInfo(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||
|
||||
/** 客户端列表*/
|
||||
List<ActivityTeamInfoResp> clientList(TeamInfoListReq teamInfoListReq);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.muyu.marketing.team.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
|
||||
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ import com.muyu.marketing.domain.model.*;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
/** 规格SKU*/
|
||||
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
||||
|
||||
public default List<ActivityTeamProductSkuInfo> getActivityTeamProductSkuInfoByTeamId(Long teamId){
|
||||
|
@ -45,7 +46,14 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
*/
|
||||
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
||||
|
||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList);
|
||||
/** 修改规格SKU*/
|
||||
public boolean updateBath(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuReqModelList);
|
||||
|
||||
/**
|
||||
* 删除商品规格list
|
||||
*/
|
||||
public boolean deleteById(List<Long> skuByIdDeleteList);
|
||||
|
||||
|
||||
/**
|
||||
* 根据 业务模型 进行 团购商品修改
|
||||
|
|
|
@ -7,6 +7,8 @@ import com.muyu.common.core.utils.StringUtils;
|
|||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||
|
@ -15,9 +17,12 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 拼团活动
|
||||
*/
|
||||
@Service
|
||||
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo>
|
||||
implements ActivityTeamInfoService {
|
||||
|
@ -31,14 +36,42 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
@Override
|
||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||
|
||||
// LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
// queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getKeyWord()), ActivityTeamInfo::getName, activityTeamInfoListQueryModel.getKeyWord());
|
||||
// queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getStatus()), ActivityTeamInfo::getStatus, activityTeamInfoListQueryModel.getStatus());
|
||||
//
|
||||
// /**
|
||||
// * Object<T> -> 创建对象的时候进行的占用
|
||||
// * <T> Result<T> 以方法返回值为占用
|
||||
// */
|
||||
// Page<ActivityTeamInfo> activityTeamInfoPage = this.page(activityTeamInfoListQueryModel.buildPage(), queryWrapper);
|
||||
// List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
||||
// List<ActivityTeamInfoListModel> activityTeamInfoListModels = activityTeamInfoList.stream()
|
||||
// .map(activityTeamInfo -> ActivityTeamInfoListModel.infoBuild(activityTeamInfo,
|
||||
// (activityTeamInfoListModelBuilder) -> {
|
||||
// TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
|
||||
// TeamProductStockModel teamProductStockModel = activityTeamProductSkuInfoService.getStock(activityTeamInfo.getId());
|
||||
// Long teamOpenTypeNumber = activityTeamOpenInfoService.getTeamOpenTypeNumberByTeamId(activityTeamInfo.getId());
|
||||
// Long teamInTypeNumber = activityTeamOpenInfoService.getTeamInTypeNumberByTeamId(activityTeamInfo.getId());
|
||||
//
|
||||
// return activityTeamInfoListModelBuilder
|
||||
// .openTeamNumber(teamOpenTypeNumber)
|
||||
// .addTeamNumber(teamInTypeNumber)
|
||||
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||
// .teamPrice(discountPrice.getTeamPrice())
|
||||
// .productPrice(discountPrice.getProductPrice())
|
||||
// .teamStock(teamProductStockModel.getTeamStock())
|
||||
// .remainStock(teamProductStockModel.getRemainStock())
|
||||
// .build();
|
||||
// })).toList();
|
||||
// TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>();
|
||||
// tableDataInfo.setTotal(activityTeamInfoPage.getTotal());
|
||||
// tableDataInfo.setRows(activityTeamInfoListModels);
|
||||
// return tableDataInfo;
|
||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getKeyWord()), ActivityTeamInfo::getName, activityTeamInfoListQueryModel.getKeyWord());
|
||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getStatus()), ActivityTeamInfo::getStatus, activityTeamInfoListQueryModel.getStatus());
|
||||
|
||||
/**
|
||||
* Object<T> -> 创建对象的时候进行的占用
|
||||
* <T> Result<T> 以方法返回值为占用
|
||||
*/
|
||||
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(activityTeamInfoListQueryModel.buildPage(), queryWrapper);
|
||||
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
||||
List<ActivityTeamInfoListModel> activityTeamInfoListModels = activityTeamInfoList.stream()
|
||||
|
@ -57,6 +90,7 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
.productPrice(discountPrice.getProductPrice())
|
||||
.teamStock(teamProductStockModel.getTeamStock())
|
||||
.remainStock(teamProductStockModel.getRemainStock())
|
||||
.productId(activityTeamInfo.getProductId())
|
||||
.build();
|
||||
})).toList();
|
||||
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>();
|
||||
|
@ -80,29 +114,79 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
}
|
||||
|
||||
/**
|
||||
* 根据ID查询商品的详情
|
||||
* @param id 团购活动ID
|
||||
* @return 团购详情
|
||||
* 查询拼团活动(回显)
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ActivityTeamDetailModel findDetailById(Long id) {
|
||||
ActivityTeamInfo activityTeamInfo = this.getById(id);
|
||||
List<ActivityTeamProductSkuModel> activityTeamProductSkuModelList = activityTeamProductSkuInfoService.findListByTeamId(id);
|
||||
return ActivityTeamDetailModel.findSkuSumList(activityTeamInfo,
|
||||
(teamInfoFindByIdRespModelBuilder) -> teamInfoFindByIdRespModelBuilder.projectSkuInfoAddReqList(activityTeamProductSkuModelList).build()
|
||||
public ActivityTeamInfoSelectModel findDetailById(Long teamId) {
|
||||
//根据拼团活动id 查询拼团活动
|
||||
ActivityTeamInfo activityTeamInfo = this.getById(teamId);
|
||||
//查询活动中的 商品sku集合
|
||||
List<ActivityTeamProductSkuModel> activityTeamProductSkuModelList = activityTeamProductSkuInfoService.findListByTeamId(teamId);
|
||||
return ActivityTeamInfoSelectModel.getTeamInfoSelectModel(activityTeamInfo,
|
||||
(teamInfoFindByIdRespModelBuilder) -> teamInfoFindByIdRespModelBuilder.activityTeamProductSkuModels(activityTeamProductSkuModelList).build()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改团购活动信息
|
||||
* @param activityTeamInfoUpdModel 团购活动信息
|
||||
* @return 是否成功
|
||||
* 修改拼团活动活动
|
||||
*/
|
||||
@Override
|
||||
public boolean update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||
boolean update = this.updateById(ActivityTeamInfo.TeamUpdateBuild(activityTeamInfoUpdModel));
|
||||
Assert.isTrue(update,"修改失败");
|
||||
activityTeamProductSkuInfoService.setting(activityTeamInfoUpdModel.getActivityTeamProductSkuSettingModel());
|
||||
return update;
|
||||
public void updateTeamInfo(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||
//查询当前活动状态
|
||||
ActivityTeamInfo activityTeamInfo = this.getById(activityTeamInfoUpdModel.getTeamId());
|
||||
if ("Y".equals(activityTeamInfo.getStatus())){
|
||||
//当前活动运营中禁止修改
|
||||
throw new RuntimeException("当前活动运营中禁止修改");
|
||||
}
|
||||
|
||||
//修改:
|
||||
List<ActivityTeamProductSkuAddModel> skuAddList = activityTeamInfoUpdModel.getSkuList().getSkuAddList();
|
||||
//添加列表不为空并且长度大于零
|
||||
if (null != skuAddList && 0<skuAddList.size()){
|
||||
//构造 添加
|
||||
activityTeamProductSkuInfoService.batchSave(skuAddList);
|
||||
|
||||
}
|
||||
|
||||
List<ActivityTeamProductSkuUpdModel> skuUpdateList = activityTeamInfoUpdModel.getSkuList().getSkuUpdateList();
|
||||
//修改列表不为空并且长度大于零
|
||||
if (null != skuUpdateList && 0<skuUpdateList.size()){
|
||||
//构造 修改
|
||||
activityTeamProductSkuInfoService.updateBath(skuUpdateList);
|
||||
}
|
||||
|
||||
List<Long> skuByIdDeleteList = activityTeamInfoUpdModel.getSkuList().getSkuByIdDeleteList();
|
||||
if (null != skuByIdDeleteList && 0<skuByIdDeleteList.size()){
|
||||
//构造 删除
|
||||
activityTeamProductSkuInfoService.deleteById(skuByIdDeleteList);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/** 客户端列表*/
|
||||
@Override
|
||||
public List<ActivityTeamInfoResp> clientList(TeamInfoListReq teamInfoListReq) {
|
||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
//查询活动状态
|
||||
if (null != teamInfoListReq.getStatus() && ! "".equals(teamInfoListReq.getStatus())){
|
||||
queryWrapper.eq(ActivityTeamInfo::getStatus,teamInfoListReq.getStatus());
|
||||
}
|
||||
if (null != teamInfoListReq.getKeyWord() && ! "".equals(teamInfoListReq.getKeyWord())){
|
||||
queryWrapper.eq(ActivityTeamInfo::getStatus,teamInfoListReq.getStatus());
|
||||
}
|
||||
//拼团列表
|
||||
List<ActivityTeamInfo> activityTeamInfos = this.list(queryWrapper);
|
||||
//构造成Resp
|
||||
ArrayList<ActivityTeamInfoResp> activityTeamInfoResps = new ArrayList<>();
|
||||
activityTeamInfos.forEach(activityTeamInfo -> {
|
||||
ActivityTeamInfoResp client = ActivityTeamInfoResp.client(activityTeamInfo);
|
||||
activityTeamInfoResps.add(client);
|
||||
});
|
||||
|
||||
return activityTeamInfoResps;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
|
@ -14,10 +13,6 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||
import org.springframework.stereotype.Service;
|
||||
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.Optional;
|
||||
|
||||
|
@ -96,43 +91,44 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
|||
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改商品规格list
|
||||
* @param activityTeamProductSkuReqModelList
|
||||
* @return
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean updateBath(List<ActivityTeamProductSkuReqModel> activityTeamProductSkuReqModelList) {
|
||||
return this.updateBatchById(activityTeamProductSkuReqModelList.stream().map(ActivityTeamProductSkuInfo::updateModelBuild).toList());
|
||||
public boolean updateBath(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuReqModelList) {
|
||||
return
|
||||
this.updateBatchById(activityTeamProductSkuReqModelList
|
||||
.stream()
|
||||
.map(ActivityTeamProductSkuInfo::updateModelBuild)
|
||||
.toList());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 业务模型 进行 团购商品修改
|
||||
*
|
||||
* @param activityTeamProductSkuUpdModel 修改业务模型
|
||||
* @return 修改结果
|
||||
* 删除商品规格list
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteById(List<Long> skuByIdDeleteList) {
|
||||
boolean b = this.removeBatchByIds(skuByIdDeleteList);
|
||||
return b;
|
||||
}
|
||||
|
||||
@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);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 业务模型 进行 团购商品批量修改
|
||||
*
|
||||
* @param activityTeamProductSkuUpdModelList 修改业务模型
|
||||
* @return 修改结果
|
||||
*/
|
||||
@Override
|
||||
public boolean batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
||||
return this.updateBatchById(
|
||||
activityTeamProductSkuUpdModelList.stream()
|
||||
.map(ActivityTeamProductSkuInfo::updModelBuild)
|
||||
.toList()
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,9 +4,24 @@ server:
|
|||
|
||||
# Spring
|
||||
spring:
|
||||
datasource:
|
||||
dynamic:
|
||||
primary: master
|
||||
datasource:
|
||||
# 主库数据源
|
||||
master:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://60.204.150.30:3306/activity_team?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: xx-12345
|
||||
slave:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://60.204.150.30:3306/product?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||
username: root
|
||||
password: xx-12345
|
||||
application:
|
||||
# 应用名称
|
||||
name: muyu-buy
|
||||
name: muyu-marketing
|
||||
profiles:
|
||||
# 环境配置
|
||||
active: dev
|
||||
|
@ -14,10 +29,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -20,4 +20,5 @@
|
|||
<description>
|
||||
muyu-marketing营销模块
|
||||
</description>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@TableName("mall_product_category")
|
||||
public class ProductCategory {
|
||||
/**
|
||||
* 主键自增
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 父级id
|
||||
*/
|
||||
private Integer parentId;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 等级
|
||||
*/
|
||||
private String level;
|
||||
/**
|
||||
* 类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
/**
|
||||
* 修改时间
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date updateTime;
|
||||
|
||||
}
|
|
@ -34,6 +34,8 @@ public class TemplateAttributeModel extends BaseEntity {
|
|||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
private String value;
|
||||
|
||||
|
||||
public static TemplateAttributeModel attributeInfoBuild(AttributeInfo attributeInfo){
|
||||
return TemplateAttributeModel.builder()
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -33,5 +36,9 @@ public class AttributeGroupEditReq extends BaseEntity {
|
|||
@ApiModelProperty(name = "状态", value = "状态", required = true)
|
||||
private String states;
|
||||
|
||||
/** 属性id 集合 */
|
||||
@ApiModelProperty(name = "属性集合", value = "属性集合", required = true)
|
||||
private List<AttributeInfo> attributeList;
|
||||
private List<Long> attributeIdList;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 修改 属性状态
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class AttributeGroupStateReq {
|
||||
|
||||
/** 属性id */
|
||||
@ApiModelProperty(name = "属性id", value = "属性id", required = true)
|
||||
private Long id;
|
||||
/** 状态 */
|
||||
@ApiModelProperty(name = "状态", value = "状态", required = true)
|
||||
private String states;
|
||||
}
|
|
@ -8,6 +8,8 @@ import lombok.experimental.SuperBuilder;
|
|||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.TreeEntity;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 品类信息对象 category_info
|
||||
*
|
||||
|
@ -39,4 +41,21 @@ public class CategoryInfoEditReq extends TreeEntity {
|
|||
@ApiModelProperty(name = "介绍", value = "介绍")
|
||||
private String introduction;
|
||||
|
||||
/**
|
||||
* 商品属性组关联ID
|
||||
*/
|
||||
@ApiModelProperty(name = "商品属性组关联ID", value = "商品属性组关联ID")
|
||||
private List<Long> attributeGroupIdList;
|
||||
/**
|
||||
* 商品属性关联ID
|
||||
*/
|
||||
@ApiModelProperty(name = "商品属性关联ID", value = "商品属性关联ID")
|
||||
private List<Long> attributeIdList;
|
||||
|
||||
/**
|
||||
* 商品品牌组关联ID
|
||||
*/
|
||||
@ApiModelProperty(name = "商品品牌组关联ID", value = "商品品牌组关联ID")
|
||||
private List<Long> brandIdList;
|
||||
|
||||
}
|
||||
|
|
|
@ -48,7 +48,6 @@ public class CategoryInfoSaveReq extends TreeEntity {
|
|||
private String start;
|
||||
|
||||
/** 介绍 */
|
||||
|
||||
@ApiModelProperty(name = "介绍", value = "介绍")
|
||||
private String introduction;
|
||||
|
||||
|
@ -56,6 +55,7 @@ public class CategoryInfoSaveReq extends TreeEntity {
|
|||
* 商品属性组关联ID
|
||||
*/
|
||||
private List<Long> attributeGroupIdList;
|
||||
|
||||
/**
|
||||
* 商品属性关联ID
|
||||
*/
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.product.domain.ProjectInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* 商品信息对象 project_info
|
||||
|
@ -63,4 +64,18 @@ public class ProjectInfoEditReq extends BaseEntity {
|
|||
@ApiModelProperty(name = "品牌", value = "品牌")
|
||||
private Long brandId;
|
||||
|
||||
|
||||
public static ProjectInfoEditReq convertToReq(ProjectInfoUpdReq projectInfoUpdReq){
|
||||
ProjectInfo projectInfo = projectInfoUpdReq.getProjectInfo();
|
||||
return ProjectInfoEditReq.builder()
|
||||
.name(projectInfo.getName())
|
||||
.introduction(projectInfo.getIntroduction())
|
||||
.mianType(projectInfo.getMianType())
|
||||
.parentType(projectInfo.getParentType())
|
||||
.type(projectInfo.getType())
|
||||
.image(projectInfo.getImage())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import com.muyu.product.domain.ProjectInfo;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 修改商品
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectInfoUpdReq {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private List<Long> attrValueList;
|
||||
|
||||
/**
|
||||
* 商品 规格
|
||||
*/
|
||||
private ProjectSkuInfo productSkuList;
|
||||
/**
|
||||
* 商品信息
|
||||
*/
|
||||
private ProjectInfo projectInfo;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class WyzRuleInfoSaveReq {
|
||||
public Long id;
|
||||
public String status;
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.muyu.product.domain.resp;
|
||||
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class AttributeGroupUpd {
|
||||
/** 属性组编号 */
|
||||
private Long id;
|
||||
|
||||
/** 组名称 */
|
||||
private String name;
|
||||
|
||||
/** 状态 */
|
||||
private String states;
|
||||
|
||||
/**
|
||||
* 属性id 集合
|
||||
*/
|
||||
|
||||
private List<AttributeInfo> attributeList;
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
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 io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
/** 品类信息*/
|
||||
public class CategoryInfoUpdResp {
|
||||
/** 主键 */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(name = "主键", value = "主键")
|
||||
private Long id;
|
||||
|
||||
/** 品类名称 */
|
||||
@Excel(name = "品类名称")
|
||||
@ApiModelProperty(name = "品类名称", value = "品类名称", required = true)
|
||||
private String name;
|
||||
|
||||
/** 图片 */
|
||||
@Excel(name = "图片")
|
||||
@ApiModelProperty(name = "图片", value = "图片", required = true)
|
||||
private String image;
|
||||
|
||||
/** 是否启用 */
|
||||
@Excel(name = "是否启用")
|
||||
@ApiModelProperty(name = "是否启用", value = "是否启用", required = true)
|
||||
private String start;
|
||||
|
||||
/** 介绍 */
|
||||
@Excel(name = "介绍")
|
||||
@ApiModelProperty(name = "介绍", value = "介绍")
|
||||
private String introduction;
|
||||
|
||||
/**
|
||||
* 商品属性 组 关联ID
|
||||
* AttributeGroup
|
||||
*/
|
||||
/**
|
||||
* 属性集合
|
||||
*/
|
||||
private List<Long> attributeInfoList;
|
||||
|
||||
/**
|
||||
* 属性组集合
|
||||
*/
|
||||
private List<Long> attributeGroupList;
|
||||
|
||||
/**
|
||||
* 品牌集合
|
||||
*/
|
||||
private List<Long> brandInfoList;
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.product.domain.resp;
|
||||
|
||||
import com.muyu.product.domain.ProductCategory;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 产品品类
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProductCategoryResp extends ProductCategory {
|
||||
/**
|
||||
* 产品品类子集合
|
||||
*/
|
||||
private List<ProductCategoryResp> childrenList;
|
||||
|
||||
public static ProductCategoryResp convertToResp(ProductCategory productCategory){
|
||||
return ProductCategoryResp.builder()
|
||||
.id(productCategory.getId())
|
||||
.name(productCategory.getName())
|
||||
.level(productCategory.getLevel())
|
||||
.parentId(productCategory.getParentId())
|
||||
.sort(productCategory.getSort())
|
||||
.createTime(productCategory.getCreateTime())
|
||||
.updateTime(productCategory.getUpdateTime())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,129 @@
|
|||
package com.muyu.product.domain.resp;
|
||||
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import com.muyu.product.domain.model.ProjectAddModel;
|
||||
import com.muyu.product.domain.req.ProjectInfoEditReq;
|
||||
import com.muyu.product.domain.req.ProjectInfoQueryReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 商品信息对象 project_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProjectInfoListResp extends BaseEntity {
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 商品名称 */
|
||||
private String name;
|
||||
|
||||
/** 商品描述 */
|
||||
private String introduction;
|
||||
|
||||
|
||||
/** 主类型 */
|
||||
private Long mianType;
|
||||
|
||||
/**
|
||||
* 主类型名称
|
||||
*/
|
||||
public String mianTypeName;
|
||||
/** 父类型 */
|
||||
private Long parentType;
|
||||
|
||||
private String parentTypeName;
|
||||
/** 商品类型 */
|
||||
private Long type;
|
||||
|
||||
private String typeName;
|
||||
/** 商品图片 */
|
||||
private String image;
|
||||
|
||||
/** 商品轮播图 */
|
||||
private String carouselImages;
|
||||
|
||||
/** 商品状态 */
|
||||
private String status;
|
||||
|
||||
/** 规格 */
|
||||
private Long ruleId;
|
||||
private String ruleName;
|
||||
|
||||
/** 品牌 */
|
||||
private Long brandId;
|
||||
private String brandName;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
public static ProjectInfoListResp queryBuild(ProjectInfoQueryReq projectInfoQueryReq){
|
||||
return ProjectInfoListResp.builder()
|
||||
.name(projectInfoQueryReq.getName())
|
||||
.introduction(projectInfoQueryReq.getIntroduction())
|
||||
.mianType(projectInfoQueryReq.getMianType())
|
||||
.parentType(projectInfoQueryReq.getParentType())
|
||||
.type(projectInfoQueryReq.getType())
|
||||
.image(projectInfoQueryReq.getImage())
|
||||
.carouselImages(projectInfoQueryReq.getCarouselImages())
|
||||
.status(projectInfoQueryReq.getStatus())
|
||||
.ruleId(projectInfoQueryReq.getRuleId())
|
||||
.brandId(projectInfoQueryReq.getBrandId())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static ProjectInfoListResp saveModelBuild(ProjectAddModel projectAddModel, Supplier<String> createBy){
|
||||
return ProjectInfoListResp.builder()
|
||||
.name(projectAddModel.getName())
|
||||
.introduction(projectAddModel.getIntroduction())
|
||||
.mianType(projectAddModel.getMianType())
|
||||
.parentType(projectAddModel.getParentType())
|
||||
.type(projectAddModel.getType())
|
||||
.image(projectAddModel.getImage())
|
||||
.carouselImages(projectAddModel.getCarouselImages())
|
||||
.status(projectAddModel.getStatus())
|
||||
.ruleId(projectAddModel.getRuleId())
|
||||
.brandId(projectAddModel.getBrandId())
|
||||
.createBy(createBy.get())
|
||||
.createTime(new Date())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static ProjectInfoListResp editBuild(Long id, ProjectInfoEditReq projectInfoEditReq){
|
||||
return ProjectInfoListResp.builder()
|
||||
.id(id)
|
||||
.name(projectInfoEditReq.getName())
|
||||
.introduction(projectInfoEditReq.getIntroduction())
|
||||
.mianType(projectInfoEditReq.getMianType())
|
||||
.parentType(projectInfoEditReq.getParentType())
|
||||
.type(projectInfoEditReq.getType())
|
||||
.image(projectInfoEditReq.getImage())
|
||||
.carouselImages(projectInfoEditReq.getCarouselImages())
|
||||
.status(projectInfoEditReq.getStatus())
|
||||
.ruleId(projectInfoEditReq.getRuleId())
|
||||
.brandId(projectInfoEditReq.getBrandId())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,33 +1,29 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.domain.AttributeGroup;
|
||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||
import com.muyu.product.domain.req.AttributeGroupEditReq;
|
||||
import com.muyu.product.domain.req.AttributeGroupQueryReq;
|
||||
import com.muyu.product.domain.req.AttributeGroupSaveReq;
|
||||
import com.muyu.product.domain.req.AttributeGroupEditReq;
|
||||
import com.muyu.product.domain.req.AttributeGroupStateReq;
|
||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||
import com.muyu.product.service.AttributeGroupService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 属性组Controller
|
||||
|
@ -103,6 +99,18 @@ public class AttributeGroupController extends BaseController {
|
|||
return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq)));
|
||||
}
|
||||
|
||||
/***
|
||||
* 修改属性 状态
|
||||
*/
|
||||
@RequiresPermissions("product:attributeGroup:edit")
|
||||
@Log(title = "属性状态", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/updateState")
|
||||
@ApiOperation("修改属性状态")
|
||||
public Result<String> updateState(@RequestBody AttributeGroupStateReq attributeGroupStateReq) {
|
||||
attributeGroupService.updateState(attributeGroupStateReq);
|
||||
return Result.success("修改成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除属性组
|
||||
*/
|
||||
|
|
|
@ -1,30 +1,25 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import com.muyu.product.domain.req.AttributeInfoEditReq;
|
||||
import com.muyu.product.domain.req.AttributeInfoQueryReq;
|
||||
import com.muyu.product.domain.req.AttributeInfoSaveReq;
|
||||
import com.muyu.product.domain.req.AttributeInfoEditReq;
|
||||
import com.muyu.product.service.AttributeInfoService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品属性Controller
|
||||
|
|
|
@ -1,31 +1,25 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.domain.BrandInfo;
|
||||
import com.muyu.product.domain.req.BrandInfoEditReq;
|
||||
import com.muyu.product.domain.req.BrandInfoQueryReq;
|
||||
import com.muyu.product.domain.req.BrandInfoSaveReq;
|
||||
import com.muyu.product.domain.req.BrandInfoEditReq;
|
||||
import com.muyu.product.service.BrandInfoService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 品牌信息Controller
|
||||
|
|
|
@ -1,37 +1,27 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.product.domain.AttributeGroup;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import com.muyu.product.domain.BrandInfo;
|
||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.product.domain.CategoryInfo;
|
||||
import com.muyu.product.domain.req.CategoryInfoQueryReq;
|
||||
import com.muyu.product.domain.req.CategoryInfoSaveReq;
|
||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import com.muyu.product.domain.req.CategoryInfoEditReq;
|
||||
import com.muyu.product.domain.req.CategoryInfoSaveReq;
|
||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||
import com.muyu.product.service.CategoryInfoService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 品类信息Controller
|
||||
|
@ -136,9 +126,7 @@ public class CategoryInfoController extends BaseController {
|
|||
@GetMapping("/parentCommonElement/{categoryId}")
|
||||
@ApiOperation("通过品类ID获取父级以上的属性集合")
|
||||
@ApiImplicitParam(name = "categoryId", value = "categoryId", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class, example = "1")
|
||||
public Result<CategoryParentCommonElementResp> parentCommonElement(
|
||||
@PathVariable(value = "categoryId") Long categoryId
|
||||
) {
|
||||
public Result<CategoryParentCommonElementResp> parentCommonElement(@PathVariable(value = "categoryId") Long categoryId) {
|
||||
return Result.success(categoryInfoService.parentCommonElement(categoryId));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,30 +1,25 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.domain.CommentInfo;
|
||||
import com.muyu.product.domain.req.CommentInfoEditReq;
|
||||
import com.muyu.product.domain.req.CommentInfoQueryReq;
|
||||
import com.muyu.product.domain.req.CommentInfoSaveReq;
|
||||
import com.muyu.product.domain.req.CommentInfoEditReq;
|
||||
import com.muyu.product.service.CommentInfoService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品评论Controller
|
||||
|
@ -43,7 +38,7 @@ public class CommentInfoController extends BaseController {
|
|||
* 查询商品评论列表
|
||||
*/
|
||||
@ApiOperation("获取商品评论列表")
|
||||
@RequiresPermissions("product:comment:list")
|
||||
// @RequiresPermissions("product:comment:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<CommentInfo>> list(CommentInfoQueryReq commentInfoQueryReq) {
|
||||
startPage();
|
||||
|
@ -68,7 +63,7 @@ public class CommentInfoController extends BaseController {
|
|||
* 获取商品评论详细信息
|
||||
*/
|
||||
@ApiOperation("获取商品评论详细信息")
|
||||
@RequiresPermissions("product:comment:query")
|
||||
// @RequiresPermissions("product:comment:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<CommentInfo> getInfo(@PathVariable("id") Long id) {
|
||||
|
|
|
@ -1,30 +1,25 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.domain.CommentLikeInfo;
|
||||
import com.muyu.product.domain.req.CommentLikeInfoEditReq;
|
||||
import com.muyu.product.domain.req.CommentLikeInfoQueryReq;
|
||||
import com.muyu.product.domain.req.CommentLikeInfoSaveReq;
|
||||
import com.muyu.product.domain.req.CommentLikeInfoEditReq;
|
||||
import com.muyu.product.service.CommentLikeInfoService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 评论点赞Controller
|
||||
|
|
|
@ -1,32 +1,29 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.product.cache.ProjectInfoCache;
|
||||
import com.muyu.product.domain.resp.ProjectDetailResp;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.cache.ProjectInfoCache;
|
||||
import com.muyu.product.domain.ProjectInfo;
|
||||
import com.muyu.product.domain.req.ProjectInfoEditReq;
|
||||
import com.muyu.product.domain.req.ProjectInfoQueryReq;
|
||||
import com.muyu.product.domain.req.ProjectInfoSaveReq;
|
||||
import com.muyu.product.domain.req.ProjectInfoEditReq;
|
||||
import com.muyu.product.domain.req.ProjectInfoUpdReq;
|
||||
import com.muyu.product.domain.resp.ProjectDetailResp;
|
||||
import com.muyu.product.domain.resp.ProjectInfoListResp;
|
||||
import com.muyu.product.service.ProjectInfoService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品信息Controller
|
||||
|
@ -50,10 +47,10 @@ public class ProjectInfoController extends BaseController {
|
|||
@ApiOperation("获取商品信息列表")
|
||||
@RequiresPermissions("product:info:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<ProjectInfo>> list(ProjectInfoQueryReq projectInfoQueryReq) {
|
||||
public Result<TableDataInfo<ProjectInfoListResp>> list(ProjectInfoQueryReq projectInfoQueryReq) {
|
||||
startPage();
|
||||
List<ProjectInfo> list = projectInfoService.list(ProjectInfo.queryBuild(projectInfoQueryReq));
|
||||
return getDataTable(list);
|
||||
List<ProjectInfoListResp> projectInfoListResps = projectInfoService.ProjectInfo(ProjectInfo.queryBuild(projectInfoQueryReq));
|
||||
return getDataTable(projectInfoListResps);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -73,9 +70,8 @@ public class ProjectInfoController extends BaseController {
|
|||
* 获取商品信息详细信息
|
||||
*/
|
||||
@ApiOperation("获取商品信息详细信息")
|
||||
@RequiresPermissions("product:info:query")
|
||||
// @RequiresPermissions("product:info:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<ProjectInfo> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(projectInfoCache.get(id));
|
||||
}
|
||||
|
@ -84,7 +80,7 @@ public class ProjectInfoController extends BaseController {
|
|||
* 获取商品信息详细信息
|
||||
*/
|
||||
@ApiOperation("获取商品信息详细信息")
|
||||
@RequiresPermissions("product:info:query")
|
||||
// @RequiresPermissions("product:info:query")
|
||||
@GetMapping(value = "/cache/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<ProjectInfo> getCacheInfo(@PathVariable("id") Long id) {
|
||||
|
@ -95,7 +91,7 @@ public class ProjectInfoController extends BaseController {
|
|||
* 获取商品信息详细信息
|
||||
*/
|
||||
@ApiOperation("获取商品信息详细信息")
|
||||
@RequiresPermissions("product:info:query")
|
||||
// @RequiresPermissions("product:info:query")
|
||||
@GetMapping(value = "/detail/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<ProjectDetailResp> getDetailInfo(@PathVariable("id") Long id) {
|
||||
|
@ -120,7 +116,8 @@ public class ProjectInfoController extends BaseController {
|
|||
@Log(title = "商品信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改商品信息")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody ProjectInfoEditReq projectInfoEditReq) {
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody ProjectInfoUpdReq projectInfoUpdReq) {
|
||||
ProjectInfoEditReq projectInfoEditReq = ProjectInfoEditReq.convertToReq(projectInfoUpdReq);
|
||||
return toAjax(projectInfoService.updateById(ProjectInfo.editBuild(id,projectInfoEditReq)));
|
||||
}
|
||||
|
||||
|
|
|
@ -1,30 +1,25 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
import com.muyu.product.domain.req.ProjectSkuInfoEditReq;
|
||||
import com.muyu.product.domain.req.ProjectSkuInfoQueryReq;
|
||||
import com.muyu.product.domain.req.ProjectSkuInfoSaveReq;
|
||||
import com.muyu.product.domain.req.ProjectSkuInfoEditReq;
|
||||
import com.muyu.product.service.ProjectSkuInfoService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品SKUController
|
||||
|
@ -43,7 +38,7 @@ public class ProjectSkuInfoController extends BaseController {
|
|||
* 查询商品SKU列表
|
||||
*/
|
||||
@ApiOperation("获取商品SKU列表")
|
||||
@RequiresPermissions("product:sku:list")
|
||||
// @RequiresPermissions("product:sku:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<ProjectSkuInfo>> list(ProjectSkuInfoQueryReq projectSkuInfoQueryReq) {
|
||||
startPage();
|
||||
|
@ -65,7 +60,7 @@ public class ProjectSkuInfoController extends BaseController {
|
|||
* 导出商品SKU列表
|
||||
*/
|
||||
@ApiOperation("导出商品SKU列表")
|
||||
@RequiresPermissions("product:sku:export")
|
||||
// @RequiresPermissions("product:sku:export")
|
||||
@Log(title = "商品SKU", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProjectSkuInfo projectSkuInfo) {
|
||||
|
@ -78,7 +73,7 @@ public class ProjectSkuInfoController extends BaseController {
|
|||
* 获取商品SKU详细信息
|
||||
*/
|
||||
@ApiOperation("获取商品SKU详细信息")
|
||||
@RequiresPermissions("product:sku:query")
|
||||
// @RequiresPermissions("product:sku:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<ProjectSkuInfo> getInfo(@PathVariable("id") Long id) {
|
||||
|
|
|
@ -1,30 +1,25 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.domain.RuleAttrInfo;
|
||||
import com.muyu.product.domain.req.RuleAttrInfoEditReq;
|
||||
import com.muyu.product.domain.req.RuleAttrInfoQueryReq;
|
||||
import com.muyu.product.domain.req.RuleAttrInfoSaveReq;
|
||||
import com.muyu.product.domain.req.RuleAttrInfoEditReq;
|
||||
import com.muyu.product.service.RuleAttrInfoService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 规格详情Controller
|
||||
|
@ -43,7 +38,7 @@ public class RuleAttrInfoController extends BaseController {
|
|||
* 查询规格详情列表
|
||||
*/
|
||||
@ApiOperation("获取规格详情列表")
|
||||
@RequiresPermissions("product:ruleAttr:list")
|
||||
// @RequiresPermissions("product:ruleAttr:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<RuleAttrInfo>> list(RuleAttrInfoQueryReq ruleAttrInfoQueryReq) {
|
||||
startPage();
|
||||
|
@ -68,7 +63,7 @@ public class RuleAttrInfoController extends BaseController {
|
|||
* 获取规格详情详细信息
|
||||
*/
|
||||
@ApiOperation("获取规格详情详细信息")
|
||||
@RequiresPermissions("product:ruleAttr:query")
|
||||
// @RequiresPermissions("product:ruleAttr:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<RuleAttrInfo> getInfo(@PathVariable("id") Long id) {
|
||||
|
|
|
@ -1,34 +1,29 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.product.domain.model.RuleInfoAddModel;
|
||||
import com.muyu.product.domain.resp.RuleInfoResp;
|
||||
import com.muyu.product.domain.resp.RuleInfoUpdResp;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.text.Convert;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.domain.RuleInfo;
|
||||
import com.muyu.product.domain.model.RuleInfoAddModel;
|
||||
import com.muyu.product.domain.req.RuleInfoEditReq;
|
||||
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.domain.resp.RuleInfoResp;
|
||||
import com.muyu.product.domain.resp.RuleInfoUpdResp;
|
||||
import com.muyu.product.service.RuleInfoService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 商品规格Controller
|
||||
|
@ -47,7 +42,7 @@ public class RuleInfoController extends BaseController {
|
|||
* 查询商品规格列表
|
||||
*/
|
||||
@ApiOperation("获取商品规格列表")
|
||||
@RequiresPermissions("product:rule:list")
|
||||
// @RequiresPermissions("product:rule:list")
|
||||
@GetMapping("/list")
|
||||
public Result list(RuleInfoQueryReq ruleInfoQueryReq) {
|
||||
boolean isPage = ruleInfoQueryReq.getParams().get("isPage") == null || Convert.toBool(ruleInfoQueryReq.getParams().get("isPage"), true);
|
||||
|
@ -62,7 +57,7 @@ public class RuleInfoController extends BaseController {
|
|||
* 导出商品规格列表
|
||||
*/
|
||||
@ApiOperation("导出商品规格列表")
|
||||
@RequiresPermissions("product:rule:export")
|
||||
// @RequiresPermissions("product:rule:export")
|
||||
@Log(title = "商品规格", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, RuleInfo ruleInfo) {
|
||||
|
@ -75,7 +70,7 @@ public class RuleInfoController extends BaseController {
|
|||
* 获取商品规格详细信息
|
||||
*/
|
||||
@ApiOperation("获取商品规格详细信息")
|
||||
@RequiresPermissions("product:rule:query")
|
||||
// @RequiresPermissions("product:rule:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<RuleInfoUpdResp> getInfo(@PathVariable("id") Long id) {
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsAttributeGroup;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 属性与组中间Mapper接口
|
||||
|
@ -10,6 +11,11 @@ import com.muyu.product.domain.AsAttributeGroup;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsAttributeGroupMapper extends BaseMapper<AsAttributeGroup> {
|
||||
|
||||
void delete(Long id);
|
||||
|
||||
//添加 属性组
|
||||
void add(@Param("groupId") Long groupId, @Param("id") Long id);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsBrandProject;
|
||||
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsCategoryAttributeGroup;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 品类属性组中间Mapper接口
|
||||
|
@ -10,6 +13,20 @@ import com.muyu.product.domain.AsCategoryAttributeGroup;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsCategoryAttributeGroupMapper extends BaseMapper<AsCategoryAttributeGroup> {
|
||||
|
||||
void deleteAsCategoryAttributeGroup(Long id);
|
||||
|
||||
/**
|
||||
* 添加 品类 属性组 中间表
|
||||
* categoryId:品类id
|
||||
* attributeGroupId:属性id
|
||||
*/
|
||||
void addAsCategoryAttributeGroup(@Param("categoryId") Long categoryId, @Param("attributeGroupId") Long attributeGroupId);
|
||||
|
||||
/**
|
||||
* 查询 品类 属性组 中间表
|
||||
*/
|
||||
List<Long> selectAsCategoryAttributeGroupList(@Param("id") Long id);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsCategoryAttribute;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 品类属性中间Mapper接口
|
||||
|
@ -10,6 +13,23 @@ import com.muyu.product.domain.AsCategoryAttribute;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsCategoryAttributeMapper extends BaseMapper<AsCategoryAttribute> {
|
||||
|
||||
|
||||
/**删除 品类 属性 中间表 */
|
||||
void deleteAsCategoryAttribute(Long id);
|
||||
|
||||
|
||||
/**
|
||||
* 添加 品类 属性 中间表
|
||||
* categoryId:品类id
|
||||
* attributeId:属性id
|
||||
*/
|
||||
void addAsCategoryAttribute(@Param("categoryId") Long categoryId, @Param("attributeId") Long attributeId);
|
||||
|
||||
/**
|
||||
* 查询 品类 属性组 中间表
|
||||
*/
|
||||
List<Long> selectAsCategoryAttributeList(@Param("id") Long id);
|
||||
}
|
||||
|
|
|
@ -1,8 +1,11 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsCategoryBrand;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 品类品牌中间Mapper接口
|
||||
|
@ -10,6 +13,21 @@ import com.muyu.product.domain.AsCategoryBrand;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface AsCategoryBrandMapper extends BaseMapper<AsCategoryBrand> {
|
||||
|
||||
/**删除 品类 品牌 中间表 */
|
||||
void deleteAsCategoryBrandMapper(Long id);
|
||||
|
||||
/**
|
||||
* 添加 品类 品牌 中间表
|
||||
* categoryId:品类id
|
||||
* brandId:品牌id
|
||||
*/
|
||||
void addAsCategoryBrandMapper(@Param("categoryId") Long categoryId, @Param("brandId") Long brandId);
|
||||
|
||||
/**
|
||||
* 查询 品类 属性组 中间表
|
||||
*/
|
||||
List<Long> selectAsCategoryBrandList(@Param("id") Long id);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AsProductAttributeInfo;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AttributeGroup;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 属性组Mapper接口
|
||||
|
@ -10,6 +10,7 @@ import com.muyu.product.domain.AttributeGroup;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface AttributeGroupMapper extends BaseMapper<AttributeGroup> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.BrandInfo;
|
||||
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.CategoryInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 品类信息Mapper接口
|
||||
*
|
||||
|
@ -12,4 +13,11 @@ import com.muyu.product.domain.CategoryInfo;
|
|||
*/
|
||||
public interface CategoryInfoMapper extends BaseMapper<CategoryInfo> {
|
||||
|
||||
|
||||
//修改 品类
|
||||
boolean updateCategoryInfo( CategoryInfo categoryInfo );
|
||||
|
||||
CategoryInfo findByOne(Long ids);
|
||||
|
||||
List<CategoryInfo> findParentId(Long parentId);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.CommentInfo;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.CommentLikeInfo;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.ProjectInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 商品信息Mapper接口
|
||||
|
@ -10,6 +10,7 @@ import com.muyu.product.domain.ProjectInfo;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProjectInfoMapper extends BaseMapper<ProjectInfo> {
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.RuleAttrInfo;
|
||||
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.RuleInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 商品规格Mapper接口
|
||||
|
@ -10,6 +10,7 @@ import com.muyu.product.domain.RuleInfo;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface RuleInfoMapper extends BaseMapper<RuleInfo> {
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,10 @@ import com.muyu.product.domain.AttributeGroup;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||
import com.muyu.product.domain.req.AttributeGroupEditReq;
|
||||
import com.muyu.product.domain.req.AttributeGroupStateReq;
|
||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||
import com.muyu.product.domain.resp.AttributeGroupUpd;
|
||||
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||
|
||||
/**
|
||||
|
@ -46,4 +49,21 @@ public interface AttributeGroupService extends IService<AttributeGroup> {
|
|||
* @return
|
||||
*/
|
||||
AttributeGroupUpdResp getUpdById(Long id);
|
||||
|
||||
/**
|
||||
* 吴彦祖 的 修改 属性
|
||||
*/
|
||||
void updateAttribute(Long id, AttributeGroupEditReq attributeGroupEditReq);
|
||||
/**
|
||||
* 吴彦祖 的 回显属性组
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
AttributeGroupUpd getByIdUpd(Long id);
|
||||
|
||||
/**
|
||||
* 修改 属性 状态 (wyz)
|
||||
* @param attributeGroupStateReq
|
||||
*/
|
||||
void updateState(AttributeGroupStateReq attributeGroupStateReq);
|
||||
}
|
||||
|
|
|
@ -8,7 +8,9 @@ import com.muyu.product.domain.BrandInfo;
|
|||
import com.muyu.product.domain.CategoryInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import com.muyu.product.domain.req.CategoryInfoEditReq;
|
||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||
import com.muyu.product.domain.resp.CategoryInfoUpdResp;
|
||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||
|
||||
/**
|
||||
|
@ -69,4 +71,17 @@ public interface CategoryInfoService extends IService<CategoryInfo> {
|
|||
CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId);
|
||||
|
||||
public <T, AS> List<T> getCommon (Long categoryId, IService<AS> iService, IService<T> bsiService);
|
||||
|
||||
/**
|
||||
* 修改品类信息 吴彦祖
|
||||
* @param id
|
||||
* @param categoryInfoEditReq
|
||||
* @return
|
||||
*/
|
||||
|
||||
boolean updateUpdById(Long id, CategoryInfoEditReq categoryInfoEditReq);
|
||||
|
||||
|
||||
/** 获取品类信息详细信息 wyz*/
|
||||
CategoryInfoUpdResp getByIdUpd(Long id);
|
||||
}
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.product.domain.ProjectInfo;
|
||||
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.resp.ProjectDetailResp;
|
||||
import com.muyu.product.domain.resp.ProjectInfoListResp;
|
||||
|
||||
/**
|
||||
* 商品信息Service接口
|
||||
|
@ -20,7 +24,7 @@ public interface ProjectInfoService extends IService<ProjectInfo> {
|
|||
* @return 商品信息集合
|
||||
*/
|
||||
public List<ProjectInfo> list(ProjectInfo projectInfo);
|
||||
|
||||
public List<ProjectInfoListResp> ProjectInfo(ProjectInfo projectInfo);
|
||||
/**
|
||||
* 保存商品信息
|
||||
* @param projectInfoSaveReq 请求对象
|
||||
|
@ -34,4 +38,12 @@ public interface ProjectInfoService extends IService<ProjectInfo> {
|
|||
* @return 商品详情
|
||||
*/
|
||||
ProjectDetailResp getDetailInfo (Long id);
|
||||
/**
|
||||
* 吴彦祖 的 自定义 修改方法
|
||||
* @param id
|
||||
* @param projectInfoEditReq
|
||||
* @return
|
||||
*/
|
||||
Result<String> wyzUpdateProjectInfo(Long id, ProjectInfoEditReq projectInfoEditReq);
|
||||
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.product.service;
|
|||
import java.util.List;
|
||||
import com.muyu.product.domain.RuleAttrInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.req.WyzRuleInfoSaveReq;
|
||||
|
||||
/**
|
||||
* 规格详情Service接口
|
||||
|
@ -25,4 +26,8 @@ public interface RuleAttrInfoService extends IService<RuleAttrInfo> {
|
|||
* @return 规格详情集合
|
||||
*/
|
||||
List<RuleAttrInfo> getInfoByRuleId (Long ruleId);
|
||||
/**
|
||||
* 修改 规格 状态
|
||||
*/
|
||||
void updateSaveById(WyzRuleInfoSaveReq wyzRuleInfoSaveReq);
|
||||
}
|
||||
|
|
|
@ -49,4 +49,6 @@ public interface RuleInfoService extends IService<RuleInfo> {
|
|||
* @return
|
||||
*/
|
||||
boolean updateById(Long id, RuleInfoEditReq ruleInfoEditReq);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -9,8 +9,12 @@ import com.muyu.product.domain.AsAttributeGroup;
|
|||
import com.muyu.product.domain.AttributeGroup;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import com.muyu.product.domain.model.AttributeGroupSaveModel;
|
||||
import com.muyu.product.domain.req.AttributeGroupEditReq;
|
||||
import com.muyu.product.domain.req.AttributeGroupStateReq;
|
||||
import com.muyu.product.domain.resp.AttributeGroupPageResp;
|
||||
import com.muyu.product.domain.resp.AttributeGroupUpd;
|
||||
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||
import com.muyu.product.mapper.AsAttributeGroupMapper;
|
||||
import com.muyu.product.mapper.AttributeGroupMapper;
|
||||
import com.muyu.product.service.AsAttributeGroupService;
|
||||
import com.muyu.product.service.AttributeGroupService;
|
||||
|
@ -38,6 +42,9 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
|||
@Autowired
|
||||
private AttributeInfoService attributeInfoService;
|
||||
|
||||
@Autowired
|
||||
private AsAttributeGroupMapper attributeGroupMapper;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
|
@ -126,4 +133,87 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
|||
.attributeList(attributeInfoList)
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 吴彦祖 的 修改 属性
|
||||
*/
|
||||
@Override
|
||||
public void updateAttribute(Long id, AttributeGroupEditReq attributeGroupEditReq) {
|
||||
//删除原 属性组
|
||||
attributeGroupMapper.delete(id);
|
||||
if (null == attributeGroupEditReq.getAttributeList() || 0==attributeGroupEditReq.getAttributeList().size()){
|
||||
List<Long> list = attributeGroupEditReq.getAttributeIdList();
|
||||
//添加
|
||||
for (Long info : list) {
|
||||
attributeGroupMapper.add(id,info);
|
||||
}
|
||||
}else {
|
||||
List<AttributeInfo> list = attributeGroupEditReq.getAttributeList();
|
||||
//添加
|
||||
for (AttributeInfo info : list) {
|
||||
attributeGroupMapper.add(id,info.getId());
|
||||
}
|
||||
}
|
||||
//获取新数据组
|
||||
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private AttributeGroupMapper mapper;
|
||||
|
||||
/**
|
||||
* 吴彦祖 修改 属性 状态
|
||||
* @param attributeGroupStateReq
|
||||
*/
|
||||
@Override
|
||||
public void updateState(AttributeGroupStateReq attributeGroupStateReq) {
|
||||
LambdaQueryWrapper<AttributeGroup> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AttributeGroup ::getId ,attributeGroupStateReq.getId());
|
||||
|
||||
AttributeGroup attributeGroup = new AttributeGroup();
|
||||
attributeGroup.setStates(attributeGroupStateReq.getStates());
|
||||
|
||||
mapper.update(attributeGroup,queryWrapper);
|
||||
}
|
||||
|
||||
//属性与组中间列表
|
||||
@Autowired
|
||||
private AsAttributeGroupService attributeGroupService;
|
||||
|
||||
/**
|
||||
* 吴彦祖 的 回显属性组
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public AttributeGroupUpd getByIdUpd(Long id) {
|
||||
//获取当前id的 组
|
||||
AttributeGroup byId = this.getById(id);
|
||||
//查询 该 组 的 属性 集合
|
||||
LambdaQueryWrapper<AsAttributeGroup> wrapper = new LambdaQueryWrapper<>();
|
||||
//返回
|
||||
wrapper.eq(AsAttributeGroup::getGroupId,id);
|
||||
List<AsAttributeGroup> asAttributeGroups=attributeGroupService.list(wrapper);
|
||||
//判断当前会显得 属性及 是否为空
|
||||
if (asAttributeGroups.size() != 0){
|
||||
List<Long> longList = asAttributeGroups.stream()
|
||||
.map(AsAttributeGroup::getAttributeId)//属性
|
||||
.toList();
|
||||
List<AttributeInfo> attributeInfos = attributeInfoService.listByIds(longList);
|
||||
return AttributeGroupUpd.builder()
|
||||
.id(byId.getId())
|
||||
.name(byId.getName())
|
||||
.attributeList(//属性
|
||||
attributeInfos
|
||||
).build();//修改回显时信息
|
||||
}
|
||||
|
||||
return AttributeGroupUpd.builder()
|
||||
.id(byId.getId())
|
||||
.name(byId.getName())
|
||||
.build();//修改回显时信息
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -10,8 +10,13 @@ import com.muyu.product.domain.base.CategoryBase;
|
|||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import com.muyu.product.domain.model.TemplateAttributeGroupModel;
|
||||
import com.muyu.product.domain.model.TemplateAttributeModel;
|
||||
import com.muyu.product.domain.req.CategoryInfoEditReq;
|
||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||
import com.muyu.product.domain.resp.CategoryInfoUpdResp;
|
||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||
import com.muyu.product.mapper.AsCategoryAttributeGroupMapper;
|
||||
import com.muyu.product.mapper.AsCategoryAttributeMapper;
|
||||
import com.muyu.product.mapper.AsCategoryBrandMapper;
|
||||
import com.muyu.product.mapper.CategoryInfoMapper;
|
||||
import com.muyu.product.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
@ -58,6 +63,18 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
@Autowired
|
||||
private AttributeGroupService attributeGroupService;
|
||||
|
||||
|
||||
@Autowired
|
||||
private AsCategoryAttributeGroupMapper attributeGroupMapper;
|
||||
|
||||
@Autowired
|
||||
private AsCategoryAttributeMapper asCategoryAttributeMapper;
|
||||
@Autowired
|
||||
private AsCategoryBrandMapper asCategoryBrandMapper;
|
||||
|
||||
@Autowired
|
||||
private AsProductAttributeInfoService asProductAttributeInfoService;
|
||||
|
||||
/**
|
||||
* 查询品类信息列表
|
||||
*
|
||||
|
@ -270,6 +287,88 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public boolean updateUpdById(Long id, CategoryInfoEditReq categoryInfoEditReq) {
|
||||
LambdaQueryWrapper<CategoryInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CategoryInfo::getId,id);
|
||||
|
||||
//修改 品类信息
|
||||
CategoryInfo info = CategoryInfo.editBuild(id, categoryInfoEditReq);
|
||||
if (info != null){
|
||||
//修改 品类中 的 商品属性 attributeIdList
|
||||
updateAttributeIdList(id, categoryInfoEditReq);
|
||||
//修改 品类中 的 商品属性组 (attributeGroupIdList)
|
||||
updateAttributeGroupIdList(id, categoryInfoEditReq);
|
||||
//修改 品类中 的 商品品牌组 brandIdList
|
||||
updateAsCategoryBrandMapper(id, categoryInfoEditReq);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
/** 获取品类信息详细信息 wyz*/
|
||||
@Override
|
||||
public CategoryInfoUpdResp getByIdUpd(Long id) {
|
||||
LambdaQueryWrapper<CategoryInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(CategoryInfo::getId,id);
|
||||
CategoryInfo byId = this.getById(id);
|
||||
//查询 品类信息
|
||||
return CategoryInfoUpdResp.builder()
|
||||
.id(byId.getId())
|
||||
.name(byId.getName())
|
||||
.image(byId.getImage())
|
||||
.start(byId.getStart())
|
||||
.introduction(byId.getIntroduction())
|
||||
.attributeInfoList(attributeGroupMapper.selectAsCategoryAttributeGroupList(id))
|
||||
.attributeGroupList(attributeGroupMapper.selectAsCategoryAttributeGroupList(id))
|
||||
.brandInfoList(asCategoryBrandMapper.selectAsCategoryBrandList(id))
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
/**修改 品类中 的 商品品牌组 brandIdList**/
|
||||
private void updateAsCategoryBrandMapper(Long id, CategoryInfoEditReq categoryInfoEditReq) {
|
||||
//修改 品类中 的 商品属性 attributeIdList
|
||||
/** 删除商品品牌组*/
|
||||
asCategoryBrandMapper.deleteAsCategoryBrandMapper(id);
|
||||
//获取 入参中的 商品品牌组 id 集合
|
||||
List<Long> list = categoryInfoEditReq.getBrandIdList();
|
||||
for (Long aLong : list) {
|
||||
//添加 品类 商品品牌组 中间 表
|
||||
asCategoryBrandMapper.addAsCategoryBrandMapper(id,aLong);
|
||||
}
|
||||
}
|
||||
|
||||
/**修改 品类中 的 商品属性 attributeIdList**/
|
||||
private void updateAttributeIdList(Long id, CategoryInfoEditReq categoryInfoEditReq) {
|
||||
//修改 品类中 的 商品属性 attributeIdList
|
||||
/** 删除属性*/
|
||||
asCategoryAttributeMapper.deleteAsCategoryAttribute(id);
|
||||
//获取 入参中的 属性 id 集合
|
||||
List<Long> list = categoryInfoEditReq.getAttributeIdList();
|
||||
for (Long aLong : list) {
|
||||
//添加 品类 属性 中间 表
|
||||
asCategoryAttributeMapper.addAsCategoryAttribute(id,aLong);
|
||||
}
|
||||
}
|
||||
|
||||
/**修改 品类中 的 商品属性组 updateAttributeGroupIdList**/
|
||||
private void updateAttributeGroupIdList(Long id, CategoryInfoEditReq categoryInfoEditReq) {
|
||||
/** 删除 属性组*/
|
||||
attributeGroupMapper.deleteAsCategoryAttributeGroup(id);
|
||||
/** 添加 属性组*/
|
||||
List<Long> list = categoryInfoEditReq.getAttributeGroupIdList();
|
||||
for (Long aLong : list) {
|
||||
attributeGroupMapper.addAsCategoryAttributeGroup(id,aLong);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过品类ID获取父级以上的属性、属性组、品牌集合
|
||||
*
|
||||
|
|
|
@ -2,15 +2,20 @@ package com.muyu.product.service.impl;
|
|||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import com.muyu.product.domain.*;
|
||||
import com.muyu.product.domain.model.*;
|
||||
import com.muyu.product.domain.req.ProjectInfoEditReq;
|
||||
import com.muyu.product.domain.req.ProjectInfoSaveReq;
|
||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||
import com.muyu.product.domain.resp.ProjectDetailResp;
|
||||
import com.muyu.product.domain.resp.ProjectInfoListResp;
|
||||
import com.muyu.product.mapper.RuleInfoMapper;
|
||||
import com.muyu.product.service.*;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -101,8 +106,6 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
|
|||
|
||||
|
||||
|
||||
|
||||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
|
@ -229,4 +232,82 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
|
|||
.attributeGroupList(templateAttributeGroupList)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Autowired
|
||||
private ProjectInfoMapper projectInfoMapper;
|
||||
|
||||
/***
|
||||
* wyz 商品的修改方法
|
||||
* @param id
|
||||
* @param projectInfoEditReq
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Result<String> wyzUpdateProjectInfo(Long id, ProjectInfoEditReq projectInfoEditReq) {
|
||||
|
||||
LambdaQueryWrapper<ProjectInfo> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProjectInfo::getId,id);
|
||||
|
||||
ProjectInfo projectInfo = ProjectInfo.builder()
|
||||
.id(id)
|
||||
.name(projectInfoEditReq.getName())
|
||||
.introduction(projectInfoEditReq.getIntroduction())
|
||||
.mianType(projectInfoEditReq.getMianType())
|
||||
.parentType(projectInfoEditReq.getParentType())
|
||||
.type(projectInfoEditReq.getType())
|
||||
.image(projectInfoEditReq.getImage())
|
||||
.carouselImages(projectInfoEditReq.getCarouselImages())
|
||||
.status(projectInfoEditReq.getStatus())
|
||||
.ruleId(projectInfoEditReq.getRuleId()).build();
|
||||
|
||||
projectInfoMapper.update(projectInfo,wrapper);
|
||||
return Result.success("修改成功");
|
||||
}
|
||||
|
||||
|
||||
@Autowired
|
||||
private RuleInfoMapper ruleInfoMapper;
|
||||
@Override
|
||||
public List<ProjectInfoListResp> ProjectInfo(ProjectInfo projectInfo) {
|
||||
List<ProjectInfo> list = list(projectInfo);
|
||||
|
||||
List<ProjectInfoListResp> projectInfoListResps = new LinkedList<>();
|
||||
list.forEach(p -> {
|
||||
// 获取类别信息
|
||||
CategoryInfo mianTypeName = categoryInfoService.getById(p.getMianType());
|
||||
CategoryInfo parentTypeName = categoryInfoService.getById(p.getParentType());
|
||||
CategoryInfo typeName = p.getType() != null ? categoryInfoService.getById(p.getType()) : null;
|
||||
|
||||
// 获取规则信息
|
||||
RuleInfo ruleName = ruleInfoMapper.selectById(p.getRuleId());
|
||||
|
||||
// 获取品牌信息
|
||||
BrandInfo brandName = brandInfoService.getById(p.getBrandId());
|
||||
|
||||
// 构建响应对象
|
||||
ProjectInfoListResp resp = ProjectInfoListResp.builder()
|
||||
.id(p.getId())
|
||||
.name(p.getName())
|
||||
.introduction(p.getIntroduction())
|
||||
.mianType(p.getMianType())
|
||||
.parentType(p.getParentType())
|
||||
.type(p.getType())
|
||||
.image(p.getImage())
|
||||
.carouselImages(p.getCarouselImages())
|
||||
.status(p.getStatus())
|
||||
.mianTypeName(mianTypeName != null ? mianTypeName.getName() : "")
|
||||
.parentTypeName(parentTypeName != null ? parentTypeName.getName() : "")
|
||||
.typeName(typeName != null ? typeName.getName() : "")
|
||||
.ruleName(ruleName != null ? ruleName.getName() : "")
|
||||
.brandName(brandName != null ? brandName.getNam() : "")
|
||||
.build();
|
||||
|
||||
// 添加到结果列表
|
||||
projectInfoListResps.add(resp);
|
||||
});
|
||||
|
||||
return projectInfoListResps;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue