Compare commits

...

12 Commits

Author SHA1 Message Date
donghongyang ba04016a1b feat(): 更改信息 2024-12-04 09:39:20 +08:00
donghongyang b4c8992164 feat(): 更改信息 2024-12-01 10:18:34 +08:00
donghongyang 917e764c38 feat(): 更改信息 2024-11-30 12:10:01 +08:00
donghongyang a91ea7b02e Merge remote-tracking branch 'origin/1127/donghongyang' into 1127/donghongyang
# Conflicts:
#	muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/controller/ActivityTeamController.java
2024-11-30 12:08:38 +08:00
donghongyang 2ec5822072 feat(): 更改信息 2024-11-30 12:08:26 +08:00
donghongyang 2e3572ef7c feat(): 更改信息 2024-11-30 12:06:39 +08:00
donghongyang 0a5e8071d1 feat(): 更改信息 2024-11-30 11:58:52 +08:00
donghongyang 62efa5e9de feat(): 完善修改功能 2024-11-29 16:48:28 +08:00
86182 8e2b8532f9 fit(): 增加规格修改功能 2024-11-28 00:42:43 +08:00
86182 b0f4774e89 fit(): 增加规格修改功能 2024-11-28 00:42:31 +08:00
86182 8c5fba2ea9 feat(): 更改详情和添加的规范性 2024-11-27 14:28:41 +08:00
86182 e5597f3b49 feat(): 活动添加和回显方法实现 2024-11-27 00:53:13 +08:00
49 changed files with 1249 additions and 61 deletions

View File

@ -0,0 +1,35 @@
$.{
"活动ID":"Long",
"商品ID":"Long", //activity_team_info.product_id
"商品图片":"String",
"活动名称":"String",
"活动简介":"String",
"商品单位":"String",
"商品的轮播图":[
"String",
"String"
],
"活动时间":"date",
"策略类型":"String",
"策略ID":"Long",
"商品规格":{
"商品规格List":[ // activity_team_product_sku_info
{
"规格Id":"Long",
"商品价格":"BigDecimal", // activity_team_product_sku_info.product_sku
"拼团价格":"BigDecimal",
"拼团库存":"Long" // 若是只修改库存可以直接写一个单独的修改库存接口
}
],
"删除商品规格IdList":["Long","Long"],
"删除商品规格IdList":[
"商品SKU": "String",
"商品价格":"BigDecimal",
"拼团价格":"BigDecimal",
"拼团库存":"Long" // 若是只修改库存可以直接写一个单独的修改库存接口
]
},
"状态":"String" //需要判断该商品是否已开启秒杀状态 若开启禁止修改 未开启则可以修改
"排序":"Integer",
"详情":"String"
}

View File

@ -0,0 +1,16 @@
1.
2.
3.
4. (,)
4.1
4.2
4.3
4.4
4.
4.1
4.2
1.

View File

@ -0,0 +1,25 @@
$.{
"活动ID": "Long",
"商品ID": "Long", //activity_team_info.product_id
"商品图片": "String",
"活动名称": "String",
"活动简介": "String",
"商品单位": "String",
"商品的轮播图": [
"String", "String"
],
"活动时间": "date",
"策略类型": "String",
"策略ID": "Long",
"商品规格List": [ // activity_team_product_sku_info
{
"规格Id": "Long",
"规格SKU": "String", // activity_team_product_sku_info.product_sku
"拼团价格": "BigDecimal",
"拼团库存": "Long"
}
],
"排序": "Integer",
"详情": "String"
}

View File

@ -11,10 +11,7 @@ import com.muyu.common.security.service.TokenService;
import com.muyu.common.security.utils.SecurityUtils; import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.common.system.domain.LoginUser; import com.muyu.common.system.domain.LoginUser;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -24,6 +21,7 @@ import javax.servlet.http.HttpServletRequest;
* @author muyu * @author muyu
*/ */
@RestController @RestController
public class TokenController { public class TokenController {
@Autowired @Autowired
private TokenService tokenService; private TokenService tokenService;

View File

@ -14,10 +14,12 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -0,0 +1,53 @@
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);
};
}
}

View File

@ -14,10 +14,12 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -14,10 +14,12 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -14,10 +14,12 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -14,10 +14,12 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
amespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -3,12 +3,18 @@ package com.muyu.marketing.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.web.domain.BaseEntity; import com.muyu.common.core.web.domain.BaseEntity;
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel; import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
import com.muyu.marketing.domain.model.ActivityTeamInfoModel;
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
import lombok.*; import lombok.*;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
import java.util.List;
@Data @Data
@SuperBuilder @SuperBuilder
@ -22,7 +28,7 @@ public class ActivityTeamInfo extends BaseEntity {
* *
*/ */
@TableId(value = "id", type = IdType.AUTO) @TableId(value = "id", type = IdType.AUTO)
private long id; private Long id;
/** /**
* *
*/ */
@ -50,11 +56,13 @@ public class ActivityTeamInfo extends BaseEntity {
/** /**
* *
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime; private Date endTime;
/** /**
* *
*/ */
private long sort; private Long sort;
/** /**
* *
*/ */
@ -70,7 +78,11 @@ public class ActivityTeamInfo extends BaseEntity {
/** /**
* ID * ID
*/ */
private long strategyId; private Long strategyId;
/**
*
*/
/** /**
* *
@ -93,4 +105,21 @@ public class ActivityTeamInfo extends BaseEntity {
.strategyId(activityTeamInfoAddModel.getStrategyId()) .strategyId(activityTeamInfoAddModel.getStrategyId())
.build(); .build();
} }
public static ActivityTeamInfo addTeamInfoModelBuild(ActivityTeamInfoModel activityTeamInfoModel) {
return ActivityTeamInfo.builder()
.name(activityTeamInfoModel.getName())
.productId(activityTeamInfoModel.getProductId())
.productImage(activityTeamInfoModel.getProductImage())
.introduction(activityTeamInfoModel.getIntroduction())
.unit(activityTeamInfoModel.getUnit())
.imageList(activityTeamInfoModel.getImageList())
.endTime(activityTeamInfoModel.getEndTime())
.sort(activityTeamInfoModel.getSort())
.content(activityTeamInfoModel.getContent())
.status(activityTeamInfoModel.getStatus())
.strategyType(activityTeamInfoModel.getStrategyType())
.strategyId(activityTeamInfoModel.getStrategyId())
.build();
}
} }

View File

@ -3,9 +3,11 @@ package com.muyu.marketing.domain;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.web.domain.BaseEntity; import com.muyu.common.core.web.domain.BaseEntity;
import lombok.*; import lombok.*;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date; import java.util.Date;
@ -41,6 +43,8 @@ public class ActivityTeamOpenInfo extends BaseEntity {
/** /**
* *
*/ */
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime; private Date endTime;
/** /**
* ID * ID

View File

@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.muyu.common.core.web.domain.BaseEntity; import com.muyu.common.core.web.domain.BaseEntity;
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel; import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
import lombok.*; import lombok.*;
import lombok.experimental.SuperBuilder; import lombok.experimental.SuperBuilder;
@ -48,6 +49,7 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
*/ */
private BigDecimal teamPrice; private BigDecimal teamPrice;
/** /**
* *
* @param activityTeamProductSkuAddModel * @param activityTeamProductSkuAddModel
@ -60,6 +62,14 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
.teamStock(activityTeamProductSkuAddModel.getTeamStock()) .teamStock(activityTeamProductSkuAddModel.getTeamStock())
.remainStock(activityTeamProductSkuAddModel.getTeamStock()) .remainStock(activityTeamProductSkuAddModel.getTeamStock())
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice()) .teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
.build() .build();
}
public static ActivityTeamProductSkuInfo skuUpdModel(ActivityTeamProductSkuModel activityTeamProductSkuModel) {
return ActivityTeamProductSkuInfo.builder()
.id(activityTeamProductSkuModel.getId())
.teamStock(activityTeamProductSkuModel.getTeamStock())
.teamPrice(activityTeamProductSkuModel.getTeamPrice())
.build();
} }
} }

View File

@ -15,7 +15,7 @@ import java.util.function.Supplier;
/** /**
* *
* *
* @author DongZeLiang * @author
* @date 2024-11-26 09:38 * @date 2024-11-26 09:38
*/ */
@Data @Data
@ -48,7 +48,6 @@ public class ActivityTeamInfoAddModel {
/** /**
* *
*/ */
private String imageList; private String imageList;
/** /**
* *
@ -58,7 +57,7 @@ public class ActivityTeamInfoAddModel {
/** /**
* *
*/ */
private Integer sort; private Long sort;
/** /**
* SkU * SkU
*/ */

View File

@ -0,0 +1,101 @@
package com.muyu.marketing.domain.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.marketing.domain.ActivityTeamInfo;
import com.muyu.marketing.domain.resp.ActivityTeamProductSkuResp;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.Date;
import java.util.List;
/**
*
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ActivityTeamInfoDatailModel {
/**
* Id
*/
private Long id;
/**
*
*/
private String name;
/**
* ID
*/
private Long productId;
/**
*
*/
private String productImage;
/**
*
*/
private String introduction;
/**
*
*/
private String unit;
/**
*
*/
private String imageList;
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
private Date endTime;
/**
*
*/
private Long sort;
/**
* SkU
*/
private List<ActivityTeamProductSkuModel> activityTeamProductSkuList;
/**
*
*/
private String content;
/**
*
*/
private String status;
/**
*
*/
private String strategyType;
/**
* ID
*/
private Long strategyId;
public static ActivityTeamInfoDatailModel DatailModel(ActivityTeamInfo activityTeamInfo, List<ActivityTeamProductSkuModel> teamInfoSkuListModelList) {
return ActivityTeamInfoDatailModel.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())
.activityTeamProductSkuList(teamInfoSkuListModelList)
.content(activityTeamInfo.getContent())
.status(activityTeamInfo.getStatus())
.strategyType(activityTeamInfo.getStrategyType())
.strategyId(activityTeamInfo.getStrategyId())
.build();
}
}

View File

@ -12,7 +12,7 @@ import java.util.function.Function;
/** /**
* *
* @author DongZeLiang * @author
* @date 2024-11-20 14:18:10 * @date 2024-11-20 14:18:10
*/ */
@Data @Data

View File

@ -9,7 +9,7 @@ import lombok.experimental.SuperBuilder;
/** /**
* *
* @author DongZeLiang * @author
* @date 2024-11-20 14:18:10 * @date 2024-11-20 14:18:10
*/ */
@Data @Data

View File

@ -0,0 +1,100 @@
package com.muyu.marketing.domain.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.muyu.marketing.domain.req.ActivityTeamProductReq;
import com.muyu.marketing.domain.req.ActivityTeamProductUpdReq;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.Date;
/**
*
*/
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
public class ActivityTeamInfoModel {
/**
*
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
*
*/
private String name;
/**
* ID
*/
private long productId;
/**
*
*/
private String productImage;
/**
*
*/
private String introduction;
/**
*
*/
private String unit;
/**
*
*/
private String imageList;
/**
*
*/
private Date endTime;
/**
*
*/
private Long sort;
/**
*
*/
private String content;
/**
*
*/
private String status;
/**
*
*/
private String strategyType;
/**
* ID
*/
private Long strategyId;
/**
*
*/
private ActivityTeamProductUpdModel activityTeamProductUpdModel;
public static ActivityTeamInfoModel activityTeamBuilder(ActivityTeamProductReq activityTeamProductReq) {
return ActivityTeamInfoModel.builder()
.id(activityTeamProductReq.getId())
.name(activityTeamProductReq.getName())
.productId(activityTeamProductReq.getProductId())
.productImage(activityTeamProductReq.getProductImage())
.introduction(activityTeamProductReq.getIntroduction())
.unit(activityTeamProductReq.getUnit())
.imageList(activityTeamProductReq.getImageList())
.endTime(activityTeamProductReq.getEndTime())
.sort(activityTeamProductReq.getSort())
.content(activityTeamProductReq.getContent())
.status(activityTeamProductReq.getStatus())
.strategyType(activityTeamProductReq.getStrategyType())
.strategyId(activityTeamProductReq.getProductId())
.activityTeamProductUpdModel(ActivityTeamProductUpdModel.teamProductBuilder(activityTeamProductReq.getActivityTeamProductUpdReq()))
.build();
}
}

View File

@ -0,0 +1,62 @@
package com.muyu.marketing.domain.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.marketing.domain.ActivityTeamInfo;
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import java.util.function.Function;
/**
* Id
* @author
* @date 2024-11-20 14:18:10
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ActivityTeamInfoSkuListModel {
/**
* Id
*/
private Long teamId;
/**
* Id
*/
private Long productId;
/**
* SKU
*/
private String sku;
/**
*
*/
private BigDecimal teamPrice;
/**
*
*/
private Long teamStock;
public static ActivityTeamProductSkuModel skuByIdModel(ActivityTeamProductSkuInfo activityTeamProductSkuInfo) {
return ActivityTeamProductSkuModel.builder()
.teamId(activityTeamProductSkuInfo.getTeamId())
.productId(activityTeamProductSkuInfo.getProductId())
.sku(activityTeamProductSkuInfo.getProductSku())
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
.teamStock(activityTeamProductSkuInfo.getTeamStock())
.build();
}
}

View File

@ -8,13 +8,12 @@ import lombok.Data;
import lombok.NoArgsConstructor; import lombok.NoArgsConstructor;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.function.Function;
import java.util.function.Supplier; import java.util.function.Supplier;
/** /**
* spu * spu
* *
* @author DongZeLiang * @author
* @date 2024-11-26 09:36 * @date 2024-11-26 09:36
*/ */
@Data @Data
@ -56,4 +55,5 @@ public class ActivityTeamProductSkuAddModel {
.teamPrice(teamProjectSkuInfoAddReq.getTeamPrice()) .teamPrice(teamProjectSkuInfoAddReq.getTeamPrice())
.build(); .build();
} }
} }

View File

@ -0,0 +1,47 @@
package com.muyu.marketing.domain.model;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.math.BigDecimal;
/**
*
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ActivityTeamProductSkuModel {
/**
* Id
*/
private Long id;
/**
* ID
*/
private Long teamId;
/**
* ID
*/
private Long productId;
/**
* SKU
*/
private String sku;
/**
*
*/
private BigDecimal teamPrice;
/**
*
*/
private Long teamStock;
}

View File

@ -0,0 +1,40 @@
package com.muyu.marketing.domain.model;
import com.muyu.marketing.domain.req.ActivityTeamProductUpdReq;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
/**
*
*/
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
public class ActivityTeamProductUpdModel {
/**
*
*/
private List<ActivityTeamProductSkuModel> activityTeamProductSkuUpdModelList;
/**
*
*/
private List<Long> ids;
/**
*
*/
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
public static ActivityTeamProductUpdModel teamProductBuilder(ActivityTeamProductUpdReq activityTeamProductUpdReq) {
return ActivityTeamProductUpdModel.builder()
.activityTeamProductSkuUpdModelList(activityTeamProductUpdReq.getActivityTeamProductSkuUpdModelList())
.ids(activityTeamProductUpdReq.getIds())
.activityTeamProductSkuAddModelList(activityTeamProductUpdReq.getActivityTeamProductSkuAddModelList())
.build();
}
}

View File

@ -12,7 +12,7 @@ import java.math.RoundingMode;
/** /**
* *
* *
* @author DongZeLiang * @author
* @date 2024-11-21 11:57 * @date 2024-11-21 11:57
*/ */
@Data @Data
@ -44,7 +44,7 @@ public class TeamProductDiscountPriceModel {
* @return * @return
*/ */
public static TeamProductDiscountPriceModel of(BigDecimal productPrice, BigDecimal teamPrice) { public static TeamProductDiscountPriceModel of(BigDecimal productPrice, BigDecimal teamPrice) {
TeamProductDiscountPriceModel.builder() return TeamProductDiscountPriceModel.builder()
.productPrice(productPrice) .productPrice(productPrice)
.teamPrice(teamPrice) .teamPrice(teamPrice)
.discount( .discount(

View File

@ -9,7 +9,7 @@ import lombok.NoArgsConstructor;
/** /**
* *
* *
* @author DongZeLiang * @author
* @date 2024-11-21 14:04 * @date 2024-11-21 14:04
*/ */
@Data @Data

View File

@ -0,0 +1,10 @@
package com.muyu.marketing.domain.req;
import com.muyu.marketing.domain.ActivityTeamInfo;
import lombok.Data;
@Data
public class ActivityTeamInfoReq extends ActivityTeamInfo {
private Integer pageNum=1;
private Integer pageSize=2;
}

View File

@ -11,6 +11,9 @@ import lombok.experimental.SuperBuilder;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@Data @Data
@SuperBuilder @SuperBuilder
@NoArgsConstructor @NoArgsConstructor
@ -51,7 +54,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
/** /**
* *
*/ */
private Integer sort; private Long sort;
/** /**
* SkU * SkU
*/ */
@ -72,4 +75,5 @@ public class ActivityTeamInfoSaveReq extends BaseEntity {
* ID * ID
*/ */
private Long strategyId; private Long strategyId;
} }

View File

@ -0,0 +1,77 @@
package com.muyu.marketing.domain.req;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.muyu.marketing.domain.model.ActivityTeamInfoModel;
import com.muyu.marketing.domain.model.ActivityTeamProductUpdModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.Date;
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
public class ActivityTeamProductReq {
/**
*
*/
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/**
*
*/
private String name;
/**
* ID
*/
private long productId;
/**
*
*/
private String productImage;
/**
*
*/
private String introduction;
/**
*
*/
private String unit;
/**
*
*/
private String imageList;
/**
*
*/
private Date endTime;
/**
*
*/
private Long sort;
/**
*
*/
private String content;
/**
*
*/
private String status;
/**
*
*/
private String strategyType;
/**
* ID
*/
private Long strategyId;
/**
*
*/
private ActivityTeamProductUpdReq activityTeamProductUpdReq;
}

View File

@ -0,0 +1,30 @@
package com.muyu.marketing.domain.req;
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import java.util.List;
@Data
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
public class ActivityTeamProductUpdReq {
/**
*
*/
private List<ActivityTeamProductSkuModel> activityTeamProductSkuUpdModelList;
/**
*
*/
private List<Long> ids;
/**
*
*/
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
}

View File

@ -3,9 +3,10 @@ package com.muyu.marketing.domain.req;
import com.muyu.common.core.web.page.PageDomain; import com.muyu.common.core.web.page.PageDomain;
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel; import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
import lombok.*; import lombok.*;
import lombok.experimental.SuperBuilder;
@Data @Data
@Builder @SuperBuilder
@NoArgsConstructor @NoArgsConstructor
@AllArgsConstructor @AllArgsConstructor
@EqualsAndHashCode(callSuper = true) @EqualsAndHashCode(callSuper = true)
@ -21,7 +22,6 @@ public class TeamInfoListReq extends PageDomain {
*/ */
private String status; private String status;
/** /**
* *
* @return * @return

View File

@ -0,0 +1,129 @@
package com.muyu.marketing.domain.resp;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.marketing.domain.model.ActivityTeamInfoDatailModel;
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel;
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
*
*
* @author
* @date 2024-11-26 09:38
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ActivityTeamInfoDatailResp {
/**
* Id
*/
private Long id;
/**
*
*/
private String name;
/**
* ID
*/
private Long productId;
/**
*
*/
private String productImage;
/**
*
*/
private String introduction;
/**
*
*/
private String unit;
/**
*
*/
private String imageList;
/**
*
*/
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
private Date endTime;
/**
*
*/
private Long sort;
/**
* SkU
*/
private List<ActivityTeamProductSkuResp> activityTeamProductSkuList;
/**
*
*/
private String content;
/**
*
*/
private String status;
/**
*
*/
private String strategyType;
/**
* ID
*/
private Long strategyId;
public static ActivityTeamInfoDatailResp findRespBuild (ActivityTeamInfoDatailResp activityTeamInfoDatailResp){
return ActivityTeamInfoDatailResp.builder()
.name(activityTeamInfoDatailResp.getName())
.productId(activityTeamInfoDatailResp.getProductId())
.productImage(activityTeamInfoDatailResp.getProductImage())
.introduction(activityTeamInfoDatailResp.getIntroduction())
.unit(activityTeamInfoDatailResp.getUnit())
.imageList(activityTeamInfoDatailResp.getImageList())
.endTime(activityTeamInfoDatailResp.getEndTime())
.sort(activityTeamInfoDatailResp.getSort())
.content(activityTeamInfoDatailResp.getContent())
.status(activityTeamInfoDatailResp.getStatus())
.strategyType(activityTeamInfoDatailResp.getStrategyType())
.strategyId(activityTeamInfoDatailResp.getStrategyId())
.activityTeamProductSkuList(
activityTeamInfoDatailResp.getActivityTeamProductSkuList()
.stream()
.map(findResp -> ActivityTeamProductSkuResp.addReqBuild(findResp, activityTeamInfoDatailResp::getProductId))
.toList()
).build();
}
public static ActivityTeamInfoDatailResp datailRespBuilder(ActivityTeamInfoDatailModel datailModel,List<ActivityTeamProductSkuResp> activityTeamProductSkuResps ) {
return ActivityTeamInfoDatailResp.builder()
.id(datailModel.getId())
.name(datailModel.getName())
.productId(datailModel.getProductId())
.productImage(datailModel.getProductImage())
.introduction(datailModel.getIntroduction())
.unit(datailModel.getUnit())
.imageList(datailModel.getImageList())
.endTime(datailModel.getEndTime())
.sort(datailModel.getSort())
.status(datailModel.getStatus())
.content(datailModel.getContent())
.strategyType(datailModel.getStrategyType())
.strategyId(datailModel.getStrategyId())
.activityTeamProductSkuList(activityTeamProductSkuResps)
.build();
}
}

View File

@ -0,0 +1,77 @@
package com.muyu.marketing.domain.resp;
import com.muyu.marketing.domain.model.ActivityTeamProductSkuModel;
import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Supplier;
/**
* spu
*
* @author
* @date 2024-11-26 09:36
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ActivityTeamProductSkuResp {
/**
* Id
*/
private Long id;
/**
* ID
*/
private Long teamId;
/**
* ID
*/
private Long productId;
/**
* SKU
*/
private String sku;
/**
*
*/
private BigDecimal teamPrice;
/**
*
*/
private Long teamStock;
public static ActivityTeamProductSkuResp addReqBuild(ActivityTeamProductSkuResp activityTeamProductSkuResp, Supplier<Long> productId){
return ActivityTeamProductSkuResp.builder()
.productId(productId.get())
.sku(activityTeamProductSkuResp.getSku())
.teamStock(activityTeamProductSkuResp.getTeamStock())
.teamPrice(activityTeamProductSkuResp.getTeamPrice())
.build();
}
public static ActivityTeamProductSkuResp skuRespbuilder(ActivityTeamProductSkuModel activityTeamProductSkuModel) {
return ActivityTeamProductSkuResp.builder()
.id(activityTeamProductSkuModel.getId())
.productId(activityTeamProductSkuModel.getProductId())
.sku(activityTeamProductSkuModel.getSku())
.teamStock(activityTeamProductSkuModel.getTeamStock())
.teamStock(activityTeamProductSkuModel.getTeamStock())
.teamPrice(activityTeamProductSkuModel.getTeamPrice())
.build();
}
}

View File

@ -1,19 +1,21 @@
package com.muyu.marketing.team.controller; 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.domain.Result;
import com.muyu.common.core.web.page.TableDataInfo; 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.ActivityTeamInfoAddModel;
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel; import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
import com.muyu.marketing.domain.req.ActivityTeamInfoReq;
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq; import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
import com.muyu.marketing.domain.req.TeamInfoListReq; import com.muyu.marketing.domain.req.TeamInfoListReq;
import com.muyu.marketing.domain.resp.ActivityTeamInfoDatailResp;
import com.muyu.marketing.domain.resp.TeamInfoListResp; import com.muyu.marketing.domain.resp.TeamInfoListResp;
import com.muyu.marketing.team.service.ActivityTeamInfoService; import com.muyu.marketing.team.service.ActivityTeamInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List; import java.util.List;
@ -53,9 +55,33 @@ public class ActivityTeamController {
* @param activityTeamInfoSaveReq * @param activityTeamInfoSaveReq
* @return * @return
*/ */
@PostMapping @PostMapping("/add")
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) { public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq)); activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
return Result.success(); return Result.success();
} }
/**
*
* @param activityTeamInfo
* @return
*/
@PostMapping("/listTeam")
public Result listTeam(@RequestBody ActivityTeamInfoReq activityTeamInfo){
PageHelper.startPage(activityTeamInfo.getPageNum(),activityTeamInfo.getPageSize());
List<ActivityTeamInfo> list = activityTeamInfoService.list();
PageInfo<ActivityTeamInfo> activityTeamInfoPageInfo = new PageInfo<>(list);
return Result.success(activityTeamInfoPageInfo);
}
/**
* Id
* @param
* @return
*/
@GetMapping("/byId/{id}")
public Result<ActivityTeamInfoDatailResp> findById(@PathVariable Long id) {
ActivityTeamInfoDatailResp activityById = activityTeamInfoService.findActivityById(id);
return Result.success(activityById);
}
} }

View File

@ -6,8 +6,9 @@ import com.muyu.marketing.domain.ActivityTeamInfo;
import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel; import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
import com.muyu.marketing.domain.model.ActivityTeamInfoListModel; import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel; import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
import com.muyu.marketing.domain.model.ActivityTeamInfoModel;
import java.util.List; import com.muyu.marketing.domain.req.ActivityTeamProductReq;
import com.muyu.marketing.domain.resp.ActivityTeamInfoDatailResp;
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> { public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
@ -24,4 +25,17 @@ public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
* @param activityTeamInfoAddModel * @param activityTeamInfoAddModel
*/ */
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel); public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
/**
*
* @param id
* @return
*/
public ActivityTeamInfoDatailResp findActivityById(Long id);
/**
*
* @param activityTeamInfoModel
*/
public void bateUpdate(ActivityTeamInfoModel activityTeamInfoModel);
} }

View File

@ -3,7 +3,6 @@ package com.muyu.marketing.team.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum; import com.muyu.common.core.enums.market.team.TeamOpenTypeEnum;
import com.muyu.marketing.domain.ActivityTeamOpenInfo; import com.muyu.marketing.domain.ActivityTeamOpenInfo;
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> { public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
@ -32,4 +31,5 @@ public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenIn
public default Long getTeamInTypeNumberByTeamId(Long teamId){ public default Long getTeamInTypeNumberByTeamId(Long teamId){
return this.getTeamOpenNumberByTeamIdAndType(teamId, TeamOpenTypeEnum.IN_TEAM); return this.getTeamOpenNumberByTeamIdAndType(teamId, TeamOpenTypeEnum.IN_TEAM);
} }
} }

View File

