From 5e137c9f39ec58aba1e5310ac9072e50441309ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=88=98=E6=B2=B3=E5=B9=B3?=
<14767849+liuehping@user.noreply.gitee.com>
Date: Sat, 23 Nov 2024 09:06:28 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8B=BC=E5=9B=A2=E6=B7=BB=E5=8A=A0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
market.json | 21 +++
.../muyu-marketing/marketing-common/pom.xml | 4 +
.../marketing/domain/ActivityTeamInfo.java | 39 +++-
.../domain/ActivityTeamProductSkuInfo.java | 35 ++++
.../model/ActivityTeamInfoAddModel.java | 81 --------
.../domain/req/ActivityTeamInfoAddReq.java | 97 ++++++++++
.../domain/resp/ActivityTeamInfoResp.java | 81 ++++++++
.../muyu/marketing/domain/resp/RuleInfo.java | 41 ++++
.../muyu/marketing/domain/resp/Strategy.java | 25 +++
.../domain/resp/TeamInfoListResp.java | 2 +-
.../muyu-marketing/marketing-serve/pom.xml | 20 +-
.../marketing/MuYuMarketingApplication.java | 2 +-
.../ActivityTeamInfoController.java | 33 ++--
.../remote/ProjectRemoteService.java | 15 ++
.../service/ActivityTeamInfoService.java | 10 +
.../ActivityTeamProductSkuInfoService.java | 2 +
.../impl/ActivityTeamInfoServiceImpl.java | 68 +++++--
...ActivityTeamProductSkuInfoServiceImpl.java | 13 ++
.../java/com/muyu/marketing/util/OssUtil.java | 175 ++++++++++++++++++
.../src/main/resources/bootstrap.yml | 6 +
.../system/ActivityTeamOpenInfoMapper.xml | 5 +
.../com/muyu/product/domain/RuleInfo.java | 14 ++
.../muyu/product/MuYuProductApplication.java | 1 +
.../mapper/AsAttributeGroupMapper.java | 2 +
.../product/mapper/AsBrandProjectMapper.java | 2 +
.../AsCategoryAttributeGroupMapper.java | 2 +
.../mapper/AsCategoryAttributeMapper.java | 2 +
.../product/mapper/AsCategoryBrandMapper.java | 2 +
.../mapper/AsProductAttributeInfoMapper.java | 2 +
.../product/mapper/AttributeGroupMapper.java | 2 +
.../product/mapper/AttributeInfoMapper.java | 2 +
.../muyu/product/mapper/BrandInfoMapper.java | 2 +
.../product/mapper/CategoryInfoMapper.java | 2 +
.../product/mapper/CommentInfoMapper.java | 2 +
.../product/mapper/CommentLikeInfoMapper.java | 2 +
.../product/mapper/ProjectInfoMapper.java | 2 +
.../product/mapper/ProjectSkuInfoMapper.java | 2 +
.../product/mapper/RuleAttrInfoMapper.java | 2 +
.../muyu/product/mapper/RuleInfoMapper.java | 2 +
.../mapper/UpdAsCategoryAttributeMapper.java | 2 +
.../service/impl/ProjectInfoServiceImpl.java | 2 +
.../src/main/resources/bootstrap.yml | 2 +
42 files changed, 709 insertions(+), 119 deletions(-)
create mode 100644 market.json
delete mode 100644 muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamInfoAddModel.java
create mode 100644 muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoAddReq.java
create mode 100644 muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamInfoResp.java
create mode 100644 muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/RuleInfo.java
create mode 100644 muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/Strategy.java
create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/remote/ProjectRemoteService.java
create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/util/OssUtil.java
create mode 100644 muyu-modules/muyu-marketing/marketing-serve/src/main/resources/mapper/system/ActivityTeamOpenInfoMapper.xml
diff --git a/market.json b/market.json
new file mode 100644
index 0000000..933042a
--- /dev/null
+++ b/market.json
@@ -0,0 +1,21 @@
+{
+ "商品id": "Long",
+ "商品图片": "String",
+ "活动名称": "String",
+ "活动简介": "String",
+ "商品单位": "String",
+ "商品轮播图": ["String","String","",""],
+ "活动时间": "Date",
+ "开始时间": "Date",
+ "策略id": "Long",
+ "策略类型": "String",
+ "商品规格集合": [
+ {
+ "规格id": "Long",
+ "库存": "Long",
+ "秒杀价": "BigDecimal"
+ }
+ ],
+ "排序":"Integer",
+ "详情": "text"
+}
\ No newline at end of file
diff --git a/muyu-modules/muyu-marketing/marketing-common/pom.xml b/muyu-modules/muyu-marketing/marketing-common/pom.xml
index 7b1e721..c9012cb 100644
--- a/muyu-modules/muyu-marketing/marketing-common/pom.xml
+++ b/muyu-modules/muyu-marketing/marketing-common/pom.xml
@@ -50,6 +50,10 @@
mybatis-plus-annotation
3.4.1
+
+ com.muyu
+ muyu-product-common
+
\ No newline at end of file
diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamInfo.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamInfo.java
index 339a322..d27ea4c 100644
--- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamInfo.java
+++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamInfo.java
@@ -2,8 +2,10 @@ package com.muyu.marketing.domain;
import com.alibaba.ttl.threadpool.agent.internal.javassist.bytecode.AttributeInfo;
import com.baomidou.mybatisplus.annotation.TableName;
+import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.common.core.annotation.Excel;
import com.muyu.common.core.web.domain.BaseEntity;
+import com.muyu.marketing.domain.req.ActivityTeamInfoAddReq;
import com.muyu.marketing.domain.req.ActivityTeamInfoReq;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -13,12 +15,14 @@ import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;
import org.apache.xmlbeans.impl.xb.xsdschema.AttributeGroup;
+import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import java.util.List;
import java.util.function.Function;
+import java.util.function.Supplier;
/**
* 商品拼团信息
@@ -31,7 +35,7 @@ import java.util.function.Function;
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "activity_team_info", description = "商品拼团信息")
public class ActivityTeamInfo extends BaseEntity {
- /**
+ /**
* 主键
*/
private Long id;
@@ -42,7 +46,7 @@ public class ActivityTeamInfo extends BaseEntity {
/**
* 商品ID
*/
- private BigInteger productId;
+ private Long productId;
/**
* 商品活动图
@@ -63,6 +67,8 @@ public class ActivityTeamInfo extends BaseEntity {
/**
* 活动结束时间
*/
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date endTime;
/**
* 活动排序
@@ -83,8 +89,33 @@ public class ActivityTeamInfo extends BaseEntity {
/**
* 策略ID
*/
- private BigInteger strategyId;
-
+ private Long strategyId;
+ /**
+ * 拼团活动新增构建器
+ *
+ * @param activityTeamInfoAddModel
+ * @return
+ */
+ public static ActivityTeamInfo saveBuildModel(ActivityTeamInfoAddReq activityTeamInfoAddModel, Supplier createBy){
+ return ActivityTeamInfo.builder()
+ .id(activityTeamInfoAddModel.getId())
+ .name(activityTeamInfoAddModel.getName())
+ .productId(activityTeamInfoAddModel.getProductId())
+ .productImage(activityTeamInfoAddModel.getProductImage())
+ .introduction(activityTeamInfoAddModel.getIntroduction())
+ .unit(activityTeamInfoAddModel.getUnit())
+ .imageList(activityTeamInfoAddModel.getImageList())
+ .endTime(activityTeamInfoAddModel.getEndTime())
+ .sort(activityTeamInfoAddModel.getSort())
+ .content(activityTeamInfoAddModel.getContent())
+ .strategyType(activityTeamInfoAddModel.getStrategyType())
+ .strategyId(activityTeamInfoAddModel.getStrategyId())
+ .content(activityTeamInfoAddModel.getContent())
+ .status(activityTeamInfoAddModel.getStatus())
+ .createBy(createBy.get())
+ .createTime(new Date())
+ .build();
+ }
}
diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamProductSkuInfo.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamProductSkuInfo.java
index 84a1159..3cec631 100644
--- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamProductSkuInfo.java
+++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/ActivityTeamProductSkuInfo.java
@@ -4,6 +4,7 @@ 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.product.domain.ProjectSkuInfo;
import io.swagger.annotations.ApiModel;
import lombok.AllArgsConstructor;
import lombok.Data;
@@ -54,4 +55,38 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
* 拼团价格
*/
private BigDecimal teamPrice;
+
+// /**
+// * 拼团规格信息构建
+// * @param projectSkuInfo
+// * @param o
+// * @return
+// */
+// public static ActivityTeamProductSkuInfo productSkuModelBuild(ProjectSkuInfo projectSkuInfo, Object o) {
+// return ActivityTeamProductSkuInfo.builder()
+// .productId(projectSkuInfo.getProjectId())
+// .productSku(projectSkuInfo.getSku())
+// .teamPrice(projectSkuInfo.getPrice())
+// .teamStock(projectSkuInfo.getStock())
+// .remainStock(projectSkuInfo.getStock())
+// .build();
+// }
+
+// /**
+// * 拼团规格信息构建
+// * @param projectSkuInfo
+// * @param id
+// * @param o
+// * @return
+// */
+// public static ActivityTeamProductSkuInfo productSkuModelBuild(ProjectSkuInfo projectSkuInfo, Long id, Object o) {
+// return ActivityTeamProductSkuInfo.builder()
+// .id(id)
+// .productId(projectSkuInfo.getProjectId())
+// .productSku(projectSkuInfo.getSku())
+// .teamPrice(projectSkuInfo.getPrice())
+// .teamStock(projectSkuInfo.getStock())
+// .remainStock(projectSkuInfo.getStock())
+// .build();
+// }
}
diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamInfoAddModel.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamInfoAddModel.java
deleted file mode 100644
index 513b817..0000000
--- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamInfoAddModel.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package com.muyu.marketing.domain.model;
-
-import com.muyu.common.core.web.domain.BaseEntity;
-import com.muyu.marketing.domain.ActivityTeamInfo;
-import lombok.*;
-import lombok.experimental.SuperBuilder;
-
-import java.math.BigDecimal;
-import java.util.Date;
-
-@Data
-//@Builder
-@NoArgsConstructor
-@AllArgsConstructor
-@EqualsAndHashCode(callSuper = true)
-public class ActivityTeamInfoAddModel extends BaseEntity {
- /**
- * 拼团名称
- */
- private String name;
- /**
- * 商品图片
- */
- private String productImage;
- /**
- * 轮播图片
- */
- private String imageList;
- /**
- * 拼团库存
- */
- private Long teamStock;
- /**
- * 商品价格
- */
- private BigDecimal productPrice;
-
- /**
- * 团购优惠价格
- */
- private BigDecimal teamPrice;
- /**
- * 拼团人数
- */
- private Long attendTeamNumber;
- /**
- * 参团人数
- */
- private Long addTeamNumber;
- /**
- * 开团人数
- */
- private Long openTeamNumber;
- /**
- * 拼团剩余库存
- */
- private Long remainStock;
- /**
- * 活动状态
- */
- private String status;
- /**
- * 结束时间
- */
- private Date endTime;
-
-// public ActivityTeamInfoAddModel AddBuild(){
-// return ActivityTeamInfoAddModel.builder()
-// .name(this.name)
-// .productImage(this.getProductImage())
-// .imageList(this.getImageList())
-// .teamStock(this.getTeamStock())
-// .productPrice(this.getProductPrice())
-// .teamPrice(this.getTeamPrice())
-// .attendTeamNumber(this.getAttendTeamNumber())
-// .addTeamNumber(this.getAddTeamNumber())
-// .openTeamNumber(this.getOpenTeamNumber())
-// .remainStock(this.getRemainStock())
-// .build();
-// }
-}
diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoAddReq.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoAddReq.java
new file mode 100644
index 0000000..b3eb6b7
--- /dev/null
+++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoAddReq.java
@@ -0,0 +1,97 @@
+package com.muyu.marketing.domain.req;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fasterxml.jackson.annotation.JsonFormat;
+
+import com.muyu.product.domain.RuleInfo;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.AllArgsConstructor;
+import lombok.Builder;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+import org.springframework.format.annotation.DateTimeFormat;
+
+import javax.validation.constraints.NotNull;
+import java.util.Date;
+import java.util.List;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Builder
+public class ActivityTeamInfoAddReq {
+
+ @TableId(value = "id", type = IdType.AUTO)
+ @ApiModelProperty("主键")
+ private Long id;
+ /**
+ * 商品ID
+ */
+ @NotNull(message = "商品ID不能为空")
+ private Long productId;
+ /**
+ * 商品图片
+ */
+ private String productImage;
+ /**
+ * 活动名称
+ */
+ @NotNull(message = "商品名称不能为空")
+ private String name;
+ /**
+ * 活动简介
+ */
+ @NotNull(message = "商品简介不能为空")
+ private String introduction;
+ /**
+ * 商品单位
+ */
+ private String unit;
+ /**
+ * 商品的轮播图
+ */
+ @NotNull(message = "商品轮播图不能为空")
+ private String imageList;
+ /**
+ * 活动时间
+ */
+ @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+ private Date endTime;
+ /**
+ * 策略ID
+ */
+ @NotNull(message = "策略ID不能为空")
+ private Long strategyId;
+ /**
+ * 策略类型
+ */
+ @NotNull(message = "策略类型不能为空")
+ private String strategyType;
+ /**
+ * 商品规格List
+ */
+ @NotNull(message = "商品规格不能为空")
+ private List ruleInfo;
+ /**
+ * 排序
+ */
+ @NotNull(message = "排序不能为空")
+ private Integer sort;
+ /**
+ * 详情
+ */
+ @NotNull(message = "详情不能为空")
+ private String content;
+
+ /**
+ * 状态
+ */
+ private String status;
+ /**
+ * 规则List
+ */
+ private List ruleInfoList;
+
+}
diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamInfoResp.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamInfoResp.java
new file mode 100644
index 0000000..3be2fbe
--- /dev/null
+++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamInfoResp.java
@@ -0,0 +1,81 @@
+//package com.muyu.marketing.domain.resp;
+//
+//import lombok.AllArgsConstructor;
+//import lombok.Builder;
+//import lombok.Data;
+//import lombok.NoArgsConstructor;
+//
+//import javax.validation.constraints.NotNull;
+//import javax.validation.constraints.Pattern;
+//import java.math.BigDecimal;
+//import java.util.Date;
+//
+//@Data
+//@AllArgsConstructor
+//@NoArgsConstructor
+//@Builder
+//public class ActivityTeamInfoResp {
+// /**
+// * 主键
+// */
+// private Long id;
+// /**
+// * 拼团名称
+// */
+// @NotNull(message = "拼团名称不能为空")
+// private String name;
+// /**
+// * 参团人数
+// */
+// @Pattern(regexp = "^[1-9]\\d*$", message = "拼团人数必须为正整数")
+// private Long addTeamNumber;
+//
+// /**
+// * 开团人数
+// */
+// @Pattern(regexp = "^[1-9]\\d*$", message = "开团人数必须为正整数")
+// private Long openTeamNumber;
+// /**
+// * 拼团人数
+// */
+// @Pattern(regexp = "^[1-9]\\d*$", message = "拼团人数必须为正整数")
+// private Long attendTeamNumber;
+// /**
+// * 活动结束时间
+// */
+// private Date endTime;
+// /**
+// * 图片
+// */
+// private String productImage;
+// /**
+// * 拼团价格
+// */
+// @Pattern(regexp = "^(([1-9][0-9]*)|(([0-9]|[1-9][0-9]*)(\\.[0-9]{1,2})?))$", message = "拼团价格必须为小数")
+// private BigDecimal teamPrice;
+//
+// /**
+// * 商品价格
+// */
+// @Pattern(regexp = "^(([1-9][0-9]*)|(([0-9]|[1-9][0-9]*)(\\.[0-9]{1,2})?))$", message = "商品价格必须为小数")
+// private BigDecimal productPrice;
+// /**
+// * 总库存
+// */
+// @Pattern(regexp = "^[1-9]\\d*$", message = "总库存必须为正整数")
+// private Long totalStock;
+// /**
+// * 团购库存
+// */
+// @Pattern(regexp = "^[1-9]\\d*$", message = "团购库存必须为正整数")
+// private Long teamStock;
+// /**
+// * 剩余库存
+// */
+// @Pattern(regexp = "^[1-9]\\d*$", message = "剩余库存必须为正整数")
+// private Long RemainStock;
+// /**
+// * 活动状态
+// */
+// private String Status;
+//}
diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/RuleInfo.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/RuleInfo.java
new file mode 100644
index 0000000..4d88227
--- /dev/null
+++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/RuleInfo.java
@@ -0,0 +1,41 @@
+//package com.muyu.marketing.domain.resp;
+//
+//import com.baomidou.mybatisplus.annotation.IdType;
+//import com.baomidou.mybatisplus.annotation.TableId;
+//import com.baomidou.mybatisplus.annotation.TableName;
+//import io.swagger.annotations.ApiModelProperty;
+//import lombok.AllArgsConstructor;
+//import lombok.Data;
+//import lombok.NoArgsConstructor;
+//
+//import java.math.BigDecimal;
+//
+//@Data
+//@NoArgsConstructor
+//@AllArgsConstructor
+//@TableName(value = "activity_team_product_sku_info")
+//public class RuleInfo {
+//
+//
+// /**
+// * 主键
+// */
+//
+//
+// @TableId(value = "id",type = IdType.AUTO)
+// @ApiModelProperty("主键")
+// private Long id;
+// /**
+// *规格Sku
+// */
+// private String ruleSku;
+// /**
+// *拼团库存
+// */
+// private Long teamStock;
+// /**
+// * 拼团价格
+// */
+// private BigDecimal teamPrice;
+//
+//}
\ No newline at end of file
diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/Strategy.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/Strategy.java
new file mode 100644
index 0000000..a01d265
--- /dev/null
+++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/Strategy.java
@@ -0,0 +1,25 @@
+//package com.muyu.marketing.domain.resp;
+//
+//import lombok.AllArgsConstructor;
+//import lombok.Data;
+//import lombok.NoArgsConstructor;
+//
+//import java.math.BigDecimal;
+//
+//@Data
+//@AllArgsConstructor
+//@NoArgsConstructor
+//public class Strategy {
+// /**
+// * 商品规格id
+// */
+// private Long productSkuId;
+// /**
+// * 拼团价格
+// */
+// private BigDecimal price;
+// /**
+// * 拼团库存
+// */
+// private Long stock;
+//}
diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/TeamInfoListResp.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/TeamInfoListResp.java
index 6c7ad02..b58e80a 100644
--- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/TeamInfoListResp.java
+++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/TeamInfoListResp.java
@@ -17,7 +17,7 @@ import java.util.Date;
@NoArgsConstructor
@Builder
public class TeamInfoListResp {
- /**
+ /**
* 主键
*/
private Long id;
diff --git a/muyu-modules/muyu-marketing/marketing-serve/pom.xml b/muyu-modules/muyu-marketing/marketing-serve/pom.xml
index 2dc611e..30b2fef 100644
--- a/muyu-modules/muyu-marketing/marketing-serve/pom.xml
+++ b/muyu-modules/muyu-marketing/marketing-serve/pom.xml
@@ -2,7 +2,7 @@
-
+
com.muyu
muyu-marketing
3.6.3
@@ -14,7 +14,7 @@
marketing-server
- marketing-server系统模块
+ marketing-server系统模块
@@ -90,6 +90,22 @@
com.muyu
muyu-product-cache
+
+ com.aliyun.oss
+ aliyun-sdk-oss
+ 3.15.2
+
+
+ com.muyu
+ muyu-file
+ 3.6.3
+
+
+ com.muyu
+ muyu-product-server
+ 3.6.3
+
+
diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/MuYuMarketingApplication.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/MuYuMarketingApplication.java
index 47481ff..87b66d0 100644
--- a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/MuYuMarketingApplication.java
+++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/MuYuMarketingApplication.java
@@ -16,7 +16,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
@EnableCustomSwagger2
@EnableMyFeignClients
@SpringBootApplication
-//@MapperScan("com.muyu.marketing.mapper")
+@MapperScan("com.muyu.marketing.mapper")
public class MuYuMarketingApplication {
public static void main (String[] args) {
SpringApplication.run(MuYuMarketingApplication.class, args);
diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/controller/ActivityTeamInfoController.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/controller/ActivityTeamInfoController.java
index b412578..7f250e1 100644
--- a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/controller/ActivityTeamInfoController.java
+++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/controller/ActivityTeamInfoController.java
@@ -4,21 +4,22 @@ import com.muyu.common.core.domain.Result;
import com.muyu.common.core.web.page.TableDataInfo;
import com.muyu.common.log.annotation.Log;
import com.muyu.common.log.enums.BusinessType;
-import com.muyu.common.security.annotation.RequiresPermissions;
import com.muyu.marketing.domain.ActivityTeamInfo;
-import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel;
-import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
+import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
+import com.muyu.marketing.domain.req.ActivityTeamInfoAddReq;
import com.muyu.marketing.domain.req.ActivityTeamInfoReq;
-import com.muyu.marketing.domain.resp.TeamInfoListResp;
+
import com.muyu.marketing.service.ActivityTeamInfoService;
+import com.muyu.marketing.util.OssUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.multipart.MultipartFile;
-import java.util.List;
+import javax.validation.Valid;
@RestController
@RequestMapping("/activity")
@@ -26,22 +27,20 @@ public class ActivityTeamInfoController {
@Autowired
private ActivityTeamInfoService activityTeamInfoService;
+
@PostMapping("list")
- public Result> list(@RequestBody ActivityTeamInfoReq activityTeamInfoReq){
- activityTeamInfoService.query(activityTeamInfoReq.buildQueryModel());
- return Result.success();
+ public Result> list(@RequestBody ActivityTeamInfoReq activityTeamInfoReq) {
+ TableDataInfo query = activityTeamInfoService.query(activityTeamInfoReq.buildQueryModel());
+ return Result.success(query);
}
- /**
- * 新增属性组
+ /**
+ * 新增拼团
*/
- @Log(title = "属性组", businessType = BusinessType.INSERT)
+ @Log(title = "拼团", businessType = BusinessType.INSERT)
@PostMapping
- @ApiOperation("新增拼团")
- public Result add(@RequestBody ActivityTeamInfo activityTeamInfo) {
-// return toAjax(
-// activityTeamInfoService.add(ActivityTeamInfoAddModel.AddBuild(activityTeamInfo))
-// );
- return null;
+ public Result add(@RequestBody ActivityTeamInfoAddReq activityTeamInfoAddReq) {
+
+ return activityTeamInfoService.insert(activityTeamInfoAddReq);
}
}
diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/remote/ProjectRemoteService.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/remote/ProjectRemoteService.java
new file mode 100644
index 0000000..16e941b
--- /dev/null
+++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/remote/ProjectRemoteService.java
@@ -0,0 +1,15 @@
+package com.muyu.marketing.remote;
+
+import com.muyu.common.core.domain.Result;
+import com.muyu.product.domain.ProjectSkuInfo;
+import org.springframework.cloud.openfeign.FeignClient;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+
+import java.util.List;
+
+@FeignClient(value = "muyu-product")
+public interface ProjectRemoteService {
+ @GetMapping("/sku/list/{projectId}")
+ public Result> listByProjectId(@PathVariable("projectId") Long projectId);
+}
diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamInfoService.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamInfoService.java
index 8a070c8..632e41b 100644
--- a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamInfoService.java
+++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamInfoService.java
@@ -1,10 +1,13 @@
package com.muyu.marketing.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.ActivityTeamInfoListModel;
import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
+import com.muyu.marketing.domain.req.ActivityTeamInfoAddReq;
+import org.springframework.web.multipart.MultipartFile;
import java.util.List;
@@ -15,4 +18,11 @@ public interface ActivityTeamInfoService extends IService {
* @return 团购活动列表
*/
public TableDataInfo query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
+
+ /**
+ * 新增团购活动
+ * @param activityTeamInfoAddReq
+ * @return
+ */
+ Result insert(ActivityTeamInfoAddReq activityTeamInfoAddReq);
}
diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamProductSkuInfoService.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamProductSkuInfoService.java
index af50ec2..d52919f 100644
--- a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamProductSkuInfoService.java
+++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/ActivityTeamProductSkuInfoService.java
@@ -10,6 +10,7 @@ import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
import com.muyu.marketing.domain.model.TeamProductDisCountPriceModel;
import com.muyu.marketing.domain.model.TeamProductStockModel;
+import java.math.BigInteger;
import java.util.List;
public interface ActivityTeamProductSkuInfoService extends IService {
@@ -37,4 +38,5 @@ public interface ActivityTeamProductSkuInfoService extends IService getSkuList(BigInteger productId);
}
diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java
index 6d2c1c8..1a67d84 100644
--- a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java
+++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java
@@ -1,29 +1,28 @@
package com.muyu.marketing.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
-import com.baomidou.mybatisplus.core.metadata.OrderItem;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.muyu.common.core.domain.Result;
import com.muyu.common.core.utils.StringUtils;
import com.muyu.common.core.web.page.TableDataInfo;
+import com.muyu.common.security.utils.SecurityUtils;
import com.muyu.marketing.domain.ActivityTeamInfo;
-import com.muyu.marketing.domain.model.ActivityTeamInfoListModel;
-import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel;
-import com.muyu.marketing.domain.model.TeamProductDisCountPriceModel;
-import com.muyu.marketing.domain.model.TeamProductStockModel;
+import com.muyu.marketing.domain.ActivityTeamProductSkuInfo;
+import com.muyu.marketing.domain.model.*;
+import com.muyu.marketing.domain.req.ActivityTeamInfoAddReq;
import com.muyu.marketing.mapper.ActivityTeamInfoMapper;
import com.muyu.marketing.service.ActivityTeamInfoService;
import com.muyu.marketing.service.ActivityTeamOpenInfoService;
import com.muyu.marketing.service.ActivityTeamProductSkuInfoService;
+import com.muyu.product.domain.RuleInfo;
+import com.muyu.product.service.ProjectInfoService;
+import com.muyu.marketing.remote.ProjectRemoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-
-import java.math.BigDecimal;
-import java.util.ArrayList;
-import java.util.Arrays;
import java.util.Date;
import java.util.List;
-import java.util.function.Consumer;
+
@Service
public class ActivityTeamInfoServiceImpl extends ServiceImpl implements ActivityTeamInfoService {
@@ -34,6 +33,13 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
@@ -43,7 +49,7 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl activityTeamInfoPage = this.page(
+ Page activityTeamInfoPage = this.page(
activityTeamInfoListQueryModel.buildPage()
, queryWrapper);
@@ -59,12 +65,12 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl ruleInfoList = activityTeamInfoAddReq.getRuleInfoList();
+ //构建拼团规则明细
+ List activityTeamProductSkuInfoList = ruleInfoList.stream().map(ruleInfo -> {
+ ActivityTeamProductSkuInfo teamProductSkuInfo = ActivityTeamProductSkuInfo.builder()
+ .id(ruleInfo.getId())
+ .teamId(activityTeamInfo.getId())
+ .productId(activityTeamInfoAddReq.getProductId())
+ .teamStock(ruleInfo.getTeamStock())
+ .teamPrice(ruleInfo.getTeamPrice())
+ .productSku(ruleInfo.getRuleSku())
+ .createTime(new Date())
+ .updateTime(new Date())
+ .createBy(SecurityUtils.getUsername())
+ .updateBy(SecurityUtils.getUsername())
+ .remark(ruleInfo.getRemark())
+ .params(ruleInfo.getParams())
+ .searchValue(ruleInfo.getSearchValue())
+ .build();
+ return teamProductSkuInfo;
+ }).toList();
+ //批量插入拼团规则明细
+ activityTeamProductSkuInfoService.saveBatch(activityTeamProductSkuInfoList);
+ return Result.success(200,"添加成功");
+ }
}
diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamProductSkuInfoServiceImpl.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamProductSkuInfoServiceImpl.java
index 07fac16..6a5f4ca 100644
--- a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamProductSkuInfoServiceImpl.java
+++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/service/impl/ActivityTeamProductSkuInfoServiceImpl.java
@@ -15,6 +15,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
+import java.math.BigInteger;
import java.rmi.ServerException;
import java.util.Comparator;
import java.util.List;
@@ -51,4 +52,16 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl getSkuList(BigInteger productId) {
+ LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper().eq(ActivityTeamProductSkuInfo::getProductId, productId);
+ List activityTeamProductSkuInfoList = this.list(queryWrapper);
+ return activityTeamProductSkuInfoList;
+ }
}
diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/util/OssUtil.java b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/util/OssUtil.java
new file mode 100644
index 0000000..a3302ce
--- /dev/null
+++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/java/com/muyu/marketing/util/OssUtil.java
@@ -0,0 +1,175 @@
+package com.muyu.marketing.util;
+
+import com.aliyun.oss.OSS;
+import com.aliyun.oss.OSSClientBuilder;
+import com.aliyun.oss.model.GetObjectRequest;
+import com.aliyun.oss.model.PutObjectRequest;
+import lombok.Data;
+import lombok.extern.log4j.Log4j2;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.*;
+import java.time.LocalDateTime;
+import java.util.UUID;
+
+/**
+ * Oss服务调用
+ */
+@Log4j2
+@Configuration
+@ConfigurationProperties(prefix = "oss")
+@Data
+public class OssUtil {
+
+ /**
+ * Endpoint 存储对象概述 阿里云主账号AccessKey,accessKeySecret拥有所有API的访问权限 访问路径前缀 存储对象概述
+ */
+ private String endPoint;
+ private String accessKeyId;
+ private String accessKeySecret;
+ private String accessPre;
+
+ /**
+ * bucket名称
+ *
+ * @return
+ */
+ private String bucketName;
+
+ /**
+ * 构建 OSS 对象
+ * @return
+ */
+ private OSS initOssClient() {
+ return new OSSClientBuilder().build(
+ endPoint,
+ accessKeyId,
+ accessKeySecret);
+ }
+
+
+ /**
+ * 默认路径上传本地文件
+ *
+ * @param filePath
+ */
+ public String uploadFile(String filePath) {
+ return uploadFileForBucket(bucketName, getOssFilePath(filePath), filePath);
+ }
+
+ /**
+ * 默认路径上传multipartFile文件
+ *
+ * @param multipartFile
+ */
+ public String uploadMultipartFile(MultipartFile multipartFile) {
+ return uploadMultipartFile(bucketName, getOssFilePath(multipartFile.getOriginalFilename()), multipartFile);
+ }
+
+ /**
+ * 上传 multipartFile 类型文件
+ *
+ * @param bucketName
+ * @param ossPath
+ * @param multipartFile
+ */
+ public String uploadMultipartFile(String bucketName, String ossPath, MultipartFile multipartFile) {
+ InputStream inputStream = null;
+ try {
+ inputStream = multipartFile.getInputStream();
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ uploadFileInputStreamForBucket(bucketName, ossPath, inputStream);
+ return accessPre + ossPath;
+ }
+
+ /**
+ * 使用File上传PutObject上传文件 ** 程序默认使用次方法上传
+ *
+ * @param bucketName 实例名称
+ * @param ossPath oss存储路径
+ * @param filePath 本地文件路径
+ */
+ public String uploadFileForBucket(String bucketName, String ossPath, String filePath) {
+ // 创建PutObjectRequest对象。
+ PutObjectRequest putObjectRequest = new PutObjectRequest(bucketName, ossPath, new File(filePath));
+
+ // 上传
+ initOssClient().putObject(putObjectRequest);
+ return accessPre + ossPath;
+ }
+
+ /**
+ * 使用文件流上传到指定的bucket实例
+ *
+ * @param bucketName 实例名称
+ * @param ossPath oss存储路径
+ * @param filePath 本地文件路径
+ */
+ public String uploadFileInputStreamForBucket(String bucketName, String ossPath, String filePath) {
+
+ // 填写本地文件的完整路径。如果未指定本地路径,则默认从示例程序所属项目对应本地路径中上传文件流。
+ InputStream inputStream = null;
+ try {
+ inputStream = new FileInputStream(filePath);
+ } catch (FileNotFoundException e) {
+ e.printStackTrace();
+ }
+ // 填写Bucket名称和Object完整路径。Object完整路径中不能包含Bucket名称。
+ uploadFileInputStreamForBucket(bucketName, ossPath, inputStream);
+ return accessPre + ossPath;
+ }
+
+ public void uploadFileInputStreamForBucket(String bucketName, String ossPath, InputStream inputStream) {
+ initOssClient().putObject(bucketName, ossPath, inputStream);
+ }
+
+ /**
+ * 下载
+ *
+ * @param ossFilePath
+ * @param filePath
+ */
+ public void downloadFile(String ossFilePath, String filePath) {
+ downloadFileForBucket(bucketName, ossFilePath, filePath);
+ }
+
+ /**
+ * 下载
+ *
+ * @param bucketName 实例名称
+ * @param ossFilePath oss存储路径
+ * @param filePath 本地文件路径
+ */
+ public void downloadFileForBucket(String bucketName, String ossFilePath, String filePath) {
+ initOssClient().getObject(new GetObjectRequest(bucketName, ossFilePath), new File(filePath));
+ }
+
+ /**
+ * @return
+ */
+ public String getOssDefaultPath() {
+ LocalDateTime now = LocalDateTime.now();
+ String url =
+ now.getYear() + "/" +
+ now.getMonth() + "/" +
+ now.getDayOfMonth() + "/" +
+ now.getHour() + "/" +
+ now.getMinute() + "/";
+ return url;
+ }
+
+ /**
+ * 对文件进行重新命名
+ * @param filePath
+ * @return
+ */
+ public String getOssFilePath(String filePath) {
+ String fileSuf = filePath.substring(filePath.lastIndexOf(".") + 1);
+ return getOssDefaultPath() + UUID.randomUUID().toString() + "." + fileSuf;
+ }
+
+}
diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/bootstrap.yml b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/bootstrap.yml
index a4143d3..3417483 100644
--- a/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/bootstrap.yml
+++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/bootstrap.yml
@@ -33,3 +33,9 @@ mybatis-plus:
- classpath*:mapper/*Mapper.xml
# 搜索指定包别名
typeAliasesPackage: com.muyu.marketing.domain
+oss:
+ endPoint: https://oss-cn-shanghai.aliyuncs.com
+ accessKeyId: LTAI5tLMYKdkKFsCqjNMk1GY
+ accessKeySecret: m3Tnb3FWegHh7tnfN1o48vZ2UyJa4l
+ accessPre: https://ccc-demo123123.oss-cn-shanghai.aliyuncs.com/
+ bucketName: lhc-2204a
diff --git a/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/mapper/system/ActivityTeamOpenInfoMapper.xml b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/mapper/system/ActivityTeamOpenInfoMapper.xml
new file mode 100644
index 0000000..2949e9d
--- /dev/null
+++ b/muyu-modules/muyu-marketing/marketing-serve/src/main/resources/mapper/system/ActivityTeamOpenInfoMapper.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/RuleInfo.java b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/RuleInfo.java
index ba90969..0f74a64 100644
--- a/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/RuleInfo.java
+++ b/muyu-modules/muyu-product/muyu-product-common/src/main/java/com/muyu/product/domain/RuleInfo.java
@@ -16,6 +16,7 @@ import com.muyu.product.domain.req.RuleInfoSaveReq;
import com.muyu.product.domain.req.RuleInfoEditReq;
import com.muyu.common.core.web.domain.BaseEntity;
+import java.math.BigDecimal;
import java.util.Date;
import java.util.function.Supplier;
@@ -51,6 +52,19 @@ public class RuleInfo extends BaseEntity {
@ApiModelProperty(name = "规格状态", value = "规格状态")
private String status;
+ /**
+ *规格Sku
+ */
+ private String ruleSku;
+ /**
+ *拼团库存
+ */
+ private Long teamStock;
+ /**
+ * 拼团价格
+ */
+ private BigDecimal teamPrice;
+
/**
* 查询构造器
*/
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/MuYuProductApplication.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/MuYuProductApplication.java
index 84b6d80..242c6f3 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/MuYuProductApplication.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/MuYuProductApplication.java
@@ -3,6 +3,7 @@ package com.muyu.product;
import com.muyu.common.security.annotation.EnableCustomConfig;
import com.muyu.common.security.annotation.EnableMyFeignClients;
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
+import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsAttributeGroupMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsAttributeGroupMapper.java
index dd6a93f..3ea0890 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsAttributeGroupMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsAttributeGroupMapper.java
@@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsAttributeGroup;
import com.muyu.product.domain.req.AttributeInfoSaveReq;
+import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
@@ -12,6 +13,7 @@ import org.apache.ibatis.annotations.Param;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface AsAttributeGroupMapper extends BaseMapper {
void shanchu(Long id);
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsBrandProjectMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsBrandProjectMapper.java
index a78f814..587ac98 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsBrandProjectMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsBrandProjectMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsBrandProject;
+import org.apache.ibatis.annotations.Mapper;
/**
* 品牌商品中间Mapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.AsBrandProject;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface AsBrandProjectMapper extends BaseMapper {
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeGroupMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeGroupMapper.java
index b09e788..1393ef6 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeGroupMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeGroupMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsCategoryAttributeGroup;
+import org.apache.ibatis.annotations.Mapper;
/**
* 品类属性组中间Mapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.AsCategoryAttributeGroup;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface AsCategoryAttributeGroupMapper extends BaseMapper {
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeMapper.java
index 66c2e87..6214585 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryAttributeMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsCategoryAttribute;
+import org.apache.ibatis.annotations.Mapper;
/**
* 品类属性中间Mapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.AsCategoryAttribute;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface AsCategoryAttributeMapper extends BaseMapper {
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryBrandMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryBrandMapper.java
index 3e8c164..86f4133 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryBrandMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsCategoryBrandMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsCategoryBrand;
+import org.apache.ibatis.annotations.Mapper;
/**
* 品类品牌中间Mapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.AsCategoryBrand;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface AsCategoryBrandMapper extends BaseMapper {
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsProductAttributeInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsProductAttributeInfoMapper.java
index 4350c22..70b649b 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsProductAttributeInfoMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AsProductAttributeInfoMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AsProductAttributeInfo;
+import org.apache.ibatis.annotations.Mapper;
/**
* 商品属性Mapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.AsProductAttributeInfo;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface AsProductAttributeInfoMapper extends BaseMapper {
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AttributeGroupMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AttributeGroupMapper.java
index 9f1acd3..5839581 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AttributeGroupMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AttributeGroupMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AttributeGroup;
+import org.apache.ibatis.annotations.Mapper;
/**
* 属性组Mapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.AttributeGroup;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface AttributeGroupMapper extends BaseMapper {
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AttributeInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AttributeInfoMapper.java
index 8d00d2e..d62db60 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AttributeInfoMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/AttributeInfoMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.AttributeInfo;
+import org.apache.ibatis.annotations.Mapper;
/**
* 商品属性Mapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.AttributeInfo;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface AttributeInfoMapper extends BaseMapper {
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java
index 74ee44c..3dff738 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/BrandInfoMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.BrandInfo;
+import org.apache.ibatis.annotations.Mapper;
/**
* 品牌信息Mapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.BrandInfo;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface BrandInfoMapper extends BaseMapper {
String getName(Long brandId);
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CategoryInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CategoryInfoMapper.java
index 3218fce..8a20ab7 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CategoryInfoMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CategoryInfoMapper.java
@@ -4,6 +4,7 @@ import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.CategoryInfo;
import com.muyu.product.domain.resp.CategoryInfoResp;
+import org.apache.ibatis.annotations.Mapper;
/**
* 品类信息Mapper接口
@@ -11,6 +12,7 @@ import com.muyu.product.domain.resp.CategoryInfoResp;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface CategoryInfoMapper extends BaseMapper {
int findById(String ids);
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CommentInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CommentInfoMapper.java
index 9badc38..d5cf762 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CommentInfoMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CommentInfoMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.CommentInfo;
+import org.apache.ibatis.annotations.Mapper;
/**
* 商品评论Mapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.CommentInfo;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface CommentInfoMapper extends BaseMapper {
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CommentLikeInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CommentLikeInfoMapper.java
index 8b28651..5fe9859 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CommentLikeInfoMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/CommentLikeInfoMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.CommentLikeInfo;
+import org.apache.ibatis.annotations.Mapper;
/**
* 评论点赞Mapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.CommentLikeInfo;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface CommentLikeInfoMapper extends BaseMapper {
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectInfoMapper.java
index 128897f..e92881e 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectInfoMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectInfoMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.ProjectInfo;
+import org.apache.ibatis.annotations.Mapper;
/**
* 商品信息Mapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.ProjectInfo;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface ProjectInfoMapper extends BaseMapper {
ProjectInfo getProjectName(String name);
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectSkuInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectSkuInfoMapper.java
index 040cb21..88cf2c0 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectSkuInfoMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/ProjectSkuInfoMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.ProjectSkuInfo;
+import org.apache.ibatis.annotations.Mapper;
/**
* 商品SKUMapper接口
@@ -10,6 +11,7 @@ import com.muyu.product.domain.ProjectSkuInfo;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface ProjectSkuInfoMapper extends BaseMapper {
}
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleAttrInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleAttrInfoMapper.java
index b27d6be..d7e12a8 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleAttrInfoMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleAttrInfoMapper.java
@@ -3,6 +3,7 @@ package com.muyu.product.mapper;
import java.util.List;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.muyu.product.domain.RuleAttrInfo;
+import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
@@ -11,6 +12,7 @@ import org.apache.ibatis.annotations.Param;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface RuleAttrInfoMapper extends BaseMapper {
void shanchu(Long id);
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleInfoMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleInfoMapper.java
index 786fab8..a10b55d 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleInfoMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/RuleInfoMapper.java
@@ -6,6 +6,7 @@ import com.muyu.product.domain.RuleInfo;
import com.muyu.product.domain.req.RuleAttrInfoReq;
import com.muyu.product.domain.req.RuleInfoEditReq;
import com.muyu.product.domain.resp.RuleInfoResp;
+import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
/**
@@ -14,6 +15,7 @@ import org.apache.ibatis.annotations.Param;
* @author DongZeLiang
* @date 2024-02-27
*/
+@Mapper
public interface RuleInfoMapper extends BaseMapper {
RuleInfoResp getRuleById(Long id);
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/UpdAsCategoryAttributeMapper.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/UpdAsCategoryAttributeMapper.java
index 5d00e34..f508a10 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/UpdAsCategoryAttributeMapper.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/mapper/UpdAsCategoryAttributeMapper.java
@@ -1,7 +1,9 @@
package com.muyu.product.mapper;
+import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
+@Mapper
public interface UpdAsCategoryAttributeMapper {
void delAsCategoryAttribute(Long id);
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/ProjectInfoServiceImpl.java b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/ProjectInfoServiceImpl.java
index 14ab706..b907533 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/ProjectInfoServiceImpl.java
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/java/com/muyu/product/service/impl/ProjectInfoServiceImpl.java
@@ -20,6 +20,7 @@ import com.muyu.product.service.*;
import io.netty.util.internal.StringUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import com.muyu.product.mapper.ProjectInfoMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
@@ -33,6 +34,7 @@ import org.springframework.util.CollectionUtils;
* @date 2024-02-27
*/
@Slf4j
+@Component
@Service
public class ProjectInfoServiceImpl extends ServiceImpl implements ProjectInfoService {
diff --git a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/bootstrap.yml b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/bootstrap.yml
index 43fd3c4..5dfeebc 100644
--- a/muyu-modules/muyu-product/muyu-product-server/src/main/resources/bootstrap.yml
+++ b/muyu-modules/muyu-product/muyu-product-server/src/main/resources/bootstrap.yml
@@ -28,3 +28,5 @@ spring:
logging:
level:
com.muyu.product.mapper: DEBUG
+mybatis:
+ mapperLocations: classpath:mapper/*.xml