Compare commits
5 Commits
master
...
1125/cheng
Author | SHA1 | Date |
---|---|---|
|
f041621ae4 | |
|
78c47a1d90 | |
|
2855601c13 | |
|
d3a93de52b | |
|
f9384d3b16 |
|
@ -0,0 +1,23 @@
|
|||
{
|
||||
"拼团名称": "String",
|
||||
"商品活动图": "String",
|
||||
"商品ID": "Long",
|
||||
"策略ID": "Long",
|
||||
"团购活动ID": "Long",
|
||||
"商品sku": [
|
||||
"Long","Long"
|
||||
],
|
||||
"轮播图": [
|
||||
|
||||
],
|
||||
"活动排序": "",
|
||||
"活动详情": "",
|
||||
|
||||
"策略类型": "",
|
||||
|
||||
"库存": "",
|
||||
"活动状态": "",
|
||||
"活动结束时间": "",
|
||||
"商品状态": "",
|
||||
|
||||
}
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.muyu.common.core.web.page;
|
|||
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -60,6 +60,6 @@ public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|||
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||
.build()
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,12 +2,16 @@ package com.muyu.marketing.domain.model;
|
|||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -78,4 +82,29 @@ public class ActivityTeamInfoAddModel {
|
|||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
|
||||
/** addReq 转话addModel模型**/
|
||||
public static ActivityTeamInfoAddModel convertAddModel(ActivityTeamInfoSaveReq addReq) {
|
||||
|
||||
return ActivityTeamInfoAddModel.builder()
|
||||
.name(addReq.getName())
|
||||
.productId(addReq.getProductId())
|
||||
.productImage(addReq.getProductImage())
|
||||
.introduction(addReq.getIntroduction())
|
||||
.unit(addReq.getUnit())
|
||||
.imageList(addReq.getImageList())
|
||||
.endTime(addReq.getEndTime())
|
||||
.sort(addReq.getSort())
|
||||
.activityTeamProductSkuAddModelList(addReq.getProjectSkuInfoAddReqList()
|
||||
.stream()
|
||||
.map(projectSkuInfoAddReq -> ActivityTeamProductSkuAddModel.convertProductSkuList(projectSkuInfoAddReq, addReq))
|
||||
.toList())
|
||||
.content(addReq.getContent())
|
||||
.status(addReq.getStatus())
|
||||
.strategyType(addReq.getStrategyType())
|
||||
.strategyId(addReq.getStrategyId())
|
||||
.build();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,12 +1,15 @@
|
|||
package com.muyu.marketing.domain.model;
|
||||
|
||||
|
||||
import com.muyu.marketing.domain.req.ActivityTeamInfoSaveReq;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 团购spu库存添加模型
|
||||
|
@ -44,4 +47,15 @@ public class ActivityTeamProductSkuAddModel {
|
|||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
/** ProjectSkuInfoAddReq 转换 ProductSkuAddModel **/
|
||||
public static ActivityTeamProductSkuAddModel convertProductSkuList(ProjectSkuInfoAddReq skuInfoAdd,ActivityTeamInfoSaveReq addReq) {
|
||||
return ActivityTeamProductSkuAddModel
|
||||
.builder()
|
||||
.sku(skuInfoAdd.getSku())
|
||||
.teamPrice(skuInfoAdd.getTeamPrice())
|
||||
.teamStock(skuInfoAdd.getTeamStock())
|
||||
.productId(addReq.getProductId())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.muyu.marketing.domain.req.ProjectSkuInfoAddReq;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/** 拼团活动回显对象*/
|
||||
public class ActivityTeamInfoResp {
|
||||
/**
|
||||
* 活动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<ProjectSkuInfoAddResp> projectSkuInfoAddList;
|
||||
/**
|
||||
* 活动详情
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 活动状态
|
||||
*/
|
||||
private String status;
|
||||
/**
|
||||
* 策略类型
|
||||
*/
|
||||
private String strategyType;
|
||||
/**
|
||||
* 策略ID
|
||||
*/
|
||||
private Long strategyId;
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.muyu.marketing.domain.resp;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
public class ProjectSkuInfoAddResp {
|
||||
/**
|
||||
* 规格SKU
|
||||
*/
|
||||
private String sku;
|
||||
|
||||
/**
|
||||
* 拼团价格
|
||||
*/
|
||||
private BigDecimal teamPrice;
|
||||
|
||||
/**
|
||||
* 拼团库存
|
||||
*/
|
||||
private Long teamStock;
|
||||
|
||||
/** 规格id*/
|
||||
private Integer ruleId;
|
||||
}
|
|
@ -3,7 +3,10 @@ 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.ProjectSkuInfoAddReq;
|
||||
import com.muyu.marketing.domain.req.TeamInfoListReq;
|
||||
import com.muyu.marketing.domain.resp.TeamInfoListResp;
|
||||
import com.muyu.marketing.team.service.ActivityTeamInfoService;
|
||||
|
@ -44,4 +47,10 @@ public class ActivityTeamController {
|
|||
}}
|
||||
);
|
||||
}
|
||||
|
||||
@PostMapping("/add")
|
||||
public Result<String> add(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
||||
activityTeamInfoService.save(ActivityTeamInfoAddModel.convertAddModel(activityTeamInfoSaveReq));
|
||||
return Result.success();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -16,10 +16,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Tomcat
|
||||
server:
|
||||
port: 9100
|
||||
port: 9101
|
||||
|
||||
# Spring
|
||||
spring:
|
||||
|
@ -14,10 +14,10 @@ spring:
|
|||
nacos:
|
||||
discovery:
|
||||
# 服务注册地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
config:
|
||||
# 配置中心地址
|
||||
server-addr: 127.0.0.1:8848
|
||||
server-addr: 60.204.150.30:8848
|
||||
# 配置文件格式
|
||||
file-extension: yml
|
||||
# 共享配置
|
||||
|
|
Loading…
Reference in New Issue