第二次优化
parent
987cc25fc8
commit
662723be28
|
@ -113,4 +113,16 @@ public class CategoryInfo extends TreeEntity {
|
|||
.createTime(new Date())
|
||||
.build();
|
||||
}
|
||||
|
||||
public static CategoryInfo saveModelBuildTwo(CategoryInfoSaveReq categoryInfoSaveReq) {
|
||||
return CategoryInfo.builder()
|
||||
.name(categoryInfoSaveReq.getName())
|
||||
.image(categoryInfoSaveReq.getImage())
|
||||
.start(categoryInfoSaveReq.getStart())
|
||||
.introduction(categoryInfoSaveReq.getIntroduction())
|
||||
.parentId(categoryInfoSaveReq.getParentId())
|
||||
.createBy(categoryInfoSaveReq.getCreateBy())
|
||||
.createTime(new Date())
|
||||
.build();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,109 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.product.domain.req.GroupBuyQueryReq;
|
||||
import com.muyu.product.domain.req.GroupBuySaveReq;
|
||||
import com.muyu.product.domain.req.GroupBuyEditReq;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 拼团活动对象 group_buy
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("group_buy")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "GroupBuy", description = "拼团活动")
|
||||
public class GroupBuy extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(name = "编号", value = "编号")
|
||||
private Long id;
|
||||
|
||||
/** 外键:关联商品 */
|
||||
@Excel(name = "外键:关联商品")
|
||||
@ApiModelProperty(name = "外键:关联商品", value = "外键:关联商品")
|
||||
private Long productId;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "开始时间", value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "结束时间", value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/** 最小成团人数 */
|
||||
@Excel(name = "最小成团人数")
|
||||
@ApiModelProperty(name = "最小成团人数", value = "最小成团人数")
|
||||
private Long minMembers;
|
||||
|
||||
/** 活动转态 */
|
||||
@Excel(name = "活动转态")
|
||||
@ApiModelProperty(name = "活动转态", value = "活动转态")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
public static GroupBuy queryBuild( GroupBuyQueryReq groupBuyQueryReq){
|
||||
return GroupBuy.builder()
|
||||
.productId(groupBuyQueryReq.getProductId())
|
||||
.startTime(groupBuyQueryReq.getStartTime())
|
||||
.endTime(groupBuyQueryReq.getEndTime())
|
||||
.minMembers(groupBuyQueryReq.getMinMembers())
|
||||
.status(groupBuyQueryReq.getStatus())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static GroupBuy saveBuild(GroupBuySaveReq groupBuySaveReq){
|
||||
return GroupBuy.builder()
|
||||
.productId(groupBuySaveReq.getProductId())
|
||||
.startTime(groupBuySaveReq.getStartTime())
|
||||
.endTime(groupBuySaveReq.getEndTime())
|
||||
.minMembers(groupBuySaveReq.getMinMembers())
|
||||
.status(groupBuySaveReq.getStatus())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static GroupBuy editBuild(Long id, GroupBuyEditReq groupBuyEditReq){
|
||||
return GroupBuy.builder()
|
||||
.id(id)
|
||||
.productId(groupBuyEditReq.getProductId())
|
||||
.startTime(groupBuyEditReq.getStartTime())
|
||||
.endTime(groupBuyEditReq.getEndTime())
|
||||
.minMembers(groupBuyEditReq.getMinMembers())
|
||||
.status(groupBuyEditReq.getStatus())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,89 @@
|
|||
package com.muyu.product.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.product.domain.req.GroupOrderQueryReq;
|
||||
import com.muyu.product.domain.req.GroupOrderSaveReq;
|
||||
import com.muyu.product.domain.req.GroupOrderEditReq;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 拼团订单对象 group_order
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("group_order")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ApiModel(value = "GroupOrder", description = "拼团订单")
|
||||
public class GroupOrder extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(value = "id",type = IdType.AUTO)
|
||||
@ApiModelProperty(name = "主键", value = "主键")
|
||||
private Long id;
|
||||
|
||||
/** 外键:关联拼团活动 */
|
||||
@Excel(name = "外键:关联拼团活动")
|
||||
@ApiModelProperty(name = "外键:关联拼团活动", value = "外键:关联拼团活动")
|
||||
private Long groupBuyId;
|
||||
|
||||
/** 用户ID */
|
||||
@Excel(name = "用户ID")
|
||||
@ApiModelProperty(name = "用户ID", value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 订单状态 */
|
||||
@Excel(name = "订单状态")
|
||||
@ApiModelProperty(name = "订单状态", value = "订单状态")
|
||||
private Long status;
|
||||
|
||||
/**
|
||||
* 查询构造器
|
||||
*/
|
||||
public static GroupOrder queryBuild( GroupOrderQueryReq groupOrderQueryReq){
|
||||
return GroupOrder.builder()
|
||||
.groupBuyId(groupOrderQueryReq.getGroupBuyId())
|
||||
.userId(groupOrderQueryReq.getUserId())
|
||||
.status(groupOrderQueryReq.getStatus())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static GroupOrder saveBuild(GroupOrderSaveReq groupOrderSaveReq){
|
||||
return GroupOrder.builder()
|
||||
.groupBuyId(groupOrderSaveReq.getGroupBuyId())
|
||||
.userId(groupOrderSaveReq.getUserId())
|
||||
.status(groupOrderSaveReq.getStatus())
|
||||
.build();
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改构造器
|
||||
*/
|
||||
public static GroupOrder editBuild(Long id, GroupOrderEditReq groupOrderEditReq){
|
||||
return GroupOrder.builder()
|
||||
.id(id)
|
||||
.groupBuyId(groupOrderEditReq.getGroupBuyId())
|
||||
.userId(groupOrderEditReq.getUserId())
|
||||
.status(groupOrderEditReq.getStatus())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
|
@ -1,5 +1,6 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -8,6 +9,10 @@ import lombok.experimental.SuperBuilder;
|
|||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.TreeEntity;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 品类信息对象 category_info
|
||||
*
|
||||
|
@ -39,4 +44,38 @@ public class CategoryInfoEditReq extends TreeEntity {
|
|||
@ApiModelProperty(name = "介绍", value = "介绍")
|
||||
private String introduction;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 商品属性组关联ID
|
||||
*/
|
||||
private List<Long> attributeGroupIdList;
|
||||
/**
|
||||
* 商品属性关联ID
|
||||
*/
|
||||
private List<Long> attributeIdList;
|
||||
|
||||
/**
|
||||
* 商品品牌组关联ID
|
||||
*/
|
||||
private List<Long> brandIdList;
|
||||
|
||||
/**
|
||||
* 添加构造器
|
||||
*/
|
||||
public static CategoryInfoSaveModel saveBuild(CategoryInfoSaveReq categoryInfoSaveReq, Supplier<String> supplier){
|
||||
return CategoryInfoSaveModel.builder()
|
||||
.name(categoryInfoSaveReq.getName())
|
||||
.image(categoryInfoSaveReq.getImage())
|
||||
.start(categoryInfoSaveReq.getStart())
|
||||
.introduction(categoryInfoSaveReq.getIntroduction())
|
||||
.parentId(categoryInfoSaveReq.getParentId())
|
||||
.attributeGroupIdList(categoryInfoSaveReq.getAttributeGroupIdList())
|
||||
.attributeIdList(categoryInfoSaveReq.getAttributeIdList())
|
||||
.brandIdList(categoryInfoSaveReq.getBrandIdList())
|
||||
.createBy(supplier.get())
|
||||
.createTime(new Date())
|
||||
.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import com.muyu.common.core.web.domain.TreeEntity;
|
||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* 品类信息对象 category_info
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
|
||||
public class CategoryInfoReq {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 品类名称 */
|
||||
|
||||
private String name;
|
||||
|
||||
/** 图片 */
|
||||
|
||||
private String image;
|
||||
|
||||
/** 是否启用 */
|
||||
|
||||
private String start;
|
||||
|
||||
/** 介绍 */
|
||||
@ApiModelProperty(name = "介绍", value = "介绍")
|
||||
private String introduction;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 商品属性组关联ID
|
||||
*/
|
||||
private List<Long> attributeGroupList;
|
||||
/**
|
||||
* 商品属性关联ID
|
||||
*/
|
||||
private List<Long> attributeInfoList;
|
||||
|
||||
/**
|
||||
* 商品品牌组关联ID
|
||||
*/
|
||||
private List<Long> brandInfoList;
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 拼团活动对象 group_buy
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "GroupBuyEditReq", description = "拼团活动")
|
||||
public class GroupBuyEditReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 外键:关联商品 */
|
||||
@ApiModelProperty(name = "外键:关联商品", value = "外键:关联商品")
|
||||
private Long productId;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "开始时间", value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "结束时间", value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/** 最小成团人数 */
|
||||
@ApiModelProperty(name = "最小成团人数", value = "最小成团人数")
|
||||
private Long minMembers;
|
||||
|
||||
/** 活动转态 */
|
||||
@ApiModelProperty(name = "活动转态", value = "活动转态")
|
||||
private Long status;
|
||||
|
||||
}
|
|
@ -0,0 +1,50 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 拼团活动对象 group_buy
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "GroupBuyQueryReq", description = "拼团活动")
|
||||
public class GroupBuyQueryReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 外键:关联商品 */
|
||||
@ApiModelProperty(name = "外键:关联商品", value = "外键:关联商品")
|
||||
private Long productId;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "开始时间", value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
@ApiModelProperty(name = "结束时间", value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/** 最小成团人数 */
|
||||
@ApiModelProperty(name = "最小成团人数", value = "最小成团人数")
|
||||
private Long minMembers;
|
||||
|
||||
/** 活动转态 */
|
||||
@ApiModelProperty(name = "活动转态", value = "活动转态")
|
||||
private Long status;
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 拼团活动对象 group_buy
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "GroupBuySaveReq", description = "拼团活动")
|
||||
public class GroupBuySaveReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 编号 */
|
||||
|
||||
@ApiModelProperty(name = "编号", value = "编号")
|
||||
private Long id;
|
||||
|
||||
/** 外键:关联商品 */
|
||||
|
||||
@ApiModelProperty(name = "外键:关联商品", value = "外键:关联商品")
|
||||
private Long productId;
|
||||
|
||||
/** 开始时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
|
||||
@ApiModelProperty(name = "开始时间", value = "开始时间")
|
||||
private Date startTime;
|
||||
|
||||
/** 结束时间 */
|
||||
@JsonFormat(pattern = "yyyy-MM-dd")
|
||||
|
||||
@ApiModelProperty(name = "结束时间", value = "结束时间")
|
||||
private Date endTime;
|
||||
|
||||
/** 最小成团人数 */
|
||||
|
||||
@ApiModelProperty(name = "最小成团人数", value = "最小成团人数")
|
||||
private Long minMembers;
|
||||
|
||||
/** 活动转态 */
|
||||
|
||||
@ApiModelProperty(name = "活动转态", value = "活动转态")
|
||||
private Long status;
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 拼团订单对象 group_order
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "GroupOrderEditReq", description = "拼团订单")
|
||||
public class GroupOrderEditReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 外键:关联拼团活动 */
|
||||
@ApiModelProperty(name = "外键:关联拼团活动", value = "外键:关联拼团活动")
|
||||
private Long groupBuyId;
|
||||
|
||||
/** 用户ID */
|
||||
@ApiModelProperty(name = "用户ID", value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 订单状态 */
|
||||
@ApiModelProperty(name = "订单状态", value = "订单状态")
|
||||
private Long status;
|
||||
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 拼团订单对象 group_order
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "GroupOrderQueryReq", description = "拼团订单")
|
||||
public class GroupOrderQueryReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 外键:关联拼团活动 */
|
||||
@ApiModelProperty(name = "外键:关联拼团活动", value = "外键:关联拼团活动")
|
||||
private Long groupBuyId;
|
||||
|
||||
/** 用户ID */
|
||||
@ApiModelProperty(name = "用户ID", value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 订单状态 */
|
||||
@ApiModelProperty(name = "订单状态", value = "订单状态")
|
||||
private Long status;
|
||||
|
||||
}
|
|
@ -0,0 +1,46 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import io.swagger.annotations.*;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 拼团订单对象 group_order
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Data
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@ApiModel(value = "GroupOrderSaveReq", description = "拼团订单")
|
||||
public class GroupOrderSaveReq extends BaseEntity {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
|
||||
@ApiModelProperty(name = "主键", value = "主键")
|
||||
private Long id;
|
||||
|
||||
/** 外键:关联拼团活动 */
|
||||
|
||||
@ApiModelProperty(name = "外键:关联拼团活动", value = "外键:关联拼团活动")
|
||||
private Long groupBuyId;
|
||||
|
||||
/** 用户ID */
|
||||
|
||||
@ApiModelProperty(name = "用户ID", value = "用户ID")
|
||||
private Long userId;
|
||||
|
||||
/** 订单状态 */
|
||||
|
||||
@ApiModelProperty(name = "订单状态", value = "订单状态")
|
||||
private Long status;
|
||||
|
||||
}
|
|
@ -1,6 +1,8 @@
|
|||
package com.muyu.product.domain.req;
|
||||
|
||||
import com.muyu.product.domain.RuleInfo;
|
||||
import com.muyu.product.domain.model.RuleAttrAddModel;
|
||||
import com.muyu.product.domain.resp.RuleInfoResp;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -34,6 +36,6 @@ public class RuleInfoEditReq extends BaseEntity {
|
|||
@ApiModelProperty(name = "规格状态", value = "规格状态")
|
||||
private String status;
|
||||
|
||||
private List<RuleInfo> ruleInfoList;
|
||||
private List<RuleAttrAddModel> ruleAttrList;
|
||||
|
||||
}
|
||||
|
|
|
@ -113,6 +113,7 @@ public class CategoryInfoController extends BaseController {
|
|||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改品类信息")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody CategoryInfoEditReq categoryInfoEditReq) {
|
||||
categoryInfoService.updateCategory(id,categoryInfoEditReq);
|
||||
return toAjax(categoryInfoService.updateById(CategoryInfo.editBuild(id,categoryInfoEditReq)));
|
||||
}
|
||||
|
||||
|
@ -124,8 +125,8 @@ public class CategoryInfoController extends BaseController {
|
|||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除品类信息")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(categoryInfoService.removeBatchByIds(ids));
|
||||
public Result remove(@PathVariable String ids) {
|
||||
return categoryInfoService.delById(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.domain.GroupBuy;
|
||||
import com.muyu.product.domain.req.GroupBuyQueryReq;
|
||||
import com.muyu.product.domain.req.GroupBuySaveReq;
|
||||
import com.muyu.product.domain.req.GroupBuyEditReq;
|
||||
import com.muyu.product.service.GroupBuyService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 拼团活动Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Api(tags = "拼团活动")
|
||||
@RestController
|
||||
@RequestMapping("/groupBuy")
|
||||
public class GroupBuyController extends BaseController {
|
||||
@Autowired
|
||||
private GroupBuyService groupBuyService;
|
||||
|
||||
/**
|
||||
* 查询拼团活动列表
|
||||
*/
|
||||
@ApiOperation("获取拼团活动列表")
|
||||
@RequiresPermissions("product:groupBuy:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<GroupBuy>> list(GroupBuyQueryReq groupBuyQueryReq) {
|
||||
startPage();
|
||||
List<GroupBuy> list = groupBuyService.list(GroupBuy.queryBuild(groupBuyQueryReq));
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出拼团活动列表
|
||||
*/
|
||||
@ApiOperation("导出拼团活动列表")
|
||||
@RequiresPermissions("product:groupBuy:export")
|
||||
@Log(title = "拼团活动", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GroupBuy groupBuy) {
|
||||
List<GroupBuy> list = groupBuyService.list(groupBuy);
|
||||
ExcelUtil<GroupBuy> util = new ExcelUtil<GroupBuy>(GroupBuy.class);
|
||||
util.exportExcel(response, list, "拼团活动数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取拼团活动详细信息
|
||||
*/
|
||||
@ApiOperation("获取拼团活动详细信息")
|
||||
@RequiresPermissions("product:groupBuy:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<GroupBuy> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(groupBuyService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增拼团活动
|
||||
*/
|
||||
@RequiresPermissions("product:groupBuy:add")
|
||||
@Log(title = "拼团活动", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation("新增拼团活动")
|
||||
public Result<String> add(@RequestBody GroupBuySaveReq groupBuySaveReq) {
|
||||
return toAjax(groupBuyService.save(GroupBuy.saveBuild(groupBuySaveReq)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改拼团活动
|
||||
*/
|
||||
@RequiresPermissions("product:groupBuy:edit")
|
||||
@Log(title = "拼团活动", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改拼团活动")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody GroupBuyEditReq groupBuyEditReq) {
|
||||
return toAjax(groupBuyService.updateById(GroupBuy.editBuild(id,groupBuyEditReq)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除拼团活动
|
||||
*/
|
||||
@RequiresPermissions("product:groupBuy:remove")
|
||||
@Log(title = "拼团活动", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除拼团活动")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(groupBuyService.removeBatchByIds(ids));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,111 @@
|
|||
package com.muyu.product.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.log.annotation.Log;
|
||||
import com.muyu.common.log.enums.BusinessType;
|
||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.product.domain.GroupOrder;
|
||||
import com.muyu.product.domain.req.GroupOrderQueryReq;
|
||||
import com.muyu.product.domain.req.GroupOrderSaveReq;
|
||||
import com.muyu.product.domain.req.GroupOrderEditReq;
|
||||
import com.muyu.product.service.GroupOrderService;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 拼团订单Controller
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Api(tags = "拼团订单")
|
||||
@RestController
|
||||
@RequestMapping("/GroupOrder")
|
||||
public class GroupOrderController extends BaseController {
|
||||
@Autowired
|
||||
private GroupOrderService groupOrderService;
|
||||
|
||||
/**
|
||||
* 查询拼团订单列表
|
||||
*/
|
||||
@ApiOperation("获取拼团订单列表")
|
||||
@RequiresPermissions("product:GroupOrder:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<GroupOrder>> list(GroupOrderQueryReq groupOrderQueryReq) {
|
||||
startPage();
|
||||
List<GroupOrder> list = groupOrderService.list(GroupOrder.queryBuild(groupOrderQueryReq));
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出拼团订单列表
|
||||
*/
|
||||
@ApiOperation("导出拼团订单列表")
|
||||
@RequiresPermissions("product:GroupOrder:export")
|
||||
@Log(title = "拼团订单", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GroupOrder groupOrder) {
|
||||
List<GroupOrder> list = groupOrderService.list(groupOrder);
|
||||
ExcelUtil<GroupOrder> util = new ExcelUtil<GroupOrder>(GroupOrder.class);
|
||||
util.exportExcel(response, list, "拼团订单数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取拼团订单详细信息
|
||||
*/
|
||||
@ApiOperation("获取拼团订单详细信息")
|
||||
@RequiresPermissions("product:GroupOrder:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = Long.class)
|
||||
public Result<GroupOrder> getInfo(@PathVariable("id") Long id) {
|
||||
return Result.success(groupOrderService.getById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增拼团订单
|
||||
*/
|
||||
@RequiresPermissions("product:GroupOrder:add")
|
||||
@Log(title = "拼团订单", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
@ApiOperation("新增拼团订单")
|
||||
public Result<String> add(@RequestBody GroupOrderSaveReq groupOrderSaveReq) {
|
||||
return toAjax(groupOrderService.save(GroupOrder.saveBuild(groupOrderSaveReq)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改拼团订单
|
||||
*/
|
||||
@RequiresPermissions("product:GroupOrder:edit")
|
||||
@Log(title = "拼团订单", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/{id}")
|
||||
@ApiOperation("修改拼团订单")
|
||||
public Result<String> edit(@PathVariable Long id, @RequestBody GroupOrderEditReq groupOrderEditReq) {
|
||||
return toAjax(groupOrderService.updateById(GroupOrder.editBuild(id,groupOrderEditReq)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除拼团订单
|
||||
*/
|
||||
@RequiresPermissions("product:GroupOrder:remove")
|
||||
@Log(title = "拼团订单", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除拼团订单")
|
||||
@ApiImplicitParam(name = "id", value = "id", required = true, dataType = "Long", paramType = "path", dataTypeClass = String.class, example = "1,2,3,4")
|
||||
public Result<String> remove(@PathVariable List<Long> ids) {
|
||||
return toAjax(groupOrderService.removeBatchByIds(ids));
|
||||
}
|
||||
}
|
|
@ -3,6 +3,8 @@ package com.muyu.product.mapper;
|
|||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.CategoryInfo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 品类信息Mapper接口
|
||||
|
@ -10,6 +12,20 @@ import com.muyu.product.domain.CategoryInfo;
|
|||
* @author DongZeLiang
|
||||
* @date 2024-02-27
|
||||
*/
|
||||
@Mapper
|
||||
public interface CategoryInfoMapper extends BaseMapper<CategoryInfo> {
|
||||
|
||||
void delAttributeGroupId(Long id);
|
||||
|
||||
void delAttributeIdList(Long id);
|
||||
|
||||
void delArandIdList(Long id);
|
||||
|
||||
void addAttributeGroupId(@Param("id") Long id, @Param("attributeGroupId") Long attributeGroupId);
|
||||
|
||||
void addAttributeIdList(@Param("id") Long id, @Param("attributeId") Long attributeId);
|
||||
|
||||
void addArandIdList(@Param("id") Long id, @Param("brandId") Long brandId);
|
||||
|
||||
Integer selectByPid(String ids);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.GroupBuy;
|
||||
|
||||
/**
|
||||
* 拼团活动Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
public interface GroupBuyMapper extends BaseMapper<GroupBuy> {
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.muyu.product.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.GroupOrder;
|
||||
|
||||
/**
|
||||
* 拼团订单Mapper接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
public interface GroupOrderMapper extends BaseMapper<GroupOrder> {
|
||||
|
||||
}
|
|
@ -4,6 +4,7 @@ import java.util.List;
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.muyu.product.domain.RuleAttrInfo;
|
||||
import com.muyu.product.domain.RuleInfo;
|
||||
import com.muyu.product.domain.req.RuleInfoEditReq;
|
||||
import com.muyu.product.domain.resp.RuleInfoResp;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
@ -21,6 +22,6 @@ public interface RuleAttrInfoMapper extends BaseMapper<RuleAttrInfo> {
|
|||
|
||||
void del(Long id);
|
||||
|
||||
void add(@Param("id") Long id, @Param("ruleInfoList") List<RuleInfo> ruleInfoList);
|
||||
void add(@Param("id") Long id, @Param("name") String name, @Param("attrValue") String attrValue);
|
||||
|
||||
}
|
||||
|
|
|
@ -2,12 +2,14 @@ package com.muyu.product.service;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.product.domain.AttributeGroup;
|
||||
import com.muyu.product.domain.AttributeInfo;
|
||||
import com.muyu.product.domain.BrandInfo;
|
||||
import com.muyu.product.domain.CategoryInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import com.muyu.product.domain.req.CategoryInfoEditReq;
|
||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||
|
||||
|
@ -69,4 +71,8 @@ public interface CategoryInfoService extends IService<CategoryInfo> {
|
|||
CategoryCommonElementResp getTemplateAttributeByCateGoryId (Long cateGoryId);
|
||||
|
||||
public <T, AS> List<T> getCommon (Long categoryId, IService<AS> iService, IService<T> bsiService);
|
||||
|
||||
Result updateCategory(Long id, CategoryInfoEditReq categoryInfoEditReq);
|
||||
|
||||
Result delById(String ids);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.product.domain.GroupBuy;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 拼团活动Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
public interface GroupBuyService extends IService<GroupBuy> {
|
||||
/**
|
||||
* 查询拼团活动列表
|
||||
*
|
||||
* @param groupBuy 拼团活动
|
||||
* @return 拼团活动集合
|
||||
*/
|
||||
public List<GroupBuy> list(GroupBuy groupBuy);
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.muyu.product.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.product.domain.GroupOrder;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 拼团订单Service接口
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
public interface GroupOrderService extends IService<GroupOrder> {
|
||||
/**
|
||||
* 查询拼团订单列表
|
||||
*
|
||||
* @param groupOrder 拼团订单
|
||||
* @return 拼团订单集合
|
||||
*/
|
||||
public List<GroupOrder> list(GroupOrder groupOrder);
|
||||
|
||||
}
|
|
@ -4,12 +4,14 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import com.muyu.product.domain.*;
|
||||
import com.muyu.product.domain.base.CategoryBase;
|
||||
import com.muyu.product.domain.model.CategoryInfoSaveModel;
|
||||
import com.muyu.product.domain.model.TemplateAttributeGroupModel;
|
||||
import com.muyu.product.domain.model.TemplateAttributeModel;
|
||||
import com.muyu.product.domain.req.CategoryInfoEditReq;
|
||||
import com.muyu.product.domain.resp.CategoryCommonElementResp;
|
||||
import com.muyu.product.domain.resp.CategoryParentCommonElementResp;
|
||||
import com.muyu.product.mapper.CategoryInfoMapper;
|
||||
|
@ -58,6 +60,9 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
@Autowired
|
||||
private AttributeGroupService attributeGroupService;
|
||||
|
||||
@Autowired
|
||||
private CategoryInfoMapper categoryInfoMapper;
|
||||
|
||||
/**
|
||||
* 查询品类信息列表
|
||||
*
|
||||
|
@ -270,6 +275,38 @@ public class CategoryInfoServiceImpl extends ServiceImpl<CategoryInfoMapper, Cat
|
|||
return list;
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Result updateCategory(Long id, CategoryInfoEditReq categoryInfoEditReq) {
|
||||
categoryInfoMapper.delAttributeGroupId(id);
|
||||
List<Long> attributeGroupIdList = categoryInfoEditReq.getAttributeGroupIdList();
|
||||
for (Long aLong : attributeGroupIdList) {
|
||||
categoryInfoMapper.addAttributeGroupId(id,aLong);
|
||||
}
|
||||
|
||||
categoryInfoMapper.delAttributeIdList(id);
|
||||
List<Long> attributeIdList = categoryInfoEditReq.getAttributeIdList();
|
||||
for (Long aLong : attributeIdList) {
|
||||
categoryInfoMapper.addAttributeIdList(id,aLong);
|
||||
}
|
||||
categoryInfoMapper.delArandIdList(id);
|
||||
List<Long> brandIdList = categoryInfoEditReq.getBrandIdList();
|
||||
for (Long aLong : brandIdList) {
|
||||
categoryInfoMapper.addArandIdList(id,aLong);
|
||||
}
|
||||
return Result.success(0,"修改成功");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result delById(String ids) {
|
||||
Integer count = categoryInfoMapper.selectByPid(ids);
|
||||
if(count>0){
|
||||
return Result.error(400,"该数据存在子集,禁止删除");
|
||||
}
|
||||
categoryInfoMapper.deleteById(ids);
|
||||
return Result.success(200,"删除成功");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过品类ID获取父级以上的属性、属性组、品牌集合
|
||||
*
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
package com.muyu.product.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.product.mapper.GroupBuyMapper;
|
||||
import com.muyu.product.domain.GroupBuy;
|
||||
import com.muyu.product.service.GroupBuyService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
/**
|
||||
* 拼团活动Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class GroupBuyServiceImpl extends ServiceImpl<GroupBuyMapper, GroupBuy> implements GroupBuyService {
|
||||
|
||||
/**
|
||||
* 查询拼团活动列表
|
||||
*
|
||||
* @param groupBuy 拼团活动
|
||||
* @return 拼团活动
|
||||
*/
|
||||
@Override
|
||||
public List<GroupBuy> list(GroupBuy groupBuy) {
|
||||
LambdaQueryWrapper<GroupBuy> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
||||
if (ObjUtils.notNull(groupBuy.getProductId())){
|
||||
queryWrapper.eq(GroupBuy::getProductId, groupBuy.getProductId());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(groupBuy.getStartTime())){
|
||||
queryWrapper.eq(GroupBuy::getStartTime, groupBuy.getStartTime());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(groupBuy.getEndTime())){
|
||||
queryWrapper.eq(GroupBuy::getEndTime, groupBuy.getEndTime());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(groupBuy.getMinMembers())){
|
||||
queryWrapper.eq(GroupBuy::getMinMembers, groupBuy.getMinMembers());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(groupBuy.getStatus())){
|
||||
queryWrapper.eq(GroupBuy::getStatus, groupBuy.getStatus());
|
||||
}
|
||||
return list(queryWrapper);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
package com.muyu.product.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.muyu.common.core.utils.ObjUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.product.mapper.GroupOrderMapper;
|
||||
import com.muyu.product.domain.GroupOrder;
|
||||
import com.muyu.product.service.GroupOrderService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
|
||||
/**
|
||||
* 拼团订单Service业务层处理
|
||||
*
|
||||
* @author DongZeLiang
|
||||
* @date 2024-11-14
|
||||
*/
|
||||
@Slf4j
|
||||
@Service
|
||||
public class GroupOrderServiceImpl extends ServiceImpl<GroupOrderMapper, GroupOrder> implements GroupOrderService {
|
||||
|
||||
/**
|
||||
* 查询拼团订单列表
|
||||
*
|
||||
* @param groupOrder 拼团订单
|
||||
* @return 拼团订单
|
||||
*/
|
||||
@Override
|
||||
public List<GroupOrder> list(GroupOrder groupOrder) {
|
||||
LambdaQueryWrapper<GroupOrder> queryWrapper = new LambdaQueryWrapper<>();
|
||||
|
||||
|
||||
if (ObjUtils.notNull(groupOrder.getGroupBuyId())){
|
||||
queryWrapper.eq(GroupOrder::getGroupBuyId, groupOrder.getGroupBuyId());
|
||||
}
|
||||
|
||||
if (ObjUtils.notNull(groupOrder.getUserId())){
|
||||
queryWrapper.eq(GroupOrder::getUserId, groupOrder.getUserId());
|
||||
}
|
||||
|
||||
|
||||
if (ObjUtils.notNull(groupOrder.getStatus())){
|
||||
queryWrapper.eq(GroupOrder::getStatus, groupOrder.getStatus());
|
||||
}
|
||||
return list(queryWrapper);
|
||||
}
|
||||
}
|
|
@ -132,7 +132,16 @@ public class RuleInfoServiceImpl extends ServiceImpl<RuleInfoMapper, RuleInfo>
|
|||
@Override
|
||||
public Result upd(Long id, RuleInfoEditReq ruleInfoEditReq) {
|
||||
ruleAttrInfoMapper.del(id);
|
||||
ruleAttrInfoMapper.add(id,ruleInfoEditReq.getRuleInfoList());
|
||||
List<RuleAttrAddModel> ruleAttrList = ruleInfoEditReq.getRuleAttrList();
|
||||
for (RuleAttrAddModel ruleAttrAddModel : ruleAttrList) {
|
||||
List<String> valueList = ruleAttrAddModel.getValueList();
|
||||
String join = String.join(",", valueList);
|
||||
// for (String s : valueList) {
|
||||
// ruleAttrInfoMapper.add(id,ruleAttrAddModel.getName(),s);
|
||||
// }
|
||||
ruleAttrInfoMapper.add(id,ruleAttrAddModel.getName(),join);
|
||||
}
|
||||
|
||||
return Result.success(0,"修改成功");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,4 +21,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<sql id="selectCategoryInfoVo">
|
||||
select id, name, image, parent_id, start, introduction, remark, create_by, create_time, update_by, update_time from category_info
|
||||
</sql>
|
||||
<insert id="addAttributeGroupId">
|
||||
INSERT INTO `as_category_attribute_group` (`category_id`, `attribute_group_id`) values
|
||||
(#{id},#{attributeGroupId})
|
||||
</insert>
|
||||
<insert id="addAttributeIdList">
|
||||
INSERT INTO `as_category_attribute` (`category_id`, `attribute_id`) values
|
||||
(#{id},#{attributeId})
|
||||
</insert>
|
||||
<insert id="addArandIdList">
|
||||
INSERT INTO `as_category_brand` (`category_id`, `brand_id`) values
|
||||
(#{id},#{brandId})
|
||||
</insert>
|
||||
<delete id="delAttributeGroupId">
|
||||
delete from as_category_attribute where category_id = #{id}
|
||||
</delete>
|
||||
<delete id="delAttributeIdList">
|
||||
delete from as_category_brand where category_id = #{id}
|
||||
</delete>
|
||||
<delete id="delArandIdList">
|
||||
delete from as_category_attribute_group where category_id = #{id}
|
||||
</delete>
|
||||
<select id="selectByPid" resultType="java.lang.Integer">
|
||||
select count(1) from category_info where parent_id = #{ids}
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.GroupBuyMapper">
|
||||
|
||||
<resultMap type="com.muyu.product.domain.GroupBuy" id="GroupBuyResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="endTime" column="end_time" />
|
||||
<result property="minMembers" column="min_members" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGroupBuyVo">
|
||||
select id, product_id, start_time, end_time, min_members, status from group_buy
|
||||
</sql>
|
||||
</mapper>
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.muyu.product.mapper.GroupOrderMapper">
|
||||
|
||||
<resultMap type="com.muyu.product.domain.GroupOrder" id="GroupOrderResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="groupBuyId" column="group_buy_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="status" column="status" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGroupOrderVo">
|
||||
select id, group_buy_id, user_id, create_time, status from group_order
|
||||
</sql>
|
||||
</mapper>
|
|
@ -41,6 +41,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
select id, rule_id, name, attr_value, remark, create_by, create_time, update_by, update_time from rule_attr_info
|
||||
</sql>
|
||||
<insert id="add">
|
||||
INSERT INTO `rule_attr_info` ( `rule_id`, `name`, `attr_value`,create_by,create_time)
|
||||
VALUES
|
||||
(#{id},#{name},#{attrValue},"admin",now())
|
||||
|
||||
</insert>
|
||||
<delete id="del">
|
||||
|
|
Loading…
Reference in New Issue