From c9cf72d31146929829d240f99a4ccbb2fd9c0b03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=AC=A8=E8=9B=8B?= <14958938+qianqiao5-6-7@user.noreply.gitee.com> Date: Sun, 24 Nov 2024 21:42:45 +0800 Subject: [PATCH] =?UTF-8?q?2204-11-20=20=20(=E6=B7=BB=E5=8A=A0=E6=8B=BC?= =?UTF-8?q?=E5=9B=A211.24)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../domain/ActivityTeamProductSkuInfo.java | 2 +- .../model/ActivityTeamProductSkuInfoModel.java | 8 +++++--- .../muyu/marketing/MuYuMarketIngApplication.java | 1 + .../service/impl/ActivityTeamInfoServiceImpl.java | 6 ++---- .../src/main/resources/bootstrap.yml | 15 +++++++++++++++ 5 files changed, 24 insertions(+), 8 deletions(-) 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 4c8d771..49fed3d 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 @@ -32,7 +32,7 @@ public class ActivityTeamProductSkuInfo extends BaseEntity { /** 商品SKU*/ private String productSku; /** 拼团库存*/ - private Long teamStock; + private Integer teamStock; /** 拼团价格*/ private BigDecimal teamPrice; 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 index c612218..fbf78e1 100644 --- 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 @@ -8,6 +8,8 @@ import lombok.Data; import lombok.NoArgsConstructor; import org.apache.poi.hpsf.Decimal; +import java.math.BigDecimal; + /** 添加拼团商品规格Model*/ @Data @AllArgsConstructor @@ -23,9 +25,9 @@ private Long productId; /** 商品SKU*/ private String productSku; /** 拼团库存*/ -private String teamStock; +private Long teamStock; /** 拼团价格*/ -private Decimal teamPrice; +private BigDecimal teamPrice; /** * 拼团活动的商品规格*/ @@ -34,7 +36,7 @@ private Decimal teamPrice; .teamId(projectId) .productId(goodsId) .productSku(skuInfo.getProductSku()) - .teamStock(0L) + .teamStock(skuInfo.getTeamStock()) .teamPrice(skuInfo.getTeamPrice()) .build(); diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/MuYuMarketIngApplication.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/MuYuMarketIngApplication.java index d7bee3e..c256091 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/MuYuMarketIngApplication.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/MuYuMarketIngApplication.java @@ -4,6 +4,7 @@ import com.muyu.common.security.annotation.EnableMyFeignClients; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.cloud.openfeign.EnableFeignClients; +import org.springframework.context.annotation.Primary; import org.springframework.stereotype.Component; /** diff --git a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java index f036cb9..c07b0aa 100644 --- a/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java +++ b/muyu-modules/muyu-marketing/marketing-server/src/main/java/com/muyu/marketing/service/impl/ActivityTeamInfoServiceImpl.java @@ -91,14 +91,12 @@ implements ActivityTeamInfoService { ActivityTeamInfo activityTeamInfo = ActivityTeamInfoAddModel.saveModelBuild(activityTeamInfoReq); boolean save = this.save(activityTeamInfo); - + List skuList = activityTeamInfoReq.getProjectSkuList(); + ArrayList infoArrayList = new ArrayList<>(); //添加 拼团规格表 if (save){ Long projectId = activityTeamInfo.getId();//活动id Long goodsId = activityTeamInfo.getProductId(); - List skuList = activityTeamInfoReq.getProjectSkuList(); - - ArrayList infoArrayList = new ArrayList<>(); skuList.forEach(skuInfo->{ ActivityTeamProductSkuInfo activityTeamProductSkuInfo = ActivityTeamProductSkuInfoModel.saveModelBuild(projectId, goodsId, skuInfo); infoArrayList.add(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 0225afa..b35d120 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 @@ -3,6 +3,21 @@ server: port: 9204 # Spring spring: + datasource: + dynamic: + primary: master + datasource: + # 主库数据源 + master: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://60.204.150.30:3306/activity_team?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: xx-12345 + slave: + driver-class-name: com.mysql.cj.jdbc.Driver + url: jdbc:mysql://60.204.150.30:3306/product?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8 + username: root + password: xx-12345 application: # 应用名称 name: muyu-marketing