初始化-第四次提交11.25
parent
f3015a1171
commit
1f1da077cf
|
@ -87,7 +87,8 @@ public class PageDomain {
|
||||||
return reasonable;
|
return reasonable;
|
||||||
}
|
}
|
||||||
|
|
||||||
// public void setReasonable (Boolean reasonable) {
|
|
||||||
// this.reasonable = reasonable;
|
public void setReasonable (Boolean reasonable) {
|
||||||
// }
|
this.reasonable = reasonable;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,6 @@ import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表格分页数据对象
|
* 表格分页数据对象
|
||||||
*
|
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,9 @@ import com.muyu.common.core.constant.ServiceNameConstants;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.system.domain.SysFile;
|
import com.muyu.common.system.domain.SysFile;
|
||||||
import com.muyu.common.system.remote.factory.RemoteFileFallbackFactory;
|
import com.muyu.common.system.remote.factory.RemoteFileFallbackFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestPart;
|
import org.springframework.web.bind.annotation.RequestPart;
|
||||||
|
@ -16,6 +18,8 @@ import org.springframework.web.multipart.MultipartFile;
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
|
@FeignClient(contextId = "remoteFileService", value = ServiceNameConstants.FILE_SERVICE, fallbackFactory = RemoteFileFallbackFactory.class)
|
||||||
|
@Qualifier
|
||||||
|
@Primary
|
||||||
public interface RemoteFileService {
|
public interface RemoteFileService {
|
||||||
/**
|
/**
|
||||||
* 上传文件
|
* 上传文件
|
||||||
|
|
|
@ -6,7 +6,9 @@ import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.system.domain.SysLogininfor;
|
import com.muyu.common.system.domain.SysLogininfor;
|
||||||
import com.muyu.common.system.domain.SysOperLog;
|
import com.muyu.common.system.domain.SysOperLog;
|
||||||
import com.muyu.common.system.remote.factory.RemoteLogFallbackFactory;
|
import com.muyu.common.system.remote.factory.RemoteLogFallbackFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
import org.springframework.web.bind.annotation.RequestBody;
|
||||||
import org.springframework.web.bind.annotation.RequestHeader;
|
import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
|
@ -17,6 +19,8 @@ import org.springframework.web.bind.annotation.RequestHeader;
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
@FeignClient(contextId = "remoteLogService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class)
|
@FeignClient(contextId = "remoteLogService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteLogFallbackFactory.class)
|
||||||
|
@Qualifier
|
||||||
|
@Primary
|
||||||
public interface RemoteLogService {
|
public interface RemoteLogService {
|
||||||
/**
|
/**
|
||||||
* 保存系统日志
|
* 保存系统日志
|
||||||
|
|
|
@ -6,7 +6,9 @@ import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.common.system.domain.SysUser;
|
import com.muyu.common.system.domain.SysUser;
|
||||||
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
import com.muyu.common.system.remote.factory.RemoteUserFallbackFactory;
|
||||||
import com.muyu.common.system.domain.LoginUser;
|
import com.muyu.common.system.domain.LoginUser;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -15,6 +17,8 @@ import org.springframework.web.bind.annotation.*;
|
||||||
* @author muyu
|
* @author muyu
|
||||||
*/
|
*/
|
||||||
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
|
@FeignClient(contextId = "remoteUserService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteUserFallbackFactory.class)
|
||||||
|
@Qualifier
|
||||||
|
@Primary
|
||||||
public interface RemoteUserService {
|
public interface RemoteUserService {
|
||||||
/**
|
/**
|
||||||
* 通过用户名查询用户信息
|
* 通过用户名查询用户信息
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.muyu.active.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.muyu.active.domain.model.ActivityTeamInfoSaveModel;
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -12,24 +12,48 @@ import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团信息主表
|
||||||
|
*/
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "activity_team_info",autoResultMap = true)
|
|
||||||
public class ActivityTeamInfo extends BaseEntity {
|
public class ActivityTeamInfo extends BaseEntity {
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
@TableId(value = "id",type = IdType.AUTO)
|
||||||
|
private long id;
|
||||||
private String name;
|
private String name;
|
||||||
private Integer productId;
|
private long productId;
|
||||||
private String productImage;
|
private String productImage;
|
||||||
private String introduction;
|
private String introduction;
|
||||||
private String unit;
|
private String unit;
|
||||||
private String imageList;
|
private String imageList;
|
||||||
private Date endTime;
|
private Date endTime;
|
||||||
private Integer sort;
|
private long sort;
|
||||||
|
private String content;
|
||||||
private String status;
|
private String status;
|
||||||
private String strategyType;
|
private String strategyType;
|
||||||
private Integer strategyId;
|
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,8 +1,5 @@
|
||||||
package com.muyu.active.domain;
|
package com.muyu.active.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -10,25 +7,28 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品开团表
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode
|
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@TableName(value = "activity_team_open_info",autoResultMap = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class ActivityTeamOpenInfo extends BaseEntity {
|
public class ActivityTeamOpenInfo extends BaseEntity {
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
private long id;
|
||||||
private Long id;
|
private long teamId;
|
||||||
private Integer teamId;
|
|
||||||
private String teamType;
|
private String teamType;
|
||||||
private Integer teamStrategyId;
|
private long teamStrategyId;
|
||||||
private String executiveType;
|
private String executiveType;
|
||||||
private String endTime;
|
private Date endTime;
|
||||||
private Integer productId;
|
private long productId;
|
||||||
private String productName;
|
private String productName;
|
||||||
private String productSku;
|
private String productSku;
|
||||||
private String key;
|
private String key;
|
||||||
private Integer orderId;
|
private long orderId;
|
||||||
private Integer status;
|
private String status;
|
||||||
private String createBy;
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
package com.muyu.active.domain;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*参团类型枚举类
|
||||||
|
**/
|
||||||
|
public enum ActivityTeamOpenInfoEnum {
|
||||||
|
OPEN_TEAM("open_team","开团"),
|
||||||
|
IN_TEAM("in_team","参团");
|
||||||
|
private String code;
|
||||||
|
private String label;
|
||||||
|
|
||||||
|
ActivityTeamOpenInfoEnum(String code, String label) {
|
||||||
|
this.code = code;
|
||||||
|
this.label = label;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String code() {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String label() {
|
||||||
|
return label;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,8 +1,6 @@
|
||||||
package com.muyu.active.domain;
|
package com.muyu.active.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.muyu.active.domain.model.TeamSkuInfoModel;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -10,18 +8,35 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品sku主表
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@EqualsAndHashCode
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@TableName(value = "activity_team_product_sku_info",autoResultMap = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class ActivityTeamProductSkuInfo extends BaseEntity {
|
public class ActivityTeamProductSkuInfo extends BaseEntity {
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
private long id;
|
||||||
private Long id;
|
private long teamId;
|
||||||
private Integer teamId;
|
private Long productId;
|
||||||
private Integer productId;
|
|
||||||
private String productSku;
|
private String productSku;
|
||||||
private String teamStock;
|
private Long teamStock;
|
||||||
private String teamPrice;
|
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,8 +1,5 @@
|
||||||
package com.muyu.active.domain;
|
package com.muyu.active.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -10,21 +7,25 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团免单策略表
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode
|
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@TableName(value = "team_strategy_exemption",autoResultMap = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class TeamStrategyExemption extends BaseEntity {
|
public class TeamStrategyExemption extends BaseEntity {
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
private long id;
|
||||||
private String duration;
|
private long duration;
|
||||||
private Integer exemptionNumber;
|
private long exemptionNumber;
|
||||||
private Integer maxBuy;
|
private long maxBuy;
|
||||||
private Integer oneBuy;
|
private long oneBuy;
|
||||||
private Integer virtualNumber;
|
private long virtualNumber;
|
||||||
private String type;
|
private String type;
|
||||||
private String ruleInfo;
|
private String ruleInfo;
|
||||||
private Integer status;
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package com.muyu.active.domain;
|
package com.muyu.active.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -10,19 +7,21 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团百人策略表
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@EqualsAndHashCode
|
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@TableName(value = "team_strategy_exemption_hundred",autoResultMap = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
public class TeamStrategyExemptionHundred extends BaseEntity {
|
public class TeamStrategyExemptionHundred extends BaseEntity {
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
private long id;
|
||||||
private Long id;
|
private long duration;
|
||||||
private String duration;
|
private long maxBuy;
|
||||||
private Integer maxBuy;
|
private long oneBuy;
|
||||||
private Integer oneBuy;
|
private long virtualNumber;
|
||||||
private Integer virtualNumber;
|
private String status;
|
||||||
private Integer status;
|
|
||||||
private String ruleInfo;
|
private String ruleInfo;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
package com.muyu.active.domain;
|
package com.muyu.active.domain;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
|
||||||
import com.muyu.common.core.web.domain.BaseEntity;
|
import com.muyu.common.core.web.domain.BaseEntity;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
@ -10,20 +7,23 @@ import lombok.EqualsAndHashCode;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.experimental.SuperBuilder;
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团普通策略表
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@EqualsAndHashCode
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@TableName(value = "team_strategy_exemption_ordinary",autoResultMap = true)
|
|
||||||
public class TeamStrategyExemptionOrdinary extends BaseEntity {
|
public class TeamStrategyExemptionOrdinary extends BaseEntity {
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Long id;
|
private long id;
|
||||||
private String duration;
|
private long duration;
|
||||||
private Integer teamNumber;
|
private long teamNumber;
|
||||||
private Integer maxBuy;
|
private long maxBuy;
|
||||||
private Integer oneBuy;
|
private long oneBuy;
|
||||||
private Integer virtualNumber;
|
private long virtualNumber;
|
||||||
private Integer status;
|
private String status;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 活动优惠力度价格模型
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class ActivityTeamDiscountModel {
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
private double discount;
|
||||||
|
|
||||||
|
public static ActivityTeamDiscountModel of(BigDecimal price, BigDecimal teamPrice) {
|
||||||
|
return ActivityTeamDiscountModel.builder()
|
||||||
|
.productPrice(price)
|
||||||
|
.teamPrice(teamPrice)
|
||||||
|
.discount(Double.valueOf(price.subtract(teamPrice).divide(price, 2, RoundingMode.CEILING).intValue()))
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,44 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
import com.muyu.active.domain.ActivityTeamInfo;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.function.Function;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品列表模型
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ActivityTeamInfoListModel {
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private String productImage;
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
private Long attendNumber;
|
||||||
|
private Long openTeamNumber;
|
||||||
|
private Long addTeamNumber;
|
||||||
|
private Long teamStock;
|
||||||
|
private Long remainStock;
|
||||||
|
private Date endTime;
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
public static ActivityTeamInfoListModel domainBuild(ActivityTeamInfo activityTeamInfo, Function<ActivityTeamInfoListModelBuilder,ActivityTeamInfoListModel> function){
|
||||||
|
return function.apply(
|
||||||
|
ActivityTeamInfoListModel.builder()
|
||||||
|
.id(activityTeamInfo.getId())
|
||||||
|
.name(activityTeamInfo.getName())
|
||||||
|
.endTime(activityTeamInfo.getEndTime())
|
||||||
|
.productImage(activityTeamInfo.getProductImage())
|
||||||
|
.status(activityTeamInfo.getStatus())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品详情模型
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ActivityTeamInfoQueryModel extends QueryModel<ActivityTeamInfoQueryModel> {
|
||||||
|
private String keyWord;
|
||||||
|
private String status;
|
||||||
|
}
|
|
@ -0,0 +1,76 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品添加表
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class ActivityTeamInfoSaveModel {
|
||||||
|
/**
|
||||||
|
* 商品id
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品图片
|
||||||
|
*/
|
||||||
|
private String productImage;
|
||||||
|
/**
|
||||||
|
* 活动名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 商品单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 商品轮播图
|
||||||
|
*/
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 拼团类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
private Long teamStock;
|
||||||
|
private String productSku;
|
||||||
|
/**
|
||||||
|
* 商品sku
|
||||||
|
*/
|
||||||
|
private List<TeamSkuInfoModel> projectSkuInfoList;
|
||||||
|
|
||||||
|
}
|
|
@ -1,4 +1,4 @@
|
||||||
package com.muyu.active.model;
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
import com.baomidou.mybatisplus.core.metadata.OrderItem;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
@ -10,6 +10,10 @@ import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 分页表
|
||||||
|
* @param <T>
|
||||||
|
*/
|
||||||
@Data
|
@Data
|
||||||
@SuperBuilder
|
@SuperBuilder
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@ -50,10 +54,10 @@ public class QueryModel<T> {
|
||||||
/**
|
/**
|
||||||
* 构建查询分页对象
|
* 构建查询分页对象
|
||||||
*/
|
*/
|
||||||
public Page<T> buildPage(){
|
public <I> Page<I> bulidPage(){
|
||||||
Page<T> page= Page.of(this.getPageNum(),this.getPageSize());
|
Page<I> page = Page.of(this.getPageNum(), this.getPageSize());
|
||||||
page.setOrders(List.of(this.isAsc ?
|
page.setOrders(List.of(this.isAsc()? OrderItem.asc(this.getOrderByColumn())
|
||||||
OrderItem.asc(this.getOrderByColumn()) : OrderItem.desc(this.getOrderByColumn())));
|
:OrderItem.desc(this.getOrderByColumn())));
|
||||||
return page;
|
return page;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品sku模型
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class TeamSkuInfoModel {
|
||||||
|
private Long productId;
|
||||||
|
private String productSku;
|
||||||
|
private Long teamStock;
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
package com.muyu.active.domain.model;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Builder;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品库存模型
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Builder
|
||||||
|
public class TeamStockModel {
|
||||||
|
private Long teamStock;
|
||||||
|
private Long remainStock;
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package com.muyu.active.domain.req;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamInfoQueryModel;
|
||||||
|
import com.muyu.common.core.web.page.PageDomain;
|
||||||
|
import lombok.*;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团信息请求表(搜索+分页)
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@Builder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class ActivityTeamInfoReq extends PageDomain {
|
||||||
|
private String keyWord;
|
||||||
|
private String status;
|
||||||
|
private Integer pageNum=1;
|
||||||
|
private Integer pageSize=3;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通过当前对象查询构建模型
|
||||||
|
*/
|
||||||
|
public ActivityTeamInfoQueryModel buildModel(){
|
||||||
|
return ActivityTeamInfoQueryModel.builder()
|
||||||
|
.keyWord(keyWord)
|
||||||
|
.status(status)
|
||||||
|
.pageNum(pageNum)
|
||||||
|
.pageSize(pageSize)
|
||||||
|
.build()
|
||||||
|
.domainbuild(this);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,99 @@
|
||||||
|
package com.muyu.active.domain.req;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamInfoSaveModel;
|
||||||
|
import com.muyu.active.domain.model.TeamSkuInfoModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加拼团活动(入参)请求表
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@SuperBuilder
|
||||||
|
public class ActivityTeamInfoSaveReq {
|
||||||
|
/**
|
||||||
|
* 商品id
|
||||||
|
*/
|
||||||
|
private Long productId;
|
||||||
|
/**
|
||||||
|
* 商品图片
|
||||||
|
*/
|
||||||
|
private String image;
|
||||||
|
/**
|
||||||
|
* 活动名称
|
||||||
|
*/
|
||||||
|
private String name;
|
||||||
|
/**
|
||||||
|
* 活动简介
|
||||||
|
*/
|
||||||
|
private String introduction;
|
||||||
|
/**
|
||||||
|
* 商品单位
|
||||||
|
*/
|
||||||
|
private String unit;
|
||||||
|
/**
|
||||||
|
* 商品轮播图
|
||||||
|
*/
|
||||||
|
private String imageList;
|
||||||
|
/**
|
||||||
|
* 活动结束时间
|
||||||
|
*/
|
||||||
|
private Date endTime;
|
||||||
|
/**
|
||||||
|
* 排序
|
||||||
|
*/
|
||||||
|
private Integer sort;
|
||||||
|
/**
|
||||||
|
* 详情
|
||||||
|
*/
|
||||||
|
private String content;
|
||||||
|
/**
|
||||||
|
* 状态
|
||||||
|
*/
|
||||||
|
private String status;
|
||||||
|
/**
|
||||||
|
* 拼团类型
|
||||||
|
*/
|
||||||
|
private String strategyType;
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
private Long teamStock;
|
||||||
|
private String productSku;
|
||||||
|
/**
|
||||||
|
* 商品sku
|
||||||
|
*/
|
||||||
|
private List<TeamSkuInfoModel> projectSkuInfoList;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*构造方法
|
||||||
|
*/
|
||||||
|
public ActivityTeamInfoSaveModel saveModel(){
|
||||||
|
return ActivityTeamInfoSaveModel.builder()
|
||||||
|
.productId(productId)
|
||||||
|
.productImage(image)
|
||||||
|
.name(name)
|
||||||
|
.introduction(introduction)
|
||||||
|
.unit(unit)
|
||||||
|
.imageList("0")
|
||||||
|
.endTime(endTime)
|
||||||
|
.sort(sort)
|
||||||
|
.content(content)
|
||||||
|
.status(status)
|
||||||
|
.strategyType("0")
|
||||||
|
.teamPrice(teamPrice)
|
||||||
|
.productSku(productSku)
|
||||||
|
.teamStock(teamStock)
|
||||||
|
.projectSkuInfoList(projectSkuInfoList)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
package com.muyu.active.domain.resp;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamInfoListModel;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.experimental.SuperBuilder;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拼团响应实体类
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@SuperBuilder
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
public class ActivityTeamInfoResp {
|
||||||
|
private Long id;
|
||||||
|
private String name;
|
||||||
|
private String productImage;
|
||||||
|
private BigDecimal productPrice;
|
||||||
|
private BigDecimal teamPrice;
|
||||||
|
private Long AttendNumber;
|
||||||
|
private Long openTeamNumber;
|
||||||
|
private Long addTeamNumber;
|
||||||
|
private Long teamStock;
|
||||||
|
private Long remainStock;
|
||||||
|
private Date endTime;
|
||||||
|
private String status;
|
||||||
|
|
||||||
|
public static ActivityTeamInfoResp respBuild(ActivityTeamInfoListModel activityTeamInfoListModel){
|
||||||
|
return ActivityTeamInfoResp.builder()
|
||||||
|
.id(activityTeamInfoListModel.getId())
|
||||||
|
.name(activityTeamInfoListModel.getName())
|
||||||
|
.endTime(activityTeamInfoListModel.getEndTime())
|
||||||
|
.productImage(activityTeamInfoListModel.getProductImage())
|
||||||
|
.status(activityTeamInfoListModel.getStatus())
|
||||||
|
.addTeamNumber(activityTeamInfoListModel.getAddTeamNumber())
|
||||||
|
.AttendNumber(activityTeamInfoListModel.getAttendNumber())
|
||||||
|
.openTeamNumber(activityTeamInfoListModel.getOpenTeamNumber())
|
||||||
|
.productPrice(activityTeamInfoListModel.getProductPrice())
|
||||||
|
.remainStock(activityTeamInfoListModel.getRemainStock())
|
||||||
|
.teamPrice(activityTeamInfoListModel.getTeamPrice())
|
||||||
|
.teamStock(activityTeamInfoListModel.getTeamStock())
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,65 +0,0 @@
|
||||||
package com.muyu.maketing.domain.model;
|
|
||||||
|
|
||||||
import com.muyu.common.core.web.page.QueryModel;
|
|
||||||
import lombok.*;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团队活动查询信息
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@Builder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
public class ActivityTeamInfoListModel {
|
|
||||||
/**
|
|
||||||
* 拼团活动id
|
|
||||||
*/
|
|
||||||
private Long id;
|
|
||||||
/**
|
|
||||||
* 拼团名称
|
|
||||||
*/
|
|
||||||
private String name;
|
|
||||||
/**
|
|
||||||
*参团人数
|
|
||||||
*/
|
|
||||||
private Long addTeamNumber;
|
|
||||||
/**
|
|
||||||
* 拼团人数
|
|
||||||
*/
|
|
||||||
private Long attendNumber;
|
|
||||||
/**
|
|
||||||
* 团购结束时间
|
|
||||||
*/
|
|
||||||
private Date endTime;
|
|
||||||
/**
|
|
||||||
* 开团人数
|
|
||||||
*/
|
|
||||||
private Long openTeamNumber;
|
|
||||||
/**
|
|
||||||
* 拼团商品图片
|
|
||||||
*/
|
|
||||||
private String productImage;
|
|
||||||
/**
|
|
||||||
* 商品价格
|
|
||||||
*/
|
|
||||||
private Double productPrice;
|
|
||||||
/**
|
|
||||||
* 剩余库存
|
|
||||||
*/
|
|
||||||
private Long remainStock;
|
|
||||||
/**
|
|
||||||
* 团购状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
/**
|
|
||||||
* 拼团价格
|
|
||||||
*/
|
|
||||||
private Double teamprice;
|
|
||||||
/**
|
|
||||||
* 团购库存
|
|
||||||
*/
|
|
||||||
private Long teamStock;
|
|
||||||
}
|
|
|
@ -1,31 +0,0 @@
|
||||||
package com.muyu.maketing.domain.model;
|
|
||||||
|
|
||||||
import com.muyu.common.core.web.page.PageDomain;
|
|
||||||
import com.muyu.common.core.web.page.QueryModel;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
import org.apache.poi.ss.formula.functions.T;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 团队活动查询信息
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@SuperBuilder
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@EqualsAndHashCode(callSuper = true)
|
|
||||||
public class ActivityTeamInfoListQueryModel extends QueryModel<ActivityTeamInfoListQueryModel> {
|
|
||||||
/**
|
|
||||||
* 搜索关键字
|
|
||||||
*/
|
|
||||||
private String keyWord;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,34 +0,0 @@
|
||||||
package com.muyu.active.req;
|
|
||||||
|
|
||||||
import com.muyu.common.core.web.page.PageDomain;
|
|
||||||
import com.muyu.maketing.domain.model.ActivityTeamInfoListQueryModel;
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@SuperBuilder
|
|
||||||
public class TeamInfoListReq extends PageDomain {
|
|
||||||
/**
|
|
||||||
* 搜索关键字
|
|
||||||
*/
|
|
||||||
private String keyWord;
|
|
||||||
/**
|
|
||||||
* 活动状态
|
|
||||||
*/
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 通过当前对象构建业务查询模型
|
|
||||||
*/
|
|
||||||
public ActivityTeamInfoListQueryModel buildQueryModel(){
|
|
||||||
return ActivityTeamInfoListQueryModel.builder()
|
|
||||||
.keyWord(this.keyWord)
|
|
||||||
.status(this.status)
|
|
||||||
.build()
|
|
||||||
.domainBuild(this);
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,26 +0,0 @@
|
||||||
package com.muyu.active.resp;
|
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
import lombok.experimental.SuperBuilder;
|
|
||||||
|
|
||||||
@Data
|
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
|
||||||
@SuperBuilder
|
|
||||||
public class TeamInfoListResp {
|
|
||||||
private Long id;
|
|
||||||
private String name;
|
|
||||||
private String productImage;
|
|
||||||
private String teamPrice;
|
|
||||||
private String attendNumber;
|
|
||||||
private String openTeamNumber;
|
|
||||||
private String addTeamNumber;
|
|
||||||
private String teamStock;
|
|
||||||
private String RemainStock;
|
|
||||||
private String endTime;
|
|
||||||
private Integer status;
|
|
||||||
private String productPrice;
|
|
||||||
|
|
||||||
}
|
|
|
@ -30,6 +30,15 @@
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-product-cache</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
<artifactId>active-remote</artifactId>
|
<artifactId>active-remote</artifactId>
|
||||||
|
@ -72,6 +81,10 @@
|
||||||
<artifactId>muyu-common-datascope</artifactId>
|
<artifactId>muyu-common-datascope</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-validation</artifactId>
|
||||||
|
</dependency>
|
||||||
<!-- MuYu Common Log -->
|
<!-- MuYu Common Log -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.muyu</groupId>
|
<groupId>com.muyu</groupId>
|
||||||
|
@ -88,6 +101,20 @@
|
||||||
<groupId>com.dtflys.forest</groupId>
|
<groupId>com.dtflys.forest</groupId>
|
||||||
<artifactId>forest-spring-boot-starter</artifactId>
|
<artifactId>forest-spring-boot-starter</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-product-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-product-common</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.muyu</groupId>
|
||||||
|
<artifactId>muyu-product-server</artifactId>
|
||||||
|
<version>3.6.3</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,12 @@ import com.muyu.common.security.annotation.EnableCustomConfig;
|
||||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||||
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
import com.muyu.common.swagger.annotation.EnableCustomSwagger2;
|
||||||
import org.mybatis.spring.annotation.MapperScan;
|
import org.mybatis.spring.annotation.MapperScan;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.openfeign.EnableFeignClients;
|
||||||
|
import org.springframework.context.annotation.Primary;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统模块
|
* 系统模块
|
||||||
|
@ -17,6 +21,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
@EnableMyFeignClients
|
@EnableMyFeignClients
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
@MapperScan("com.muyu.mapper")
|
@MapperScan("com.muyu.mapper")
|
||||||
|
@EnableFeignClients
|
||||||
public class MuYuActivesApplication {
|
public class MuYuActivesApplication {
|
||||||
public static void main (String[] args) {
|
public static void main (String[] args) {
|
||||||
SpringApplication.run(MuYuActivesApplication.class, args);
|
SpringApplication.run(MuYuActivesApplication.class, args);
|
||||||
|
|
|
@ -1,24 +0,0 @@
|
||||||
package com.muyu.controller;
|
|
||||||
|
|
||||||
import com.muyu.active.req.TeamInfoListReq;
|
|
||||||
import com.muyu.active.resp.TeamInfoListResp;
|
|
||||||
import com.muyu.common.core.domain.Result;
|
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
|
||||||
import com.muyu.service.ActivityTeamInfoService;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/team")
|
|
||||||
public class ActivityTeamController {
|
|
||||||
@Autowired
|
|
||||||
private ActivityTeamInfoService activityTeamInfoService;
|
|
||||||
@PostMapping("list")
|
|
||||||
public Result<TableDataInfo<TeamInfoListResp>> list(@RequestBody TeamInfoListReq teamInfoListReq){
|
|
||||||
activityTeamInfoService.query(teamInfoListReq.buildQueryModel());
|
|
||||||
return Result.success();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,95 @@
|
||||||
|
package com.muyu.controller;
|
||||||
|
import com.github.pagehelper.Page;
|
||||||
|
import com.muyu.active.domain.model.ActivityTeamInfoListModel;
|
||||||
|
import com.muyu.active.domain.req.ActivityTeamInfoReq;
|
||||||
|
import com.muyu.active.domain.req.ActivityTeamInfoSaveReq;
|
||||||
|
import com.muyu.active.domain.resp.ActivityTeamInfoResp;
|
||||||
|
import com.muyu.common.core.domain.Result;
|
||||||
|
import com.muyu.common.core.utils.PageUtils;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.muyu.service.ActivityTeamInfoService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import javax.validation.Valid;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Controller
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/actives")
|
||||||
|
@Slf4j
|
||||||
|
public class ActivityTeamInfoController {
|
||||||
|
@Resource
|
||||||
|
private ActivityTeamInfoService activityTeamInfoService;
|
||||||
|
|
||||||
|
//检查前端404的打印
|
||||||
|
public ActivityTeamInfoController() {
|
||||||
|
log.info("商品拼团控制层{}",getClass().getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 列表
|
||||||
|
*/
|
||||||
|
@PostMapping("/list")
|
||||||
|
public Result<TableDataInfo<ActivityTeamInfoResp>> list(@RequestBody ActivityTeamInfoReq activityTeamInfoReq) {
|
||||||
|
// TableDataInfo<ActivityTeamInfoListModel> list = activityTeamInfoService.list(activityTeamInfoReq.buildModel());
|
||||||
|
// List<ActivityTeamInfoListModel> rows = list.getRows();
|
||||||
|
// List<ActivityTeamInfoResp> activityTeamInfoResps = rows.stream().map(activityTeamInfoListModel -> {
|
||||||
|
// ActivityTeamInfoResp build = ActivityTeamInfoResp.respBuild(activityTeamInfoListModel);
|
||||||
|
// return build;
|
||||||
|
// }).toList();
|
||||||
|
// TableDataInfo<ActivityTeamInfoResp> activityTeamInfoRespTableDataInfo = new TableDataInfo<>();
|
||||||
|
// activityTeamInfoRespTableDataInfo.setRows(activityTeamInfoResps);
|
||||||
|
// activityTeamInfoRespTableDataInfo.setTotal(list.getTotal());
|
||||||
|
// return Result.success(activityTeamInfoRespTableDataInfo);
|
||||||
|
// //开始分页
|
||||||
|
// PageUtils.startPage(activityTeamInfoReq.getPageNum(),activityTeamInfoReq.getPageSize());
|
||||||
|
// // 获取数据列表
|
||||||
|
// List<ActivityTeamInfoListModel> row = activityTeamInfoService.list(activityTeamInfoReq.buildModel()).getRows();
|
||||||
|
// // 将数据模型转换为响应模型
|
||||||
|
// List<ActivityTeamInfoResp> activityTeamInfoResp = row.stream().map(activityTeamInfoListModel -> {
|
||||||
|
// return ActivityTeamInfoResp.respBuild(activityTeamInfoListModel);
|
||||||
|
// }).toList();
|
||||||
|
// // 创建分页信息对象
|
||||||
|
// TableDataInfo<ActivityTeamInfoResp> activityTeamInfoRespTableDataInfo= new TableDataInfo<>();
|
||||||
|
// activityTeamInfoRespTableDataInfo.setRows(activityTeamInfoResps);
|
||||||
|
// activityTeamInfoRespTableDataInfo.setTotal(PageUtils.startPage(activityTeamInfoReq.getPageNum(),activityTeamInfoReq.getPageSize()).getTotal());
|
||||||
|
// // 返回结果
|
||||||
|
// return Result.success(activityTeamInfoRespTableDataInfo);
|
||||||
|
// 开始分页
|
||||||
|
Page<ActivityTeamInfoListModel> page = PageUtils.startPage(activityTeamInfoReq.getPageNum(), activityTeamInfoReq.getPageSize());
|
||||||
|
// 获取数据列表 列表数据
|
||||||
|
List<ActivityTeamInfoListModel> rows = activityTeamInfoService.list(activityTeamInfoReq.buildModel()).getRows();
|
||||||
|
// 将数据模型转换为响应模型 利用Steam流吧数据转换为响应列表 起名activityTeamInfoListModel,返回实体类响应调用模型里面的数据,把自定义的实体类放在里面进行相应
|
||||||
|
List<ActivityTeamInfoResp> activityTeamInfoResps = rows.stream().map(activityTeamInfoListModel -> {
|
||||||
|
return ActivityTeamInfoResp.respBuild(activityTeamInfoListModel);
|
||||||
|
}).toList();
|
||||||
|
|
||||||
|
// 创建分页信息对象
|
||||||
|
TableDataInfo<ActivityTeamInfoResp> activityTeamInfoRespTableDataInfo = new TableDataInfo<>();
|
||||||
|
//列表数据
|
||||||
|
activityTeamInfoRespTableDataInfo.setRows(activityTeamInfoResps);
|
||||||
|
//条数
|
||||||
|
activityTeamInfoRespTableDataInfo.setTotal(page.getTotal());
|
||||||
|
// 返回结果
|
||||||
|
return Result.success(activityTeamInfoRespTableDataInfo);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加
|
||||||
|
*/
|
||||||
|
@PostMapping("/addTeam")
|
||||||
|
public Result addTeam(@Valid @RequestBody ActivityTeamInfoSaveReq activityTeamInfoSaveReq){
|
||||||
|
//判断是否添加成功所以定义为Boolean类型
|
||||||
|
boolean success = activityTeamInfoService.addTeam(activityTeamInfoSaveReq.saveModel());
|
||||||
|
//判断添加是否成功
|
||||||
|
if (success){
|
||||||
|
return Result.success("添加成功");
|
||||||
|
}
|
||||||
|
return Result.error("添加失败");
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,10 +1,12 @@
|
||||||
package com.muyu.mapper;
|
package com.muyu.mapper;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.active.domain.ActivityTeamInfo;
|
import com.muyu.active.domain.ActivityTeamInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
/**
|
||||||
|
* 商品拼团信息Mapper接口
|
||||||
|
*/
|
||||||
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo> {
|
public interface ActivityTeamInfoMapper extends BaseMapper<ActivityTeamInfo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
package com.muyu.mapper;
|
package com.muyu.mapper;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.active.domain.ActivityTeamOpenInfo;
|
import com.muyu.active.domain.ActivityTeamOpenInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
/**
|
||||||
|
* 商品拼团信息Mapper接口
|
||||||
|
*/
|
||||||
public interface ActivityTeamOpenInfoMapper extends BaseMapper<ActivityTeamOpenInfo> {
|
public interface ActivityTeamOpenInfoMapper extends BaseMapper<ActivityTeamOpenInfo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
package com.muyu.mapper;
|
package com.muyu.mapper;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
/**
|
||||||
|
* 商品拼团信息Mapper接口
|
||||||
|
*/
|
||||||
public interface ActivityTeamProductSkuInfoMapper extends BaseMapper<ActivityTeamProductSkuInfo> {
|
public interface ActivityTeamProductSkuInfoMapper extends BaseMapper<ActivityTeamProductSkuInfo> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,10 @@ package com.muyu.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.active.domain.TeamStrategyExemptionHundred;
|
import com.muyu.active.domain.TeamStrategyExemptionHundred;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
/**
|
||||||
|
* 商品拼团信息Mapper接口
|
||||||
|
*/
|
||||||
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyExemptionHundred> {
|
public interface TeamStrategyExemptionHundredMapper extends BaseMapper<TeamStrategyExemptionHundred> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
package com.muyu.mapper;
|
package com.muyu.mapper;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.active.domain.TeamStrategyExemption;
|
import com.muyu.active.domain.TeamStrategyExemption;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
/**
|
||||||
|
* 商品拼团信息Mapper接口
|
||||||
|
*/
|
||||||
public interface TeamStrategyExemptionMapper extends BaseMapper<TeamStrategyExemption> {
|
public interface TeamStrategyExemptionMapper extends BaseMapper<TeamStrategyExemption> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
package com.muyu.mapper;
|
package com.muyu.mapper;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.muyu.active.domain.TeamStrategyExemptionOrdinary;
|
import com.muyu.active.domain.TeamStrategyExemptionOrdinary;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
|
||||||
|
|
||||||
@Mapper
|
/**
|
||||||
|
* 商品拼团信息Mapper接口
|
||||||
|
*/
|
||||||
public interface TeamStrategyExemptionOrdinaryMapper extends BaseMapper<TeamStrategyExemptionOrdinary> {
|
public interface TeamStrategyExemptionOrdinaryMapper extends BaseMapper<TeamStrategyExemptionOrdinary> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,15 +1,24 @@
|
||||||
package com.muyu.service;
|
package com.muyu.service;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.active.domain.ActivityTeamInfo;
|
import com.muyu.active.domain.ActivityTeamInfo;
|
||||||
import com.muyu.maketing.domain.model.ActivityTeamInfoListQueryModel;
|
import com.muyu.active.domain.model.ActivityTeamInfoListModel;
|
||||||
import com.muyu.maketing.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;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service接口
|
||||||
|
*/
|
||||||
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
public interface ActivityTeamInfoService extends IService<ActivityTeamInfo> {
|
||||||
/**
|
/**
|
||||||
* 分页+搜索条件通过模型查询团购活动列表
|
* 通过查询模型查询团购活动列表
|
||||||
*/
|
*/
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> query(com.muyu.maketing.domain.model.ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel);
|
TableDataInfo<ActivityTeamInfoListModel> list(ActivityTeamInfoQueryModel activityTeamInfoQueryModel);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加拼团信息
|
||||||
|
*/
|
||||||
|
boolean addTeam(ActivityTeamInfoSaveModel activityTeamInfoSaveModel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,17 @@ package com.muyu.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.active.domain.ActivityTeamOpenInfo;
|
import com.muyu.active.domain.ActivityTeamOpenInfo;
|
||||||
|
import com.muyu.active.domain.ActivityTeamOpenInfoEnum;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service接口
|
||||||
|
*/
|
||||||
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
public interface ActivityTeamOpenInfoService extends IService<ActivityTeamOpenInfo> {
|
||||||
|
public Long getActivityTeamOpenInfoNum(Long id, ActivityTeamOpenInfoEnum teamOpenInfo);
|
||||||
|
public default Long getTeamOpenNum(Long id){
|
||||||
|
return this.getActivityTeamOpenInfoNum(id,ActivityTeamOpenInfoEnum.OPEN_TEAM);
|
||||||
|
}
|
||||||
|
public default Long getTeamInNum(Long id){
|
||||||
|
return this.getActivityTeamOpenInfoNum(id,ActivityTeamOpenInfoEnum.IN_TEAM);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,23 @@
|
||||||
package com.muyu.service;
|
package com.muyu.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
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 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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,5 +3,9 @@ package com.muyu.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.active.domain.TeamStrategyExemptionHundred;
|
import com.muyu.active.domain.TeamStrategyExemptionHundred;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service接口
|
||||||
|
*/
|
||||||
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred> {
|
public interface TeamStrategyExemptionHundredService extends IService<TeamStrategyExemptionHundred> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,11 @@
|
||||||
package com.muyu.service;
|
package com.muyu.service;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.active.domain.TeamStrategyExemptionOrdinary;
|
import com.muyu.active.domain.TeamStrategyExemptionOrdinary;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service接口
|
||||||
|
*/
|
||||||
public interface TeamStrategyExemptionOrdinaryService extends IService<TeamStrategyExemptionOrdinary> {
|
public interface TeamStrategyExemptionOrdinaryService extends IService<TeamStrategyExemptionOrdinary> {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,5 +3,8 @@ package com.muyu.service;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.muyu.active.domain.TeamStrategyExemption;
|
import com.muyu.active.domain.TeamStrategyExemption;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service接口
|
||||||
|
*/
|
||||||
public interface TeamStrategyExemptionService extends IService<TeamStrategyExemption> {
|
public interface TeamStrategyExemptionService extends IService<TeamStrategyExemption> {
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,99 @@
|
||||||
|
package com.muyu.service.impl;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import com.muyu.active.domain.ActivityTeamInfo;
|
||||||
|
import com.muyu.active.domain.ActivityTeamOpenInfo;
|
||||||
|
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
||||||
|
import com.muyu.active.domain.model.*;
|
||||||
|
import com.muyu.common.core.utils.StringUtils;
|
||||||
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
|
import com.muyu.mapper.ActivityTeamInfoMapper;
|
||||||
|
import com.muyu.service.ActivityTeamInfoService;
|
||||||
|
import com.muyu.service.ActivityTeamOpenInfoService;
|
||||||
|
import com.muyu.service.ActivityTeamProductSkuInfoService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import javax.annotation.Resource;
|
||||||
|
import java.util.List;
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service业务层处理
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class ActivityTeamInfoServiceImpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo> implements ActivityTeamInfoService {
|
||||||
|
@Resource
|
||||||
|
private ActivityTeamOpenInfoService activityTeamOpenInfoService;
|
||||||
|
@Resource
|
||||||
|
private ActivityTeamProductSkuInfoService activityTeamProductSkuInfoService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<ActivityTeamInfoListModel> list(ActivityTeamInfoQueryModel activityTeamInfoQueryModel) {
|
||||||
|
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.like(StringUtils.isNotEmpty(
|
||||||
|
activityTeamInfoQueryModel.getKeyWord()),
|
||||||
|
ActivityTeamInfo::getName,
|
||||||
|
activityTeamInfoQueryModel.getKeyWord()
|
||||||
|
);
|
||||||
|
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoQueryModel.getStatus()),
|
||||||
|
ActivityTeamInfo::getStatus,
|
||||||
|
activityTeamInfoQueryModel.getStatus()
|
||||||
|
);
|
||||||
|
Page<ActivityTeamInfo> pages = this.page(activityTeamInfoQueryModel.bulidPage(),queryWrapper);
|
||||||
|
List<ActivityTeamInfo> records = pages.getRecords();
|
||||||
|
|
||||||
|
List<ActivityTeamInfoListModel> list = records.stream().map(activityTeamInfo -> ActivityTeamInfoListModel
|
||||||
|
.domainBuild(activityTeamInfo, (activityTeamInfoListModelBuilder) -> {
|
||||||
|
Long teamOpenNum = activityTeamOpenInfoService.getTeamOpenNum(activityTeamInfo.getId());
|
||||||
|
Long teamInNum = activityTeamOpenInfoService.getTeamInNum(activityTeamInfo.getId());
|
||||||
|
ActivityTeamDiscountModel activityTeamDiscountModel = activityTeamProductSkuInfoService.discountPrice(activityTeamInfo.getId());
|
||||||
|
TeamStockModel stock = activityTeamProductSkuInfoService.getStock(activityTeamInfo.getId());
|
||||||
|
return activityTeamInfoListModelBuilder
|
||||||
|
.addTeamNumber(teamInNum)
|
||||||
|
.openTeamNumber(teamOpenNum)
|
||||||
|
.attendNumber(teamOpenNum + teamInNum)
|
||||||
|
.teamPrice(activityTeamDiscountModel.getTeamPrice())
|
||||||
|
.productPrice(activityTeamDiscountModel.getProductPrice())
|
||||||
|
.teamStock(stock.getTeamStock())
|
||||||
|
.remainStock(stock.getRemainStock())
|
||||||
|
.build();
|
||||||
|
})).toList();
|
||||||
|
|
||||||
|
return TableDataInfo.<ActivityTeamInfoListModel>builder()
|
||||||
|
.total(pages.getTotal())
|
||||||
|
.rows(list)
|
||||||
|
.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加拼团信息
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean addTeam(ActivityTeamInfoSaveModel activityTeamInfoSaveModel) {
|
||||||
|
//调用拼团信息表的构造方法进行添加吧自己定义的添加实体类
|
||||||
|
ActivityTeamInfo activityTeamInfo = ActivityTeamInfo.saveActivityTeamInfo(activityTeamInfoSaveModel);
|
||||||
|
//用this调用save添加方法把返回值放进去
|
||||||
|
boolean save = this.save(activityTeamInfo);
|
||||||
|
//判断添加的时候,添加规格sku列表的数据,调用activityTeamInfoSaveModel的集合
|
||||||
|
if (save){
|
||||||
|
List<TeamSkuInfoModel> projectSkuInfoList = activityTeamInfoSaveModel.getProjectSkuInfoList();
|
||||||
|
//利用Steam流遍历,把集合中的数据进行转换,转换成ActivityTeamProductSkuInfo对象,然后进行批量添加
|
||||||
|
//批量添加方法
|
||||||
|
activityTeamProductSkuInfoService.saveBatch(projectSkuInfoList.stream().map(projectSkuInfo -> ActivityTeamProductSkuInfo.TeamSkuInfoBuild(projectSkuInfo, (activityTeamProductSkuInfoBuilder) -> {
|
||||||
|
LambdaQueryWrapper<ActivityTeamOpenInfo> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
//获取团队的ID
|
||||||
|
queryWrapper.eq(ActivityTeamOpenInfo::getTeamId,activityTeamInfo.getId());
|
||||||
|
//获取团队中商品的ID
|
||||||
|
queryWrapper.eq(ActivityTeamOpenInfo::getProductId,projectSkuInfo.getProductId());
|
||||||
|
long count = activityTeamOpenInfoService.count(queryWrapper);
|
||||||
|
return activityTeamProductSkuInfoBuilder
|
||||||
|
//商品表的ID
|
||||||
|
.teamId(activityTeamInfo.getId())
|
||||||
|
//sku的剩余库存
|
||||||
|
.remainStock(projectSkuInfo.getTeamStock() - count)
|
||||||
|
.build();
|
||||||
|
})).toList());
|
||||||
|
}
|
||||||
|
return save;
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,76 +0,0 @@
|
||||||
package com.muyu.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.active.domain.ActivityTeamInfo;
|
|
||||||
import com.muyu.common.core.utils.StringUtils;
|
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
|
||||||
import com.muyu.maketing.domain.model.ActivityTeamInfoListQueryModel ;
|
|
||||||
import com.muyu.maketing.domain.model.ActivityTeamInfoListModel;
|
|
||||||
import com.muyu.mapper.ActivityTeamInfoMapper;
|
|
||||||
import com.muyu.service.ActivityTeamInfoService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ActivityTeamInfoServiceimpl extends ServiceImpl<ActivityTeamInfoMapper, ActivityTeamInfo> implements ActivityTeamInfoService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public TableDataInfo<ActivityTeamInfoListModel> query(ActivityTeamInfoListQueryModel activityTeamInfoListQueryModel) {
|
|
||||||
|
|
||||||
LambdaQueryWrapper<ActivityTeamInfo> queryWrapper = new LambdaQueryWrapper<>();
|
|
||||||
queryWrapper.like(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getKeyWord()),ActivityTeamInfo::getName, activityTeamInfoListQueryModel.getKeyWord());
|
|
||||||
queryWrapper.eq(StringUtils.isNotEmpty(activityTeamInfoListQueryModel.getStatus()),ActivityTeamInfo::getStatus, activityTeamInfoListQueryModel.getStatus());
|
|
||||||
|
|
||||||
Page<ActivityTeamInfo> activityTeamInfoPage = this.page(activityTeamInfoListQueryModel.buildPage(), queryWrapper);
|
|
||||||
List<ActivityTeamInfo> activityTeamInfoList = activityTeamInfoPage.getRecords();
|
|
||||||
List<ActivityTeamInfoListModel> activityTeamInfoListModels = new ArrayList<>();
|
|
||||||
|
|
||||||
for (ActivityTeamInfo activityTeamInfo : activityTeamInfoList) {
|
|
||||||
ActivityTeamInfoListModel activityTeamInfoListModel = new ActivityTeamInfoListModel();
|
|
||||||
//TODO 6、拼团价格和商品价格 选择的是优惠力度最大的商品规格
|
|
||||||
// TODO 7、团购库存和剩余库存是总库存的概念,即所有商品规格的库存总和
|
|
||||||
activityTeamInfoListModel.setId(activityTeamInfo.getId());
|
|
||||||
activityTeamInfoListModel.setName(activityTeamInfo.getName());
|
|
||||||
activityTeamInfoListModel.setAddTeamNumber(0L);
|
|
||||||
activityTeamInfoListModel.setOpenTeamNumber(0L);
|
|
||||||
activityTeamInfoListModel.setAttendNumber(0L);
|
|
||||||
activityTeamInfoListModel.setEndTime(activityTeamInfo.getEndTime());
|
|
||||||
activityTeamInfoListModel.setProductImage(activityTeamInfo.getProductImage());
|
|
||||||
activityTeamInfoListModel.setTeamprice(0.00);
|
|
||||||
activityTeamInfoListModel.setProductPrice(0.00);
|
|
||||||
activityTeamInfoListModel.setTeamStock(0L);
|
|
||||||
activityTeamInfoListModel.setRemainStock(0L);
|
|
||||||
activityTeamInfoListModel.setStatus(activityTeamInfo.getStatus());
|
|
||||||
|
|
||||||
activityTeamInfoListModels.add(activityTeamInfoListModel);
|
|
||||||
}
|
|
||||||
|
|
||||||
TableDataInfo<ActivityTeamInfoListModel> tableDataInfo = new TableDataInfo<>();
|
|
||||||
tableDataInfo.setTotal(activityTeamInfoPage.getTotal());
|
|
||||||
tableDataInfo.setRows(activityTeamInfoListModels);
|
|
||||||
return tableDataInfo;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据商品id关联规格 查出最优惠的选择的规格信息
|
|
||||||
* teamprice 拼团价格
|
|
||||||
* productPrice 商品价格
|
|
||||||
*/
|
|
||||||
public ActivityTeamInfoListModel getOptimalSpec(Long id) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据商品id查询此商品下所有规格库存
|
|
||||||
*/
|
|
||||||
public Integer getStock(Long id) {
|
|
||||||
//根据商品id查询此商品下所有规格库存
|
|
||||||
//sum+= 汇总起来 得到所有库存
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
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.ActivityTeamOpenInfo;
|
||||||
|
import com.muyu.active.domain.ActivityTeamOpenInfoEnum;
|
||||||
|
import com.muyu.mapper.ActivityTeamOpenInfoMapper;
|
||||||
|
import com.muyu.service.ActivityTeamOpenInfoService;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品开团表service业务层处理
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class ActivityTeamOpenInfoServiceImpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo> implements ActivityTeamOpenInfoService {
|
||||||
|
@Override
|
||||||
|
public Long getActivityTeamOpenInfoNum(Long id, ActivityTeamOpenInfoEnum teamOpenInfo) {
|
||||||
|
LambdaQueryWrapper<ActivityTeamOpenInfo> lambdaQueryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
lambdaQueryWrapper.eq(ActivityTeamOpenInfo::getId,id);
|
||||||
|
lambdaQueryWrapper.eq(ActivityTeamOpenInfo::getTeamType,teamOpenInfo.code());
|
||||||
|
return this.count(lambdaQueryWrapper);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +0,0 @@
|
||||||
package com.muyu.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.active.domain.ActivityTeamOpenInfo;
|
|
||||||
import com.muyu.mapper.ActivityTeamOpenInfoMapper;
|
|
||||||
import com.muyu.service.ActivityTeamOpenInfoService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ActivityTeamOpenInfoServiceimpl extends ServiceImpl<ActivityTeamOpenInfoMapper, ActivityTeamOpenInfo> implements ActivityTeamOpenInfoService {
|
|
||||||
}
|
|
|
@ -0,0 +1,60 @@
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,11 +0,0 @@
|
||||||
package com.muyu.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.muyu.active.domain.ActivityTeamProductSkuInfo;
|
|
||||||
import com.muyu.mapper.ActivityTeamProductSkuInfoMapper;
|
|
||||||
import com.muyu.service.ActivityTeamProductSkuInfoService;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
@Service
|
|
||||||
public class ActivityTeamProductSkuInfoServiceimpl extends ServiceImpl<ActivityTeamProductSkuInfoMapper, ActivityTeamProductSkuInfo> implements ActivityTeamProductSkuInfoService {
|
|
||||||
}
|
|
|
@ -1,11 +1,16 @@
|
||||||
package com.muyu.service.impl;
|
package com.muyu.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.active.domain.TeamStrategyExemptionHundred;
|
import com.muyu.active.domain.TeamStrategyExemptionHundred;
|
||||||
import com.muyu.mapper.TeamStrategyExemptionHundredMapper;
|
import com.muyu.mapper.TeamStrategyExemptionHundredMapper;
|
||||||
import com.muyu.service.TeamStrategyExemptionHundredService;
|
import com.muyu.service.TeamStrategyExemptionHundredService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service业务层处理
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class TeamStrategyExemptionHundredServiceimpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred> implements TeamStrategyExemptionHundredService {
|
public class TeamStrategyExemptionHundredServiceImpl extends ServiceImpl<TeamStrategyExemptionHundredMapper, TeamStrategyExemptionHundred> implements TeamStrategyExemptionHundredService {
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,11 +1,16 @@
|
||||||
package com.muyu.service.impl;
|
package com.muyu.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.active.domain.TeamStrategyExemptionOrdinary;
|
import com.muyu.active.domain.TeamStrategyExemptionOrdinary;
|
||||||
import com.muyu.mapper.TeamStrategyExemptionOrdinaryMapper;
|
import com.muyu.mapper.TeamStrategyExemptionOrdinaryMapper;
|
||||||
import com.muyu.service.TeamStrategyExemptionOrdinaryService;
|
import com.muyu.service.TeamStrategyExemptionOrdinaryService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service业务层处理
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class TeamStrategyExemptionOrdinaryServiceimpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary> implements TeamStrategyExemptionOrdinaryService {
|
public class TeamStrategyExemptionOrdinaryServiceImpl extends ServiceImpl<TeamStrategyExemptionOrdinaryMapper, TeamStrategyExemptionOrdinary> implements TeamStrategyExemptionOrdinaryService {
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,11 +1,16 @@
|
||||||
package com.muyu.service.impl;
|
package com.muyu.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.active.domain.TeamStrategyExemption;
|
import com.muyu.active.domain.TeamStrategyExemption;
|
||||||
import com.muyu.mapper.TeamStrategyExemptionMapper;
|
import com.muyu.mapper.TeamStrategyExemptionMapper;
|
||||||
import com.muyu.service.TeamStrategyExemptionService;
|
import com.muyu.service.TeamStrategyExemptionService;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品拼团信息Service业务层处理
|
||||||
|
*/
|
||||||
|
@Slf4j
|
||||||
@Service
|
@Service
|
||||||
public class TeamStrategyExemptionServiceimpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption> implements TeamStrategyExemptionService {
|
public class TeamStrategyExemptionServiceImpl extends ServiceImpl<TeamStrategyExemptionMapper, TeamStrategyExemption> implements TeamStrategyExemptionService {
|
||||||
|
|
||||||
}
|
}
|
|
@ -4,9 +4,11 @@ server:
|
||||||
|
|
||||||
# Spring
|
# Spring
|
||||||
spring:
|
spring:
|
||||||
|
main:
|
||||||
|
allow-bean-definition-overriding: true
|
||||||
application:
|
application:
|
||||||
# 应用名称
|
# 应用名称
|
||||||
name: muyu-acties
|
name: muyu-actives
|
||||||
profiles:
|
profiles:
|
||||||
# 环境配置
|
# 环境配置
|
||||||
active: dev
|
active: dev
|
||||||
|
|
|
@ -41,3 +41,6 @@ public class SysFileController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ import com.muyu.common.core.constant.ServiceNameConstants;
|
||||||
import com.muyu.common.core.domain.Result;
|
import com.muyu.common.core.domain.Result;
|
||||||
import com.muyu.product.domain.ProjectInfo;
|
import com.muyu.product.domain.ProjectInfo;
|
||||||
import com.muyu.product.remote.factory.RemoteProjectInfoFactory;
|
import com.muyu.product.remote.factory.RemoteProjectInfoFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Qualifier;
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
|
|
|
@ -136,4 +136,14 @@ public class ProjectInfoController extends BaseController {
|
||||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||||
return toAjax(projectInfoService.removeBatchByIds(ids));
|
return toAjax(projectInfoService.removeBatchByIds(ids));
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 商品信息列表
|
||||||
|
*/
|
||||||
|
@RequiresPermissions("product:info:list")
|
||||||
|
@Log(title = "商品信息", businessType = BusinessType.DELETE)
|
||||||
|
@GetMapping("/getList")
|
||||||
|
@ApiOperation("商品信息列表")
|
||||||
|
public Result<List<ProjectInfo>> getList() {
|
||||||
|
return Result.success(projectInfoService.list());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,6 @@ import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||||
public interface CategoryInfoService extends IService<CategoryInfo> {
|
public interface CategoryInfoService extends IService<CategoryInfo> {
|
||||||
/**
|
/**
|
||||||
* 查询品类信息列表
|
* 查询品类信息列表
|
||||||
*
|
|
||||||
* @param categoryInfo 品类信息
|
* @param categoryInfo 品类信息
|
||||||
* @return 品类信息集合
|
* @return 品类信息集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -13,7 +13,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
public interface CommentInfoService extends IService<CommentInfo> {
|
public interface CommentInfoService extends IService<CommentInfo> {
|
||||||
/**
|
/**
|
||||||
* 查询商品评论列表
|
* 查询商品评论列表
|
||||||
*
|
|
||||||
* @param commentInfo 商品评论
|
* @param commentInfo 商品评论
|
||||||
* @return 商品评论集合
|
* @return 商品评论集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
package com.muyu.product.service;
|
package com.muyu.product.service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
import com.muyu.product.domain.ProjectSkuInfo;
|
import com.muyu.product.domain.ProjectSkuInfo;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
@ -33,4 +35,6 @@ public interface ProjectSkuInfoService extends IService<ProjectSkuInfo> {
|
||||||
* @return 商品SKU信息
|
* @return 商品SKU信息
|
||||||
*/
|
*/
|
||||||
List<ProjectSkuInfo> listByProjectId (Long projectId);
|
List<ProjectSkuInfo> listByProjectId (Long projectId);
|
||||||
|
|
||||||
|
List<ProjectSkuInfo> listPrice(LambdaQueryWrapper<ProjectSkuInfo> queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,7 +13,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
public interface RuleAttrInfoService extends IService<RuleAttrInfo> {
|
public interface RuleAttrInfoService extends IService<RuleAttrInfo> {
|
||||||
/**
|
/**
|
||||||
* 查询规格详情列表
|
* 查询规格详情列表
|
||||||
*
|
|
||||||
* @param ruleAttrInfo 规格详情
|
* @param ruleAttrInfo 规格详情
|
||||||
* @return 规格详情集合
|
* @return 规格详情集合
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -39,11 +39,6 @@ public class CommentLikeInfoServiceImpl extends ServiceImpl<CommentLikeInfoMappe
|
||||||
if (ObjUtils.notNull(commentLikeInfo.getUserId())){
|
if (ObjUtils.notNull(commentLikeInfo.getUserId())){
|
||||||
queryWrapper.eq(CommentLikeInfo::getUserId, commentLikeInfo.getUserId());
|
queryWrapper.eq(CommentLikeInfo::getUserId, commentLikeInfo.getUserId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return list(queryWrapper);
|
return list(queryWrapper);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,4 +88,9 @@ public class ProjectSkuInfoServiceImpl extends ServiceImpl<ProjectSkuInfoMapper,
|
||||||
queryWrapper.eq(ProjectSkuInfo::getProjectId, projectId);
|
queryWrapper.eq(ProjectSkuInfo::getProjectId, projectId);
|
||||||
return this.list(queryWrapper);
|
return this.list(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ProjectSkuInfo> listPrice(LambdaQueryWrapper<ProjectSkuInfo> queryWrapper) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue