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