@ -4,9 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo; import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
import com.muyu.marketing.domain.TeamStrategyExemptionHundred; import com.muyu.marketing.domain.TeamStrategyExemptionHundred;
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel; import com.muyu.marketing.domain.model.*;
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
import com.muyu.marketing.domain.model.TeamProductStockModel;
import java.util.List; import java.util.List;
@ -41,4 +39,25 @@ public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeam
*/ */
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList); public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
/**
* Id
*/
public List<ActivityTeamProductSkuModel> findById(Long id);
/**
*
*/
public boolean update(ActivityTeamProductSkuModel activityTeamProductSkuModel);
/**
*
*/
public boolean bathUpdate(List<ActivityTeamProductSkuModel> activityTeamProductSkuModels);
/**
*
*/
public void bathDelete(List<Long> id);
} }

View File

@ -1,14 +1,14 @@
package com.muyu.marketing.team.service.impl; package com.muyu.marketing.team.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.exception.ServiceException;
import com.muyu.common.core.utils.StringUtils; import com.muyu.common.core.utils.StringUtils;
import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.marketing.domain.ActivityTeamInfo; import com.muyu.marketing.domain.ActivityTeamInfo;
import com.muyu.marketing.domain.model.*; import com.muyu.marketing.domain.model.*;
import com.muyu.marketing.domain.resp.ActivityTeamInfoDatailResp;
import com.muyu.marketing.domain.resp.ActivityTeamProductSkuResp;
import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper; import com.muyu.marketing.team.mapper.ActivityTeamInfoMapper;
import com.muyu.marketing.team.service.ActivityTeamInfoService; import com.muyu.marketing.team.service.ActivityTeamInfoService;
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService; import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
@ -19,7 +19,6 @@ import org.springframework.util.Assert;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.function.Consumer;
@Service @Service
@ -82,4 +81,50 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId())); teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList); this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
} }
/**
*
* @param id
* @return
*/
@Override
public ActivityTeamInfoDatailResp findActivityById(Long id) {
//查找根据活动Id规格信息
List<ActivityTeamProductSkuModel> teamInfoSkuListModelList = activityTeamProductSkuInfoService.findById(id);
ActivityTeamInfo activityTeamInfo = this.getById(id);
ActivityTeamInfoDatailModel datailModel = ActivityTeamInfoDatailModel.DatailModel(activityTeamInfo, teamInfoSkuListModelList);
List<ActivityTeamProductSkuModel> activityTeamProductSkuList = datailModel.getActivityTeamProductSkuList();
List<ActivityTeamProductSkuResp> activityTeamProductSkuResps = new ArrayList<>();
activityTeamProductSkuList.stream().map(ActivityTeamInfoSkuListModel->{
return activityTeamProductSkuResps.add(ActivityTeamProductSkuResp.skuRespbuilder(ActivityTeamInfoSkuListModel));
}).toList();
return ActivityTeamInfoDatailResp.datailRespBuilder(datailModel,activityTeamProductSkuResps);
}
/**
*
* @param
*/
@Override
public void bateUpdate(ActivityTeamInfoModel activityTeamInfoModel) {
//添加
List<ActivityTeamProductSkuAddModel> teamProductSkuAddModelList = activityTeamInfoModel.getActivityTeamProductUpdModel().getActivityTeamProductSkuAddModelList();
//根据 Sku的Id删除
activityTeamOpenInfoService.removeBatchByIds(activityTeamInfoModel.getActivityTeamProductUpdModel().getIds());
teamProductSkuAddModelList.forEach(
activityTeamProductSkuAddModel -> {
activityTeamProductSkuAddModel.setTeamId(activityTeamInfoModel.getId());
}
);
activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
//活动修改
this.updateById(ActivityTeamInfo.addTeamInfoModelBuild(activityTeamInfoModel));
activityTeamProductSkuInfoService.bathUpdate(activityTeamInfoModel.getActivityTeamProductUpdModel().getActivityTeamProductSkuUpdModelList());
}
} }

View File

@ -1,12 +1,12 @@
package com.muyu.marketing.team.service.impl; package com.muyu.marketing.team.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.muyu.common.core.exception.ServiceException; import com.muyu.common.core.exception.ServiceException;
import com.muyu.marketing.domain.ActivityTeamInfo;
import com.muyu.marketing.domain.ActivityTeamProductSkuInfo; import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel; import com.muyu.marketing.domain.model.*;
import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel;
import com.muyu.marketing.domain.model.TeamProductStockModel;
import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper; import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper;
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService; import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
import com.muyu.product.cache.ProjectSkuCache; import com.muyu.product.cache.ProjectSkuCache;
@ -80,4 +80,64 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityT
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList() activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
); );
} }
/**
* Id
*
* @param id
*/
@Override
public List<ActivityTeamProductSkuModel> findById(Long id) {
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,id);
List<ActivityTeamProductSkuInfo> list = this.list(lambdaQueryWrapper);
List<ActivityTeamProductSkuModel> teamInfoSkuListModelList = list.stream().map(ActivityTeamProductSkuInfo -> {
ActivityTeamProductSkuModel activityTeamInfoSkuListModel = ActivityTeamInfoSkuListModel.skuByIdModel(ActivityTeamProductSkuInfo);
return activityTeamInfoSkuListModel;
}).toList();
return teamInfoSkuListModelList;
}
/**
*
* @param activityTeamProductSkuUpdModel
*/
@Override
public boolean update(ActivityTeamProductSkuModel activityTeamProductSkuUpdModel) {
LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock,activityTeamProductSkuUpdModel.getTeamStock());
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice,activityTeamProductSkuUpdModel.getTeamPrice());
updateWrapper.eq(ActivityTeamProductSkuInfo::getId,activityTeamProductSkuUpdModel.getId());
return this.update(updateWrapper);
}
/**
*
* @param activityTeamProductSkuUpdModelList
*/
@Override
public boolean bathUpdate(List<ActivityTeamProductSkuModel> activityTeamProductSkuUpdModelList) {
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = activityTeamProductSkuUpdModelList
.stream()
.map(ActivityTeamProductSkuInfo::skuUpdModel)
.toList();
return this.updateBatchById(teamProductSkuInfoList);
}
/**
*
* @param id
*/
@Override
public void bathDelete(List<Long> id) {
this.bathDelete(id);
}
} }

