Compare commits
9 Commits
master
...
1125/liuhe
Author | SHA1 | Date |
---|---|---|
|
a7e609ad50 | |
|
906e79ab91 | |
|
efab73e637 | |
|
35ad772ac8 | |
|
7ed26373af | |
|
ec384efbaf | |
|
10368d9a9d | |
|
7e256f9a95 | |
|
43a18c95d8 |
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"团购活动id":"Long"
|
||||
"商品ID":"Long",
|
||||
"活动名称":"String",
|
||||
"活动简介":"String",
|
||||
"商品图片":"String",
|
||||
"商品单位":"String",
|
||||
"商品的轮播图":[
|
||||
"String","String"
|
||||
],
|
||||
"活动时间":"date",
|
||||
"策略类型":"String",
|
||||
"策略ID":"Long",
|
||||
"商品规格":{
|
||||
"商品规格List":[
|
||||
{
|
||||
"规格id":"Long",
|
||||
"拼团价格":"BigDecimal",
|
||||
"拼团库存":"Long"
|
||||
}
|
||||
],
|
||||
"删除商品规格idList":["Long","Long"],
|
||||
"添加商品规格List":[
|
||||
"规格SKU": "String", // activity_team_product_sku_info.product_sku
|
||||
"拼团价格": "BigDecimal",
|
||||
"商品价格":"BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
]
|
||||
},
|
||||
"排序":"Integer",
|
||||
"详情":"String",
|
||||
"状态":"String"
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"团购活动id":"Long"
|
||||
"商品ID":"Long",
|
||||
"活动名称":"String",
|
||||
"活动简介":"String",
|
||||
"商品图片":"String",
|
||||
"商品单位":"String",
|
||||
"商品的轮播图":[
|
||||
"String","String"
|
||||
],
|
||||
"活动时间":"date",
|
||||
"策略类型":"String",
|
||||
"策略ID":"Long",
|
||||
"商品规格List":[
|
||||
{
|
||||
"规格id":"Long",
|
||||
"规格SKU":"String",
|
||||
"拼团价格":"BigDecimal",
|
||||
"拼团库存":"Long"
|
||||
}
|
||||
],
|
||||
"排序":"Integer",
|
||||
"详情":"String"
|
||||
}
|
|
@ -14,10 +14,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
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,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -22,7 +22,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private long id;
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
|
@ -30,7 +30,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private long productId;
|
||||
private Long projectId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
|
@ -54,7 +54,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private long sort;
|
||||
private Long sort;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
|
@ -70,7 +70,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private long strategyId;
|
||||
private Long strategyId;
|
||||
|
||||
/**
|
||||
* 公共添加模型,转换成添加对象
|
||||
|
@ -80,7 +80,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
public static ActivityTeamInfo addModelBuild(ActivityTeamInfoAddModel activityTeamInfoAddModel){
|
||||
return ActivityTeamInfo.builder()
|
||||
.name(activityTeamInfoAddModel.getName())
|
||||
.productId(activityTeamInfoAddModel.getProductId())
|
||||
.projectId(activityTeamInfoAddModel.getProductId())
|
||||
.productImage(activityTeamInfoAddModel.getProductImage())
|
||||
.introduction(activityTeamInfoAddModel.getIntroduction())
|
||||
.unit(activityTeamInfoAddModel.getUnit())
|
||||
|
|
|
@ -22,11 +22,11 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
* 主键
|
||||
*/
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private long id;
|
||||
private Long id;
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
private long teamId;
|
||||
private Long teamId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
|
@ -60,6 +60,6 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||
.build()
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityProductSkuListModel {
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
private Long skuId;
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -0,0 +1,79 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.resp.ActivityProductUpdResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamProductSkuResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 活动商品修改参数
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityProductUpdModel {
|
||||
/**
|
||||
* 活动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 ActivityProductUpdResp activityProductUpdResp;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
}
|
|
@ -2,6 +2,7 @@ package com.muyu.marketing.domain.model;
|
|||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
@ -22,7 +23,6 @@ import java.util.List;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoAddModel {
|
||||
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
|
@ -42,12 +42,10 @@ public class ActivityTeamInfoAddModel {
|
|||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
|
@ -57,7 +55,7 @@ public class ActivityTeamInfoAddModel {
|
|||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
|
@ -78,4 +76,29 @@ public class ActivityTeamInfoAddModel {
|
|||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
public static ActivityTeamInfoAddModel addBuild(ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
||||
return ActivityTeamInfoAddModel.builder()
|
||||
.name(activityTeamInfoSaveReq.getName())
|
||||
.productId(activityTeamInfoSaveReq.getProductId())
|
||||
.productImage(activityTeamInfoSaveReq.getProductImage())
|
||||
.introduction(activityTeamInfoSaveReq.getIntroduction())
|
||||
.unit(activityTeamInfoSaveReq.getUnit())
|
||||
.imageList(activityTeamInfoSaveReq.getImageList())
|
||||
.endTime(activityTeamInfoSaveReq.getEndTime())
|
||||
.sort(activityTeamInfoSaveReq.getSort())
|
||||
.content(activityTeamInfoSaveReq.getContent())
|
||||
.status(activityTeamInfoSaveReq.getStatus())
|
||||
.strategyType(activityTeamInfoSaveReq.getStrategyType())
|
||||
.strategyId(activityTeamInfoSaveReq.getStrategyId())
|
||||
.activityTeamProductSkuAddModelList(
|
||||
activityTeamInfoSaveReq.getProjectSkuInfoAddReqList()
|
||||
.stream().map(addReq -> ActivityTeamProductSkuAddModel.addReqBuild(addReq,activityTeamInfoSaveReq::getProductId))
|
||||
.toList()
|
||||
).build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 团购spu库存添加模型
|
||||
|
@ -33,7 +36,7 @@ public class ActivityTeamProductSkuAddModel {
|
|||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
private String productSku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
|
@ -44,4 +47,14 @@ public class ActivityTeamProductSkuAddModel {
|
|||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
public static ActivityTeamProductSkuAddModel addReqBuild(ProjectSkuInfoAddReq projectSkuInfoAddReq, Supplier<Long> getProductId) {
|
||||
return ActivityTeamProductSkuAddModel.builder()
|
||||
.teamId(projectSkuInfoAddReq.getId())
|
||||
.productId(getProductId.get())
|
||||
.productSku(projectSkuInfoAddReq.getSku())
|
||||
.teamStock(projectSkuInfoAddReq.getTeamStock())
|
||||
.teamPrice(projectSkuInfoAddReq.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,32 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 拼团活动商品sku修改模型
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityTeamProductSkuUpdModel {
|
||||
/**
|
||||
* 商品id
|
||||
*/
|
||||
private Long ProductId;
|
||||
|
||||
/**
|
||||
* 团购价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 团购库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ProductSkuAddModel {
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品规格
|
||||
*/
|
||||
private String productSku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品规格的修改模型
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ProductSkuUpdModel {
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -44,7 +44,7 @@ public class TeamProductDiscountPriceModel {
|
|||
* @return 优惠力度
|
||||
*/
|
||||
public static TeamProductDiscountPriceModel of(BigDecimal productPrice, BigDecimal teamPrice) {
|
||||
TeamProductDiscountPriceModel.builder()
|
||||
return TeamProductDiscountPriceModel.builder()
|
||||
.productPrice(productPrice)
|
||||
.teamPrice(teamPrice)
|
||||
.discount(
|
||||
|
|
|
@ -0,0 +1,75 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.resp.ActivityProductUpdResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityProductUpdReq {
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
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 ActivityProductUpdResp activityProductUpdResp;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
}
|
|
@ -36,7 +36,6 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
|||
/**
|
||||
* 单位
|
||||
*/
|
||||
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
|
@ -51,7 +50,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
|||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
private Long sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
|
@ -72,4 +71,6 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
|
|||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ import java.math.BigDecimal;
|
|||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ProjectSkuInfoAddReq {
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 规格SKU
|
||||
|
|
|
@ -3,9 +3,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.experimental.SuperBuilder;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuUpdModel;
|
||||
import com.muyu.marketing.domain.model.ProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.ProductSkuUpdModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ActivityProductUpdResp {
|
||||
/**
|
||||
* 商品修改SkU集合
|
||||
*/
|
||||
private List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdList;
|
||||
|
||||
/**
|
||||
* 删除商品规格idList
|
||||
*/
|
||||
private List<Long> deleteSkuIdList;
|
||||
|
||||
/**
|
||||
* 添加商品规格的List
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddList;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,80 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 修改回显的团购活动信息
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-26 09:38
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoDetailResp {
|
||||
/**
|
||||
* 活动id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long projectId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ActivityTeamProductSkuResp> ActivityTeamProductSkuList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductSkuResp {
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
private Long ProductId;
|
||||
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品规格数据
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class ProductSkuResp {
|
||||
/**
|
||||
* 规格id
|
||||
*/
|
||||
private Long ProductId;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -3,15 +3,18 @@ package com.muyu.marketing.team.controller;
|
|||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityProductUpdModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.req.ActivityProductUpdReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoDetailResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -44,4 +47,44 @@ public class ActivityTeamController {
|
|||
}}
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加营销团购活动
|
||||
*/
|
||||
@PostMapping("insert")
|
||||
public Result<String> insert(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.addBuild(activityTeamInfoSaveReq));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取营销团购活动信息
|
||||
*/
|
||||
@GetMapping("/{teamId}")
|
||||
public Result<ActivityTeamInfoDetailResp> getTeamInfo(@PathVariable("teamId") Long teamId){
|
||||
return Result.success(activityTeamInfoService.getActivityByTeamId(teamId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 营销活动的修改
|
||||
*/
|
||||
@PutMapping("update")
|
||||
public Result<String> update(@RequestBody ActivityProductUpdReq activityProductUpdReq){
|
||||
activityTeamInfoService.edit(activityProductUpdReq);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 团购活动列表
|
||||
*/
|
||||
@GetMapping("/teamList")
|
||||
public Result<TableDataInfo<ActivityTeamInfo>> teamList(){
|
||||
List<ActivityTeamInfo> list = activityTeamInfoService.list();
|
||||
TableDataInfo<ActivityTeamInfo> tableDataInfo = new TableDataInfo<>();
|
||||
tableDataInfo.setRows(list);
|
||||
tableDataInfo.setTotal(list.size());
|
||||
return Result.success(tableDataInfo);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.marketing.team.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.marketing.domain.model.ActivityProductSkuListModel;
|
||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("sku")
|
||||
public class ActivityTeamProductSkuController {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||
|
||||
|
||||
}
|
|
@ -3,9 +3,13 @@ package com.muyu.marketing.team.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityProductUpdModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
|
||||
import com.muyu.marketing.domain.req.ActivityProductUpdReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoDetailResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -24,4 +28,22 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
|||
* @param activityTeamInfoAddModel 团购添加模型
|
||||
*/
|
||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||
|
||||
/**
|
||||
* 通过id查询团购活动详情
|
||||
*/
|
||||
ActivityTeamInfoDetailResp getActivityByTeamId(Long teamId);
|
||||
|
||||
|
||||
/**
|
||||
* 修改团购活动信息
|
||||
* @param activityProductUpdReq
|
||||
*/
|
||||
void edit(ActivityProductUpdReq activityProductUpdReq);
|
||||
|
||||
/**
|
||||
* 列表
|
||||
* @param activityTeamInfo
|
||||
* @return
|
||||
*/
|
||||
}
|
||||
|
|
|
@ -3,10 +3,7 @@ package com.muyu.marketing.team.service;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -41,4 +38,18 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
*/
|
||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||
|
||||
/**
|
||||
* 通过活动id查询活动商品规格信息
|
||||
*/
|
||||
public List<ActivityProductSkuListModel> getTeamProductSkuInfoListByTeamId(Long teamId);
|
||||
|
||||
/**
|
||||
* 修改商品规格
|
||||
*/
|
||||
public boolean editBatchActivityTeamProductSkuUpdModelList(List<ActivityTeamProductSkuUpdModel> productSkuUpdList);
|
||||
|
||||
/**
|
||||
* 商品规格的批量删除
|
||||
*/
|
||||
public boolean deleteBatchByTeamIds(List<Long> id);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.marketing.team.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
|
||||
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred> {
|
||||
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred>, ActivityTeamStrategy {
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.marketing.team.service;
|
|||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
|
||||
public interface TeamStrategyExemptionOrdinaryService extends IService<TeamStrategyExemptionOrdinary> {
|
||||
public interface TeamStrategyExemptionOrdinaryService extends ActivityTeamStrategy,IService<TeamStrategyExemptionOrdinary> {
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.marketing.team.service;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
|
||||
public interface TeamStrategyExemptionService extends IService<TeamStrategyExemption> {
|
||||
public interface TeamStrategyExemptionService extends ActivityTeamStrategy, IService<TeamStrategyExemption> {
|
||||
}
|
||||
|
|
|
@ -1,20 +1,29 @@
|
|||
package com.muyu.marketing.team.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import com.muyu.common.core.utils.bean.BeanUtils;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.domain.req.ActivityProductUpdReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityProductUpdResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoDetailResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamProductSkuResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
import io.lettuce.core.ClientOptions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -31,6 +40,10 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
@Autowired
|
||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||
|
||||
// @Autowired
|
||||
// private ActivityTeamInfoMapper activityTeamInfoMapper;
|
||||
|
||||
|
||||
@Override
|
||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
||||
|
||||
|
@ -85,4 +98,114 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询活动详情
|
||||
*
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ActivityTeamInfoDetailResp getActivityByTeamId(Long teamId) {
|
||||
//根据id查询活动详情
|
||||
ActivityTeamInfo activityTeamInfo = getById(teamId);
|
||||
//封装活动详情
|
||||
ActivityTeamInfoDetailResp activityTeamInfoDetailResp = new ActivityTeamInfoDetailResp();
|
||||
//根据活动id查询活动商品SKU集合
|
||||
List<ActivityProductSkuListModel> teamProductSkuInfoList = activityTeamProductSkuInfoService.getTeamProductSkuInfoListByTeamId(teamId);
|
||||
if (teamProductSkuInfoList != null) {
|
||||
//定义一个空集合
|
||||
ArrayList<ActivityTeamProductSkuResp> activityProductSkuList = new ArrayList<>();
|
||||
for (ActivityProductSkuListModel activityProductSkuListModel : teamProductSkuInfoList) {
|
||||
Long id = activityProductSkuListModel.getId();
|
||||
//根据id查询
|
||||
ActivityTeamProductSkuInfo activityTeamProductSkuInfo = activityTeamProductSkuInfoService.getById(id);
|
||||
//添加到集合中
|
||||
activityProductSkuList.add(
|
||||
ActivityTeamProductSkuResp.builder()
|
||||
.ProductId(activityTeamProductSkuInfo.getProductId())
|
||||
.sku(activityTeamProductSkuInfo.getProductSku())
|
||||
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
||||
.teamStock(activityTeamProductSkuInfo.getTeamStock())
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
||||
activityTeamInfoDetailResp.setActivityTeamProductSkuList(activityProductSkuList);
|
||||
BeanUtils.copyBeanProp(activityTeamInfoDetailResp, activityTeamInfo);
|
||||
}
|
||||
return activityTeamInfoDetailResp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改团购活动信息
|
||||
* @param activityProductUpdReq
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public void edit(ActivityProductUpdReq activityProductUpdReq) {
|
||||
//获取活动商品SKU
|
||||
ActivityProductUpdResp activityProductUpdResp = activityProductUpdReq.getActivityProductUpdResp();
|
||||
//获取需要删除的SKU集合
|
||||
List<Long> deleteSkuIdList = activityProductUpdResp.getDeleteSkuIdList();
|
||||
//判断是否为空
|
||||
if (deleteSkuIdList != null){
|
||||
activityTeamProductSkuInfoService.deleteBatchByTeamIds(deleteSkuIdList);
|
||||
}
|
||||
//获取需要修改的SKU集合
|
||||
List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuList = activityProductUpdResp.getActivityTeamProductSkuUpdList();
|
||||
//判断是否为空
|
||||
if (activityTeamProductSkuList != null){
|
||||
activityTeamProductSkuList.stream().map(productSkuUpdModel -> {
|
||||
return ProductSkuUpdModel.builder()
|
||||
.productId(productSkuUpdModel.getProductId())
|
||||
.teamPrice(productSkuUpdModel.getTeamPrice())
|
||||
.teamStock(productSkuUpdModel.getTeamStock())
|
||||
.build();
|
||||
}).toList();
|
||||
//批量修改SKU集合
|
||||
activityTeamProductSkuInfoService.editBatchActivityTeamProductSkuUpdModelList(activityTeamProductSkuList);
|
||||
}
|
||||
|
||||
//获取要添加的SKU集合
|
||||
List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddList = activityProductUpdResp.getActivityTeamProductSkuAddList();
|
||||
//判断是否为空
|
||||
if (activityTeamProductSkuAddList != null){
|
||||
activityTeamProductSkuAddList.stream().map(productSkuAddModel -> {
|
||||
return ProductSkuAddModel.builder()
|
||||
.productId(productSkuAddModel.getProductId())
|
||||
.teamPrice(productSkuAddModel.getTeamPrice())
|
||||
.teamStock(productSkuAddModel.getTeamStock())
|
||||
.productSku(productSkuAddModel.getProductSku())
|
||||
.build();
|
||||
}).toList();
|
||||
//批量添加SKU集合
|
||||
activityTeamProductSkuInfoService.batchSave(activityTeamProductSkuAddList);
|
||||
|
||||
}
|
||||
//修改活动信息
|
||||
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.builder()
|
||||
.id(activityProductUpdReq.getId())
|
||||
.name(activityProductUpdReq.getName())
|
||||
.projectId(activityProductUpdReq.getProjectId())
|
||||
.productImage(activityProductUpdReq.getProductImage())
|
||||
.introduction(activityProductUpdReq.getIntroduction())
|
||||
.unit(activityProductUpdReq.getUnit())
|
||||
.imageList(activityProductUpdReq.getImageList())
|
||||
.endTime(activityProductUpdReq.getEndTime())
|
||||
.sort(activityProductUpdReq.getSort())
|
||||
.content(activityProductUpdReq.getContent())
|
||||
.status(activityProductUpdReq.getStatus())
|
||||
.strategyType(activityProductUpdReq.getStrategyType())
|
||||
.strategyId(activityProductUpdReq.getStrategyId())
|
||||
.build();
|
||||
//修改拼团活动
|
||||
updateById(activityTeamInfo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,23 +1,24 @@
|
|||
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.conditions.update.LambdaUpdateChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
|
||||
import com.muyu.marketing.domain.model.TeamProductStockModel;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoDetailResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamProductSkuResp;
|
||||
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
import com.muyu.product.cache.ProjectSkuCache;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -27,6 +28,10 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
|||
|
||||
@Autowired
|
||||
private ProjectSkuCache projectSkuCache;
|
||||
@Autowired
|
||||
private @Lazy ActivityTeamInfoService activityTeamInfoService;
|
||||
@Autowired
|
||||
private ActivityTeamProductSkuInfoMapper activityTeamProductSkuInfoMapper;
|
||||
|
||||
/**
|
||||
* 通过团购活动ID获取团购中最优惠的价格
|
||||
|
@ -80,4 +85,68 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
|||
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据团购ID获取团购商品SKU列表
|
||||
*
|
||||
* @param teamId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ActivityProductSkuListModel> getTeamProductSkuInfoListByTeamId(Long teamId) {
|
||||
//根据活动id查询团购商品SKU集合
|
||||
List<ActivityTeamProductSkuInfo> activityTeamProductSkuList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||
ArrayList<ActivityProductSkuListModel> activityProductSkuList = new ArrayList<>();
|
||||
for (ActivityTeamProductSkuInfo activityTeamProductSkuInfo : activityTeamProductSkuList) {
|
||||
activityProductSkuList.add(ActivityProductSkuListModel.builder()
|
||||
.id(activityTeamProductSkuInfo.getId())
|
||||
.productId(activityTeamProductSkuInfo.getProductId())
|
||||
.sku(activityTeamProductSkuInfo.getProductSku())
|
||||
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
||||
.teamStock(activityTeamProductSkuInfo.getTeamStock())
|
||||
.build());
|
||||
}
|
||||
return activityProductSkuList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑团购商品SKU集合
|
||||
*
|
||||
* @param productSkuUpdList
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean editBatchActivityTeamProductSkuUpdModelList(List<ActivityTeamProductSkuUpdModel> productSkuUpdList) {
|
||||
//创建updateWrapper
|
||||
LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
//遍历集合
|
||||
for (ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel : productSkuUpdList) {
|
||||
//赋值
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice, activityTeamProductSkuUpdModel.getTeamPrice());
|
||||
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock, activityTeamProductSkuUpdModel.getTeamStock());
|
||||
updateWrapper.eq(ActivityTeamProductSkuInfo::getProductId, activityTeamProductSkuUpdModel.getProductId());
|
||||
}
|
||||
//返回
|
||||
return this.update(updateWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品规格的批量删除
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean deleteBatchByTeamIds(List<Long> id) {
|
||||
//创建updateWrapper
|
||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
//根据id查询
|
||||
List<Long> productIdList = activityTeamProductSkuInfoMapper.selectList(lambdaQueryWrapper).stream().map(ActivityTeamProductSkuInfo::getProductId).toList();
|
||||
//判断集合是否为空
|
||||
if (productIdList == null && productIdList.isEmpty()) {
|
||||
throw new ServiceException("该团购下没有商品");
|
||||
}
|
||||
return this.removeBatchByIds(productIdList);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,10 +7,36 @@ import com.muyu.marketing.team.mapper.TeamStrategyExemptionHundredMapper;
|
|||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionHundredService;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Service("team_strategy_exemption_hundred")
|
||||
@Log4j2
|
||||
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred>
|
||||
implements TeamStrategyExemptionHundredService {
|
||||
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
log.info("参加-百人团 -[{}]",activityTeamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,36 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionOrdinaryMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionOrdinaryService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Service("team_strategy_exemption_ordinary")
|
||||
@Log4j2
|
||||
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary>
|
||||
implements TeamStrategyExemptionOrdinaryService {
|
||||
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
log.info("参加-普通团 -[{}]",activityTeamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,10 +4,36 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.muyu.marketing.domain.TeamStrategyExemption;
|
||||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Service("team_strategy_exemption")
|
||||
@Log4j2
|
||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||
implements TeamStrategyExemptionService {
|
||||
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
log.info("参加-免单团 -[{}]",activityTeamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.marketing.team.strategy;
|
||||
|
||||
/**
|
||||
* 团购活动策略
|
||||
*/
|
||||
public interface ActivityTeamStrategy {
|
||||
|
||||
/**
|
||||
* 开团
|
||||
* @param activityTeamId 活动拼团id
|
||||
*/
|
||||
public void openTeam(Long activityTeamId);
|
||||
|
||||
/**
|
||||
* 申请加团
|
||||
* @param teamId 拼团id
|
||||
*/
|
||||
public void applyTeam(Long teamId);
|
||||
|
||||
/**
|
||||
* 加团
|
||||
* @param teamId 拼团id
|
||||
* @param orderNumber 订单号
|
||||
*/
|
||||
public void addTeam(Long teamId, String orderNumber);
|
||||
|
||||
/**
|
||||
* 退团
|
||||
* @param teamId 拼团id
|
||||
*/
|
||||
public void backTeam(Long teamId);
|
||||
|
||||
/**
|
||||
* 结算团
|
||||
* @param teamId 拼团id
|
||||
*/
|
||||
public void settle(Long teamId);
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.muyu.marketing.team.strategy.impl;
|
||||
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.core.utils.SpringUtils;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
@Primary
|
||||
public class ActivityTeamStrategyImpl implements ActivityTeamStrategy {
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
String activityTeamType = null;
|
||||
if (activityTeamId==null){
|
||||
throw new ServiceException("activityTeamId 不能为空");
|
||||
}else if (activityTeamId==1){
|
||||
activityTeamType="team_strategy_exemption_hundred";
|
||||
}else if (activityTeamId==2){
|
||||
activityTeamType="team_strategy_exemption_ordinary";
|
||||
}else if (activityTeamId==3){
|
||||
activityTeamType="team_strategy_exemption";
|
||||
}
|
||||
ActivityTeamStrategy activityTeamStrategy = SpringUtils.getBean(activityTeamType);
|
||||
activityTeamStrategy.openTeam(activityTeamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeam(Long teamId, String orderNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
|
@ -14,10 +14,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.test;
|
||||
|
||||
import com.muyu.marketing.MuYuMarketIngApplication;
|
||||
import com.muyu.marketing.team.strategy.ActivityTeamStrategy;
|
||||
import io.jsonwebtoken.lang.Classes;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest(classes= MuYuMarketIngApplication.class)
|
||||
public class TeamStrategyTest {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamStrategy activityTeamStrategy;
|
||||
|
||||
@Test
|
||||
public void test(){
|
||||
activityTeamStrategy.openTeam(1L);
|
||||
activityTeamStrategy.openTeam(2L);
|
||||
activityTeamStrategy.openTeam(3L);
|
||||
}
|
||||
}
|
|
@ -3,6 +3,7 @@ package com.muyu.product.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -32,7 +33,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "商品评论")
|
||||
//@Api(tags = "商品评论")
|
||||
@RestController
|
||||
@RequestMapping("/comment")
|
||||
public class CommentInfoController extends BaseController {
|
||||
|
@ -42,10 +43,10 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 查询商品评论列表
|
||||
*/
|
||||
@ApiOperation("获取商品评论列表")
|
||||
@RequiresPermissions("product:comment:list")
|
||||
// @ApiOperation("获取商品评论列表")
|
||||
// @RequiresPermissions("product:comment:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<CommentInfo>> list(CommentInfoQueryReq commentInfoQueryReq) {
|
||||
public Result<TableDataInfo<CommentInfo>> list(@RequestBody CommentInfoQueryReq commentInfoQueryReq) {
|
||||
startPage();
|
||||
List<CommentInfo> list = commentInfoService.list(CommentInfo.queryBuild(commentInfoQueryReq));
|
||||
return getDataTable(list);
|
||||
|
@ -54,8 +55,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 导出商品评论列表
|
||||
*/
|
||||
@ApiOperation("导出商品评论列表")
|
||||
@RequiresPermissions("product:comment:export")
|
||||
// @ApiOperation("导出商品评论列表")
|
||||
// @RequiresPermissions("product:comment:export")
|
||||
@Log(title = "商品评论", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CommentInfo commentInfo) {
|
||||
|
@ -67,8 +68,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 获取商品评论详细信息
|
||||
*/
|
||||
@ApiOperation("获取商品评论详细信息")
|
||||
@RequiresPermissions("product:comment:query")
|
||||
// @ApiOperation("获取商品评论详细信息")
|
||||
// @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) {
|
||||
|
@ -78,8 +79,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 新增商品评论
|
||||
*/
|
||||
@RequiresPermissions("product:comment:add")
|
||||
@Log(title = "商品评论", businessType = BusinessType.INSERT)
|
||||
// @RequiresPermissions("product:comment:add")
|
||||
// @Log(title = "商品评论", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation("新增商品评论")
|
||||
public Result<String> add(@RequestBody CommentInfoSaveReq commentInfoSaveReq) {
|
||||
|
@ -89,8 +90,8 @@ public class CommentInfoController extends BaseController {
|
|||
/**
|
||||
* 修改商品评论
|
||||
*/
|
||||
@RequiresPermissions("product:comment:edit")
|
||||
@Log(title = "商品评论", businessType = BusinessType.UPDATE)
|
||||
// @RequiresPermissions("product:comment:edit")
|
||||
// @Log(title = "商品评论", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改商品评论")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody CommentInfoEditReq commentInfoEditReq) {
|
||||
|
@ -108,4 +109,16 @@ public class CommentInfoController extends BaseController {
|
|||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(commentInfoService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品Id查询评论
|
||||
*/
|
||||
@GetMapping("/getCommentByProjectId/{projectId}")
|
||||
public Result getCommentByProjectId(@PathVariable Long projectId){
|
||||
//查询条件
|
||||
LambdaQueryWrapper<CommentInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(CommentInfo::getProjectId,projectId);
|
||||
//查询
|
||||
return Result.success(commentInfoService.list(lambdaQueryWrapper));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.muyu.common.core.web.page.TableDataInfo;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Api(tags = "评论点赞")
|
||||
//@Api(tags = "评论点赞")
|
||||
@RestController
|
||||
@RequestMapping("/commentLike")
|
||||
public class CommentLikeInfoController extends BaseController {
|
||||
|
@ -42,8 +42,8 @@ public class CommentLikeInfoController extends BaseController {
|
|||
/**
|
||||
* 查询评论点赞列表
|
||||
*/
|
||||
@ApiOperation("获取评论点赞列表")
|
||||
@RequiresPermissions("product:commentLike:list")
|
||||
// @ApiOperation("获取评论点赞列表")
|
||||
// @RequiresPermissions("product:commentLike:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<CommentLikeInfo>> list(CommentLikeInfoQueryReq commentLikeInfoQueryReq) {
|
||||
startPage();
|
||||
|
@ -54,8 +54,8 @@ public class CommentLikeInfoController extends BaseController {
|
|||
/**
|
||||
* 导出评论点赞列表
|
||||
*/
|
||||
@ApiOperation("导出评论点赞列表")
|
||||
@RequiresPermissions("product:commentLike:export")
|
||||
// @ApiOperation("导出评论点赞列表")
|
||||
// @RequiresPermissions("product:commentLike:export")
|
||||
@Log(title = "评论点赞", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CommentLikeInfo commentLikeInfo) {
|
||||
|
@ -68,7 +68,7 @@ public class CommentLikeInfoController extends BaseController {
|
|||
* 获取评论点赞详细信息
|
||||
*/
|
||||
@ApiOperation("获取评论点赞详细信息")
|
||||
@RequiresPermissions("product:commentLike:query")
|
||||
// @RequiresPermissions("product:commentLike:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<CommentLikeInfo> getInfo(@PathVariable("id") Long id) {
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.product.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
|
@ -130,4 +131,15 @@ public class ProjectSkuInfoController extends BaseController {
|
|||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(projectSkuInfoService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据商品Id查询规格
|
||||
*/
|
||||
@GetMapping("getProductSKUByProductId/{productId}")
|
||||
public Result getProductSKUByProductId(@PathVariable Integer productId){
|
||||
LambdaQueryWrapper<ProjectSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
lambdaQueryWrapper.eq(ProjectSkuInfo::getProjectId, productId);
|
||||
List<ProjectSkuInfo> projectSkuInfoList = projectSkuInfoService.list(lambdaQueryWrapper);
|
||||
return Result.success(projectSkuInfoList);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,4 +19,5 @@ public interface CommentInfoService extends IService<CommentInfo> {
|
|||
*/
|
||||
public List<CommentInfo> list(CommentInfo commentInfo);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -54,4 +54,12 @@ public class CommentInfoServiceImpl extends ServiceImpl<CommentInfoMapper, Comme
|
|||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<CommentInfo> getByProjectId(Long id) {
|
||||
// LambdaQueryWrapper<CommentInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||
// lambdaQueryWrapper.eq(CommentInfo::getProjectId, id);
|
||||
// List<CommentInfo> list = this.list(lambdaQueryWrapper);
|
||||
// return list;
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -16,10 +16,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 113.44.45.42:8848
|
||||
namespace: e6fc646f-719d-4642-9228-b68fb4ed42aa
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue