diff --git a/doc/团购查询单条数据结构.java b/doc/团购查询单条数据结构.java new file mode 100644 index 0000000..cac3100 --- /dev/null +++ b/doc/团购查询单条数据结构.java @@ -0,0 +1,29 @@ +{ + "商品ID": "Long", + "拼团名称": "String", + "活动简介": "Text", + "商品名称":"String", + "商品图片": "String", + "活动名称": "String", + "活动简介": "String", + "商品单位": "String", + "商品的轮播图": [ + "String", "String" + ], + "活动时间": "date", + "策略类型": "String", + "策略ID": "Long", + "商品规格List": [ + { + "规格SKU": "String", + "拼团价格": "BigDecimal", + "拼团库存": "Long" + } + ], + "排序": "Integer", + "详情": "String" + +} + + + diff --git a/doc/团购添加数据结构.java b/doc/团购添加数据结构.java index 8f8b26d..40fb515 100644 --- a/doc/团购添加数据结构.java +++ b/doc/团购添加数据结构.java @@ -45,3 +45,30 @@ activity_team_product_sku_info.product_sku(商品SKU) <- ActivityTeamProductSkuI activity_team_product_sku_info.team_stock(拼团库存) <- ActivityTeamProductSkuInfo.teamStock <- @商品规格.拼团库存 activity_team_product_sku_info.remain_stock(剩余库存) <- ActivityTeamProductSkuInfo.remainStock <- @商品规格.拼团库存 activity_team_product_sku_info.team_price(拼团价格) <- ActivityTeamProductSkuInfo.teamPrice <- @商品规格.拼团价格 + + + + + +{ + "code": 0, + "msg": "string", + "data": { + "rows": [ + { + "id": 0, + "name": "string", + "productImage": "string", + "productPrice": "string", + "teamPrice": "string", + "attendNumber": "string", + "openTeamNumber": "string", + "teamStock": "string", + "remainStock": "string", + "endTime": "string", + "status": "string" + } + ], + "total": "string" + } + } diff --git a/muyu-auth/src/main/resources/bootstrap.yml b/muyu-auth/src/main/resources/bootstrap.yml index b309a3d..1e240aa 100644 --- a/muyu-auth/src/main/resources/bootstrap.yml +++ b/muyu-auth/src/main/resources/bootstrap.yml @@ -14,10 +14,12 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall # 配置文件格式 file-extension: yml # 共享配置 diff --git a/muyu-gateway/src/main/resources/bootstrap.yml b/muyu-gateway/src/main/resources/bootstrap.yml index d7367b4..6b6460f 100644 --- a/muyu-gateway/src/main/resources/bootstrap.yml +++ b/muyu-gateway/src/main/resources/bootstrap.yml @@ -1,6 +1,6 @@ # Tomcat server: - port: 8080 + port: 18080 # Spring spring: @@ -14,10 +14,12 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall # 配置文件格式 file-extension: yml # 共享配置 @@ -28,12 +30,13 @@ spring: eager: true transport: # 控制台地址 - dashboard: 127.0.0.1:8718 + dashboard: 113.44.45.42:8718 # nacos配置持久化 datasource: ds1: nacos: - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall dataId: sentinel-muyu-gateway groupId: DEFAULT_GROUP data-type: json diff --git a/muyu-modules/muyu-file/src/main/resources/bootstrap.yml b/muyu-modules/muyu-file/src/main/resources/bootstrap.yml index 0cb85bd..f4ebce6 100644 --- a/muyu-modules/muyu-file/src/main/resources/bootstrap.yml +++ b/muyu-modules/muyu-file/src/main/resources/bootstrap.yml @@ -14,10 +14,12 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall # 配置文件格式 file-extension: yml # 共享配置 diff --git a/muyu-modules/muyu-gen/src/main/resources/bootstrap.yml b/muyu-modules/muyu-gen/src/main/resources/bootstrap.yml index b628931..14e36c5 100644 --- a/muyu-modules/muyu-gen/src/main/resources/bootstrap.yml +++ b/muyu-modules/muyu-gen/src/main/resources/bootstrap.yml @@ -14,10 +14,12 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall # 配置文件格式 file-extension: yml # 共享配置 diff --git a/muyu-modules/muyu-job/src/main/resources/bootstrap.yml b/muyu-modules/muyu-job/src/main/resources/bootstrap.yml index 618f3e8..ae97107 100644 --- a/muyu-modules/muyu-job/src/main/resources/bootstrap.yml +++ b/muyu-modules/muyu-job/src/main/resources/bootstrap.yml @@ -14,10 +14,12 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall # 配置文件格式 file-extension: yml # 共享配置 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 e94e0db..d1bd050 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 @@ -72,11 +72,6 @@ public class ActivityTeamInfo extends BaseEntity { */ private long strategyId; - /** - * 公共添加模型,转换成添加对象 - * @param activityTeamInfoAddModel 添加模型 - * @return 添加对象 - */ public static ActivityTeamInfo addModelBuild(ActivityTeamInfoAddModel activityTeamInfoAddModel){ return ActivityTeamInfo.builder() .name(activityTeamInfoAddModel.getName()) 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 43521d0..b663274 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 @@ -60,6 +60,6 @@ public class ActivityTeamProductSkuInfo extends BaseEntity { .teamStock(activityTeamProductSkuAddModel.getTeamStock()) .remainStock(activityTeamProductSkuAddModel.getTeamStock()) .teamPrice(activityTeamProductSkuAddModel.getTeamPrice()) - .build() + .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 index 40b2def..5894f62 100644 --- 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 @@ -2,7 +2,7 @@ package com.muyu.marketing.domain.model; import com.fasterxml.jackson.annotation.JsonFormat; -import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq; +import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; @@ -78,4 +78,30 @@ public class ActivityTeamInfoAddModel { * 策略ID */ private Long strategyId; + + public static ActivityTeamInfoAddModel saveTeamInfoBuild(ActivityTeamInfoSaveReq activityTeamInfoSaveReq){ + return ActivityTeamInfoAddModel.builder() + .name(activityTeamInfoSaveReq.getName()) + .productId(activityTeamInfoSaveReq.getProductId()) + .productImage(activityTeamInfoSaveReq.getProductImage()) + .introduction(activityTeamInfoSaveReq.getIntroduction()) + .unit(activityTeamInfoSaveReq.getUnit()) + .imageList(activityTeamInfoSaveReq.getImageList()) + .endTime(activityTeamInfoSaveReq.getEndTime()) + .sort(activityTeamInfoSaveReq.getSort()) + .content(activityTeamInfoSaveReq.getContent()) + .status(activityTeamInfoSaveReq.getStatus()) + .strategyType(activityTeamInfoSaveReq.getStrategyType()) + .strategyId(activityTeamInfoSaveReq.getStrategyId()) + .activityTeamProductSkuAddModelList( + activityTeamInfoSaveReq.getProjectSkuInfoAddReqList() + .stream() + .map(projectSkuInfoAddReq ->ActivityTeamProductSkuAddModel.addReqBulid(projectSkuInfoAddReq, activityTeamInfoSaveReq::getProductId)).toList() + ).build(); + } + + + + + } diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamInfoDaitlRespModel.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamInfoDaitlRespModel.java new file mode 100644 index 0000000..8e340d0 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamInfoDaitlRespModel.java @@ -0,0 +1,101 @@ +package com.muyu.marketing.domain.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.marketing.domain.ActivityTeamInfo; +import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq; +import com.muyu.marketing.domain.resp.ActivityTeamInfoDaitlResp; +import com.muyu.marketing.domain.resp.TeamProjectSkuInfoResp; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; +import java.util.List; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ActivityTeamInfoDaitlRespModel extends BaseEntity { + /** + * 活动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 projectSkuInfoAddReqList; + /** + * 活动详情 + */ + private String content; + /** + * 活动状态 + */ + private String status; + /** + * 策略类型 + */ + private String strategyType; + /** + * 策略ID + */ + private Long strategyId; +// +// public static ActivityTeamInfoDaitlRespModel findById(ActivityTeamInfo activityTeamInfo, List teamProductSkuInfoModelList){ +// return ActivityTeamInfoDaitlRespModel.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()) +// .projectSkuInfoAddReqList(teamProductSkuInfoModelList) +// .content(activityTeamInfo.getContent()) +// .status(activityTeamInfo.getStatus()) +// .strategyType(activityTeamInfo.getStrategyType()) +// .strategyId(activityTeamInfo.getStrategyId()) +// .build(); +// } + + + +} diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamInfoUpdModel.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamInfoUpdModel.java new file mode 100644 index 0000000..0407dda --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamInfoUpdModel.java @@ -0,0 +1,80 @@ +package com.muyu.marketing.domain.model; + +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.util.Date; +import java.util.List; + +/** + * 团购活动修改模型 + */ +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ActivityTeamInfoUpdModel { + /** + * 编号 + */ + private Long id; + + /** + * 拼团名称 + */ + private String name; + /** + * 商品ID + */ + private Long productId; + /** + * 商品活动图 + */ + private String productImage; + /** + * 活动简介 + */ + private String introduction; + /** + * 单位 + */ + + private String unit; + /** + * 轮播图 + */ + + private String imageList; + /** + * 活动结束时间 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") + private Date endTime; + /** + * 活动排序 + */ + private Integer sort; + /** + * 商品SkU集合 + */ + private List activityTeamProductSkuAddModelList; + /** + * 活动详情 + */ + private String content; + /** + * 活动状态 + */ + private String status; + /** + * 策略类型 + */ + private String strategyType; + /** + * 策略ID + */ + private Long strategyId; +} diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamProductSkuAddModel.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamProductSkuAddModel.java index 62195d0..8ada70e 100644 --- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamProductSkuAddModel.java +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamProductSkuAddModel.java @@ -1,12 +1,14 @@ package com.muyu.marketing.domain.model; +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.function.Supplier; /** * 团购spu库存添加模型 @@ -44,4 +46,13 @@ public class ActivityTeamProductSkuAddModel { * 拼团库存 */ private Long teamStock; + + public static ActivityTeamProductSkuAddModel addReqBulid(TeamProjectSkuInfoAddReq teamProjectSkuInfoAddReq, Supplier productId){ + return ActivityTeamProductSkuAddModel.builder() + .productId(productId.get()) + .sku(teamProjectSkuInfoAddReq.getSku()) + .teamPrice(teamProjectSkuInfoAddReq.getTeamPrice()) + .teamStock(teamProjectSkuInfoAddReq.getTeamStock()) + .build(); + } } diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamProductSkuInfoModel.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamProductSkuInfoModel.java new file mode 100644 index 0000000..1b1e441 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/ActivityTeamProductSkuInfoModel.java @@ -0,0 +1,46 @@ +package com.muyu.marketing.domain.model; + +import com.muyu.common.core.web.domain.BaseEntity; +import jdk.jfr.Name; +import lombok.AllArgsConstructor; +import lombok.Builder; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@Builder +public class ActivityTeamProductSkuInfoModel extends BaseEntity { + /** + * 编号 + */ + private Integer id; + + /** + * 活动id + */ + private Long teamId; + + /** + * 商品id + */ + private Long productId; + + /** + * 规格SKU + */ + private String sku; + + /** + * 拼团价格 + */ + private BigDecimal teamPrice; + + /** + * 拼团库存 + */ + private Long teamStock; +} diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/TeamProductDiscountPriceModel.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/TeamProductDiscountPriceModel.java index 61f9d08..838d8e7 100644 --- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/TeamProductDiscountPriceModel.java +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/model/TeamProductDiscountPriceModel.java @@ -44,7 +44,7 @@ public class TeamProductDiscountPriceModel { * @return 优惠力度 */ public static TeamProductDiscountPriceModel of(BigDecimal productPrice, BigDecimal teamPrice) { - TeamProductDiscountPriceModel.builder() + return TeamProductDiscountPriceModel.builder() .productPrice(productPrice) .teamPrice(teamPrice) .discount( diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoSaveReq.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoSaveReq.java index 24afced..18ead04 100644 --- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoSaveReq.java +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ActivityTeamInfoSaveReq.java @@ -55,7 +55,7 @@ public class ActivityTeamInfoSaveReq extends BaseEntity { /** * 商品SkU集合 */ - private List projectSkuInfoAddReqList; + private List projectSkuInfoAddReqList; /** * 活动详情 */ @@ -72,4 +72,11 @@ public class ActivityTeamInfoSaveReq extends BaseEntity { * 策略ID */ private Long strategyId; + + public static ActivityTeamInfoSaveReq saveSkuInfosBuild(ActivityTeamInfoSaveReq activityTeamInfoSaveReq){ + return ActivityTeamInfoSaveReq.builder() + .projectSkuInfoAddReqList(activityTeamInfoSaveReq.getProjectSkuInfoAddReqList()) + .build(); + } + } diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/TeamInfoListReq.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/TeamInfoListReq.java index fcfc308..4dab2b5 100644 --- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/TeamInfoListReq.java +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/TeamInfoListReq.java @@ -3,9 +3,10 @@ package com.muyu.marketing.domain.req; import com.muyu.common.core.web.page.PageDomain; import com.muyu.marketing.domain.model.ActivityTeamInfoListQueryModel; import lombok.*; +import lombok.experimental.SuperBuilder; @Data -@Builder +@SuperBuilder @NoArgsConstructor @AllArgsConstructor @EqualsAndHashCode(callSuper = true) diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ProjectSkuInfoAddReq.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/TeamProjectSkuInfoAddReq.java similarity index 74% rename from muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ProjectSkuInfoAddReq.java rename to muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/TeamProjectSkuInfoAddReq.java index 0a7c56d..53edbe0 100644 --- a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/ProjectSkuInfoAddReq.java +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/req/TeamProjectSkuInfoAddReq.java @@ -1,27 +1,22 @@ package com.muyu.marketing.domain.req; import lombok.AllArgsConstructor; -import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; -import lombok.experimental.SuperBuilder; import java.math.BigDecimal; -/** - * 添加的 - */ @Data -@SuperBuilder @AllArgsConstructor @NoArgsConstructor -public class ProjectSkuInfoAddReq { +public class TeamProjectSkuInfoAddReq { /** * 规格SKU */ private String sku; + /** * 拼团价格 */ diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamInfoDaitlResp.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamInfoDaitlResp.java new file mode 100644 index 0000000..72f0a20 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/ActivityTeamInfoDaitlResp.java @@ -0,0 +1,89 @@ +package com.muyu.marketing.domain.resp; + +import com.fasterxml.jackson.annotation.JsonFormat; +import com.muyu.common.core.web.domain.BaseEntity; +import com.muyu.marketing.domain.req.TeamProjectSkuInfoAddReq; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; +import lombok.experimental.SuperBuilder; + +import java.util.Date; +import java.util.List; + +@Data +@SuperBuilder +@NoArgsConstructor +@AllArgsConstructor +@EqualsAndHashCode(callSuper = true) +public class ActivityTeamInfoDaitlResp extends BaseEntity { + + + /** + * 活动id + */ + private Long teamId; + /** + * 拼团名称 + */ + private String name; + /** + * 商品ID + */ + private Long productId; + /** + * 商品活动图 + */ + private String productImage; + /** + * 活动简介 + */ + private String introduction; + /** + * 单位 + */ + + private String unit; + /** + * 轮播图 + */ + + private String imageList; + /** + * 活动结束时间 + */ + @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd") + private Date endTime; + /** + * 活动排序 + */ + private Integer sort; + /** + * 商品SkU集合 + */ + private List projectSkuInfoAddReqList; + /** + * 活动详情 + */ + private String content; + /** + * 活动状态 + */ + private String status; + /** + * 策略类型 + */ + private String strategyType; + /** + * 策略ID + */ + private Long strategyId; + + public static ActivityTeamInfoDaitlResp saveSkuInfosBuild(ActivityTeamInfoDaitlResp activityTeamInfoSaveReq){ + return ActivityTeamInfoDaitlResp.builder() + .projectSkuInfoAddReqList(activityTeamInfoSaveReq.getProjectSkuInfoAddReqList()) + .build(); + } + +} diff --git a/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/TeamProjectSkuInfoResp.java b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/TeamProjectSkuInfoResp.java new file mode 100644 index 0000000..3f64109 --- /dev/null +++ b/muyu-modules/muyu-marketing/marketing-common/src/main/java/com/muyu/marketing/domain/resp/TeamProjectSkuInfoResp.java @@ -0,0 +1,44 @@ +package com.muyu.marketing.domain.resp; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +import java.math.BigDecimal; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class TeamProjectSkuInfoResp { + + /** + * 编号 + */ + private Integer id; + + /** + * 活动id + */ + private Long teamId; + + /** + * 商品id + */ + private Long productId; + + /** + * 规格SKU + */ + private String sku; + + + /** + * 拼团价格 + */ + private BigDecimal teamPrice; + + /** + * 拼团库存 + */ + private Long teamStock; +} diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/controller/ActivityTeamController.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/controller/ActivityTeamController.java index 4694815..8776a02 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/controller/ActivityTeamController.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/controller/ActivityTeamController.java @@ -3,10 +3,13 @@ package com.muyu.marketing.team.controller; import com.muyu.common.core.domain.Result; import com.muyu.common.core.web.page.TableDataInfo; +import com.muyu.marketing.domain.model.ActivityTeamInfoAddModel; import com.muyu.marketing.domain.model.ActivityTeamInfoListModel; +import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq; import com.muyu.marketing.domain.req.TeamInfoListReq; import com.muyu.marketing.domain.resp.TeamInfoListResp; import com.muyu.marketing.team.service.ActivityTeamInfoService; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; @@ -21,6 +24,7 @@ import java.util.List; * @author DongZeLiang * @date 2024-11-20 14:25 */ +@Slf4j @RestController @RequestMapping("/team") public class ActivityTeamController { @@ -44,4 +48,10 @@ public class ActivityTeamController { }} ); } + + @PostMapping("/save") + public Result save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq){ + activityTeamInfoService.save(ActivityTeamInfoAddModel.saveTeamInfoBuild(activityTeamInfoSaveReq)); + return Result.success(); + } } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/ActivityTeamProductSkuInfoService.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/ActivityTeamProductSkuInfoService.java index 6a5d6dd..2c99436 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/ActivityTeamProductSkuInfoService.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/ActivityTeamProductSkuInfoService.java @@ -3,8 +3,8 @@ package com.muyu.marketing.team.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.extension.service.IService; import com.muyu.marketing.domain.ActivityTeamProductSkuInfo; -import com.muyu.marketing.domain.TeamStrategyExemptionHundred; import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel; +import com.muyu.marketing.domain.model.ActivityTeamProductSkuInfoModel; import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel; import com.muyu.marketing.domain.model.TeamProductStockModel; @@ -41,4 +41,10 @@ public interface ActivityTeamProductSkuInfoService extends IService activityTeamProductSkuAddModelList); +// /** +// * 添加规格 +// * @param teamId +// * @return +// */ +// public List findByIdSku(Long teamId); } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamInfoServiceImpl.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamInfoServiceImpl.java index e4e9313..5153370 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamInfoServiceImpl.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamInfoServiceImpl.java @@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import com.muyu.common.core.exception.ServiceException; import com.muyu.common.core.utils.StringUtils; import com.muyu.common.core.web.page.TableDataInfo; import com.muyu.marketing.domain.ActivityTeamInfo; @@ -15,6 +14,7 @@ import com.muyu.marketing.team.service.ActivityTeamOpenInfoService; import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import org.springframework.util.Assert; import java.util.ArrayList; import java.util.List; @@ -68,6 +68,7 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl teamProductSkuAddModelList = activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList(); + teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId())); + this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList); } } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamProductSkuInfoServiceImpl.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamProductSkuInfoServiceImpl.java index 6e87518..0fc3973 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamProductSkuInfoServiceImpl.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/team/service/impl/ActivityTeamProductSkuInfoServiceImpl.java @@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.muyu.common.core.exception.ServiceException; import com.muyu.marketing.domain.ActivityTeamProductSkuInfo; import com.muyu.marketing.domain.model.ActivityTeamProductSkuAddModel; +import com.muyu.marketing.domain.model.ActivityTeamProductSkuInfoModel; import com.muyu.marketing.domain.model.TeamProductDiscountPriceModel; import com.muyu.marketing.domain.model.TeamProductStockModel; import com.muyu.marketing.team.mapper.ActivityTeamProductSkuInfoMapper; @@ -80,4 +81,15 @@ public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl findByIdSku(Long teamId) { +// LambdaQueryWrapper queryWrapper = new LambdaQueryWrapper<>(); +// queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,teamId); +// List list = this.list(); +// list.stream().map(ActivityTeamProductSkuInfo->{ +// ActivityTeamProductSkuAddModel builder = ActivityTeamProductSkuAddModel.builder(ActivityTeamProductSkuInfo); +// }) +// +// } } diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/resources/bootstrap.yml b/muyu-modules/muyu-marketing/marketing-server/src/main/resources/bootstrap.yml index 78b5a7b..268ea64 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/resources/bootstrap.yml +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/resources/bootstrap.yml @@ -14,10 +14,12 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall # 配置文件格式 file-extension: yml # 共享配置 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 e8bd02d..026b8c1 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 @@ -14,10 +14,12 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall # 配置文件格式 file-extension: yml # 共享配置 diff --git a/muyu-modules/muyu-shop-cart/muyu-shop-cart-server/src/main/resources/bootstrap.yml b/muyu-modules/muyu-shop-cart/muyu-shop-cart-server/src/main/resources/bootstrap.yml index 8e54ec5..7bc625d 100644 --- a/muyu-modules/muyu-shop-cart/muyu-shop-cart-server/src/main/resources/bootstrap.yml +++ b/muyu-modules/muyu-shop-cart/muyu-shop-cart-server/src/main/resources/bootstrap.yml @@ -16,10 +16,12 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall # 配置文件格式 file-extension: yml # 共享配置 diff --git a/muyu-modules/muyu-system/src/main/resources/bootstrap.yml b/muyu-modules/muyu-system/src/main/resources/bootstrap.yml index a66fd4c..e0bfdb2 100644 --- a/muyu-modules/muyu-system/src/main/resources/bootstrap.yml +++ b/muyu-modules/muyu-system/src/main/resources/bootstrap.yml @@ -14,10 +14,12 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall # 配置文件格式 file-extension: yml # 共享配置 diff --git a/muyu-visual/muyu-monitor/src/main/resources/bootstrap.yml b/muyu-visual/muyu-monitor/src/main/resources/bootstrap.yml index 1276c8e..57949ba 100644 --- a/muyu-visual/muyu-monitor/src/main/resources/bootstrap.yml +++ b/muyu-visual/muyu-monitor/src/main/resources/bootstrap.yml @@ -14,10 +14,12 @@ spring: nacos: discovery: # 服务注册地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall config: # 配置中心地址 - server-addr: 127.0.0.1:8848 + server-addr: 113.44.45.42:8848 + namespace: www-mall # 配置文件格式 file-extension: yml # 共享配置