View File

@ -14,10 +14,12 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -35,6 +35,11 @@ public class TemplateAttributeModel extends BaseEntity {
*/ */
private String code; private String code;
/**
*
*/
private String value;
public static TemplateAttributeModel attributeInfoBuild(AttributeInfo attributeInfo){ public static TemplateAttributeModel attributeInfoBuild(AttributeInfo attributeInfo){
return TemplateAttributeModel.builder() return TemplateAttributeModel.builder()
.id(attributeInfo.getId()) .id(attributeInfo.getId())

View File

@ -0,0 +1,73 @@
package com.muyu.product.domain.resp;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.muyu.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ProjectInfoListResp {
/** 主键 */
@TableId(value = "id",type = IdType.AUTO)
@ApiModelProperty(name = "主键", value = "主键")
private Long id;
/** 商品名称 */
@ApiModelProperty(name = "商品名称", value = "商品名称")
private String name;
/** 商品描述 */
@ApiModelProperty(name = "商品描述", value = "商品描述")
private String introduction;
/** 主类型 */
@ApiModelProperty(name = "主类型", value = "主类型")
private Long mianType;
/** 父类型 */
@ApiModelProperty(name = "父类型", value = "父类型")
private Long parentType;
/** 商品类型 */
@ApiModelProperty(name = "商品类型", value = "商品类型")
private Long type;
/** 商品图片 */
@ApiModelProperty(name = "商品图片", value = "商品图片")
private String image;
/** 商品轮播图 */
@ApiModelProperty(name = "商品轮播图", value = "商品轮播图")
private String carouselImages;
/** 商品状态 */
@ApiModelProperty(name = "商品状态", value = "商品状态")
private String status;
/** 规格 */
@ApiModelProperty(name = "规格", value = "规格")
private Long ruleId;
/** 品牌 */
@ApiModelProperty(name = "品牌", value = "品牌")
private Long brandId;
/** 主类型名称 */
private String mianTypeName;
/** 父类型名称 */
private String parentTypeName;
/** 商品类型名称 */
private String typeName;
/** 规格名称 */
private String ruleName;
/** 品牌名称 */
private String brandName;
}

View File

@ -3,6 +3,7 @@ package com.muyu.product.controller;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -108,4 +109,15 @@ public class CommentInfoController extends BaseController {
public Result<String> remove(@PathVariable List<Long> ids) { public Result<String> remove(@PathVariable List<Long> ids) {
return toAjax(commentInfoService.removeBatchByIds(ids)); return toAjax(commentInfoService.removeBatchByIds(ids));
} }
/**
*
*/
@GetMapping("/commentId/{projectId}")
public Result commentInfoList(@PathVariable("projectId") Long id){
LambdaQueryWrapper<CommentInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(CommentInfo::getParentId,id);
List<CommentInfo> list = commentInfoService.list(lambdaQueryWrapper);
return Result.success(list);
}
} }

View File

@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse;
import com.muyu.product.cache.ProjectInfoCache; import com.muyu.product.cache.ProjectInfoCache;
import com.muyu.product.domain.resp.ProjectDetailResp; import com.muyu.product.domain.resp.ProjectDetailResp;
import com.muyu.product.domain.resp.ProjectInfoListResp;
import io.swagger.annotations.*; import io.swagger.annotations.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -47,12 +48,21 @@ public class ProjectInfoController extends BaseController {
/** /**
* *
*/ */
// @ApiOperation("获取商品信息列表")
// @RequiresPermissions("product:info:list")
// @GetMapping("/list")
// public Result<TableDataInfo<ProjectInfo>> list(ProjectInfoQueryReq projectInfoQueryReq) {
// startPage();
// List<ProjectInfo> list = projectInfoService.list(ProjectInfo.queryBuild(projectInfoQueryReq));
// return getDataTable(list);
// }
@ApiOperation("获取商品信息列表") @ApiOperation("获取商品信息列表")
@RequiresPermissions("product:info:list") @RequiresPermissions("product:info:list")
@GetMapping("/list") @GetMapping("/list")
public Result<TableDataInfo<ProjectInfo>> list(ProjectInfoQueryReq projectInfoQueryReq) { public Result<TableDataInfo<ProjectInfoListResp>> list(ProjectInfoQueryReq projectInfoQueryReq) {
startPage(); startPage();
List<ProjectInfo> list = projectInfoService.list(ProjectInfo.queryBuild(projectInfoQueryReq)); List<ProjectInfoListResp> list = projectInfoService.ProjectInfoList(ProjectInfo.queryBuild(projectInfoQueryReq));
return getDataTable(list); return getDataTable(list);
} }

View File

@ -5,6 +5,7 @@ import com.muyu.product.domain.ProjectInfo;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.muyu.product.domain.req.ProjectInfoSaveReq; import com.muyu.product.domain.req.ProjectInfoSaveReq;
import com.muyu.product.domain.resp.ProjectDetailResp; import com.muyu.product.domain.resp.ProjectDetailResp;
import com.muyu.product.domain.resp.ProjectInfoListResp;
/** /**
* Service * Service
@ -34,4 +35,6 @@ public interface ProjectInfoService extends IService<ProjectInfo> {
* @return * @return
*/ */
ProjectDetailResp getDetailInfo (Long id); ProjectDetailResp getDetailInfo (Long id);
List<ProjectInfoListResp> ProjectInfoList(ProjectInfo projectInfo);
} }

View File

@ -57,6 +57,8 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
@Autowired @Autowired
private AttributeGroupService attributeGroupService; private AttributeGroupService attributeGroupService;
@Autowired
private AsProductAttributeInfoService asProductAttributeInfoService;
/** /**
* *
@ -371,6 +373,22 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
attributeInfoLambdaQueryWrapper.notIn(!attributeIdSet.isEmpty(), AttributeInfo::getId, attributeIdSet); attributeInfoLambdaQueryWrapper.notIn(!attributeIdSet.isEmpty(), AttributeInfo::getId, attributeIdSet);
attributeModelList = attributeInfoService.list(attributeInfoLambdaQueryWrapper).stream().map(AttributeInfo::buildTemplateModel).toList(); attributeModelList = attributeInfoService.list(attributeInfoLambdaQueryWrapper).stream().map(AttributeInfo::buildTemplateModel).toList();
attributeGroupModelList.forEach(TemplateAttributeGroupModel->{
TemplateAttributeGroupModel.getAttributeList().forEach(TemplateAttributeModel->{
Long id = TemplateAttributeModel.getId();
LambdaQueryWrapper<AsProductAttributeInfo> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(AsProductAttributeInfo::getAttributeId,id);
List<AsProductAttributeInfo> list = this.asProductAttributeInfoService.list(queryWrapper);
list.forEach(AsProductAttributeInfo->{
TemplateAttributeModel.setValue(AsProductAttributeInfo.getValue());
});
});
});
return CategoryCommonElementResp.builder() return CategoryCommonElementResp.builder()
.templateAttributeGroupList(attributeGroupModelList) .templateAttributeGroupList(attributeGroupModelList)
.templateAttributeList(templateAttributeModelList) .templateAttributeList(templateAttributeModelList)

View File

@ -2,6 +2,7 @@ package com.muyu.product.service.impl;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import java.util.LinkedList;
import java.util.List; import java.util.List;
import com.muyu.common.core.utils.ObjUtils; import com.muyu.common.core.utils.ObjUtils;
@ -11,6 +12,8 @@ import com.muyu.product.domain.model.*;
import com.muyu.product.domain.req.ProjectInfoSaveReq; import com.muyu.product.domain.req.ProjectInfoSaveReq;
import com.muyu.product.domain.resp.CategoryCommonElementResp; import com.muyu.product.domain.resp.CategoryCommonElementResp;
import com.muyu.product.domain.resp.ProjectDetailResp; import com.muyu.product.domain.resp.ProjectDetailResp;
import com.muyu.product.domain.resp.ProjectInfoListResp;
import com.muyu.product.mapper.RuleInfoMapper;
import com.muyu.product.service.*; import com.muyu.product.service.*;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -47,7 +50,8 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
@Autowired @Autowired
private AttributeInfoService attributeInfoService; private AttributeInfoService attributeInfoService;
@Autowired
private RuleInfoMapper ruleInfoMapper;
/** /**
* *
* *
@ -229,4 +233,37 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
.attributeGroupList(templateAttributeGroupList) .attributeGroupList(templateAttributeGroupList)
.build(); .build();
} }
@Override
public List<ProjectInfoListResp> ProjectInfoList(ProjectInfo projectInfo) {
List<ProjectInfo> list = list(projectInfo);
LinkedList<ProjectInfoListResp> objects = new LinkedList<>();
list.forEach(s -> {
CategoryInfo mianTypeName = categoryInfoService.getById(s.getMianType());
CategoryInfo parentTypeName = categoryInfoService.getById(s.getParentType());
CategoryInfo typeName = s.getType() != null ? categoryInfoService.getById(s.getType()) : null;
RuleInfo ruleName = ruleInfoMapper.selectById(s.getRuleId());
BrandInfo brandName = brandInfoService.getById(s.getBrandId());
ProjectInfoListResp build = ProjectInfoListResp.builder()
.id(s.getId())
.name(s.getName())
.introduction(s.getIntroduction())
.mianType(s.getMianType())
.parentType(s.getParentType())
.type(s.getType()).image(s.getImage())
.carouselImages(s.getCarouselImages())
.status(s.getStatus())
.mianTypeName(mianTypeName != null ? mianTypeName.getName() : "")
.parentTypeName(parentTypeName != null ? parentTypeName.getName() : "")
.typeName(typeName != null ? typeName.getName() : "")
.ruleName(ruleName != null ? ruleName.getName() : "")
.brandName(brandName != null ? brandName.getNam() : "")
.build();
objects.add(build);
});
return objects;
}
} }

View File

@ -14,10 +14,12 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -16,10 +16,12 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -14,10 +14,12 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置

View File

@ -14,10 +14,12 @@ spring:
nacos: nacos:
discovery: discovery:
# 服务注册地址 # 服务注册地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
config: config:
# 配置中心地址 # 配置中心地址
server-addr: 127.0.0.1:8848 server-addr: 124.71.140.64:8848
namespace: 22cbf23e-e2e3-489f-bb75-db2fb40c4af0
# 配置文件格式 # 配置文件格式
file-extension: yml file-extension: yml
# 共享配置 # 共享配置