2204A-cyj(回显)

1126/chengyingjie
成英杰 2024-11-27 14:25:25 +08:00
parent 46a56bd7aa
commit 0d177ec339
9 changed files with 144 additions and 11 deletions

View File

@ -0,0 +1,40 @@
{
"拼团":{
"活动id": "Long",
"商品ID": "Long",
"商品图片": "String",
"活动名称": "String",
"活动简介": "String",
"商品单位": "String",
"商品的轮播图": [
"String",
"String"
],
"活动状态": "String",
"排序": "Integer",
"详情": "String",
"团购策略": "String",
"团购类型": "String",
"活动时间": "date"
},
"商品规格List": [
{
"策略ID": "Long",
"规格主键": "Long",
"规格SKU": "String",
"拼团价格": "BigDecimal",
"拼团库存": "Long"
},
{
"策略ID": "Long",
"规格主键": "Long",
"规格SKU": "String",
"拼团价格": "BigDecimal",
"拼团库存": "Long"
}
]
}

View File

@ -36,7 +36,7 @@ public class ActivityTeamInfo extends BaseEntity {
/** /**
* ID * ID
*/ */
private long productId; private Long productId;
/** /**
* *
*/ */

View File

@ -54,6 +54,7 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
*/ */
private BigDecimal teamPrice; private BigDecimal teamPrice;
/** /**
* *
* @param activityTeamProductSkuAddModel * @param activityTeamProductSkuAddModel
@ -64,7 +65,7 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
.productId(activityTeamProductSkuAddModel.getProductId()) .productId(activityTeamProductSkuAddModel.getProductId())
.teamId(activityTeamProductSkuAddModel.getTeamId()) .teamId(activityTeamProductSkuAddModel.getTeamId())
.teamStock(activityTeamProductSkuAddModel.getTeamStock()) .teamStock(activityTeamProductSkuAddModel.getTeamStock())
.remainStock(activityTeamProductSkuAddModel.getTeamStock()) // .remainStock(activityTeamProductSkuAddModel.getTeamStock())
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice()) .teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
.build(); .build();
} }

View File

@ -0,0 +1,80 @@
package com.muyu.marketing.domain.model;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.Date;
import java.util.List;
/**
*
*
* @author DongZeLiang
* @date 2024-11-26 09:38
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ActivityTeamInfoUpdateModel {
/**
*
*/
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;
/**
*
*/
private String content;
/**
*
*/
private String status;
/**
*
*/
private String strategyType;
/**
* ID
*/
private Long strategyId;
/** 删除商品规格idList*/
private List<Long> ids;
}

View File

@ -52,7 +52,7 @@ public class ActivityTeamProductSkuAddModel {
return ActivityTeamProductSkuAddModel.builder() return ActivityTeamProductSkuAddModel.builder()
.productId(productId.get()) .productId(productId.get())
.sku(teamProjectSkuInfoAddReq.getSku()) .sku(teamProjectSkuInfoAddReq.getSku())
.teamStock(teamProjectSkuInfoAddReq.getTeamStock()) // .teamStock(teamProjectSkuInfoAddReq.getTeamStock())
.teamPrice(teamProjectSkuInfoAddReq.getTeamPrice()) .teamPrice(teamProjectSkuInfoAddReq.getTeamPrice())
.build(); .build();
} }

View File

@ -43,7 +43,7 @@ public class TeamProjectSkuInfoResp {
.ruleId(skuInfo.getId()) .ruleId(skuInfo.getId())
.sku(skuInfo.getProductSku()) .sku(skuInfo.getProductSku())
.teamPrice(skuInfo.getTeamPrice()) .teamPrice(skuInfo.getTeamPrice())
.teamStock(skuInfo.getTeamStock()) // .teamStock(skuInfo.getTeamStock())
.build(); .build();
} }

View File

@ -63,7 +63,7 @@ public class ActivityTeamController {
* *
* @teamId id * @teamId id
*/ */
@GetMapping("/select/{id}") @GetMapping("/{teamId}")
public Result<ActivityTeamInfoResp> getTeamInfo(@PathVariable Long teamId){ public Result<ActivityTeamInfoResp> getTeamInfo(@PathVariable Long teamId){
//调用Service方法 获取回显Model //调用Service方法 获取回显Model
ActivityTeamInfoSelectModel activityTeamInfoSelectModel = activityTeamInfoService.selectTeamInfo(teamId); ActivityTeamInfoSelectModel activityTeamInfoSelectModel = activityTeamInfoService.selectTeamInfo(teamId);

View File

@ -16,6 +16,7 @@ import com.muyu.marketing.team.service.ActivityTeamInfoService;
import com.muyu.marketing.team.service.ActivityTeamOpenInfoService; import com.muyu.marketing.team.service.ActivityTeamOpenInfoService;
import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService; import com.muyu.marketing.team.service.ActivityTeamProductSkuInfoService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.Assert; import org.springframework.util.Assert;
@ -31,8 +32,6 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
@Autowired @Autowired
private ActivityTeamOpenInfoService activityTeamOpenInfoService; private ActivityTeamOpenInfoService activityTeamOpenInfoService;
@Autowired
private ActivityTeamInfoServiceImpl activityTeamInfoService;
@Autowired @Autowired
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService; private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
@ -97,11 +96,9 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
@Override @Override
public ActivityTeamInfoSelectModel selectTeamInfo(Long teamId) { public ActivityTeamInfoSelectModel selectTeamInfo(Long teamId) {
//根据拼团活动id 查询拼团活动 //根据拼团活动id 查询拼团活动
ActivityTeamInfo activityTeamInfo = activityTeamInfoService.getById(teamId); ActivityTeamInfo activityTeamInfo = this.getById(teamId);
//查询活动中的 商品sku集合 //查询活动中的 商品sku集合
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>(); List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfoList = activityTeamProductSkuInfoService.getActivityTeamProductSkuInfoByTeamId(teamId);
queryWrapper.eq(ActivityTeamProductSkuInfo::getProductId,activityTeamInfo.getProductId());
List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfoList = activityTeamProductSkuInfoService.list(queryWrapper);
//构造成 ActivityTeamInfoSelectModel //构造成 ActivityTeamInfoSelectModel
ActivityTeamInfoSelectModel teamInfoSelectModel = ActivityTeamInfoSelectModel.getTeamInfoSelectModel(activityTeamInfo, activityTeamProductSkuInfoList); ActivityTeamInfoSelectModel teamInfoSelectModel = ActivityTeamInfoSelectModel.getTeamInfoSelectModel(activityTeamInfo, activityTeamProductSkuInfoList);

View File

@ -4,6 +4,21 @@ server:
# Spring # Spring
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: application:
# 应用名称 # 应用名称
name: muyu-marketing name: muyu-marketing