Compare commits
2 Commits
master
...
1126/chenz
Author | SHA1 | Date |
---|---|---|
|
f2865b8072 | |
|
b1e9c38b63 |
|
@ -0,0 +1,18 @@
|
|||
"商品ID": "Long",
|
||||
"商品图片": "String",
|
||||
"活动名称": "String",
|
||||
"活动简介": "String",
|
||||
"商品单位": "String",
|
||||
"商品的轮播图": [
|
||||
"String", "String"
|
||||
],
|
||||
"活动时间": "date",
|
||||
"策略类型": "String",
|
||||
[{
|
||||
"id" : "Long" ,
|
||||
"团购活动Id" : "Long" ,
|
||||
"规格SKU": "String" ,
|
||||
“拼团价格" :"BigDecimal",
|
||||
”拼团库存“:"Long"
|
||||
}]
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
|
||||
{ "{
|
||||
"code": 200,
|
||||
"msg": null,
|
||||
"data": {
|
||||
"id": 1,
|
||||
"teamId": null,
|
||||
"name": "手机拼团领折扣",
|
||||
"productId": 19,
|
||||
"productImage": "http://127.0.0.1:9300/statics/2024/11/18/sdfx_20241118145144A006.jpg\thttp://127.0.0.1:9300/statics/2024/11/18/mfx_20241118145150A007.jpg",
|
||||
"introduction": "好吃",
|
||||
"unit": "盒",
|
||||
"imageList": "http://127.0.0.1:9300/statics/2024/11/18/sdfx_20241118145144A006.jpg\thttp://127.0.0.1:9300/statics/2024/11/18/mfx_20241118145150A007.jpg",
|
||||
"endTime": "2024-11-19",
|
||||
"sort": 1,
|
||||
"projectSkuInfoModelList": [
|
||||
{
|
||||
"productSkuId": 2,
|
||||
"productSku": "骁龙888-8G-128G",
|
||||
"teamPrice": 1,
|
||||
"teamStock": 18
|
||||
}
|
||||
],
|
||||
"content": "",
|
||||
"status": "1",
|
||||
"strategyType": "拼团",
|
||||
"strategyId": 1
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -12,6 +12,8 @@ $.{
|
|||
"策略ID": "Long",
|
||||
"商品规格List": [ // activity_team_product_sku_info
|
||||
{
|
||||
"productId": 6,
|
||||
"teamId": 6,
|
||||
"规格SKU": "String", // activity_team_product_sku_info.product_sku
|
||||
"拼团价格": "BigDecimal",
|
||||
"拼团库存": "Long"
|
||||
|
@ -45,3 +47,6 @@ activity_team_product_sku_info.product_sku(商品SKU) <- ActivityTeamProductSkuI
|
|||
activity_team_product_sku_info.team_stock(拼团库存) <- ActivityTeamProductSkuInfo.teamStock <- @商品规格.拼团库存
|
||||
activity_team_product_sku_info.remain_stock(剩余库存) <- ActivityTeamProductSkuInfo.remainStock <- @商品规格.拼团库存
|
||||
activity_team_product_sku_info.team_price(拼团价格) <- ActivityTeamProductSkuInfo.teamPrice <- @商品规格.拼团价格
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
商城活动页 -> 商品列表
|
||||
-> 商品列表可排序筛选 商品图展示几人团
|
||||
->点击图片
|
||||
-> 展示商品详情页面 可查看拼团剩余人数,还剩下几人,剩余多少时间拼团成功
|
||||
-> 点击参与拼团
|
||||
-> 展示商品属性 选择商品属性 绑定商品信息
|
||||
|
||||
|
||||
|
||||
|
||||
商品详情页面
|
||||
显示 商品信息 商品sku
|
||||
|
||||
|
||||
支付方式
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -15,5 +15,6 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|||
public class MuYuAuthApplication {
|
||||
public static void main (String[] args) {
|
||||
SpringApplication.run(MuYuAuthApplication.class, args);
|
||||
System.out.println("auth end ");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9200
|
||||
port: 8089
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
@ -14,10 +14,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 1.94.98.9:8848
|
||||
namespace: asdasd
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 1.94.98.9:8848
|
||||
namespace: asdasd
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -13,5 +13,6 @@ import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
|
|||
public class MuYuGatewayApplication {
|
||||
public static void main (String[] args) {
|
||||
SpringApplication.run(MuYuGatewayApplication.class, args);
|
||||
System.out.println("end gateway");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
package com.muyu.gateway.config.properties;
|
||||
|
||||
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);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 8080
|
||||
port: 8081
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
@ -14,10 +14,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 1.94.98.9:8848
|
||||
namespace: asdasd
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 1.94.98.9:8848
|
||||
namespace: asdasd
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
@ -28,12 +30,12 @@ spring:
|
|||
eager: true
|
||||
transport:
|
||||
# 控制台地址
|
||||
dashboard: 127.0.0.1:8718
|
||||
dashboard: 1.94.98.9:8718
|
||||
# nacos配置持久化
|
||||
datasource:
|
||||
ds1:
|
||||
nacos:
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 1.94.98.9:8848
|
||||
dataId: sentinel-muyu-gateway
|
||||
groupId: DEFAULT_GROUP
|
||||
data-type: json
|
||||
|
|
|
@ -5,11 +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.ActivityTeamProductSkuModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuReqModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamUpdModel;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 商品拼团信息
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
@ -74,6 +80,7 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
|
||||
/**
|
||||
* 公共添加模型,转换成添加对象
|
||||
*
|
||||
* @param activityTeamInfoAddModel 添加模型
|
||||
* @return 添加对象
|
||||
*/
|
||||
|
@ -93,4 +100,21 @@ public class ActivityTeamInfo extends BaseEntity {
|
|||
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ActivityTeamInfo updModelBuild(ActivityTeamUpdModel activityTeamUpdModel) {
|
||||
return ActivityTeamInfo.builder()
|
||||
.id(activityTeamUpdModel.getId())
|
||||
.productId(activityTeamUpdModel.getProductId())
|
||||
.productImage(activityTeamUpdModel.getProductImage())
|
||||
.introduction(activityTeamUpdModel.getIntroduction())
|
||||
.unit(activityTeamUpdModel.getUnit())
|
||||
.imageList(activityTeamUpdModel.getImageList())
|
||||
.endTime(activityTeamUpdModel.getEndTime())
|
||||
.sort(activityTeamUpdModel.getSort())
|
||||
.content(activityTeamUpdModel.getContent())
|
||||
.status(activityTeamUpdModel.getStatus())
|
||||
.strategyType(activityTeamUpdModel.getStrategyType())
|
||||
.strategyId(activityTeamUpdModel.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,15 @@ package com.muyu.marketing.domain;
|
|||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 团购活动
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
@ -41,11 +44,12 @@ public class ActivityTeamOpenInfo extends BaseEntity {
|
|||
/**
|
||||
* 结束团购时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private String productId;
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品名称
|
||||
*/
|
||||
|
@ -66,4 +70,6 @@ public class ActivityTeamOpenInfo extends BaseEntity {
|
|||
* 开团状态
|
||||
*/
|
||||
private String status;
|
||||
// @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
// private Date updateTime;
|
||||
}
|
||||
|
|
|
@ -4,12 +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 com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品拼团规格
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
|
@ -50,6 +52,7 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
|
||||
/**
|
||||
* 通过模型钢构件对象
|
||||
*
|
||||
* @param activityTeamProductSkuAddModel 模型
|
||||
* @return 对象
|
||||
*/
|
||||
|
@ -60,6 +63,28 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||
.build()
|
||||
.build();
|
||||
}
|
||||
|
||||
public static ActivityTeamProductSkuInfo updModelBUild(ActivityTeamProductSkuInfoUpdModel activityTeamProductSkuModel) {
|
||||
return ActivityTeamProductSkuInfo.builder()
|
||||
.id(activityTeamProductSkuModel.getId())
|
||||
.teamStock(activityTeamProductSkuModel.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuModel.getTeamPrice())
|
||||
|
||||
.build();
|
||||
}
|
||||
public static ActivityTeamProductSkuInfo addProductBuildModel(ActivityTeamProductSkuAddModel activityTeamProductSkuAddModel) {
|
||||
return ActivityTeamProductSkuInfo.builder()
|
||||
.productId(activityTeamProductSkuAddModel.getProductId())
|
||||
.teamId(activityTeamProductSkuAddModel.getTeamId())
|
||||
.productSku(activityTeamProductSkuAddModel.getProductSku())
|
||||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.marketing.domain.dto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: d
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-27 20:48
|
||||
**/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class Deledto {
|
||||
|
||||
private List<Long> ids;
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
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 lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: l
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-27 18:59
|
||||
**/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityInfoSKuModel {
|
||||
|
||||
|
||||
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 List<Long> ids;
|
||||
|
||||
private List<ActivityTeamProductSkuModel> activityTeamProductSkuList;
|
||||
//修改
|
||||
private List<ActivityTeamProductSkuModel> activityTeamUpdModelList;
|
||||
//添加
|
||||
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
|
||||
|
||||
|
||||
// public static ActivityInfoSKuModel delSKuModel (){
|
||||
//
|
||||
// };
|
||||
}
|
|
@ -2,6 +2,8 @@ package com.muyu.marketing.domain.model;
|
|||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
|
@ -22,7 +24,6 @@ import java.util.List;
|
|||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoAddModel {
|
||||
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
|
@ -78,4 +79,29 @@ public class ActivityTeamInfoAddModel {
|
|||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
|
||||
public static ActivityTeamInfoAddModel dobuild(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.dbuild(addReq,activityTeamInfoSaveReq::getProductId)
|
||||
).toList()
|
||||
).build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,88 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 拼团活动详情模型
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamInfoDetailModel {
|
||||
private long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Long sort;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private long strategyId;
|
||||
|
||||
//查询
|
||||
public static ActivityTeamInfoDetailModel activityTeamInfoDetailModel(ActivityTeamInfo activityTeamInfo){
|
||||
return ActivityTeamInfoDetailModel.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())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: 活动商品规格修改模型
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-27 16:31
|
||||
**/
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
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 List<ActivityTeamProductSkuReqModel> activityTeamProductSkuModelList;
|
||||
private ActivityTeamInfoUpdModel activityTeamUpdSkuModel;
|
||||
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||
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())
|
||||
.activityTeamProductSkuModelList(activityTeamInfoUpdReq.getActivityTeamProductSkuList().stream().map(ActivityTeamProductSkuReqModel::activityTeamProductSkuReqModelBuild).toList())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -1,12 +1,14 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
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 +35,8 @@ public class ActivityTeamProductSkuAddModel {
|
|||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
private String productSku;
|
||||
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
|
@ -44,4 +47,14 @@ public class ActivityTeamProductSkuAddModel {
|
|||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
public static ActivityTeamProductSkuAddModel dbuild (ProjectSkuInfoAddReq projectSkuInfoAddReq, Supplier<Long> productId){
|
||||
return ActivityTeamProductSkuAddModel.builder()
|
||||
.productId(productId.get())
|
||||
.productSku(projectSkuInfoAddReq.getSku())
|
||||
.teamStock(projectSkuInfoAddReq.getTeamStock())
|
||||
.teamPrice(projectSkuInfoAddReq.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,58 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* 商品活动规格集合模型
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductSkuInfoListModel {
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
private long id;
|
||||
/**
|
||||
* 活动ID
|
||||
*/
|
||||
private long teamId;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品SKU
|
||||
*/
|
||||
private String productSku;
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
/**
|
||||
* 剩余库存
|
||||
*/
|
||||
private Long remainStock;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
public static ActivityTeamProductSkuInfoListModel infoListModel(ActivityTeamProductSkuInfo activityTeamProductSkuInfo){
|
||||
return ActivityTeamProductSkuInfoListModel.builder()
|
||||
.id(activityTeamProductSkuInfo.getId())
|
||||
.teamId(activityTeamProductSkuInfo.getTeamId())
|
||||
.productId(activityTeamProductSkuInfo.getProductId())
|
||||
.teamStock(activityTeamProductSkuInfo.getTeamStock())
|
||||
.productSku(activityTeamProductSkuInfo.getProductSku())
|
||||
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProductSkuInfoUpdModel {
|
||||
/**
|
||||
* 商品规格id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: l
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-26 21:18
|
||||
**/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
public class ActivityTeamProductSkuModel {
|
||||
/**
|
||||
* 活动规格sku修改模型
|
||||
*/
|
||||
private List<ActivityTeamProductSkuInfoUpdModel> activityTeamProductSkuModelList;
|
||||
/**
|
||||
* 活动规格id
|
||||
*/
|
||||
private List<Long> skuIdList;
|
||||
/**
|
||||
* 活动规格sku添加模型
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.marketing.domain.req.ActivityTeamProductSkuReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: sku修改模型
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-27 16:32
|
||||
**/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
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();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.muyu.marketing.domain.req.ProductSkuInfoUpdReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: l
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-27 00:43
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamSkuupdateModel {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 团购活动ID
|
||||
*/
|
||||
private Long teamId;
|
||||
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
private Long remainStock;
|
||||
public static ActivityTeamSkuupdateModel teamSkuEditBuild(ProductSkuInfoUpdReq productSkuInfoUpdReq, Supplier<Long> productId){
|
||||
return ActivityTeamSkuupdateModel.builder()
|
||||
.id(productSkuInfoUpdReq.getProductSkuId())
|
||||
.sku(productSkuInfoUpdReq.getSku())
|
||||
.teamStock(productSkuInfoUpdReq.getTeamStock())
|
||||
.teamPrice(productSkuInfoUpdReq.getTeamPrice())
|
||||
.productId(productId.get())
|
||||
.build();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamUpdReq;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: l
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-27 00:20
|
||||
**/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamUpdModel {
|
||||
private Long id;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private long sort;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private long strategyId;
|
||||
private ActivityTeamProductSkuModel activityTeamProductSkuModel;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public static ActivityTeamUpdModel activityTeamUpdReq(ActivityTeamUpdReq activityTeamInfoUpdReq){
|
||||
return ActivityTeamUpdModel.builder()
|
||||
.id(activityTeamInfoUpdReq.getId())
|
||||
.name(activityTeamInfoUpdReq.getName())
|
||||
.productId(activityTeamInfoUpdReq.getProductId())
|
||||
.introduction(activityTeamInfoUpdReq.getIntroduction())
|
||||
.unit(activityTeamInfoUpdReq.getUnit())
|
||||
.endTime(activityTeamInfoUpdReq.getEndTime())
|
||||
.imageList(activityTeamInfoUpdReq.getImageList())
|
||||
.productImage(activityTeamInfoUpdReq.getProductImage())
|
||||
.activityTeamProductSkuModel(activityTeamInfoUpdReq.getActivityTeamUpdSkuModel())
|
||||
.sort(activityTeamInfoUpdReq.getSort())
|
||||
.content(activityTeamInfoUpdReq.getContent())
|
||||
.status(activityTeamInfoUpdReq.getStatus())
|
||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: l
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-26 21:39
|
||||
**/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@SuperBuilder
|
||||
public class ActivityTeamfindidModel {
|
||||
|
||||
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 Integer sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
private String sku;
|
||||
private BigDecimal teamPrice;
|
||||
private Long teamStock;
|
||||
|
||||
public static ActivityTeamfindidModel folist(ActivityTeamProductSkuInfo activityTeamProductSkuInfo){
|
||||
return ActivityTeamfindidModel.builder()
|
||||
.productId(activityTeamProductSkuInfo.getProductId())
|
||||
.sku(activityTeamProductSkuInfo.getProductSku())
|
||||
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
||||
.build();
|
||||
|
||||
}
|
||||
}
|
|
@ -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,40 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: 活动商品规格修改入参
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-27 16:26
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
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 List<ActivityTeamProductSkuReq> activityTeamProductSkuList;
|
||||
|
||||
|
||||
private ActivityTeamProductSkuModel activityTeamProductSkuModel;
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: sku修改入参
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-27 16:27
|
||||
**/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@SuperBuilder
|
||||
public class ActivityTeamProductSkuReq {
|
||||
private Long id;
|
||||
private Long teamId;
|
||||
private Long productId;
|
||||
private String productSku;
|
||||
private Long teamStock;
|
||||
private Long remainStock;
|
||||
private BigDecimal teamPrice;
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamUpdModel;
|
||||
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamProjectSkuResp;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamUpdReq {
|
||||
|
||||
/**
|
||||
* 活动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 Integer sort;
|
||||
/**
|
||||
* 商品SkU
|
||||
*/
|
||||
private ActivityTeamProductSkuModel activityTeamUpdSkuModel;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.marketing.domain.req;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: l
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-27 00:45
|
||||
**/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ProductSkuInfoUpdReq {
|
||||
|
||||
private Long productSkuId;
|
||||
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
}
|
|
@ -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,106 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.model.ActivityTeamInfoDetailModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description:
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-26 15:20
|
||||
**/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
public class ActivityTeamDetailResp {
|
||||
private Long 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<TeamProjectSkuInfoResp> projectSkuInfoModelList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
|
||||
|
||||
public static ActivityTeamDetailResp setUpDatailResp(ActivityTeamInfoDetailModel activityTeamInfoDetailModel, Function<Long,List<TeamProjectSkuInfoResp>> teamProjectSkuInfoResp){
|
||||
return ActivityTeamDetailResp.builder()
|
||||
.id(activityTeamInfoDetailModel.getId())
|
||||
.name(activityTeamInfoDetailModel.getName())
|
||||
.productId(activityTeamInfoDetailModel.getProductId())
|
||||
.productImage(activityTeamInfoDetailModel.getProductImage())
|
||||
.introduction(activityTeamInfoDetailModel.getIntroduction())
|
||||
.unit(activityTeamInfoDetailModel.getUnit())
|
||||
.imageList(activityTeamInfoDetailModel.getImageList())
|
||||
.endTime(activityTeamInfoDetailModel.getEndTime())
|
||||
.sort(activityTeamInfoDetailModel.getSort())
|
||||
.content(activityTeamInfoDetailModel.getContent())
|
||||
.status(activityTeamInfoDetailModel.getStatus())
|
||||
.strategyType(activityTeamInfoDetailModel.getStrategyType())
|
||||
.strategyId(activityTeamInfoDetailModel.getStrategyId())
|
||||
.projectSkuInfoModelList(teamProjectSkuInfoResp.apply(activityTeamInfoDetailModel.getId()))
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: l
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-28 17:38
|
||||
**/
|
||||
|
||||
public class ActivityTeamInfoResp {
|
||||
}
|
|
@ -0,0 +1,83 @@
|
|||
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.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: 商品规格list
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-26 15:22
|
||||
**/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ActivityTeamProjectSkuResp {
|
||||
|
||||
private Long teamId;
|
||||
/**
|
||||
* 拼团名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long productId;
|
||||
/**
|
||||
* 商品活动图
|
||||
*/
|
||||
private String productImage;
|
||||
/**
|
||||
* 活动简介
|
||||
*/
|
||||
private String introduction;
|
||||
/**
|
||||
* 单位
|
||||
*/
|
||||
private String unit;
|
||||
/**
|
||||
* 轮播图
|
||||
*/
|
||||
|
||||
private String imageList;
|
||||
/**
|
||||
* 活动结束时间
|
||||
*/
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date endTime;
|
||||
/**
|
||||
* 活动排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 商品SkU集合
|
||||
*/
|
||||
private List<ActivityTeamProjectSkuResp> projectSkuInfoModelList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,47 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.muyu.marketing.domain.model.ActivityTeamProductSkuInfoListModel;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class TeamProjectSkuInfoResp {
|
||||
/**
|
||||
* 规格Id
|
||||
*/
|
||||
private Long productSkuId;
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String productSku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
public static List<TeamProjectSkuInfoResp> teamProjectSkuInfoResp(List<ActivityTeamProductSkuInfoListModel> activityTeamProductSkuInfoListModel){
|
||||
return activityTeamProductSkuInfoListModel.stream().map(teamProductSkuInfoListModel ->{
|
||||
TeamProjectSkuInfoResp skuInfoResp = TeamProjectSkuInfoResp.builder()
|
||||
.productSkuId(teamProductSkuInfoListModel.getProductId())
|
||||
.productSku(teamProductSkuInfoListModel.getProductSku())
|
||||
.teamPrice(teamProductSkuInfoListModel.getTeamPrice())
|
||||
.teamStock(teamProductSkuInfoListModel.getTeamStock())
|
||||
.build();
|
||||
return skuInfoResp;
|
||||
}).toList();
|
||||
}
|
||||
}
|
|
@ -17,6 +17,8 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
@SpringBootApplication
|
||||
public class MuYuMarketIngApplication {
|
||||
public static void main (String[] args) {
|
||||
|
||||
SpringApplication.run(MuYuMarketIngApplication.class, args);
|
||||
System.out.println("end------------");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,27 @@
|
|||
package com.muyu.marketing.team.controller;
|
||||
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
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.ActivityTeamInfoListModel;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoUpdReq;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamUpdReq;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamDetailResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
import com.muyu.marketing.domain.resp.TeamProjectSkuInfoResp;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
|
||||
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.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -26,10 +36,14 @@ import java.util.List;
|
|||
public class ActivityTeamController {
|
||||
|
||||
@Autowired
|
||||
private ActivityTeamInfoService activityTeamInfoService;;
|
||||
private ActivityTeamInfoService activityTeamInfoService;
|
||||
;
|
||||
@Autowired
|
||||
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||
|
||||
/**
|
||||
* 查询营销团购活动列表
|
||||
*
|
||||
* @param teamInfoListReq 活动查询入参
|
||||
* @return 活动响应结果
|
||||
*/
|
||||
|
@ -44,4 +58,60 @@ public class ActivityTeamController {
|
|||
}}
|
||||
);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody ActivityTeamInfoSaveReq projectSkuInfoAddReq) {
|
||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.dobuild(projectSkuInfoAddReq));
|
||||
return Result.success("ok");
|
||||
}
|
||||
|
||||
|
||||
/**id查找商品拼团活动详情
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/id/{id}")
|
||||
public Result<ActivityTeamDetailResp> findById(@PathVariable("id") Long id) {
|
||||
ActivityTeamInfoDetailModel teamInfo = activityTeamInfoService.findById(id);
|
||||
|
||||
ActivityTeamDetailResp teamInfoDetailResp = ActivityTeamDetailResp.setUpDatailResp(
|
||||
teamInfo,
|
||||
teamId -> TeamProjectSkuInfoResp.teamProjectSkuInfoResp(activityTeamProductSkuInfoService.findByTeamId(teamId))
|
||||
);
|
||||
return Result.success(teamInfoDetailResp);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**修改商品拼团活动详情
|
||||
* @param activityTeamUpdReq
|
||||
* @return
|
||||
*/
|
||||
@PutMapping
|
||||
public Result upd(@RequestBody ActivityTeamUpdReq activityTeamUpdReq){
|
||||
activityTeamInfoService.update(ActivityTeamUpdModel.activityTeamUpdReq(activityTeamUpdReq));
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/slist")
|
||||
public List<ActivityTeamInfo> select(){
|
||||
List<ActivityTeamInfo> llist = activityTeamInfoService.llist();
|
||||
return llist;
|
||||
}
|
||||
|
||||
/**
|
||||
*客户端列表
|
||||
*/
|
||||
@GetMapping("customerList")
|
||||
public Result<TableDataInfo<ActivityTeamInfo>> customerList(TeamInfoListReq teamInfoListReq){
|
||||
PageHelper.startPage(teamInfoListReq.getPageNum(), teamInfoListReq.getPageSize());
|
||||
PageInfo<ActivityTeamInfo> pageInfo = new PageInfo<>(activityTeamInfoService.list());
|
||||
TableDataInfo<ActivityTeamInfo> tableDataInfo = new TableDataInfo<>();
|
||||
tableDataInfo.setRows(pageInfo.getList());
|
||||
tableDataInfo.setTotal(pageInfo.getTotal());
|
||||
return Result.success(tableDataInfo);
|
||||
}
|
||||
|
||||
}
|
|
@ -1,27 +1,35 @@
|
|||
package com.muyu.marketing.team.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
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.model.*;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamDetailResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamProjectSkuResp;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||
|
||||
|
||||
/**
|
||||
* 通过查询模型查询团购活动列表
|
||||
* @param activityTeamInfoListQueryModel 团购活动查询模型
|
||||
* @return 团购活动列表
|
||||
*/
|
||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
||||
|
||||
/**
|
||||
* 通过添加模型,去进行商品拼团活动的操作
|
||||
* @param activityTeamInfoAddModel 团购添加模型
|
||||
*/
|
||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||
|
||||
ActivityTeamInfoDetailModel findById(Long id);
|
||||
|
||||
public void update(ActivityTeamUpdModel activityTeamUpdModelList);
|
||||
|
||||
|
||||
List<ActivityTeamInfo> llist();
|
||||
|
||||
}
|
||||
|
|
|
@ -5,8 +5,12 @@ import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
|
|||
import com.muyu.marketing.domain.ActivityTeamOpenInfo;
|
||||
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
||||
|
||||
List<ActivityTeamOpenInfo> selectlist( );
|
||||
|
||||
/**
|
||||
* 通过活动ID和开团类型查询开团数量
|
||||
* @param teamId 活动ID
|
||||
|
@ -32,4 +36,8 @@ public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenIn
|
|||
public default Long getTeamInTypeNumberByTeamId(Long teamId){
|
||||
return this.getTeamOpenNumberByTeamIdAndType(teamId, TeamOpenTypeEnum.IN_TEAM);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,10 +3,8 @@ 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.dto.Deledto;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -26,7 +24,6 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
*/
|
||||
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId);
|
||||
|
||||
|
||||
/**
|
||||
* 通过活动ID获取 剩余库存
|
||||
* @param teamId 活动ID
|
||||
|
@ -41,4 +38,16 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
|
|||
*/
|
||||
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||
|
||||
public List<ActivityTeamProductSkuInfoListModel> findByTeamId(Long teamId);
|
||||
|
||||
/** 根据业务模型进行团购批量修改
|
||||
* @param activityTeamProductSkuModelList
|
||||
* @return
|
||||
*/
|
||||
public boolean updateBath(List<ActivityTeamProductSkuInfoUpdModel> activityTeamProductSkuModelList );
|
||||
|
||||
public boolean insertinto(ActivityTeamProductSkuAddModel activityTeamProductSkuAddModel);
|
||||
|
||||
public boolean delBatch(List<Long> ids);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,24 +1,39 @@
|
|||
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.core.metadata.OrderItem;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Assert;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
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.ActivityTeamProductSkuInfo;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamDetailResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamInfoResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamProjectSkuResp;
|
||||
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 com.muyu.product.domain.AsCategoryAttribute;
|
||||
import com.muyu.product.domain.CategoryInfo;
|
||||
import com.muyu.product.domain.req.CategoryInfoEditReq;
|
||||
import org.checkerframework.checker.units.qual.A;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
@Service
|
||||
|
@ -37,7 +52,6 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
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> 以方法返回值为占用
|
||||
|
@ -47,17 +61,17 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
List<ActivityTeamInfoListModel> activityTeamInfoListModels = activityTeamInfoList.stream()
|
||||
.map(activityTeamInfo -> ActivityTeamInfoListModel.infoBuild(activityTeamInfo,
|
||||
(activityTeamInfoListModelBuilder) -> {
|
||||
TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
|
||||
// TeamProductDiscountPriceModel discountPrice = activityTeamProductSkuInfoService.getDiscountPrice(activityTeamInfo.getId());
|
||||
TeamProductStockModel teamProductStockModel = activityTeamProductSkuInfoService.getStock(activityTeamInfo.getId());
|
||||
Long teamOpenTypeNumber = activityTeamOpenInfoService.getTeamOpenTypeNumberByTeamId(activityTeamInfo.getId());
|
||||
Long teamInTypeNumber = activityTeamOpenInfoService.getTeamInTypeNumberByTeamId(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())
|
||||
// .openTeamNumber(teamOpenTypeNumber)
|
||||
// .addTeamNumber(teamInTypeNumber)
|
||||
// .attendNumber(teamOpenTypeNumber + teamInTypeNumber)
|
||||
// .teamPrice(discountPrice.getTeamPrice())
|
||||
// .productPrice(discountPrice.getProductPrice())
|
||||
.teamStock(teamProductStockModel.getTeamStock())
|
||||
.remainStock(teamProductStockModel.getRemainStock())
|
||||
.build();
|
||||
|
@ -75,14 +89,56 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
|||
*/
|
||||
@Override
|
||||
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel) {
|
||||
boolean save = this.save(ActivityTeamInfo.addModelBuild(activityTeamInfoAddModel));
|
||||
if (!save) {
|
||||
throw new ServiceException(
|
||||
StringUtils.format("团购活动添加失败:[{}]", activityTeamInfoAddModel)
|
||||
);
|
||||
|
||||
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.addModelBuild(activityTeamInfoAddModel);
|
||||
|
||||
Assert.isTrue(this.save(activityTeamInfo),StringUtils.format("不存在"),activityTeamInfoAddModel);
|
||||
|
||||
List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList = activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList();
|
||||
activityTeamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> {
|
||||
activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId());
|
||||
});
|
||||
activityTeamProductSkuInfoService.batchSave(activityTeamProductSkuAddModelList);
|
||||
}
|
||||
this.activityTeamProductSkuInfoService.batchSave(
|
||||
activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList()
|
||||
);
|
||||
|
||||
@Override
|
||||
public ActivityTeamInfoDetailModel findById(Long id) {
|
||||
return ActivityTeamInfoDetailModel.activityTeamInfoDetailModel(this.getById(id));
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean update(ActivityTeamUpdModel activityTeamUpdModelList) {
|
||||
// LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
||||
// updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice,activityTeamUpdModelList.getTeamPrice());
|
||||
// updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock,activityTeamUpdModelList.getTeamStock());
|
||||
// updateWrapper.set(ActivityTeamProductSkuInfo::getRemainStock,activityTeamUpdModelList.getRemainStock());
|
||||
// updateWrapper.eq( ActivityTeamProductSkuInfo::getId ,activityTeamUpdModelList.getId());
|
||||
//
|
||||
// return this.update(activityTeamUpdModelList);
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public void update(ActivityTeamUpdModel activityTeamUpdModel) {
|
||||
|
||||
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.updModelBuild(activityTeamUpdModel);
|
||||
//修改拼团活动表
|
||||
this.updateById(activityTeamInfo);
|
||||
//批量修改商品sku列表
|
||||
activityTeamProductSkuInfoService.updateBath(activityTeamUpdModel.getActivityTeamProductSkuModel().getActivityTeamProductSkuModelList());
|
||||
//根据活动规格批量删除
|
||||
activityTeamProductSkuInfoService.removeBatchByIds(activityTeamUpdModel.getActivityTeamProductSkuModel().getSkuIdList());
|
||||
|
||||
List<ActivityTeamProductSkuAddModel> teamProductSkuAddModelList = activityTeamUpdModel.getActivityTeamProductSkuModel().getActivityTeamProductSkuAddModelList();
|
||||
//批量添加商品规格
|
||||
activityTeamProductSkuInfoService.saveBatch(teamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::addProductBuildModel).toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActivityTeamInfo> llist() {
|
||||
|
||||
return this.list();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -8,10 +8,17 @@ import com.muyu.marketing.team.mapper.ActivityTeamOpenInfoMapper;
|
|||
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo>
|
||||
implements ActivityTeamOpenInfoService {
|
||||
|
||||
@Override
|
||||
public List<ActivityTeamOpenInfo> selectlist( ) {
|
||||
|
||||
return this.list();
|
||||
}
|
||||
/**
|
||||
* 通过活动ID和开团类型查询开团数量
|
||||
*
|
||||
|
@ -26,6 +33,4 @@ public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpe
|
|||
queryWrapper.eq(ActivityTeamOpenInfo::getTeamType, teamOpenType.code());
|
||||
return this.count(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -3,16 +3,22 @@ package com.muyu.marketing.team.service.impl;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.marketing.domain.ActivityTeamInfo;
|
||||
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.dto.Deledto;
|
||||
import com.muyu.marketing.domain.model.*;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamDetailResp;
|
||||
import com.muyu.marketing.domain.resp.ActivityTeamProjectSkuResp;
|
||||
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.AsAttributeGroup;
|
||||
import com.muyu.product.domain.AttributeGroup;
|
||||
import com.muyu.product.domain.ProjectSkuInfo;
|
||||
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;
|
||||
|
@ -80,4 +86,32 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
|
|||
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
|
||||
);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActivityTeamProductSkuInfoListModel> findByTeamId(Long teamId) {
|
||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> wrapper = new LambdaQueryWrapper<ActivityTeamProductSkuInfo>()
|
||||
.eq(ActivityTeamProductSkuInfo::getTeamId, teamId);
|
||||
List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfoList = this.list(wrapper);
|
||||
return activityTeamProductSkuInfoList.stream().
|
||||
map(ActivityTeamProductSkuInfoListModel::infoListModel)
|
||||
.toList();
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean updateBath(List<ActivityTeamProductSkuInfoUpdModel> activityTeamProductSkuModelList) {
|
||||
return this.updateBatchById(activityTeamProductSkuModelList.stream().map(ActivityTeamProductSkuInfo::updModelBUild).toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delBatch(List<Long> ids) {
|
||||
this.removeBatchByIds(ids);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean insertinto(ActivityTeamProductSkuAddModel activityTeamProductSkuAddModel) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -8,7 +8,10 @@ import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
|||
import com.muyu.marketing.team.service.TeamStrategyExemptionHundredService;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 百人
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred>
|
||||
implements TeamStrategyExemptionHundredService {
|
||||
|
|
|
@ -5,7 +5,10 @@ import com.muyu.marketing.domain.TeamStrategyExemptionOrdinary;
|
|||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionOrdinaryMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionOrdinaryService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 普通
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary>
|
||||
implements TeamStrategyExemptionOrdinaryService {
|
||||
|
|
|
@ -5,7 +5,10 @@ import com.muyu.marketing.domain.TeamStrategyExemption;
|
|||
import com.muyu.marketing.team.mapper.TeamStrategyExemptionMapper;
|
||||
import com.muyu.marketing.team.service.TeamStrategyExemptionService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 免单
|
||||
*
|
||||
*/
|
||||
@Service
|
||||
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption>
|
||||
implements TeamStrategyExemptionService {
|
||||
|
|
|
@ -0,0 +1,39 @@
|
|||
package com.muyu.marketing.team.sragety;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: 团活动策略
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-29 20:03
|
||||
**/
|
||||
|
||||
public interface AcitivtyTeamStrategy {
|
||||
|
||||
|
||||
/**开团
|
||||
* @param activityTeamId
|
||||
*/
|
||||
public void openTeam(Long activityTeamId);
|
||||
|
||||
/**申请加团
|
||||
* @param teamId
|
||||
*/
|
||||
public void applyTeam(Long teamId);
|
||||
|
||||
/**参团
|
||||
* @param teamId
|
||||
* @param TeamNumber
|
||||
*/
|
||||
public void addTeam(Long teamId, String TeamNumber);
|
||||
|
||||
|
||||
/**退团
|
||||
* @param teamId
|
||||
*/
|
||||
public void backTeam(Long teamId);
|
||||
|
||||
/**结算团
|
||||
* @param teamId
|
||||
*/
|
||||
public void settle(Long teamId);
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.muyu.marketing.team.sragety.impl;
|
||||
|
||||
import com.muyu.common.core.exception.ServiceException;
|
||||
import com.muyu.common.core.utils.SpringUtils;
|
||||
import com.muyu.marketing.team.sragety.AcitivtyTeamStrategy;
|
||||
import org.springframework.context.annotation.Primary;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* @program: daiseven-dong
|
||||
* @description: 团购执行器
|
||||
* @author: CuiFu Bo
|
||||
* @create: 2024-11-29 20:34
|
||||
**/
|
||||
@Service
|
||||
@Primary
|
||||
public class ActivityTeamStrategyImpl implements AcitivtyTeamStrategy {
|
||||
|
||||
|
||||
@Override
|
||||
public void openTeam(Long activityTeamId) {
|
||||
String activityTeamType = null;
|
||||
if (activityTeamId == null) {
|
||||
throw new ServiceException("activityTeamId is null");
|
||||
}else if (activityTeamId == 0) {
|
||||
activityTeamType = "team-strategy-exemption";
|
||||
}else if (activityTeamId == 1) {
|
||||
activityTeamType = "team-strategy-hundred";
|
||||
}else if (activityTeamId == 2) {
|
||||
activityTeamType = "team-strategy-ordinary";
|
||||
}
|
||||
AcitivtyTeamStrategy activityTeamStrategy = SpringUtils.getBean(activityTeamType);
|
||||
activityTeamStrategy.openTeam(activityTeamId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void applyTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addTeam(Long teamId, String TeamNumber) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void backTeam(Long teamId) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void settle(Long teamId) {
|
||||
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9209
|
||||
port: 9256
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
@ -14,15 +14,19 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 1.94.98.9:8848
|
||||
namespace: asdasd
|
||||
group: DEFAULT_GROUP
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 1.94.98.9:8848
|
||||
namespace: asdasd
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
shared-configs:
|
||||
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
|
||||
group: DEFAULT_GROUP
|
||||
logging:
|
||||
level:
|
||||
com.muyu.marketing.mapper: DEBUG
|
||||
|
|
|
@ -46,6 +46,7 @@ public class AttributeGroupSaveModel extends BaseEntity {
|
|||
.build();
|
||||
}
|
||||
|
||||
|
||||
public AttributeGroup buildAttributeGroup () {
|
||||
return AttributeGroup.builder()
|
||||
.name(this.getName())
|
||||
|
|
|
@ -68,16 +68,16 @@ public class AttributeGroupController extends BaseController {
|
|||
util.exportExcel(response, list, "属性组数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取属性组详细信息
|
||||
*/
|
||||
@ApiOperation("获取属性组详细信息")
|
||||
@RequiresPermissions("product:attributeGroup:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<AttributeGroupUpdResp> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(attributeGroupService.getUpdById(id));
|
||||
}
|
||||
// /**
|
||||
// * 获取属性组详细信息
|
||||
// */
|
||||
// @ApiOperation("获取属性组详细信息")
|
||||
// @RequiresPermissions("product:attributeGroup:query")
|
||||
// @GetMapping(value = "/{id}")
|
||||
// @ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
// public Result<AttributeGroupUpdResp> getInfo(@PathVariable("id") Long id) {
|
||||
// return Result.success(attributeGroupService.getUpdById(id));
|
||||
// }
|
||||
|
||||
/**
|
||||
* 新增属性组
|
||||
|
@ -92,17 +92,33 @@ public class AttributeGroupController extends BaseController {
|
|||
);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * 修改属性组
|
||||
// */
|
||||
// @RequiresPermissions("product:attributeGroup:edit")
|
||||
// @Log(title = "属性组", businessType = BusinessType.UPDATE)
|
||||
// @PutMapping("/{id}")
|
||||
// @ApiOperation("修改属性组")
|
||||
// public Result<String> edit(@PathVariable Long id, @RequestBody AttributeGroupEditReq attributeGroupEditReq) {
|
||||
//
|
||||
// return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq)));
|
||||
//// return attributeGroupService.updatebyidTwo(id,attributeGroupEditReq);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 修改属性组
|
||||
*/
|
||||
@RequiresPermissions("product:attributeGroup:edit")
|
||||
@Log(title = "属性组", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@PutMapping("")
|
||||
@ApiOperation("修改属性组")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody AttributeGroupEditReq attributeGroupEditReq) {
|
||||
return toAjax(attributeGroupService.updateById(AttributeGroup.editBuild(id,attributeGroupEditReq)));
|
||||
public Result<String> edit(@PathVariable Integer[] attrbuIdList, @RequestBody AttributeGroup attributeGroup) {
|
||||
return attributeGroupService.upd(attrbuIdList, attributeGroup);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 删除属性组
|
||||
*/
|
||||
|
@ -114,4 +130,18 @@ public class AttributeGroupController extends BaseController {
|
|||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(attributeGroupService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("changeStatus")
|
||||
public Result editStatus(@RequestBody AttributeGroup attributeGroup){
|
||||
|
||||
return toAjax(attributeGroupService.changeStatus(attributeGroup));
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/{id}")
|
||||
public Result<AttributeGroupPageResp> findById(@PathVariable Long id){
|
||||
return attributeGroupService.findById(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;
|
||||
|
@ -108,4 +109,13 @@ public class CommentInfoController extends BaseController {
|
|||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(commentInfoService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
//根据商品id查找评论
|
||||
@GetMapping("/find/{proudctId}")
|
||||
public List<CommentInfo> find(@PathVariable Integer proudctId){
|
||||
|
||||
List<CommentInfo> findddd = commentInfoService.findddd(proudctId);
|
||||
return findddd;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -130,4 +130,7 @@ public class ProjectSkuInfoController extends BaseController {
|
|||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(projectSkuInfoService.removeBatchByIds(ids));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -12,4 +12,5 @@ import com.muyu.product.domain.AttributeGroup;
|
|||
*/
|
||||
public interface AttributeGroupMapper extends BaseMapper<AttributeGroup> {
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,11 +2,13 @@ package com.muyu.product.service;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
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.resp.AttributeGroupPageResp;
|
||||
import com.muyu.product.domain.resp.AttributeGroupUpdResp;
|
||||
|
||||
|
@ -46,4 +48,17 @@ public interface AttributeGroupService extends IService<AttributeGroup> {
|
|||
* @return
|
||||
*/
|
||||
AttributeGroupUpdResp getUpdById(Long id);
|
||||
|
||||
|
||||
/**修改属性组状态
|
||||
* @param attributeGroup
|
||||
* @return
|
||||
*/
|
||||
int changeStatus(AttributeGroup attributeGroup);
|
||||
|
||||
Result<String> updatebyidTwo(Long id, AttributeGroupEditReq attributeGroupEditReq);
|
||||
|
||||
Result<String> upd(Integer[] ids, AttributeGroup attributeGroup);
|
||||
|
||||
Result<AttributeGroupPageResp> findById(Long id);
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@ package com.muyu.product.service;
|
|||
import java.util.List;
|
||||
import com.muyu.product.domain.CommentInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
/**
|
||||
* 商品评论Service接口
|
||||
|
@ -18,5 +19,5 @@ public interface CommentInfoService extends IService<CommentInfo> {
|
|||
* @return 商品评论集合
|
||||
*/
|
||||
public List<CommentInfo> list(CommentInfo commentInfo);
|
||||
|
||||
List<CommentInfo> findddd( Integer proudctId);
|
||||
}
|
||||
|
|
|
@ -3,14 +3,17 @@ package com.muyu.product.service.impl;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
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.resp.AttributeGroupPageResp;
|
||||
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 +41,10 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
|||
@Autowired
|
||||
private AttributeInfoService attributeInfoService;
|
||||
|
||||
@Autowired
|
||||
private AttributeGroupMapper attributeGroupMapper;
|
||||
@Autowired
|
||||
private AsAttributeGroupMapper asAttributeGroupMapper;
|
||||
/**
|
||||
* 分页查询
|
||||
*
|
||||
|
@ -126,4 +133,40 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
|||
.attributeList(attributeInfoList)
|
||||
.build();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int changeStatus(AttributeGroup attributeGroup) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> updatebyidTwo(Long id, AttributeGroupEditReq attributeGroupEditReq) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<String> upd(Integer[] ids, AttributeGroup attributeGroup) {
|
||||
//修改属性组
|
||||
attributeGroupMapper.updateById(attributeGroup);
|
||||
//删除属性与组中间表 as_attribute_group
|
||||
LambdaQueryWrapper<AsAttributeGroup> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(AsAttributeGroup::getGroupId,attributeGroup.getId());
|
||||
asAttributeGroupMapper.delete(queryWrapper);
|
||||
//添加属性与组中间表 as_attribute_group
|
||||
// for (Integer id : ids) {
|
||||
// attributeGroupMapper.saveAsAttributeGroup(attributeGroup.getId(),id);
|
||||
// }
|
||||
return Result.success("修改成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<AttributeGroupPageResp> findById(Long id) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public Result<AttributeGroupPageResp> findById(Long id) {
|
||||
// attributeGroupMapper.find
|
||||
// return null;
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -54,4 +54,12 @@ public class CommentInfoServiceImpl extends ServiceImpl<CommentInfoMapper, Comme
|
|||
|
||||
return list(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CommentInfo> findddd(Integer proudctId) {
|
||||
LambdaQueryWrapper<CommentInfo> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(CommentInfo::getProjectId,proudctId);
|
||||
List<CommentInfo> list = this.list(wrapper);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9302
|
||||
port: 9333
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
@ -14,10 +14,12 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 1.94.98.9:8848
|
||||
namespace: asdasd
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 1.94.98.9:8848
|
||||
namespace: asdasd
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9201
|
||||
port: 9296
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
@ -14,10 +14,13 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 1.94.98.9:8848
|
||||
namespace: asdasd
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 1.94.98.9:8848
|
||||
namespace: asdasd
|
||||
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue