最终上传12-5
parent
10d4db2163
commit
bc9270c02d
|
@ -0,0 +1,56 @@
|
||||||
|
package com.muyu.gateway.config;
|
||||||
|
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||||
|
import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||||
|
import org.springframework.web.cors.reactive.CorsUtils;
|
||||||
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
|
import org.springframework.web.server.WebFilter;
|
||||||
|
import org.springframework.web.server.WebFilterChain;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跨域配置
|
||||||
|
*/
|
||||||
|
@Configuration
|
||||||
|
public class CorsConfig
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 这里为支持的请求头,如果有自定义的header字段请自己添加
|
||||||
|
*/
|
||||||
|
private static final String ALLOWED_HEADERS = "X-Requested-With, Content-Type, Authorization, credential, X-XSRF-TOKEN, token, Admin-Token, App-Token";
|
||||||
|
private static final String ALLOWED_METHODS = "GET,POST,PUT,DELETE,OPTIONS,HEAD";
|
||||||
|
private static final String ALLOWED_ORIGIN = "*";
|
||||||
|
private static final String ALLOWED_EXPOSE = "*";
|
||||||
|
private static final String MAX_AGE = "18000L";
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
public WebFilter corsFilter()
|
||||||
|
{
|
||||||
|
return (ServerWebExchange ctx, WebFilterChain chain) -> {
|
||||||
|
ServerHttpRequest request = ctx.getRequest();
|
||||||
|
if (CorsUtils.isCorsRequest(request))
|
||||||
|
{
|
||||||
|
ServerHttpResponse response = ctx.getResponse();
|
||||||
|
HttpHeaders headers = response.getHeaders();
|
||||||
|
headers.add("Access-Control-Allow-Headers", ALLOWED_HEADERS);
|
||||||
|
headers.add("Access-Control-Allow-Methods", ALLOWED_METHODS);
|
||||||
|
headers.add("Access-Control-Allow-Origin", ALLOWED_ORIGIN);
|
||||||
|
headers.add("Access-Control-Expose-Headers", ALLOWED_EXPOSE);
|
||||||
|
headers.add("Access-Control-Max-Age", MAX_AGE);
|
||||||
|
headers.add("Access-Control-Allow-Credentials", "true");
|
||||||
|
if (request.getMethod() == HttpMethod.OPTIONS)
|
||||||
|
{
|
||||||
|
response.setStatusCode(HttpStatus.OK);
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return chain.filter(ctx);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
package com.muyu.active.domain;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.muyu.active.domain.model.ActivityTeamInfoSaveModel;
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 拼团信息主表
|
|
||||||
*/
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@SuperBuilder
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ActivityTeamInfo extends BaseEntity {
|
|
||||||
|
|
||||||
@TableId(value = "id",type = IdType.AUTO)
|
|
||||||
private long id;
|
|
||||||
private String name;
|
|
||||||
private long productId;
|
|
||||||
private String productImage;
|
|
||||||
private String introduction;
|
|
||||||
private String unit;
|
|
||||||
private String imageList;
|
|
||||||
private Date endTime;
|
|
||||||
private long sort;
|
|
||||||
private String content;
|
|
||||||
private String status;
|
|
||||||
private String strategyType;
|
|
||||||
private long strategyId;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 构造方法
|
|
||||||
*/
|
|
||||||
public static ActivityTeamInfo saveActivityTeamInfo(ActivityTeamInfoSaveModel activityTeamInfoSaveModel){
|
|
||||||
return ActivityTeamInfo.builder()
|
|
||||||
.name(activityTeamInfoSaveModel.getName())
|
|
||||||
.productId(activityTeamInfoSaveModel.getProductId())
|
|
||||||
.productImage(activityTeamInfoSaveModel.getProductImage())
|
|
||||||
.introduction(activityTeamInfoSaveModel.getIntroduction())
|
|
||||||
.unit(activityTeamInfoSaveModel.getUnit())
|
|
||||||
.imageList(activityTeamInfoSaveModel.getImageList().toString())
|
|
||||||
.endTime(activityTeamInfoSaveModel.getEndTime())
|
|
||||||
.sort(activityTeamInfoSaveModel.getSort())
|
|
||||||
.content(activityTeamInfoSaveModel.getContent())
|
|
||||||
.status(activityTeamInfoSaveModel.getStatus())
|
|
||||||
.strategyType(activityTeamInfoSaveModel.getStrategyType())
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,42 +0,0 @@
|
||||||
package com.muyu.active.domain;
|
|
||||||
|
|
||||||
import com.muyu.active.domain.model.TeamSkuInfoModel;
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品sku主表
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@SuperBuilder
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ActivityTeamProductSkuInfo extends BaseEntity {
|
|
||||||
private long id;
|
|
||||||
private long teamId;
|
|
||||||
private Long productId;
|
|
||||||
private String productSku;
|
|
||||||
private Long teamStock;
|
|
||||||
private Long remainStock;
|
|
||||||
private BigDecimal teamPrice;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 构造函数的方法
|
|
||||||
* 商品sku模型
|
|
||||||
*/
|
|
||||||
public static ActivityTeamProductSkuInfo TeamSkuInfoBuild(TeamSkuInfoModel teamSkuInfoModel, Function<ActivityTeamProductSkuInfoBuilder,ActivityTeamProductSkuInfo> function){
|
|
||||||
return function.apply(ActivityTeamProductSkuInfo.builder()
|
|
||||||
.teamPrice(teamSkuInfoModel.getTeamPrice())
|
|
||||||
.teamStock(teamSkuInfoModel.getTeamStock())
|
|
||||||
.productSku(teamSkuInfoModel.getProductSku())
|
|
||||||
.productId(teamSkuInfoModel.getProductId()));
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,24 +0,0 @@
|
||||||
package com.muyu.service;
|
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.active.domain.ActivityTeamInfo;
|
|
||||||
import com.muyu.active.domain.model.ActivityTeamInfoListModel;
|
|
||||||
import com.muyu.active.domain.model.ActivityTeamInfoQueryModel;
|
|
||||||
import com.muyu.active.domain.model.ActivityTeamInfoSaveModel;
|
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品拼团信息Service接口
|
|
||||||
*/
|
|
||||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
|
||||||
/**
|
|
||||||
* 通过查询模型查询团购活动列表
|
|
||||||
*/
|
|
||||||
TableDataInfo<ActivityTeamInfoListModel> list(ActivityTeamInfoQueryModel activityTeamInfoQueryModel);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 添加拼团信息
|
|
||||||
*/
|
|
||||||
boolean addTeam(ActivityTeamInfoSaveModel activityTeamInfoSaveModel);
|
|
||||||
}
|
|
|
@ -1,23 +0,0 @@
|
||||||
package com.muyu.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
|
||||||
import com.muyu.active.domain.model.ActivityTeamDiscountModel;
|
|
||||||
import com.muyu.active.domain.model.TeamStockModel;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品拼团信息Service接口
|
|
||||||
*/
|
|
||||||
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
|
||||||
public default List<ActivityTeamProductSkuInfo> acivitySkuList (Long id){
|
|
||||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
lambdaQueryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,id);
|
|
||||||
return this.list(lambdaQueryWrapper);
|
|
||||||
}
|
|
||||||
public ActivityTeamDiscountModel discountPrice(Long id);
|
|
||||||
public TeamStockModel getStock(Long id);
|
|
||||||
}
|
|
|
@ -1,58 +0,0 @@
|
||||||
package com.muyu.service.impl;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
|
||||||
import com.muyu.active.domain.model.ActivityTeamDiscountModel;
|
|
||||||
import com.muyu.active.domain.model.TeamStockModel;
|
|
||||||
import com.muyu.common.core.exception.ServiceException;
|
|
||||||
import com.muyu.mapper.ActivityTeamProductSkuInfoMapper;
|
|
||||||
import com.muyu.product.cache.ProjectSkuCache;
|
|
||||||
import com.muyu.product.domain.ProjectSkuInfo;
|
|
||||||
import com.muyu.service.ActivityTeamProductSkuInfoService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 商品拼团信息Service业务层处理
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Service
|
|
||||||
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo> implements ActivityTeamProductSkuInfoService {
|
|
||||||
@Autowired
|
|
||||||
private ProjectSkuCache projectSkuCache;
|
|
||||||
@Override
|
|
||||||
public ActivityTeamDiscountModel discountPrice(Long id) {
|
|
||||||
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
lambdaQueryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,id);
|
|
||||||
List<ActivityTeamProductSkuInfo> list = this.list(lambdaQueryWrapper);
|
|
||||||
if (list.size()>0){
|
|
||||||
Optional<ActivityTeamDiscountModel> min = list.stream().map(activityTeamProductSkuInfo -> {
|
|
||||||
ProjectSkuInfo projectSkuInfo = projectSkuCache.getData(activityTeamProductSkuInfo.getProductId(), activityTeamProductSkuInfo.getProductSku());
|
|
||||||
return ActivityTeamDiscountModel.of(projectSkuInfo.getPrice(), activityTeamProductSkuInfo.getTeamPrice());
|
|
||||||
}).min((o1, o2) -> Double.valueOf(100 * o1.getDiscount() - 100 * o2.getDiscount()).intValue());
|
|
||||||
if (min.isEmpty()){
|
|
||||||
throw new ServiceException("没有优惠");
|
|
||||||
}
|
|
||||||
return min.get();
|
|
||||||
}
|
|
||||||
return ActivityTeamDiscountModel.builder()
|
|
||||||
.teamPrice(BigDecimal.valueOf(0))
|
|
||||||
.productPrice(BigDecimal.valueOf(0))
|
|
||||||
.discount(0.00)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TeamStockModel getStock(Long id) {
|
|
||||||
List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfoList = this.acivitySkuList(id);
|
|
||||||
return TeamStockModel.builder()
|
|
||||||
.teamStock(activityTeamProductSkuInfoList.stream().map(ActivityTeamProductSkuInfo::getTeamStock).reduce(0L,Long::sum))
|
|
||||||
.remainStock(activityTeamProductSkuInfoList.stream().map(ActivityTeamProductSkuInfo::getRemainStock).reduce(0L,Long::sum))
|
|
||||||
.build();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -5,11 +5,11 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>muyu-actives</artifactId>
|
<artifactId>muyu-marketing</artifactId>
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>active-common</artifactId>
|
<artifactId>marketing-common</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
|
@ -0,0 +1,117 @@
|
||||||
|
package com.muyu.active.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamInfoAddModel;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamInfoSaveModel;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamInfoUpdModel;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团信息主表
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ActivityTeamInfo extends BaseEntity {
|
||||||
|
|
||||||
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private long id;
|
||||||
|
private String name;
|
||||||
|
private long productId;
|
||||||
|
private String productImage;
|
||||||
|
private String introduction;
|
||||||
|
private String unit;
|
||||||
|
private String imageList;
|
||||||
|
private Date endTime;
|
||||||
|
private long sort;
|
||||||
|
private String content;
|
||||||
|
private String status;
|
||||||
|
private String strategyType;
|
||||||
|
private long strategyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造方法
|
||||||
|
*/
|
||||||
|
public static ActivityTeamInfo saveActivityTeamInfo(ActivityTeamInfoSaveModel activityTeamInfoSaveModel){
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.name(activityTeamInfoSaveModel.getName())
|
||||||
|
.productId(activityTeamInfoSaveModel.getProductId())
|
||||||
|
.productImage(activityTeamInfoSaveModel.getProductImage())
|
||||||
|
.introduction(activityTeamInfoSaveModel.getIntroduction())
|
||||||
|
.unit(activityTeamInfoSaveModel.getUnit())
|
||||||
|
.imageList(activityTeamInfoSaveModel.getImageList().toString())
|
||||||
|
.endTime(activityTeamInfoSaveModel.getEndTime())
|
||||||
|
.sort(activityTeamInfoSaveModel.getSort())
|
||||||
|
.content(activityTeamInfoSaveModel.getContent())
|
||||||
|
.status(activityTeamInfoSaveModel.getStatus())
|
||||||
|
.strategyType(activityTeamInfoSaveModel.getStrategyType())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 公共添加模型,转换成添加对象
|
||||||
|
* @param activityTeamInfoAddModel 添加模型
|
||||||
|
* @return 添加对象
|
||||||
|
*/
|
||||||
|
public static ActivityTeamInfo addModelBuild(ActivityTeamInfoAddModel activityTeamInfoAddModel){
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.name(activityTeamInfoAddModel.getName())
|
||||||
|
.productId(activityTeamInfoAddModel.getProductId())
|
||||||
|
.productImage(activityTeamInfoAddModel.getProductImage())
|
||||||
|
.introduction(activityTeamInfoAddModel.getIntroduction())
|
||||||
|
.unit(activityTeamInfoAddModel.getUnit())
|
||||||
|
.imageList(activityTeamInfoAddModel.getImageList())
|
||||||
|
.endTime(activityTeamInfoAddModel.getEndTime())
|
||||||
|
.sort(activityTeamInfoAddModel.getSort())
|
||||||
|
.content(activityTeamInfoAddModel.getContent())
|
||||||
|
.status(activityTeamInfoAddModel.getStatus())
|
||||||
|
.strategyType(activityTeamInfoAddModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoAddModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ActivityTeamInfo teamSaveBuild(ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.name(activityTeamInfoSaveModel.getName())
|
||||||
|
.productId(activityTeamInfoSaveModel.getProductId())
|
||||||
|
.productImage(activityTeamInfoSaveModel.getProductImage())
|
||||||
|
.introduction(activityTeamInfoSaveModel.getIntroduction())
|
||||||
|
.unit(activityTeamInfoSaveModel.getUnit())
|
||||||
|
.imageList(activityTeamInfoSaveModel.getImageList())
|
||||||
|
.endTime(activityTeamInfoSaveModel.getEndTime())
|
||||||
|
.sort(activityTeamInfoSaveModel.getSort())
|
||||||
|
.content(activityTeamInfoSaveModel.getContent())
|
||||||
|
.status(activityTeamInfoSaveModel.getStatus())
|
||||||
|
.strategyType(activityTeamInfoSaveModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoSaveModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ActivityTeamInfo updTeamInfoBuild(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||||
|
return ActivityTeamInfo.builder()
|
||||||
|
.id(activityTeamInfoUpdModel.getId())
|
||||||
|
.name(activityTeamInfoUpdModel.getName())
|
||||||
|
.productId(activityTeamInfoUpdModel.getProductId())
|
||||||
|
.productImage(activityTeamInfoUpdModel.getProductImage())
|
||||||
|
.introduction(activityTeamInfoUpdModel.getIntroduction())
|
||||||
|
.unit(activityTeamInfoUpdModel.getUnit())
|
||||||
|
.imageList(activityTeamInfoUpdModel.getImageList())
|
||||||
|
.endTime(activityTeamInfoUpdModel.getEndTime())
|
||||||
|
.sort(activityTeamInfoUpdModel.getSort())
|
||||||
|
.content(activityTeamInfoUpdModel.getContent())
|
||||||
|
.status(activityTeamInfoUpdModel.getStatus())
|
||||||
|
.strategyType(activityTeamInfoUpdModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoUpdModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,90 @@
|
||||||
|
package com.muyu.active.domain;
|
||||||
|
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamProductSkuAddModel;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamProductSkuReqModel;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamProductSkuUpdModel;
|
||||||
|
import com.muyu.active.domain.model.TeamSkuInfoModel;
|
||||||
|
import com.muyu.active.domain.req.TeamProjectSkuInfoAddReq;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品sku主表
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
|
private long id;
|
||||||
|
private long teamId;
|
||||||
|
private Long productId;
|
||||||
|
private String productSku;
|
||||||
|
private Long teamStock;
|
||||||
|
private Long remainStock;
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造函数的方法
|
||||||
|
* 商品sku模型
|
||||||
|
*/
|
||||||
|
public static ActivityTeamProductSkuInfo TeamSkuInfoBuild(TeamSkuInfoModel teamSkuInfoModel, Function<ActivityTeamProductSkuInfoBuilder,ActivityTeamProductSkuInfo> function){
|
||||||
|
return function.apply(ActivityTeamProductSkuInfo.builder()
|
||||||
|
.teamPrice(teamSkuInfoModel.getTeamPrice())
|
||||||
|
.teamStock(teamSkuInfoModel.getTeamStock())
|
||||||
|
.productSku(teamSkuInfoModel.getProductSku())
|
||||||
|
.productId(teamSkuInfoModel.getProductId()));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 通过模型钢构件对象
|
||||||
|
* @param activityTeamProductSkuAddModel 模型
|
||||||
|
* @return 对象
|
||||||
|
*/
|
||||||
|
public static ActivityTeamProductSkuInfo modelBuild(ActivityTeamProductSkuAddModel activityTeamProductSkuAddModel) {
|
||||||
|
return ActivityTeamProductSkuInfo.builder()
|
||||||
|
.productId(activityTeamProductSkuAddModel.getProductId())
|
||||||
|
.teamId(activityTeamProductSkuAddModel.getTeamId())
|
||||||
|
.teamStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||||
|
.productSku(activityTeamProductSkuAddModel.getSku())
|
||||||
|
.remainStock(activityTeamProductSkuAddModel.getTeamStock())
|
||||||
|
.teamPrice(activityTeamProductSkuAddModel.getTeamPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
public static ActivityTeamProductSkuInfo updateModelBuild(ActivityTeamProductSkuReqModel activityTeamProductSkuReqModel) {
|
||||||
|
return ActivityTeamProductSkuInfo.builder()
|
||||||
|
.id(activityTeamProductSkuReqModel.getId())
|
||||||
|
.productId(activityTeamProductSkuReqModel.getProductId())
|
||||||
|
.teamStock(activityTeamProductSkuReqModel.getTeamStock())
|
||||||
|
.productSku(activityTeamProductSkuReqModel.getProductSku())
|
||||||
|
.teamPrice(activityTeamProductSkuReqModel.getTeamPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuInfo updModelBuild(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
||||||
|
return ActivityTeamProductSkuInfo.builder()
|
||||||
|
.id(activityTeamProductSkuUpdModel.getId())
|
||||||
|
.teamPrice(activityTeamProductSkuUpdModel.getTeamPrice())
|
||||||
|
.teamStock(activityTeamProductSkuUpdModel.getTeamStock())
|
||||||
|
.remainStock(activityTeamProductSkuUpdModel.getTeamStock())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuInfo buildAddSku(TeamProjectSkuInfoAddReq teamProjectSkuInfoAddReq) {
|
||||||
|
return ActivityTeamProductSkuInfo.builder()
|
||||||
|
.teamId(teamProjectSkuInfoAddReq.getTeamId())
|
||||||
|
.productId(teamProjectSkuInfoAddReq.getProductId())
|
||||||
|
.productSku(teamProjectSkuInfoAddReq.getSku())
|
||||||
|
.teamPrice(teamProjectSkuInfoAddReq.getTeamPrice())
|
||||||
|
.teamStock(teamProjectSkuInfoAddReq.getTeamStock())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,104 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.active.domain.ActivityTeamInfo;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 活动回显总模型
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 16:00
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamDetailModel {
|
||||||
|
/**
|
||||||
|
* 拼团id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品活动图
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 轮播图
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 活动排序
|
||||||
|
*/
|
||||||
|
private Long sort;
|
||||||
|
/**
|
||||||
|
* 商品SkU集合
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuModel> projectSkuInfoAddReqList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
public static ActivityTeamDetailModel findSkuSumList (ActivityTeamInfo activityTeamInfo,
|
||||||
|
Function<ActivityTeamDetailModelBuilder, ActivityTeamDetailModel> function){
|
||||||
|
return function.apply(ActivityTeamDetailModel.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())
|
||||||
|
.content(activityTeamInfo.getContent())
|
||||||
|
.status(activityTeamInfo.getStatus())
|
||||||
|
.strategyType(activityTeamInfo.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfo.getStrategyId())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,105 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.active.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动添加模型
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-26 09:38
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamInfoAddModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品活动图
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 轮播图
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 活动排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 商品SkU集合
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
public static ActivityTeamInfoAddModel addReqBuild (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.getTeamProjectSkuInfoAddReqList()
|
||||||
|
.stream()
|
||||||
|
.map(addReq -> ActivityTeamProductSkuAddModel.addReqBuild(addReq, activityTeamInfoSaveReq::getProductId))
|
||||||
|
.toList()
|
||||||
|
).build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动雷彪查询模型
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-20 14:18:10
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ActivityTeamInfoListQueryModel extends QueryModel<ActivityTeamInfoListQueryModel> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索关键词
|
||||||
|
*/
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
}
|
|
@ -68,6 +68,7 @@ public class ActivityTeamInfoSaveModel {
|
||||||
private BigDecimal teamPrice;
|
private BigDecimal teamPrice;
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
private String productSku;
|
private String productSku;
|
||||||
|
private Long strategyId;
|
||||||
/**
|
/**
|
||||||
* 商品sku
|
* 商品sku
|
||||||
*/
|
*/
|
|
@ -0,0 +1,104 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.active.domain.req.ActivityTeamInfoUpdReq;
|
||||||
|
import com.muyu.active.domain.req.TeamProjectSkuInfoAddReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 活动商品规格修改模型
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 19:25
|
||||||
|
**/
|
||||||
|
@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;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/** 排序 */
|
||||||
|
private Long sort;
|
||||||
|
|
||||||
|
/** 主键介绍 */
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/** 活动状态 */
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 策略类型 */
|
||||||
|
private String strategyType;
|
||||||
|
|
||||||
|
/** 策略id */
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团商品sku集合
|
||||||
|
*/
|
||||||
|
private List<Long> teamProductSkuIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改的活动商品sku集合
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuUpdReq> activityTeamProductSkuList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增的活动商品sku集合
|
||||||
|
*/
|
||||||
|
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddList;
|
||||||
|
|
||||||
|
public static ActivityTeamInfoUpdModel activityTeamInfoUpdReqModelBuild (ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
|
return ActivityTeamInfoUpdModel.builder()
|
||||||
|
.id(activityTeamInfoUpdReq.getId())
|
||||||
|
.name(activityTeamInfoUpdReq.getName())
|
||||||
|
.productId(activityTeamInfoUpdReq.getProductId())
|
||||||
|
.productImage(activityTeamInfoUpdReq.getProductImage())
|
||||||
|
.introduction(activityTeamInfoUpdReq.getIntroduction())
|
||||||
|
.unit(activityTeamInfoUpdReq.getUnit())
|
||||||
|
.imageList(activityTeamInfoUpdReq.getImageList())
|
||||||
|
.endTime(activityTeamInfoUpdReq.getEndTime())
|
||||||
|
.sort(activityTeamInfoUpdReq.getSort())
|
||||||
|
.content(activityTeamInfoUpdReq.getContent())
|
||||||
|
.status(activityTeamInfoUpdReq.getStatus())
|
||||||
|
.strategyType(activityTeamInfoUpdReq.getStrategyType())
|
||||||
|
.strategyId(activityTeamInfoUpdReq.getStrategyId())
|
||||||
|
.teamProductSkuIds(activityTeamInfoUpdReq.getTeamProductSkuIds())
|
||||||
|
.activityTeamProductSkuList(activityTeamInfoUpdReq.getActivityTeamProductSkuList())
|
||||||
|
.teamProjectSkuInfoAddList(activityTeamInfoUpdReq.getTeamProjectSkuInfoAddList())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,58 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.active.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库存添加模型
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-26 09:36
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamProductSkuAddModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购活动ID
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuAddModel addReqBuild(TeamProjectSkuInfoAddReq teamProjectSkuInfoAddReq, Supplier<Long> productId){
|
||||||
|
return ActivityTeamProductSkuAddModel.builder()
|
||||||
|
.productId(productId.get())
|
||||||
|
.sku(teamProjectSkuInfoAddReq.getSku())
|
||||||
|
.teamStock(teamProjectSkuInfoAddReq.getTeamStock())
|
||||||
|
.teamPrice(teamProjectSkuInfoAddReq.getTeamPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品活动SKU信息模型
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-26 15:35
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamProductSkuInfoModel {
|
||||||
|
/**
|
||||||
|
* 团购商品SKU的ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团ID
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
}
|
|
@ -0,0 +1,49 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 回显sku模型
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 16:03
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamProductSkuModel {
|
||||||
|
/**
|
||||||
|
* 规格id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuModel FindBuild(ActivityTeamProductSkuInfo activityTeamProductSkuInfo) {
|
||||||
|
return ActivityTeamProductSkuModel.builder()
|
||||||
|
.id(activityTeamProductSkuInfo.getId())
|
||||||
|
.sku(activityTeamProductSkuInfo.getProductSku())
|
||||||
|
.teamStock(activityTeamProductSkuInfo.getTeamStock())
|
||||||
|
.teamPrice(activityTeamProductSkuInfo.getTeamPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
import com.muyu.active.domain.req.ActivityTeamProductSkuReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: sku修改模型
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 19:45
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamProductSkuReqModel {
|
||||||
|
private Long id;
|
||||||
|
private Long teamId;
|
||||||
|
private Long productId;
|
||||||
|
private String productSku;
|
||||||
|
private Long teamStock;
|
||||||
|
private Long remainStock;
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
public static ActivityTeamProductSkuReqModel activityTeamProductSkuReqModelBuild(ActivityTeamProductSkuReq activityTeamProductSkuReq){
|
||||||
|
return ActivityTeamProductSkuReqModel.builder()
|
||||||
|
.id(activityTeamProductSkuReq.getId())
|
||||||
|
.productId(activityTeamProductSkuReq.getProductId())
|
||||||
|
.teamId(activityTeamProductSkuReq.getTeamId())
|
||||||
|
.productSku(activityTeamProductSkuReq.getProductSku())
|
||||||
|
.remainStock(activityTeamProductSkuReq.getRemainStock())
|
||||||
|
.teamStock(activityTeamProductSkuReq.getTeamStock())
|
||||||
|
.teamPrice(activityTeamProductSkuReq.getTeamPrice())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,45 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动商品SKU
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-27 14:18
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamProductSkuUpdModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品规格ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
public static ActivityTeamProductSkuUpdModel skuUpdBuild(ActivityTeamProductSkuUpdReq activityTeamProductSkuUpdReq) {
|
||||||
|
return ActivityTeamProductSkuUpdModel.builder()
|
||||||
|
.id(activityTeamProductSkuUpdReq.getId())
|
||||||
|
.teamPrice(activityTeamProductSkuUpdReq.getTeamPrice())
|
||||||
|
.teamStock(activityTeamProductSkuUpdReq.getTeamStock())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,33 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @Author 夜は眠れるかい?
|
||||||
|
* @Date 2024/11/27 16:49
|
||||||
|
* 好好学习,天天向上
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ActivityTeamProductSkuUpdReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品规格ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
}
|
|
@ -0,0 +1,54 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.math.RoundingMode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购商品优惠力度模型
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-21 11:57
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TeamProductDiscountPriceModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品价格
|
||||||
|
*/
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购优惠价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 优惠力度 (商品价格 - 团购优惠价格) / 商品价格
|
||||||
|
*/
|
||||||
|
private double discount;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过 商品价格和团购价格 生成优惠力度
|
||||||
|
* @param teamPrice 团购加
|
||||||
|
* @return 优惠力度
|
||||||
|
*/
|
||||||
|
public static TeamProductDiscountPriceModel of(BigDecimal price, BigDecimal teamPrice) {
|
||||||
|
return TeamProductDiscountPriceModel.builder()
|
||||||
|
.productPrice(price)
|
||||||
|
.teamPrice(teamPrice)
|
||||||
|
.discount(
|
||||||
|
price.subtract(teamPrice).divide(price, 2, RoundingMode.HALF_UP).doubleValue()
|
||||||
|
)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,31 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购商品库存模型
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-21 14:04
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TeamProductStockModel {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团总库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团剩余库存
|
||||||
|
*/
|
||||||
|
private Long remainStock;
|
||||||
|
|
||||||
|
}
|
|
@ -1,6 +1,7 @@
|
||||||
package com.muyu.active.domain.req;
|
package com.muyu.active.domain.req;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.active.domain.model.ActivityTeamInfoSaveModel;
|
import com.muyu.active.domain.model.ActivityTeamInfoSaveModel;
|
||||||
import com.muyu.active.domain.model.TeamSkuInfoModel;
|
import com.muyu.active.domain.model.TeamSkuInfoModel;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
@ -69,15 +70,21 @@ public class ActivityTeamInfoSaveReq {
|
||||||
private BigDecimal teamPrice;
|
private BigDecimal teamPrice;
|
||||||
private Long teamStock;
|
private Long teamStock;
|
||||||
private String productSku;
|
private String productSku;
|
||||||
|
private String productImage;
|
||||||
|
private Long strategyId;
|
||||||
|
private String strategyName;
|
||||||
/**
|
/**
|
||||||
* 商品sku
|
* 商品sku
|
||||||
*/
|
*/
|
||||||
private List<TeamSkuInfoModel> projectSkuInfoList;
|
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
||||||
|
|
||||||
|
private List<ActivityTeamProductSkuInfo> projectSkuInfoList;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*构造方法
|
*构造方法
|
||||||
*/
|
*/
|
||||||
public ActivityTeamInfoSaveModel saveModel(){
|
public ActivityTeamInfoSaveModel saveModel(){
|
||||||
|
|
||||||
return ActivityTeamInfoSaveModel.builder()
|
return ActivityTeamInfoSaveModel.builder()
|
||||||
.productId(productId)
|
.productId(productId)
|
||||||
.productImage(image)
|
.productImage(image)
|
||||||
|
@ -93,7 +100,10 @@ public class ActivityTeamInfoSaveReq {
|
||||||
.teamPrice(teamPrice)
|
.teamPrice(teamPrice)
|
||||||
.productSku(productSku)
|
.productSku(productSku)
|
||||||
.teamStock(teamStock)
|
.teamStock(teamStock)
|
||||||
.projectSkuInfoList(projectSkuInfoList)
|
//转换为LIST 商品sku
|
||||||
|
.projectSkuInfoList(projectSkuInfoList.stream().map(activityTeamProductSkuInfo -> {
|
||||||
|
return TeamSkuInfoModel.teamSkuInfoModel(activityTeamProductSkuInfo);
|
||||||
|
}).toList())
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.muyu.active.domain.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamProductSkuUpdReq;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 活动商品规格修改入参
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 19:25
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamInfoUpdReq {
|
||||||
|
|
||||||
|
/** 主键自增 */
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/** 活动表名称 */
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/** 主键商品id */
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/** 商品图片 */
|
||||||
|
private String productImage;
|
||||||
|
|
||||||
|
/** 活动简介 */
|
||||||
|
private String introduction;
|
||||||
|
|
||||||
|
/** 单位 */
|
||||||
|
private String unit;
|
||||||
|
|
||||||
|
/** 轮播图 */
|
||||||
|
private String imageList;
|
||||||
|
|
||||||
|
/** 结束时间 */
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
private Date endTime;
|
||||||
|
|
||||||
|
/** 排序 */
|
||||||
|
private Long sort;
|
||||||
|
|
||||||
|
/** 详情 */
|
||||||
|
private String content;
|
||||||
|
|
||||||
|
/** 活动状态 */
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
/** 策略类型 */
|
||||||
|
private String strategyType;
|
||||||
|
|
||||||
|
/** 策略id */
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团商品sku集合
|
||||||
|
*/
|
||||||
|
private List<Long> teamProductSkuIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改的活动商品sku集合
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProductSkuUpdReq> activityTeamProductSkuList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增的活动商品sku集合
|
||||||
|
*/
|
||||||
|
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddList;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
package com.muyu.active.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: sku修改入参
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 19:45
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamProductSkuReq {
|
||||||
|
private Long id;
|
||||||
|
private Long teamId;
|
||||||
|
private Long productId;
|
||||||
|
private String productSku;
|
||||||
|
private Long teamStock;
|
||||||
|
private Long remainStock;
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
package com.muyu.active.domain.req;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购商品规格设置
|
||||||
|
*
|
||||||
|
* @author DongZeLiang
|
||||||
|
* @date 2024-11-28 11:27
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class ActivityTeamProductSkuSettingReq {
|
||||||
|
/**
|
||||||
|
* 删除的ID集合
|
||||||
|
*/
|
||||||
|
private List<Long> removeIds;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加的规格集合
|
||||||
|
*/
|
||||||
|
private List<TeamProjectSkuInfoAddReq> teamProjectSkuInfoAddReqList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加的规格集合
|
||||||
|
*/
|
||||||
|
private List<TeamProjectSkuInfoUpdReq> teamProjectSkuInfoUpdReqList;
|
||||||
|
}
|
|
@ -0,0 +1,40 @@
|
||||||
|
package com.muyu.active.domain.req;
|
||||||
|
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamInfoListQueryModel;
|
||||||
|
import com.muyu.common.core.web.page.PageDomain;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
//@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class TeamInfoListReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 搜索关键词
|
||||||
|
*/
|
||||||
|
private String keyWord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过当前对象构建业务查询模型
|
||||||
|
* @return 业务查询模型
|
||||||
|
*/
|
||||||
|
public ActivityTeamInfoListQueryModel buildQueryModel() {
|
||||||
|
return ActivityTeamInfoListQueryModel.builder()
|
||||||
|
.keyWord(this.keyWord)
|
||||||
|
.status(this.status)
|
||||||
|
.build();
|
||||||
|
// .domainbuild(this);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.muyu.active.domain.req;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加的
|
||||||
|
* @author zhuyufeng
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class TeamProjectSkuInfoAddReq {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动id
|
||||||
|
*/
|
||||||
|
private Long teamId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品id
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,82 @@
|
||||||
|
package com.muyu.active.domain.resp;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ActivityTeamDetailResp 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;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 活动排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 商品SkU集合
|
||||||
|
*/
|
||||||
|
private List<ActivityTeamProjectSkuResp> activityTeamProjectSkuList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
}
|
|
@ -0,0 +1,38 @@
|
||||||
|
package com.muyu.active.domain.resp;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加的
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ActivityTeamProjectSkuResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购商品SKU的ID
|
||||||
|
*/
|
||||||
|
private Long productSkuId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
}
|
|
@ -0,0 +1,46 @@
|
||||||
|
package com.muyu.active.domain.resp;
|
||||||
|
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamProductSkuModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 回显resp
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ProjectFindSkuInfoResp {
|
||||||
|
/**
|
||||||
|
* 规格id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 规格SKU
|
||||||
|
*/
|
||||||
|
private String sku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
public static ProjectFindSkuInfoResp projectFindSkuInfoBuild (ActivityTeamProductSkuModel activityTeamProductSkuModel) {
|
||||||
|
return ProjectFindSkuInfoResp.builder()
|
||||||
|
.teamStock(activityTeamProductSkuModel.getTeamStock())
|
||||||
|
.teamPrice(activityTeamProductSkuModel.getTeamPrice())
|
||||||
|
.id(activityTeamProductSkuModel.getId())
|
||||||
|
.sku(activityTeamProductSkuModel.getSku())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,108 @@
|
||||||
|
package com.muyu.active.domain.resp;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamDetailModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @program: 2204a-cloud-server
|
||||||
|
* @description: 团购活动回显响应
|
||||||
|
* @author: AoCi Tian
|
||||||
|
* @create: 2024-11-26 15:19
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class TeamInfoFindByIdResp {
|
||||||
|
/**
|
||||||
|
* 拼团id
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 商品ID
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品活动图
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 单位
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 轮播图
|
||||||
|
*/
|
||||||
|
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 活动排序
|
||||||
|
*/
|
||||||
|
private Long sort;
|
||||||
|
/**
|
||||||
|
* 商品SkU集合
|
||||||
|
*/
|
||||||
|
private List<ProjectFindSkuInfoResp> projectSkuInfoAddList;
|
||||||
|
/**
|
||||||
|
* 活动详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 活动状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 策略类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
/**
|
||||||
|
* 策略ID
|
||||||
|
*/
|
||||||
|
private Long strategyId;
|
||||||
|
|
||||||
|
public static TeamInfoFindByIdResp teamInfoFindByIdBuild (ActivityTeamDetailModel activityTeamDetailModel){
|
||||||
|
return TeamInfoFindByIdResp.builder()
|
||||||
|
.id(activityTeamDetailModel.getId())
|
||||||
|
.name(activityTeamDetailModel.getName())
|
||||||
|
.productId(activityTeamDetailModel.getProductId())
|
||||||
|
.productImage(activityTeamDetailModel.getProductImage())
|
||||||
|
.introduction(activityTeamDetailModel.getIntroduction())
|
||||||
|
.unit(activityTeamDetailModel.getUnit())
|
||||||
|
.imageList(activityTeamDetailModel.getImageList())
|
||||||
|
.endTime(activityTeamDetailModel.getEndTime())
|
||||||
|
.sort(activityTeamDetailModel.getSort())
|
||||||
|
.projectSkuInfoAddList(activityTeamDetailModel.getProjectSkuInfoAddReqList().stream().map(ProjectFindSkuInfoResp::projectFindSkuInfoBuild).toList())
|
||||||
|
// .projectSkuInfoAddList(
|
||||||
|
// teamInfoFindByIdRespModel.getProjectSkuInfoAddReqList().stream().map(activityTeamProductSkuModel ->
|
||||||
|
// ProjectFindSkuInfoResp.projectFindSkuInfoBuild(activityTeamProductSkuModel)).toList()
|
||||||
|
// )
|
||||||
|
.content(activityTeamDetailModel.getContent())
|
||||||
|
.status(activityTeamDetailModel.getStatus())
|
||||||
|
.strategyType(activityTeamDetailModel.getStrategyType())
|
||||||
|
.strategyId(activityTeamDetailModel.getStrategyId())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,93 @@
|
||||||
|
package com.muyu.active.domain.resp;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamInfoListModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@NoArgsConstructor
|
||||||
|
@AllArgsConstructor
|
||||||
|
public class TeamInfoListResp {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团活动ID
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 拼团名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 参团人数
|
||||||
|
*/
|
||||||
|
private Long addTeamNumber;
|
||||||
|
/**
|
||||||
|
* 拼团人数
|
||||||
|
*/
|
||||||
|
private Long attendNumber;
|
||||||
|
/**
|
||||||
|
* 团购结束时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:ss:mm")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 开团人数
|
||||||
|
*/
|
||||||
|
private Long openTeamNumber;
|
||||||
|
/**
|
||||||
|
* 拼团商品图片
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 商品价格
|
||||||
|
*/
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
/**
|
||||||
|
* 剩余库存
|
||||||
|
*/
|
||||||
|
private Long remainStock;
|
||||||
|
/**
|
||||||
|
* 团购状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 拼团价格
|
||||||
|
*/
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
/**
|
||||||
|
* 团购库存
|
||||||
|
*/
|
||||||
|
private Long teamStock;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表查询结果,构建为响应对象
|
||||||
|
* @param activityTeamInfoListModel 列表数据查询结果
|
||||||
|
* @return 响应对象
|
||||||
|
*/
|
||||||
|
public static TeamInfoListResp listModelBuild(ActivityTeamInfoListModel activityTeamInfoListModel) {
|
||||||
|
return TeamInfoListResp.builder()
|
||||||
|
.id(activityTeamInfoListModel.getId())
|
||||||
|
.name(activityTeamInfoListModel.getName())
|
||||||
|
.openTeamNumber(activityTeamInfoListModel.getOpenTeamNumber())
|
||||||
|
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
||||||
|
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
||||||
|
.attendNumber(activityTeamInfoListModel.getAttendNumber())
|
||||||
|
.endTime(activityTeamInfoListModel.getEndTime())
|
||||||
|
.teamPrice(activityTeamInfoListModel.getTeamPrice())
|
||||||
|
.productImage(activityTeamInfoListModel.getProductImage())
|
||||||
|
.productPrice(activityTeamInfoListModel.getProductPrice())
|
||||||
|
.remainStock(activityTeamInfoListModel.getRemainStock())
|
||||||
|
.status(activityTeamInfoListModel.getStatus())
|
||||||
|
.teamStock(activityTeamInfoListModel.getTeamStock())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,11 +5,11 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>muyu-actives</artifactId>
|
<artifactId>muyu-marketing</artifactId>
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>active-remote</artifactId>
|
<artifactId>marketing-remote</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
@ -20,7 +20,7 @@
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>active-common</artifactId>
|
<artifactId>marketing-common</artifactId>
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
|
@ -5,11 +5,11 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>muyu-actives</artifactId>
|
<artifactId>muyu-marketing</artifactId>
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>active-server</artifactId>
|
<artifactId>marketing-server</artifactId>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<maven.compiler.source>17</maven.compiler.source>
|
<maven.compiler.source>17</maven.compiler.source>
|
||||||
|
@ -41,7 +41,7 @@
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>active-remote</artifactId>
|
<artifactId>marketing-remote</artifactId>
|
||||||
<version>3.6.3</version>
|
<version>3.6.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- SpringCloud Alibaba Sentinel -->
|
<!-- SpringCloud Alibaba Sentinel -->
|
|
@ -1,16 +1,19 @@
|
||||||
package com.muyu.controller;
|
package com.muyu.controller;
|
||||||
import com.github.pagehelper.Page;
|
import com.github.pagehelper.Page;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamInfoAddModel;
|
||||||
import com.muyu.active.domain.model.ActivityTeamInfoListModel;
|
import com.muyu.active.domain.model.ActivityTeamInfoListModel;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamInfoUpdModel;
|
||||||
import com.muyu.active.domain.req.ActivityTeamInfoReq;
|
import com.muyu.active.domain.req.ActivityTeamInfoReq;
|
||||||
import com.muyu.active.domain.req.ActivityTeamInfoSaveReq;
|
import com.muyu.active.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
import com.muyu.active.domain.req.ActivityTeamInfoUpdReq;
|
||||||
import com.muyu.active.domain.resp.ActivityTeamInfoResp;
|
import com.muyu.active.domain.resp.ActivityTeamInfoResp;
|
||||||
|
import com.muyu.active.domain.resp.TeamInfoFindByIdResp;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.core.utils.PageUtils;
|
import com.muyu.common.core.utils.PageUtils;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.service.ActivityTeamInfoService;
|
import com.muyu.service.ActivityTeamInfoService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -20,7 +23,7 @@ import java.util.List;
|
||||||
* 商品拼团信息Controller
|
* 商品拼团信息Controller
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/actives")
|
@RequestMapping("/marketing")
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ActivityTeamInfoController {
|
public class ActivityTeamInfoController {
|
||||||
@Resource
|
@Resource
|
||||||
|
@ -54,12 +57,12 @@ public class ActivityTeamInfoController {
|
||||||
// List<ActivityTeamInfoResp> activityTeamInfoResp = row.stream().map(activityTeamInfoListModel -> {
|
// List<ActivityTeamInfoResp> activityTeamInfoResp = row.stream().map(activityTeamInfoListModel -> {
|
||||||
// return ActivityTeamInfoResp.respBuild(activityTeamInfoListModel);
|
// return ActivityTeamInfoResp.respBuild(activityTeamInfoListModel);
|
||||||
// }).toList();
|
// }).toList();
|
||||||
// // 创建分页信息对象
|
// // 创建分页信息对象
|
||||||
// TableDataInfo<ActivityTeamInfoResp> activityTeamInfoRespTableDataInfo= new TableDataInfo<>();
|
// TableDataInfo<ActivityTeamInfoResp> activityTeamInfoRespTableDataInfo= new TableDataInfo<>();
|
||||||
// activityTeamInfoRespTableDataInfo.setRows(activityTeamInfoResps);
|
// activityTeamInfoRespTableDataInfo.setRows(activityTeamInfoResps);
|
||||||
// activityTeamInfoRespTableDataInfo.setTotal(PageUtils.startPage(activityTeamInfoReq.getPageNum(),activityTeamInfoReq.getPageSize()).getTotal());
|
// activityTeamInfoRespTableDataInfo.setTotal(PageUtils.startPage(activityTeamInfoReq.getPageNum(),activityTeamInfoReq.getPageSize()).getTotal());
|
||||||
// // 返回结果
|
// // 返回结果
|
||||||
// return Result.success(activityTeamInfoRespTableDataInfo);
|
// return Result.success(activityTeamInfoRespTableDataInfo);
|
||||||
// 开始分页
|
// 开始分页
|
||||||
Page<ActivityTeamInfoListModel> page = PageUtils.startPage(activityTeamInfoReq.getPageNum(), activityTeamInfoReq.getPageSize());
|
Page<ActivityTeamInfoListModel> page = PageUtils.startPage(activityTeamInfoReq.getPageNum(), activityTeamInfoReq.getPageSize());
|
||||||
// 获取数据列表 列表数据
|
// 获取数据列表 列表数据
|
||||||
|
@ -68,8 +71,7 @@ public class ActivityTeamInfoController {
|
||||||
List<ActivityTeamInfoResp> activityTeamInfoResps = rows.stream().map(activityTeamInfoListModel -> {
|
List<ActivityTeamInfoResp> activityTeamInfoResps = rows.stream().map(activityTeamInfoListModel -> {
|
||||||
return ActivityTeamInfoResp.respBuild(activityTeamInfoListModel);
|
return ActivityTeamInfoResp.respBuild(activityTeamInfoListModel);
|
||||||
}).toList();
|
}).toList();
|
||||||
|
// 创建分页信息对象
|
||||||
// 创建分页信息对象
|
|
||||||
TableDataInfo<ActivityTeamInfoResp> activityTeamInfoRespTableDataInfo = new TableDataInfo<>();
|
TableDataInfo<ActivityTeamInfoResp> activityTeamInfoRespTableDataInfo = new TableDataInfo<>();
|
||||||
//列表数据
|
//列表数据
|
||||||
activityTeamInfoRespTableDataInfo.setRows(activityTeamInfoResps);
|
activityTeamInfoRespTableDataInfo.setRows(activityTeamInfoResps);
|
||||||
|
@ -92,4 +94,33 @@ public class ActivityTeamInfoController {
|
||||||
}
|
}
|
||||||
return Result.error("添加失败");
|
return Result.error("添加失败");
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 添加团购活动
|
||||||
|
* @param activityTeamInfoSaveReq 添加请求对象
|
||||||
|
* @return 结果集
|
||||||
|
*/
|
||||||
|
@PostMapping
|
||||||
|
public Result<String> save(@RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq) {
|
||||||
|
activityTeamInfoService.save(ActivityTeamInfoAddModel.addReqBuild(activityTeamInfoSaveReq));
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据Id查询商品详情信息
|
||||||
|
* @param id
|
||||||
|
*/
|
||||||
|
@GetMapping("/findById/{id}")
|
||||||
|
public Result<TeamInfoFindByIdResp> findTeamById(@PathVariable Long id){
|
||||||
|
return Result.success(TeamInfoFindByIdResp.teamInfoFindByIdBuild(activityTeamInfoService.findDetailById(id)));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改拼团活动信息
|
||||||
|
* @param activityTeamInfoUpdReq
|
||||||
|
*/
|
||||||
|
@PutMapping("/updateActivityTeamInfo")
|
||||||
|
public Result<?> updateByTeamId(@RequestBody ActivityTeamInfoUpdReq activityTeamInfoUpdReq){
|
||||||
|
activityTeamInfoService.update(ActivityTeamInfoUpdModel.activityTeamInfoUpdReqModelBuild(activityTeamInfoUpdReq));
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
package com.muyu.service;
|
||||||
|
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.active.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.active.domain.model.*;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service接口
|
||||||
|
*/
|
||||||
|
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
|
/**
|
||||||
|
* 通过查询模型查询团购活动列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<ActivityTeamInfoListModel> list(ActivityTeamInfoQueryModel activityTeamInfoQueryModel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加拼团信息
|
||||||
|
*/
|
||||||
|
boolean addTeam(ActivityTeamInfoSaveModel activityTeamInfoSaveModel);
|
||||||
|
/**
|
||||||
|
* 通过添加模型,去进行商品拼团活动的操作
|
||||||
|
* @param activityTeamInfoAddModel 团购添加模型
|
||||||
|
*/
|
||||||
|
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据ID查询商品的详情
|
||||||
|
* @param id 团购活动ID
|
||||||
|
* @return 团购详情
|
||||||
|
*/
|
||||||
|
ActivityTeamDetailModel findDetailById(Long id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改团购活动信息
|
||||||
|
* @param activityTeamInfoUpdModel 团购活动信息
|
||||||
|
* @return 是否成功
|
||||||
|
*/
|
||||||
|
public void update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel);
|
||||||
|
}
|
|
@ -0,0 +1,64 @@
|
||||||
|
package com.muyu.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.active.domain.model.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service接口
|
||||||
|
*/
|
||||||
|
public interface ActivityTeamProductSkuInfoService extends IService<ActivityTeamProductSkuInfo> {
|
||||||
|
public default List<ActivityTeamProductSkuInfo> acivitySkuList (Long id){
|
||||||
|
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,id);
|
||||||
|
return this.list(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
public ActivityTeamDiscountModel discountPrice(Long id);
|
||||||
|
public TeamProductStockModel getStock(Long id);
|
||||||
|
/**
|
||||||
|
* 通过团购活动ID获取团购中最优惠的价格
|
||||||
|
* @param teamId 团购ID
|
||||||
|
* @return 优惠价格
|
||||||
|
*/
|
||||||
|
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId);
|
||||||
|
/**
|
||||||
|
* 通过活动ID获取 剩余库存
|
||||||
|
*
|
||||||
|
* @param teamId 活动ID
|
||||||
|
* @return 库存
|
||||||
|
*/
|
||||||
|
public TeamStockModel getStocks(Long teamId);
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加团购商品SKU
|
||||||
|
* @param activityTeamProductSkuAddModelList 团购商品SKU添加模型集合
|
||||||
|
*/
|
||||||
|
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过拼团活动ID获取拼团下商品SKU集合
|
||||||
|
* @param teamId 活动ID
|
||||||
|
* @return 拼团商品SKU集合
|
||||||
|
*/
|
||||||
|
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改团购商品sku信息
|
||||||
|
*
|
||||||
|
* @param activityTeamProductSkuUpdModel
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改团购商品sku信息(批量修改)
|
||||||
|
* @param activityTeamProductSkuUpdModelList
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public void batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList);
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ import com.muyu.active.domain.ActivityTeamInfo;
|
||||||
import com.muyu.active.domain.ActivityTeamOpenInfo;
|
import com.muyu.active.domain.ActivityTeamOpenInfo;
|
||||||
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
||||||
import com.muyu.active.domain.model.*;
|
import com.muyu.active.domain.model.*;
|
||||||
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.mapper.ActivityTeamInfoMapper;
|
import com.muyu.mapper.ActivityTeamInfoMapper;
|
||||||
|
@ -14,8 +15,13 @@ import com.muyu.service.ActivityTeamOpenInfoService;
|
||||||
import com.muyu.service.ActivityTeamProductSkuInfoService;
|
import com.muyu.service.ActivityTeamProductSkuInfoService;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.util.Assert;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 商品拼团信息Service业务层处理
|
* 商品拼团信息Service业务层处理
|
||||||
*/
|
*/
|
||||||
|
@ -30,16 +36,19 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
@Override
|
@Override
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> list(ActivityTeamInfoQueryModel activityTeamInfoQueryModel) {
|
public TableDataInfo<ActivityTeamInfoListModel> list(ActivityTeamInfoQueryModel activityTeamInfoQueryModel) {
|
||||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
//判断是否为空查询的条件 名称
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(
|
queryWrapper.like(StringUtils.isNotEmpty(
|
||||||
activityTeamInfoQueryModel.getKeyWord()),
|
activityTeamInfoQueryModel.getKeyWord()),
|
||||||
ActivityTeamInfo::getName,
|
ActivityTeamInfo::getName,
|
||||||
activityTeamInfoQueryModel.getKeyWord()
|
activityTeamInfoQueryModel.getKeyWord()
|
||||||
);
|
);
|
||||||
|
//判断是否为空查询的条件 状态
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(
|
queryWrapper.like(StringUtils.isNotEmpty(
|
||||||
activityTeamInfoQueryModel.getStatus()),
|
activityTeamInfoQueryModel.getStatus()),
|
||||||
ActivityTeamInfo::getStatus,
|
ActivityTeamInfo::getStatus,
|
||||||
activityTeamInfoQueryModel.getStatus()
|
activityTeamInfoQueryModel.getStatus()
|
||||||
);
|
);
|
||||||
|
//分页
|
||||||
Page<ActivityTeamInfo> pages = this.page(activityTeamInfoQueryModel.bulidPage(),queryWrapper);
|
Page<ActivityTeamInfo> pages = this.page(activityTeamInfoQueryModel.bulidPage(),queryWrapper);
|
||||||
List<ActivityTeamInfo> records = pages.getRecords();
|
List<ActivityTeamInfo> records = pages.getRecords();
|
||||||
|
|
||||||
|
@ -48,7 +57,7 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
Long teamOpenNum = activityTeamOpenInfoService.getTeamOpenNum(activityTeamInfo.getId());
|
Long teamOpenNum = activityTeamOpenInfoService.getTeamOpenNum(activityTeamInfo.getId());
|
||||||
Long teamInNum = activityTeamOpenInfoService.getTeamInNum(activityTeamInfo.getId());
|
Long teamInNum = activityTeamOpenInfoService.getTeamInNum(activityTeamInfo.getId());
|
||||||
ActivityTeamDiscountModel activityTeamDiscountModel = activityTeamProductSkuInfoService.discountPrice(activityTeamInfo.getId());
|
ActivityTeamDiscountModel activityTeamDiscountModel = activityTeamProductSkuInfoService.discountPrice(activityTeamInfo.getId());
|
||||||
TeamStockModel stock = activityTeamProductSkuInfoService.getStock(activityTeamInfo.getId());
|
TeamStockModel stock = activityTeamProductSkuInfoService.getStocks(activityTeamInfo.getId());
|
||||||
return activityTeamInfoListModelBuilder
|
return activityTeamInfoListModelBuilder
|
||||||
.addTeamNumber(teamInNum)
|
.addTeamNumber(teamInNum)
|
||||||
.openTeamNumber(teamOpenNum)
|
.openTeamNumber(teamOpenNum)
|
||||||
|
@ -88,13 +97,77 @@ public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMap
|
||||||
queryWrapper.eq(ActivityTeamOpenInfo::getProductId,projectSkuInfo.getProductId());
|
queryWrapper.eq(ActivityTeamOpenInfo::getProductId,projectSkuInfo.getProductId());
|
||||||
long count = activityTeamOpenInfoService.count(queryWrapper);
|
long count = activityTeamOpenInfoService.count(queryWrapper);
|
||||||
return activityTeamProductSkuInfoBuilder
|
return activityTeamProductSkuInfoBuilder
|
||||||
//商品表的ID
|
//获取商品表的ID
|
||||||
.teamId(activityTeamInfo.getId())
|
.teamId(activityTeamInfo.getId())
|
||||||
//sku的剩余库存
|
//获取sku的剩余库存
|
||||||
.remainStock(projectSkuInfo.getTeamStock() - count)
|
.remainStock(projectSkuInfo.getTeamStock() - count)
|
||||||
.build();
|
.build();
|
||||||
})).toList());
|
})).toList());
|
||||||
}
|
}
|
||||||
return save;
|
return save;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 通过添加模型,去进行商品拼团活动的操作
|
||||||
|
* @param activityTeamInfoAddModel 团购添加模型
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void save(ActivityTeamInfoAddModel activityTeamInfoAddModel) {
|
||||||
|
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.addModelBuild(activityTeamInfoAddModel);
|
||||||
|
Assert.isTrue(this.save(activityTeamInfo), StringUtils.format("团购活动添加失败:[{}]", activityTeamInfoAddModel));
|
||||||
|
List<ActivityTeamProductSkuAddModel> teamProductSkuAddModelList = activityTeamInfoAddModel.getActivityTeamProductSkuAddModelList();
|
||||||
|
teamProductSkuAddModelList.forEach(activityTeamProductSkuAddModel -> activityTeamProductSkuAddModel.setTeamId(activityTeamInfo.getId()));
|
||||||
|
this.activityTeamProductSkuInfoService.batchSave(teamProductSkuAddModelList);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 根据ID查询商品的详情
|
||||||
|
* @param id 团购活动ID
|
||||||
|
* @return 团购详情
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public ActivityTeamDetailModel findDetailById(Long id) {
|
||||||
|
//获取id
|
||||||
|
ActivityTeamInfo activityTeamInfo = this.getById(id);
|
||||||
|
//查询teamId集合
|
||||||
|
List<ActivityTeamProductSkuModel> activityTeamProductSkuModelList = activityTeamProductSkuInfoService.findListByTeamId(id);
|
||||||
|
return ActivityTeamDetailModel.findSkuSumList(activityTeamInfo,
|
||||||
|
(teamInfoFindByIdRespModelBuilder) -> teamInfoFindByIdRespModelBuilder.projectSkuInfoAddReqList(activityTeamProductSkuModelList).build()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 修改团购活动信息
|
||||||
|
* @param activityTeamInfoUpdModel 团购活动信息
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
@Transactional
|
||||||
|
public void update(ActivityTeamInfoUpdModel activityTeamInfoUpdModel) {
|
||||||
|
|
||||||
|
//判断活动状态是否是关闭状态
|
||||||
|
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(ActivityTeamInfo::getId,activityTeamInfoUpdModel.getId());
|
||||||
|
ActivityTeamInfo activityTeamInfo = this.getOne(queryWrapper);
|
||||||
|
if ("已开启".equals(activityTeamInfo.getStatus())){
|
||||||
|
throw new ServiceException("活动状态开启,不能修改!!!");
|
||||||
|
}
|
||||||
|
// Assert.isTrue(this.updateById(activityTeamInfoUpdModel), StringUtils.format("修改失败:[{}]", activityTeamInfoUpdModel));
|
||||||
|
//修改拼团活动表信息
|
||||||
|
this.updateById(ActivityTeamInfo.updTeamInfoBuild(activityTeamInfoUpdModel));
|
||||||
|
//根据根据前台传过来的skuIds集合,批量删除团购商品sku集合
|
||||||
|
activityTeamProductSkuInfoService.removeBatchByIds(activityTeamInfoUpdModel.getTeamProductSkuIds());
|
||||||
|
//批量添加团购商品sku集合
|
||||||
|
activityTeamProductSkuInfoService.saveBatch(
|
||||||
|
//将activityTeamInfoUpdModel类型转成ActivityTeamProductSkuInfo类型集合
|
||||||
|
activityTeamInfoUpdModel.getTeamProjectSkuInfoAddList().stream()
|
||||||
|
.map(ActivityTeamProductSkuInfo::buildAddSku)
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
//根据activityTeamProductSkuList集合,批量修改团购商品sku集合
|
||||||
|
List<ActivityTeamProductSkuUpdReq> activityTeamProductSkuList = activityTeamInfoUpdModel.getActivityTeamProductSkuList();
|
||||||
|
activityTeamProductSkuInfoService.batchUpdate(
|
||||||
|
activityTeamProductSkuList.stream()
|
||||||
|
.map(ActivityTeamProductSkuUpdModel::skuUpdBuild)
|
||||||
|
.collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,134 @@
|
||||||
|
package com.muyu.service.impl;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.active.domain.model.*;
|
||||||
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
|
import com.muyu.mapper.ActivityTeamProductSkuInfoMapper;
|
||||||
|
import com.muyu.product.cache.ProjectSkuCache;
|
||||||
|
import com.muyu.product.domain.ProjectSkuInfo;
|
||||||
|
import com.muyu.service.ActivityTeamProductSkuInfoService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service业务层处理
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class ActivityTeamProductSkuInfoServiceImpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo> implements ActivityTeamProductSkuInfoService {
|
||||||
|
@Autowired
|
||||||
|
private ProjectSkuCache projectSkuCache;
|
||||||
|
/**
|
||||||
|
* 通过团购活动ID获取团购中最优惠的价格
|
||||||
|
* @param teamId 团购ID
|
||||||
|
* @return 优惠价格
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TeamProductDiscountPriceModel getDiscountPrice(Long teamId) {
|
||||||
|
// List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||||
|
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.acivitySkuList(teamId);
|
||||||
|
// 优惠模型集合
|
||||||
|
Optional<TeamProductDiscountPriceModel> discountPriceModelOptional = teamProductSkuInfoList.stream()
|
||||||
|
.map(activityTeamProductSkuInfo -> {
|
||||||
|
ProjectSkuInfo projectSkuInfo = projectSkuCache.get(activityTeamProductSkuInfo.getProductId(), activityTeamProductSkuInfo.getProductSku());
|
||||||
|
return TeamProductDiscountPriceModel.of(projectSkuInfo.getPrice(), activityTeamProductSkuInfo.getTeamPrice());
|
||||||
|
}).min((o1, o2) -> Double.valueOf(o1.getDiscount() * 100 - o2.getDiscount() * 100).intValue());
|
||||||
|
|
||||||
|
if (discountPriceModelOptional.isEmpty()){
|
||||||
|
throw new ServiceException("团购活动下没有商品绑定");
|
||||||
|
}
|
||||||
|
return discountPriceModelOptional.get();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ActivityTeamDiscountModel discountPrice(Long id) {
|
||||||
|
LambdaQueryWrapper<ActivityTeamProductSkuInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,id);
|
||||||
|
List<ActivityTeamProductSkuInfo> list = this.list(lambdaQueryWrapper);
|
||||||
|
if (list.size()>0){
|
||||||
|
Optional<ActivityTeamDiscountModel> min = list.stream().map(activityTeamProductSkuInfo -> {
|
||||||
|
ProjectSkuInfo projectSkuInfo = projectSkuCache.getData(activityTeamProductSkuInfo.getProductId(), activityTeamProductSkuInfo.getProductSku());
|
||||||
|
return ActivityTeamDiscountModel.of(projectSkuInfo.getPrice(), activityTeamProductSkuInfo.getTeamPrice());
|
||||||
|
}).min((o1, o2) -> Double.valueOf(100 * o1.getDiscount() - 100 * o2.getDiscount()).intValue());
|
||||||
|
if (min.isEmpty()){
|
||||||
|
throw new ServiceException("没有优惠");
|
||||||
|
}
|
||||||
|
return min.get();
|
||||||
|
}
|
||||||
|
return ActivityTeamDiscountModel.builder()
|
||||||
|
.teamPrice(BigDecimal.valueOf(0))
|
||||||
|
.productPrice(BigDecimal.valueOf(0))
|
||||||
|
.discount(0.00)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TeamProductStockModel getStock(Long id) {
|
||||||
|
// List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.getActivityTeamProductSkuInfoByTeamId(teamId);
|
||||||
|
List<ActivityTeamProductSkuInfo> teamProductSkuInfoList = this.acivitySkuList(id);
|
||||||
|
return TeamProductStockModel.builder()
|
||||||
|
.teamStock(teamProductSkuInfoList.stream().map(ActivityTeamProductSkuInfo::getTeamStock).reduce(0L, Long::sum))
|
||||||
|
.remainStock(teamProductSkuInfoList.stream().map(ActivityTeamProductSkuInfo::getRemainStock).reduce(0L, Long::sum))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TeamStockModel getStocks(Long id) {
|
||||||
|
List<ActivityTeamProductSkuInfo> activityTeamProductSkuInfoList = this.acivitySkuList(id);
|
||||||
|
return TeamStockModel.builder()
|
||||||
|
.teamStock(activityTeamProductSkuInfoList.stream().map(ActivityTeamProductSkuInfo::getTeamStock).reduce(0L,Long::sum))
|
||||||
|
.remainStock(activityTeamProductSkuInfoList.stream().map(ActivityTeamProductSkuInfo::getRemainStock).reduce(0L,Long::sum))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void batchSave(List<ActivityTeamProductSkuAddModel> activityTeamProductSkuAddModelList) {
|
||||||
|
if (activityTeamProductSkuAddModelList == null || activityTeamProductSkuAddModelList.isEmpty()) {
|
||||||
|
throw new ServiceException("入参添加商品规格模型,不可为空");
|
||||||
|
}
|
||||||
|
this.saveBatch(
|
||||||
|
activityTeamProductSkuAddModelList.stream().map(ActivityTeamProductSkuInfo::modelBuild).toList()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ActivityTeamProductSkuModel> findListByTeamId(Long teamId) {
|
||||||
|
LambdaQueryWrapper<ActivityTeamProductSkuInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(ActivityTeamProductSkuInfo::getTeamId,teamId);
|
||||||
|
List<ActivityTeamProductSkuInfo> list = this.list(queryWrapper);
|
||||||
|
return list.stream().map(ActivityTeamProductSkuModel::FindBuild).toList();
|
||||||
|
// return list.stream().map(activityTeamProductSkuInfo -> ActivityTeamProductSkuModel.FindBuild(activityTeamProductSkuInfo)).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 单表修改
|
||||||
|
* @param activityTeamProductSkuUpdModel
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean update(ActivityTeamProductSkuUpdModel activityTeamProductSkuUpdModel) {
|
||||||
|
LambdaUpdateWrapper<ActivityTeamProductSkuInfo> updateWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamPrice,activityTeamProductSkuUpdModel.getTeamPrice());
|
||||||
|
updateWrapper.set(ActivityTeamProductSkuInfo::getTeamStock,activityTeamProductSkuUpdModel.getTeamStock());
|
||||||
|
updateWrapper.eq(ActivityTeamProductSkuInfo::getId,activityTeamProductSkuUpdModel.getId());
|
||||||
|
return this.update(updateWrapper);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void batchUpdate(List<ActivityTeamProductSkuUpdModel> activityTeamProductSkuUpdModelList) {
|
||||||
|
List<ActivityTeamProductSkuInfo> teamProductSkuInfos = activityTeamProductSkuUpdModelList.stream()
|
||||||
|
.map(ActivityTeamProductSkuInfo::updModelBuild)
|
||||||
|
.toList();
|
||||||
|
this.updateBatchById(teamProductSkuInfos);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,39 @@
|
||||||
|
package com.muyu.service.strategy;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团活动策略
|
||||||
|
*/
|
||||||
|
public interface ActivityTeamStrategy {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 开团
|
||||||
|
* @param activityTeamId 团购活动ID
|
||||||
|
*/
|
||||||
|
public void openTeam(Long activityTeamId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请加团
|
||||||
|
* @param teamId 团ID
|
||||||
|
*/
|
||||||
|
public void applyTeam(Long teamId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参团
|
||||||
|
* @param teamId 加团ID
|
||||||
|
* @param orderNumber 订单编号
|
||||||
|
*/
|
||||||
|
public void addTeam(Long teamId, String orderNumber);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退团
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
|
public void backTeam(Long teamId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算团
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
|
public void settle(Long teamId);
|
||||||
|
}
|
|
@ -0,0 +1,89 @@
|
||||||
|
package com.muyu.service.strategy.impl;
|
||||||
|
|
||||||
|
|
||||||
|
import com.muyu.common.core.exception.ServiceException;
|
||||||
|
import com.muyu.common.core.utils.SpringUtils;
|
||||||
|
import com.muyu.service.strategy.ActivityTeamStrategy;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 团购执行器
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
@Primary
|
||||||
|
public class ActivityTeamStrategyImpl implements ActivityTeamStrategy {
|
||||||
|
/**
|
||||||
|
* 开团
|
||||||
|
* @param activityTeamId 团购活动ID
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void openTeam(Long activityTeamId) {
|
||||||
|
// 假设这里是通过方法获取的type,activityTeamId.toString()
|
||||||
|
// "team-strategy-exemption"
|
||||||
|
// "team-strategy-hundred"
|
||||||
|
// "team-strategy-ordinary"
|
||||||
|
String activityTeamType = null;
|
||||||
|
if (activityTeamId == null) {
|
||||||
|
throw new ServiceException("activityTeamId is null");
|
||||||
|
}else if (activityTeamId == 0) {
|
||||||
|
activityTeamType = "team-strategy-exemption";
|
||||||
|
}else if (activityTeamId == 1) {
|
||||||
|
activityTeamType = "team-strategy-hundred";
|
||||||
|
}else if (activityTeamId == 2) {
|
||||||
|
activityTeamType = "team-strategy-ordinary";
|
||||||
|
}
|
||||||
|
ActivityTeamStrategy activityTeamStrategy = SpringUtils.getBean(activityTeamType);
|
||||||
|
activityTeamStrategy.openTeam(activityTeamId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 申请加团
|
||||||
|
* @param teamId 团ID
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void applyTeam(Long teamId) {
|
||||||
|
// 假设这里是通过方法获取的type,teamId.toString()
|
||||||
|
// "team-strategy-exemption"
|
||||||
|
// "team-strategy-hundred"
|
||||||
|
// "team-strategy-ordinary"
|
||||||
|
String teamType = null;
|
||||||
|
if (teamId == null) {
|
||||||
|
throw new ServiceException("teamId is null");
|
||||||
|
}else if (teamId == 0) {
|
||||||
|
teamType = "team-strategy-exemption";
|
||||||
|
}else if (teamId == 1) {
|
||||||
|
teamType= "team-strategy-hundred";
|
||||||
|
}
|
||||||
|
ActivityTeamStrategy activityTeamStrategy = SpringUtils.getBean(teamType);
|
||||||
|
activityTeamStrategy.applyTeam(teamId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 参团
|
||||||
|
* @param teamId 加团ID
|
||||||
|
* @param orderNumber 订单编号
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void addTeam(Long teamId, String orderNumber) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 退团
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void backTeam(Long teamId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 结算团
|
||||||
|
* @param teamId 团购ID
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public void settle(Long teamId) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,7 +8,7 @@ spring:
|
||||||
allow-bean-definition-overriding: true
|
allow-bean-definition-overriding: true
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-actives
|
name: muyu-marketing
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
|
@ -9,13 +9,13 @@
|
||||||
</parent>
|
</parent>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modules>
|
<modules>
|
||||||
<module>active-common</module>
|
<module>marketing-common</module>
|
||||||
<module>active-remote</module>
|
<module>marketing-remote</module>
|
||||||
<module>active-server</module>
|
<module>marketing-server</module>
|
||||||
</modules>
|
</modules>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>muyu-actives</artifactId>
|
<artifactId>muyu-marketing</artifactId>
|
||||||
|
|
||||||
<description>
|
<description>
|
||||||
muyu-actives营销模块
|
muyu-actives营销模块
|
|
@ -53,6 +53,7 @@ public class AttributeGroup extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
public static AttributeGroup queryBuild( AttributeGroupQueryReq attributeGroupQueryReq){
|
public static AttributeGroup queryBuild( AttributeGroupQueryReq attributeGroupQueryReq){
|
||||||
return AttributeGroup.builder()
|
return AttributeGroup.builder()
|
||||||
|
.id(attributeGroupQueryReq.getId())
|
||||||
.name(attributeGroupQueryReq.getName())
|
.name(attributeGroupQueryReq.getName())
|
||||||
.states(attributeGroupQueryReq.getStates())
|
.states(attributeGroupQueryReq.getStates())
|
||||||
.build();
|
.build();
|
||||||
|
@ -63,6 +64,7 @@ public class AttributeGroup extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
public static AttributeGroup saveBuild(AttributeGroupSaveReq attributeGroupSaveReq){
|
public static AttributeGroup saveBuild(AttributeGroupSaveReq attributeGroupSaveReq){
|
||||||
return AttributeGroup.builder()
|
return AttributeGroup.builder()
|
||||||
|
.id(attributeGroupSaveReq.getId())
|
||||||
.name(attributeGroupSaveReq.getName())
|
.name(attributeGroupSaveReq.getName())
|
||||||
.states(attributeGroupSaveReq.getStates())
|
.states(attributeGroupSaveReq.getStates())
|
||||||
.build();
|
.build();
|
||||||
|
@ -73,7 +75,7 @@ public class AttributeGroup extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
public static AttributeGroup editBuild(Long id, AttributeGroupEditReq attributeGroupEditReq){
|
public static AttributeGroup editBuild(Long id, AttributeGroupEditReq attributeGroupEditReq){
|
||||||
return AttributeGroup.builder()
|
return AttributeGroup.builder()
|
||||||
.id(id)
|
.id(id)
|
||||||
.name(attributeGroupEditReq.getName())
|
.name(attributeGroupEditReq.getName())
|
||||||
.states(attributeGroupEditReq.getStates())
|
.states(attributeGroupEditReq.getStates())
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -94,7 +94,7 @@ public class CategoryInfo extends TreeEntity {
|
||||||
*/
|
*/
|
||||||
public static CategoryInfo editBuild(Long id, CategoryInfoUpdReq categoryInfoEditReq){
|
public static CategoryInfo editBuild(Long id, CategoryInfoUpdReq categoryInfoEditReq){
|
||||||
return CategoryInfo.builder()
|
return CategoryInfo.builder()
|
||||||
.id(id)
|
.id(id)
|
||||||
.name(categoryInfoEditReq.getName())
|
.name(categoryInfoEditReq.getName())
|
||||||
.image(categoryInfoEditReq.getImage())
|
.image(categoryInfoEditReq.getImage())
|
||||||
.start(categoryInfoEditReq.getStart())
|
.start(categoryInfoEditReq.getStart())
|
||||||
|
|
|
@ -43,7 +43,6 @@ public class TemplateAttributeGroupModel extends BaseEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param attributeGroup
|
* @param attributeGroup
|
||||||
* @param attributeList
|
* @param attributeList
|
||||||
* @return
|
* @return
|
||||||
|
|
|
@ -24,6 +24,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
public class AttributeGroupEditReq extends BaseEntity {
|
public class AttributeGroupEditReq extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long id;
|
||||||
|
|
||||||
/** 组名称 */
|
/** 组名称 */
|
||||||
@ApiModelProperty(name = "组名称", value = "组名称", required = true)
|
@ApiModelProperty(name = "组名称", value = "组名称", required = true)
|
||||||
|
|
|
@ -24,6 +24,7 @@ import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
public class AttributeGroupQueryReq extends BaseEntity {
|
public class AttributeGroupQueryReq extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
private Long id;
|
||||||
|
|
||||||
/** 组名称 */
|
/** 组名称 */
|
||||||
@ApiModelProperty(name = "组名称", value = "组名称")
|
@ApiModelProperty(name = "组名称", value = "组名称")
|
||||||
|
|
|
@ -2,20 +2,16 @@ package com.muyu.product.controller;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.function.Supplier;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
import com.muyu.common.security.utils.SecurityUtils;
|
import com.muyu.common.security.utils.SecurityUtils;
|
||||||
import com.muyu.product.domain.AttributeGroup;
|
|
||||||
import com.muyu.product.domain.AttributeInfo;
|
|
||||||
import com.muyu.product.domain.BrandInfo;
|
|
||||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||||
import com.muyu.product.domain.req.CategoryInfoUpdReq;
|
import com.muyu.product.domain.req.CategoryInfoUpdReq;
|
||||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||||
import com.muyu.product.domain.resp.CategoryInfoUpdResp;
|
|
||||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||||
|
import com.muyu.product.service.CategoryInfoService;
|
||||||
import io.swagger.annotations.*;
|
import io.swagger.annotations.*;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
import org.springframework.web.bind.annotation.PutMapping;
|
||||||
|
@ -31,10 +27,7 @@ import com.muyu.common.log.annotation.Log;
|
||||||
import com.muyu.common.log.enums.BusinessType;
|
import com.muyu.common.log.enums.BusinessType;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
import com.muyu.product.domain.CategoryInfo;
|
import com.muyu.product.domain.CategoryInfo;
|
||||||
import com.muyu.product.domain.req.CategoryInfoQueryReq;
|
|
||||||
import com.muyu.product.domain.req.CategoryInfoSaveReq;
|
import com.muyu.product.domain.req.CategoryInfoSaveReq;
|
||||||
import com.muyu.product.domain.req.CategoryInfoEditReq;
|
|
||||||
import com.muyu.product.service.CategoryInfoService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 品类信息Controller
|
* 品类信息Controller
|
||||||
|
@ -46,7 +39,7 @@ import com.muyu.product.service.CategoryInfoService;
|
||||||
@RestController
|
@RestController
|
||||||
@RequestMapping("/category")
|
@RequestMapping("/category")
|
||||||
public class CategoryInfoController extends BaseController {
|
public class CategoryInfoController extends BaseController {
|
||||||
@Autowired
|
@Resource
|
||||||
private CategoryInfoService categoryInfoService;
|
private CategoryInfoService categoryInfoService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -108,4 +108,11 @@ public class CommentInfoController extends BaseController {
|
||||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||||
return toAjax(commentInfoService.removeBatchByIds(ids));
|
return toAjax(commentInfoService.removeBatchByIds(ids));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 查询评论根据Id
|
||||||
|
*/
|
||||||
|
@GetMapping("/tocomment/{id}")
|
||||||
|
public Result<List<CommentInfo>> commentInfoById(@PathVariable Long id){
|
||||||
|
return Result.success(commentInfoService.comById(id));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class ProjectInfoController extends BaseController {
|
||||||
@PostMapping
|
@PostMapping
|
||||||
@ApiOperation("新增商品信息")
|
@ApiOperation("新增商品信息")
|
||||||
public Result<String> add(@RequestBody ProjectInfoSaveReq projectInfoSaveReq) {
|
public Result<String> add(@RequestBody ProjectInfoSaveReq projectInfoSaveReq) {
|
||||||
return projectInfoService.save(projectInfoSaveReq);
|
return toAjax(projectInfoService.save(projectInfoSaveReq));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -74,7 +74,7 @@ public interface CategoryInfoService extends IService<CategoryInfo> {
|
||||||
|
|
||||||
public <T, AS> List<T> getCommon (Long categoryId, IService<AS> iService, IService<T> bsiService);
|
public <T, AS> List<T> getCommon (Long categoryId, IService<AS> iService, IService<T> bsiService);
|
||||||
|
|
||||||
boolean updateById(Long id,CategoryInfoUpdReq categoryInfoUpdReq);
|
Boolean updateById(Long id, CategoryInfoUpdReq categoryInfoUpdReq);
|
||||||
|
|
||||||
Result removeBatchById(Long ids);
|
Result removeBatchById(Long ids);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,5 +17,8 @@ public interface CommentInfoService extends IService<CommentInfo> {
|
||||||
* @return 商品评论集合
|
* @return 商品评论集合
|
||||||
*/
|
*/
|
||||||
public List<CommentInfo> list(CommentInfo commentInfo);
|
public List<CommentInfo> list(CommentInfo commentInfo);
|
||||||
|
/**
|
||||||
|
* 查询评论根据Id
|
||||||
|
*/
|
||||||
|
List<CommentInfo> comById(Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ public interface ProjectInfoService extends IService<ProjectInfo> {
|
||||||
* @param projectInfoSaveReq 请求对象
|
* @param projectInfoSaveReq 请求对象
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Result save (ProjectInfoSaveReq projectInfoSaveReq);
|
boolean save (ProjectInfoSaveReq projectInfoSaveReq);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过商品ID获取商品详情
|
* 通过商品ID获取商品详情
|
||||||
|
|
|
@ -39,11 +39,6 @@ public class AsBrandProjectServiceImpl extends ServiceImpl<AsBrandProjectMapper,
|
||||||
if (ObjUtils.notNull(asBrandProject.getProjectId())){
|
if (ObjUtils.notNull(asBrandProject.getProjectId())){
|
||||||
queryWrapper.eq(AsBrandProject::getProjectId, asBrandProject.getProjectId());
|
queryWrapper.eq(AsBrandProject::getProjectId, asBrandProject.getProjectId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return list(queryWrapper);
|
return list(queryWrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -133,6 +133,11 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改属性功能
|
||||||
|
* @param id
|
||||||
|
* @param attributeUpdReq
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public boolean updateByattr(Long id, AttributeUpdReq attributeUpdReq) {
|
public boolean updateByattr(Long id, AttributeUpdReq attributeUpdReq) {
|
||||||
|
@ -144,6 +149,7 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
||||||
queryWrapper.eq(AsAttributeGroup::getGroupId, id);
|
queryWrapper.eq(AsAttributeGroup::getGroupId, id);
|
||||||
asAttributeGroupService.remove(queryWrapper);
|
asAttributeGroupService.remove(queryWrapper);
|
||||||
|
|
||||||
|
//判空
|
||||||
if (null == attributeUpdReq.getAttributeList()) {
|
if (null == attributeUpdReq.getAttributeList()) {
|
||||||
attributeUpdReq.getAttributeIdList().stream().forEach(attributeIdList -> {
|
attributeUpdReq.getAttributeIdList().stream().forEach(attributeIdList -> {
|
||||||
asAttributeGroupService.addByGroup(id, attributeIdList);
|
asAttributeGroupService.addByGroup(id, attributeIdList);
|
||||||
|
@ -156,7 +162,6 @@ public class AttributeGroupServiceImpl extends ServiceImpl<AttributeGroupMapper,
|
||||||
asAttributeGroupService.addByGroup(id, attributeList.getId());
|
asAttributeGroupService.addByGroup(id, attributeList.getId());
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -210,9 +210,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过品类ID获取父级以上的属性集合
|
* 通过品类ID获取父级以上的属性集合
|
||||||
*
|
|
||||||
* @param categoryId 品类ID
|
* @param categoryId 品类ID
|
||||||
*
|
|
||||||
* @return 父级以上的属性集合
|
* @return 父级以上的属性集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -276,9 +274,14 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改品类信息
|
||||||
|
* @param id
|
||||||
|
* @param categoryInfoUpdReq
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
@Transactional /**解决事务问题**/
|
@Transactional /**解决事务问题**/
|
||||||
public boolean updateById(Long id,CategoryInfoUpdReq categoryInfoUpdReq) {
|
public Boolean updateById(Long id, CategoryInfoUpdReq categoryInfoUpdReq) {
|
||||||
//修改品类信息
|
//修改品类信息
|
||||||
Boolean b= categoryInfoMapper.updateById(id,categoryInfoUpdReq);
|
Boolean b= categoryInfoMapper.updateById(id,categoryInfoUpdReq);
|
||||||
//删除品类与属性,属性组,品牌关联表
|
//删除品类与属性,属性组,品牌关联表
|
||||||
|
@ -311,6 +314,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
//查询是否有子级
|
//查询是否有子级
|
||||||
//qw是plus的条件构造器,lqw是lambda表达式
|
//qw是plus的条件构造器,lqw是lambda表达式
|
||||||
QueryWrapper<CategoryInfo> queryWrapper = new QueryWrapper<>();
|
QueryWrapper<CategoryInfo> queryWrapper = new QueryWrapper<>();
|
||||||
|
//根据父级id查询
|
||||||
queryWrapper.eq("parent_id",ids);
|
queryWrapper.eq("parent_id",ids);
|
||||||
List<CategoryInfo> listall = categoryInfoMapper.selectList(queryWrapper);
|
List<CategoryInfo> listall = categoryInfoMapper.selectList(queryWrapper);
|
||||||
if(0==listall.size()){
|
if(0==listall.size()){
|
||||||
|
@ -328,9 +332,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过品类ID获取父级以上的属性、属性组、品牌集合
|
* 通过品类ID获取父级以上的属性、属性组、品牌集合
|
||||||
*
|
|
||||||
* @param categoryId 品类ID
|
* @param categoryId 品类ID
|
||||||
*
|
|
||||||
* @return 父级以上的属性、属性组、品牌集合
|
* @return 父级以上的属性、属性组、品牌集合
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
|
@ -361,7 +363,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
LambdaQueryWrapper<AsCategoryAttribute> AsAttributeQueryWrapper = new LambdaQueryWrapper<AsCategoryAttribute>().eq(AsCategoryAttribute::getCategoryId, id);
|
LambdaQueryWrapper<AsCategoryAttribute> AsAttributeQueryWrapper = new LambdaQueryWrapper<AsCategoryAttribute>().eq(AsCategoryAttribute::getCategoryId, id);
|
||||||
List<AsCategoryAttribute> asCategoryAttributeList = asCategoryAttributeService.list(AsAttributeQueryWrapper);
|
List<AsCategoryAttribute> asCategoryAttributeList = asCategoryAttributeService.list(AsAttributeQueryWrapper);
|
||||||
List<Long> longList = asCategoryAttributeList.stream().map(AsCategoryAttribute::getAttributeId).toList();
|
List<Long> longList = asCategoryAttributeList.stream().map(AsCategoryAttribute::getAttributeId).toList();
|
||||||
//拿到属性集合
|
//获取属性集合
|
||||||
List<AttributeInfo> attributeInfoList = attributeInfoService.listByIds(longList);
|
List<AttributeInfo> attributeInfoList = attributeInfoService.listByIds(longList);
|
||||||
|
|
||||||
|
|
||||||
|
@ -369,7 +371,7 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
LambdaQueryWrapper<AsCategoryAttributeGroup> GroupQueryWrapper = new LambdaQueryWrapper<AsCategoryAttributeGroup>().eq(AsCategoryAttributeGroup::getCategoryId, id);
|
LambdaQueryWrapper<AsCategoryAttributeGroup> GroupQueryWrapper = new LambdaQueryWrapper<AsCategoryAttributeGroup>().eq(AsCategoryAttributeGroup::getCategoryId, id);
|
||||||
List<AsCategoryAttributeGroup> asCategoryAttributeGroupList = asCategoryAttributeGroupService.list(GroupQueryWrapper);
|
List<AsCategoryAttributeGroup> asCategoryAttributeGroupList = asCategoryAttributeGroupService.list(GroupQueryWrapper);
|
||||||
List<Long> longList1 = asCategoryAttributeGroupList.stream().map(AsCategoryAttributeGroup::getAttributeGroupId).toList();
|
List<Long> longList1 = asCategoryAttributeGroupList.stream().map(AsCategoryAttributeGroup::getAttributeGroupId).toList();
|
||||||
//拿到属性组集合
|
//获取属性组集合
|
||||||
List<AttributeGroup> attributeGroups = attributeGroupService.listByIds(longList1);
|
List<AttributeGroup> attributeGroups = attributeGroupService.listByIds(longList1);
|
||||||
|
|
||||||
//品牌中间表构造器
|
//品牌中间表构造器
|
||||||
|
@ -392,16 +394,13 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过品类ID获取品类共有属性
|
* 通过品类ID获取品类共有属性
|
||||||
*
|
|
||||||
* @param cateGoryId 品类ID
|
|
||||||
*
|
|
||||||
* @return 品类共有属性
|
* @return 品类共有属性
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId) {
|
public CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId) {
|
||||||
List<Long> cateGoryIdList = new ArrayList<>();
|
List<Long> cateGoryIdList = new ArrayList<>();
|
||||||
getParentIdListByCateGoryId(cateGoryIdList, cateGoryId);
|
getParentIdListByCateGoryId(cateGoryIdList, cateGoryId);
|
||||||
// 取出和品类相关联的属性组关系 - 中间表
|
// 获取和品类相互关联的属性组关系 (中间表)
|
||||||
LambdaQueryWrapper<AsCategoryAttributeGroup> asCategoryAttributeGroupLambdaQueryWrapper = new LambdaQueryWrapper<>(){{
|
LambdaQueryWrapper<AsCategoryAttributeGroup> asCategoryAttributeGroupLambdaQueryWrapper = new LambdaQueryWrapper<>(){{
|
||||||
in(AsCategoryAttributeGroup::getCategoryId, cateGoryIdList);
|
in(AsCategoryAttributeGroup::getCategoryId, cateGoryIdList);
|
||||||
}};
|
}};
|
||||||
|
@ -428,17 +427,22 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
))
|
))
|
||||||
.filter(TemplateAttributeGroupModel::isEffective)
|
.filter(TemplateAttributeGroupModel::isEffective)
|
||||||
.toList();
|
.toList();
|
||||||
// 查重集合
|
// 创建集合
|
||||||
Set<Long> attributeIdSet = new HashSet<>();
|
Set<Long> attributeIdSet = new HashSet<>();
|
||||||
// 获取组内所有的属性Id
|
// attributeGroupModelList.forEach(attributeGroupModel -> {
|
||||||
|
// attributeGroupModel.getAttributeList().forEach(attributeModel -> {
|
||||||
|
// attributeIdSet.add(attributeModel.getId());
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
// 获取组内所有属性Id,判空
|
||||||
if (!attributeGroupModelList.isEmpty()){
|
if (!attributeGroupModelList.isEmpty()){
|
||||||
attributeIdSet.addAll(
|
attributeIdSet.addAll(
|
||||||
attributeGroupModelList.stream()
|
attributeGroupModelList.stream()
|
||||||
.flatMap((Function<TemplateAttributeGroupModel, Stream<TemplateAttributeModel>>) templateAttributeGroupModel -> templateAttributeGroupModel.getAttributeList().stream())
|
.flatMap((Function<TemplateAttributeGroupModel, Stream<TemplateAttributeModel>>) templateAttributeGroupModel -> templateAttributeGroupModel.getAttributeList().stream())
|
||||||
.map(TemplateAttributeModel::getId)
|
.map(TemplateAttributeModel::getId)
|
||||||
.toList()
|
.toList()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TemplateAttributeModel> templateAttributeModelList = new ArrayList<>();
|
List<TemplateAttributeModel> templateAttributeModelList = new ArrayList<>();
|
||||||
LambdaQueryWrapper<AsCategoryAttribute> categoryAttributeQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AsCategoryAttribute> categoryAttributeQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
@ -449,23 +453,29 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
||||||
.map(AsCategoryAttribute::getAttributeId)
|
.map(AsCategoryAttribute::getAttributeId)
|
||||||
.filter(templateAttributeId -> !attributeIdSet.contains(templateAttributeId))
|
.filter(templateAttributeId -> !attributeIdSet.contains(templateAttributeId))
|
||||||
.toList();
|
.toList();
|
||||||
templateAttributeModelList = attributeInfoService.listByIds(templateAttributeIdList).stream()
|
if (!templateAttributeIdList.isEmpty()){
|
||||||
.map(AttributeInfo::buildTemplateModel)
|
templateAttributeModelList = attributeInfoService.listByIds(templateAttributeIdList).stream()
|
||||||
.toList();
|
.map(AttributeInfo::buildTemplateModel)
|
||||||
|
.toList();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
List<TemplateAttributeModel> attributeModelList = new ArrayList<>();
|
List<TemplateAttributeModel> attributeModelList = new ArrayList<>();
|
||||||
|
//判断是否为空,不为空继续执行
|
||||||
if (!templateAttributeModelList.isEmpty()){
|
if (!templateAttributeModelList.isEmpty()){
|
||||||
attributeIdSet.addAll(
|
attributeIdSet.addAll(
|
||||||
|
//利用Steam 流遍历获取id集合
|
||||||
templateAttributeModelList.stream().map(TemplateAttributeModel::getId).toList()
|
templateAttributeModelList.stream().map(TemplateAttributeModel::getId).toList()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//商品属性构造
|
||||||
LambdaQueryWrapper<AttributeInfo> attributeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<AttributeInfo> attributeInfoLambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
attributeInfoLambdaQueryWrapper.notIn(!attributeIdSet.isEmpty(), AttributeInfo::getId, attributeIdSet);
|
attributeInfoLambdaQueryWrapper.notIn(!attributeIdSet.isEmpty(), AttributeInfo::getId, attributeIdSet);
|
||||||
attributeModelList = attributeInfoService.list(attributeInfoLambdaQueryWrapper).stream().map(AttributeInfo::buildTemplateModel).toList();
|
attributeModelList = attributeInfoService.list(attributeInfoLambdaQueryWrapper).stream().map(AttributeInfo::buildTemplateModel).toList();
|
||||||
|
|
||||||
|
//属性组列表回显(商品信息中)
|
||||||
return CategoryCommonElementResp.builder()
|
return CategoryCommonElementResp.builder()
|
||||||
.templateAttributeGroupList(attributeGroupModelList)
|
.templateAttributeGroupList(attributeGroupModelList)
|
||||||
.templateAttributeList(templateAttributeModelList)
|
.templateAttributeList(templateAttributeModelList)
|
||||||
|
|
|
@ -23,7 +23,6 @@ public class CommentInfoServiceImpl extends ServiceImpl<CommentInfoMapper, Comme
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询商品评论列表
|
* 查询商品评论列表
|
||||||
*
|
|
||||||
* @param commentInfo 商品评论
|
* @param commentInfo 商品评论
|
||||||
* @return 商品评论
|
* @return 商品评论
|
||||||
*/
|
*/
|
||||||
|
@ -54,4 +53,12 @@ public class CommentInfoServiceImpl extends ServiceImpl<CommentInfoMapper, Comme
|
||||||
|
|
||||||
return list(queryWrapper);
|
return list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<CommentInfo> comById(Long id) {
|
||||||
|
LambdaQueryWrapper<CommentInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(CommentInfo::getProjectId,id);
|
||||||
|
List<CommentInfo> list = this.list(queryWrapper);
|
||||||
|
return list;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ public class CommentLikeInfoServiceImpl extends ServiceImpl<CommentLikeInfoMappe
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询评论点赞列表
|
* 查询评论点赞列表
|
||||||
*
|
|
||||||
* @param commentLikeInfo 评论点赞
|
* @param commentLikeInfo 评论点赞
|
||||||
* @return 评论点赞
|
* @return 评论点赞
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -149,22 +149,45 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 保存商品信息
|
* 保存商品信息
|
||||||
|
*
|
||||||
* @param projectInfoSaveReq 请求对象
|
* @param projectInfoSaveReq 请求对象
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result save (ProjectInfoSaveReq projectInfoSaveReq) {
|
public boolean save (ProjectInfoSaveReq projectInfoSaveReq) {
|
||||||
//查询所有商品集合
|
// //查询所有商品集合
|
||||||
List<String> nameList = getStrings();
|
// List<String> nameList = getStrings();
|
||||||
//跟新商品名称作比较 判断是否重复
|
// //跟新商品名称作比较 判断是否重复
|
||||||
if (nameList.contains(projectInfoSaveReq.getProjectAddModel().getName())){
|
// if (nameList.contains(projectInfoSaveReq.getProjectAddModel().getName())){
|
||||||
return Result.error("该名称已被占用");
|
// return Result.error("该名称已被占用");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
|
// ProjectAddModel projectAddModel = projectInfoSaveReq.getProjectAddModel();
|
||||||
|
// ProjectInfo projectInfo = ProjectInfo.saveModelBuild(projectAddModel, SecurityUtils::getUsername);
|
||||||
|
// boolean save = this.save(projectInfo);
|
||||||
|
//
|
||||||
|
// if (save){
|
||||||
|
// // 属性值
|
||||||
|
// List<AttrValueModel> attrValueList = projectInfoSaveReq.getAttrValueList();
|
||||||
|
// List<AsProductAttributeInfo> asProductAttributeInfoList = attrValueList.stream()
|
||||||
|
// .map(attrValueModel -> AsProductAttributeInfo.attrValueModelBuild(attrValueModel, projectInfo::getId))
|
||||||
|
// .toList();
|
||||||
|
// if (!asProductAttributeInfoList.isEmpty()){
|
||||||
|
// asProductAttributeInfoService.saveBatch(asProductAttributeInfoList);
|
||||||
|
// }
|
||||||
|
// // sku ProductSkuModel -》 ProjectSkuInfo
|
||||||
|
// List<ProductSkuModel> productSkuModelList = projectInfoSaveReq.getProductSkuList();
|
||||||
|
// List<ProjectSkuInfo> projectSkuInfoList = productSkuModelList.stream().map(
|
||||||
|
// productSkuModel -> ProjectSkuInfo.productSkuModelBuild(productSkuModel, projectInfo::getId)
|
||||||
|
// ).toList();
|
||||||
|
// if (!projectSkuInfoList.isEmpty()){
|
||||||
|
// projectSkuInfoService.saveBatch(projectSkuInfoList);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return Result.success("添加成功");
|
||||||
ProjectAddModel projectAddModel = projectInfoSaveReq.getProjectAddModel();
|
ProjectAddModel projectAddModel = projectInfoSaveReq.getProjectAddModel();
|
||||||
ProjectInfo projectInfo = ProjectInfo.saveModelBuild(projectAddModel, SecurityUtils::getUsername);
|
ProjectInfo projectInfo = ProjectInfo.saveModelBuild(projectAddModel, SecurityUtils::getUsername);
|
||||||
boolean save = this.save(projectInfo);
|
boolean save = this.save(projectInfo);
|
||||||
|
|
||||||
if (save){
|
if (save){
|
||||||
// 属性值
|
// 属性值
|
||||||
List<AttrValueModel> attrValueList = projectInfoSaveReq.getAttrValueList();
|
List<AttrValueModel> attrValueList = projectInfoSaveReq.getAttrValueList();
|
||||||
|
@ -183,7 +206,7 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
|
||||||
projectSkuInfoService.saveBatch(projectSkuInfoList);
|
projectSkuInfoService.saveBatch(projectSkuInfoList);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Result.success("添加成功");
|
return save;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -194,7 +217,7 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ProjectDetailResp getDetailInfo (Long id) {
|
public ProjectDetailResp getDetailInfo (Long id) {
|
||||||
// 商品信息获取
|
// 商品信息获取 根据id
|
||||||
ProjectInfo projectInfo = this.getById(id);
|
ProjectInfo projectInfo = this.getById(id);
|
||||||
// 品牌信息
|
// 品牌信息
|
||||||
BrandInfo brandInfo = this.brandInfoService.getById(projectInfo.getBrandId());
|
BrandInfo brandInfo = this.brandInfoService.getById(projectInfo.getBrandId());
|
||||||
|
@ -204,16 +227,16 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
|
||||||
add(projectInfo.getParentType());
|
add(projectInfo.getParentType());
|
||||||
add(projectInfo.getType());
|
add(projectInfo.getType());
|
||||||
}});
|
}});
|
||||||
// 商品Sku集合
|
// 获取商品Sku集合
|
||||||
List<ProjectSkuInfo> projectSkuInfoList = this.projectSkuInfoService.list(new LambdaQueryWrapper<>() {{
|
List<ProjectSkuInfo> projectSkuInfoList = this.projectSkuInfoService.list(new LambdaQueryWrapper<>() {{
|
||||||
eq(ProjectSkuInfo::getProjectId, id);
|
eq(ProjectSkuInfo::getProjectId, id);
|
||||||
}});
|
}});
|
||||||
|
|
||||||
// 商品和属性集合
|
// 获取商品和属性集合
|
||||||
List<AsProductAttributeInfo> productAttributeInfoList = this.asProductAttributeInfoService.list(new LambdaQueryWrapper<>() {{
|
List<AsProductAttributeInfo> productAttributeInfoList = this.asProductAttributeInfoService.list(new LambdaQueryWrapper<>() {{
|
||||||
eq(AsProductAttributeInfo::getProductId, id);
|
eq(AsProductAttributeInfo::getProductId, id);
|
||||||
}});
|
}});
|
||||||
// 商品规格
|
// 获取商品规格
|
||||||
List<RuleAttrAddModel> ruleAttrModelList = ruleAttrInfoService.list(new LambdaQueryWrapper<>() {{
|
List<RuleAttrAddModel> ruleAttrModelList = ruleAttrInfoService.list(new LambdaQueryWrapper<>() {{
|
||||||
eq(RuleAttrInfo::getRuleId, projectInfo.getRuleId());
|
eq(RuleAttrInfo::getRuleId, projectInfo.getRuleId());
|
||||||
}}).stream()
|
}}).stream()
|
||||||
|
@ -225,7 +248,7 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
|
||||||
List<TemplateAttributeModel> templateAttributeList = new ArrayList<>(){{
|
List<TemplateAttributeModel> templateAttributeList = new ArrayList<>(){{
|
||||||
addAll(templateAttribute.getTemplateAttributeList());
|
addAll(templateAttribute.getTemplateAttributeList());
|
||||||
}};
|
}};
|
||||||
// 属性组和商品属性的ID
|
// 属性组和商品属性的ID 创建集合
|
||||||
List<Long> notInAttributeIdList = new ArrayList<>();
|
List<Long> notInAttributeIdList = new ArrayList<>();
|
||||||
List<Long> attributeGroupIdList = templateAttributeGroupList.stream()
|
List<Long> attributeGroupIdList = templateAttributeGroupList.stream()
|
||||||
.flatMap(templateAttributeGroupModel -> templateAttributeGroupModel.getAttributeList().stream())
|
.flatMap(templateAttributeGroupModel -> templateAttributeGroupModel.getAttributeList().stream())
|
||||||
|
@ -277,6 +300,12 @@ public class ProjectInfoServiceImpl extends ServiceImpl<ProjectInfoMapper, Proje
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 进行修改的时候,判断名称是否重复
|
||||||
|
* @param id
|
||||||
|
* @param projectInfoEditReq
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public Result updateById(Long id, ProjectInfoEditReq projectInfoEditReq) {
|
public Result updateById(Long id, ProjectInfoEditReq projectInfoEditReq) {
|
||||||
List<String> nameList = getStrings();
|
List<String> nameList = getStrings();
|
||||||
|
|
|
@ -44,10 +44,6 @@ public class RuleAttrInfoServiceImpl extends ServiceImpl<RuleAttrInfoMapper, Rul
|
||||||
queryWrapper.eq(RuleAttrInfo::getAttrValue, ruleAttrInfo.getAttrValue());
|
queryWrapper.eq(RuleAttrInfo::getAttrValue, ruleAttrInfo.getAttrValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return list(queryWrapper);
|
return list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,10 +81,7 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加规格信息
|
* 添加规格信息
|
||||||
*
|
|
||||||
* @param ruleInfoAddModel 规格添加模型
|
* @param ruleInfoAddModel 规格添加模型
|
||||||
*
|
|
||||||
* @return 时候成功
|
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean save (RuleInfoAddModel ruleInfoAddModel) {
|
public boolean save (RuleInfoAddModel ruleInfoAddModel) {
|
||||||
|
@ -151,6 +148,11 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
|
||||||
.build();
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据id批量修改规格属性
|
||||||
|
* @param id
|
||||||
|
* @param ruleInfoEditReq
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean updateById(Long id, RuleInfoEditReq ruleInfoEditReq) {
|
public boolean updateById(Long id, RuleInfoEditReq ruleInfoEditReq) {
|
||||||
//获取id
|
//获取id
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
<module>muyu-job</module>
|
<module>muyu-job</module>
|
||||||
<module>muyu-file</module>
|
<module>muyu-file</module>
|
||||||
<module>muyu-product</module>
|
<module>muyu-product</module>
|
||||||
<module>muyu-actives</module>
|
<module>muyu-marketing</module>
|
||||||
<module>muyu-shop-cart</module>
|
<module>muyu-shop-cart</module>
|
||||||
</modules>
|
</modules>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue