Merge branch 'dev-mitao'
# Conflicts:
# ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/factory/OrderFallbackFactory.java
# ruoyi-api/ruoyi-api-system/src/main/java/com/ruoyi/system/api/feignClient/OrderClient.java
# ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
# ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/IOrderService.java
# ruoyi-modules/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
26 文件已重命名
4个文件已删除
16个文件已添加
38个文件已修改
| | |
| | | package com.ruoyi.system.api.factory; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.domain.PromotionVideo; |
| | | import com.ruoyi.system.api.domain.dto.OrderAuctionBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderDTO; |
| | | import com.ruoyi.system.api.feignClient.OrderClient; |
| | | import com.ruoyi.system.api.feignClient.PromotionClient; |
| | | import org.springframework.cloud.openfeign.FallbackFactory; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author mitao |
| | |
| | | public R<Boolean> getOrderAuctionBond(OrderAuctionBondDTO orderAuctionBondDTO) { |
| | | return R.fail("通过视频集合查询用户失败:" + cause.getMessage()); |
| | | } |
| | | @Override |
| | | public R<Integer> getSeckillMembers(Long id) { |
| | | return R.fail("获取秒杀商品已购会员数失败:" + cause.getMessage()); |
| | | } |
| | | }; |
| | | |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.system.api.feignClient; |
| | | |
| | | import com.ruoyi.common.core.constant.ServiceNameConstants; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.system.api.domain.GoodsSku; |
| | | import com.ruoyi.system.api.domain.dto.OrderAuctionBondDTO; |
| | | import com.ruoyi.system.api.domain.dto.OrderDTO; |
| | | import com.ruoyi.system.api.factory.OrderFallbackFactory; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | @FeignClient(contextId = "orderClient", value = ServiceNameConstants.RUOYI_ORDER, fallbackFactory = OrderFallbackFactory.class) |
| | | public interface OrderClient { |
| | |
| | | @PostMapping("/order-auction-bond/getOrderAuctionBond") |
| | | R<Boolean> getOrderAuctionBond(@RequestBody OrderAuctionBondDTO orderAuctionBondDTO); |
| | | |
| | | /** |
| | | * 获取某个商品的已购会员数 |
| | | * |
| | | * @param id 秒杀商品id |
| | | * @return 已购会员数 |
| | | */ |
| | | @GetMapping("/order/seckill-members/{id}") |
| | | R<Integer> getSeckillMembers(@PathVariable("id") Long id); |
| | | } |
| | |
| | | package com.ruoyi.file.controller; |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.file.FileUtils; |
| | | import com.ruoyi.file.service.ISysFileService; |
| | | import com.ruoyi.file.utils.HuaWeiOBSUtil; |
| | | import com.ruoyi.system.api.domain.SysFile; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestPart; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.file.FileUtils; |
| | | import com.ruoyi.file.service.ISysFileService; |
| | | import com.ruoyi.system.api.domain.SysFile; |
| | | |
| | | /** |
| | | * 文件请求处理 |
| | |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 文件上传请求 |
| | | */ |
| | | @ApiOperation(value = "obs文件上传", notes = "obs文件上传") |
| | | @PostMapping("/obs/upload") |
| | | public R<String> obsUpload(@RequestPart("file") MultipartFile file) { |
| | | try { |
| | | // 上传并返回访问地址 |
| | | String url = HuaWeiOBSUtil.obsUpload(file); |
| | | return R.ok(url); |
| | | } catch (Exception e) { |
| | | log.error("上传文件失败", e); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 文件上传请求 |
| | | */ |
| | | @ApiOperation(value = "obs文件批量上传", notes = "obs文件批量上传") |
| | | @PostMapping("/obs/upload-batch") |
| | | public R<List<String>> obsUploadBatch(@RequestPart("file") MultipartFile[] file) { |
| | | List<String> urls = new ArrayList<>(); |
| | | try { |
| | | for (MultipartFile multipartFile : file) { |
| | | String url = HuaWeiOBSUtil.obsUpload(multipartFile); |
| | | urls.add(url); |
| | | } |
| | | // 上传并返回访问地址 |
| | | return R.ok(urls); |
| | | } catch (Exception e) { |
| | | log.error("上传文件失败", e); |
| | | return R.fail(e.getMessage()); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.file.utils; |
| | | |
| | | import com.obs.services.ObsClient; |
| | | import com.obs.services.model.ObjectMetadata; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.util.UUID; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | public class HuaWeiOBSUtil { |
| | | |
| | | //TODO 修改配置文件 |
| | | //OBS图片访问域名 |
| | | public static String endPoint = "obs.cn-southwest-2.myhuaweicloud.com"; |
| | | public static String accessKeyId = "IZB26ZHC7C5MWIOH1TGE"; |
| | | public static String accessKeySecret = "y5PXhFMDOHiPH0nnQMz4gkvA63oqKAC621zXzOPk"; |
| | | public static String bucketName = "mimishejiao"; |
| | | public static String oss_domain = "https://mimishejiao.obs.cn-southwest-2.myhuaweicloud.com/"; |
| | | |
| | | // 创建ObsClient实例 |
| | | public static ObsClient obsClient = new ObsClient(accessKeyId, accessKeySecret, endPoint); |
| | | |
| | | public static String obsUpload(MultipartFile file) |
| | | throws IOException { |
| | | //CommonsMultipartFile file = (CommonsMultipartFile)multipartFile; |
| | | String fileName = ""; |
| | | if (file != null && !"".equals(file.getOriginalFilename()) |
| | | && file.getOriginalFilename() != null) { |
| | | InputStream content = file.getInputStream();//获得指定文件的输入流 |
| | | ObjectMetadata meta = new ObjectMetadata();// 创建上传Object的Metadata |
| | | meta.setContentLength(file.getSize()); // 必须设置ContentLength |
| | | String originalFilename = file.getOriginalFilename(); |
| | | fileName = |
| | | UUID.randomUUID().toString().replaceAll("-", "") + originalFilename.subSequence( |
| | | originalFilename.lastIndexOf("."), originalFilename.length()); |
| | | obsClient.putObject(bucketName, fileName, content, meta);// 上传Object. |
| | | if (fileName != null && !"".equals(fileName)) { |
| | | System.out.println(fileName); |
| | | fileName = oss_domain + fileName; |
| | | } |
| | | } |
| | | return fileName; |
| | | } |
| | | |
| | | /** |
| | | * 删除某个Object |
| | | * |
| | | * @param bucketUrl |
| | | * @return |
| | | */ |
| | | public static boolean deleteObject(String bucketUrl) { |
| | | try { |
| | | bucketUrl = bucketUrl.replace(oss_domain, ""); |
| | | // 删除Object. |
| | | obsClient.deleteObject(bucketName, bucketUrl); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return false; |
| | | } finally { |
| | | // obsClient.shutdown(); |
| | | } |
| | | return true; |
| | | } |
| | | |
| | | // public static void createBucket(String bucketName) |
| | | // { |
| | | // //初始化 OSSClient |
| | | //// ossClient = new OssClient(endPoint, accessKeyId, accessKeySecret); |
| | | // |
| | | // // 新建一个Bucket |
| | | // Bucket bucket = ossClient.createBucket(bucketName); |
| | | // System.out.println(bucket.getName()); |
| | | // System.out.println(bucket.getCreationDate()); |
| | | // } |
| | | // |
| | | // public static void main(String[] args) { |
| | | // OssUploadUtil.createBucket("ssfdfsd"); |
| | | // } |
| | | } |
| | |
| | | package com.ruoyi.goods.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.goods.domain.pojo.GoodsSku; |
| | | import com.ruoyi.goods.domain.GoodsSku; |
| | | import com.ruoyi.goods.service.IGoodsSkuService; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | 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.ResponseBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/DTO/GoodsBrandDTO.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.DTO; |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | |
| | | private static final long serialVersionUID = -286811516688205647L; |
| | | |
| | | @ApiModelProperty(value = "商品品牌标题id", notes = "更新必传,新增不传") |
| | | @ApiModelProperty(value = "商品品牌id", notes = "更新必传,新增不传") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "品牌名称") |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/DTO/GoodsBrandQuery.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.DTO; |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
New file |
| | |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotBlank; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/5/21 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "商品分类数据传输对象", description = "商品分类数据传输对象") |
| | | public class GoodsCategoryDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -340456108914762488L; |
| | | |
| | | @ApiModelProperty(value = "商品分类id", notes = "更新必传,新增不传") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "分类名称") |
| | | @NotBlank(message = "分类名称不能为空") |
| | | private String categoryName; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/5/21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "商品分类查询对象", description = "商品分类查询对象") |
| | | public class GoodsCategoryQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = 2265520959737199709L; |
| | | |
| | | @ApiModelProperty(value = "分类名称") |
| | | private String categoryName; |
| | | } |
New file |
| | |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotBlank; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/5/20 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "商品香型传输对象", description = "商品香型数据传输对象") |
| | | public class GoodsFlavorTypeDTO implements Serializable { |
| | | |
| | | |
| | | private static final long serialVersionUID = -286811516688205647L; |
| | | |
| | | @ApiModelProperty(value = "商品香型id", notes = "更新必传,新增不传") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "香型名称") |
| | | @NotBlank(message = "香型名称不能为空") |
| | | private String flavorTypeName; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/5/20 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "商品香型查询对象", description = "商品香型查询对象") |
| | | public class GoodsFlavorTypeQuery extends BasePage { |
| | | |
| | | |
| | | private static final long serialVersionUID = -196269784492900797L; |
| | | |
| | | @ApiModelProperty(value = "香型名称") |
| | | private String flavorTypeName; |
| | | } |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/DTO/GoodsInfoTitleDTO.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.DTO; |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/DTO/GoodsInfoTitleQuery.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.DTO; |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/DTO/GoodsInfoTitleValueDTO.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.DTO; |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
New file |
| | |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import java.util.List; |
| | | import javax.validation.Valid; |
| | | import javax.validation.constraints.NotEmpty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/5/21 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "商品秒杀数据传输对象", description = "商品秒杀数据传输对象") |
| | | public class GoodsSeckillDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -3736491035819949518L; |
| | | |
| | | @ApiModelProperty(value = "商品信息") |
| | | @NotEmpty(message = "商品信息不能为空") |
| | | @Valid |
| | | private List<GoodsSkuInfoDTO> goodsSkuList; |
| | | |
| | | @ApiModelProperty(value = "分享标题") |
| | | private String shareTitle; |
| | | |
| | | @ApiModelProperty(value = "分享图片") |
| | | private String sharePic; |
| | | |
| | | @ApiModelProperty(value = "秒杀开始时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "秒杀结束时间") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
| | | private LocalDateTime endTime; |
| | | } |
New file |
| | |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/5/20 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "秒杀商品查询对象", description = "秒杀商品查询对象") |
| | | public class GoodsSeckillQuery extends BasePage { |
| | | |
| | | |
| | | private static final long serialVersionUID = 1440540784488131168L; |
| | | |
| | | @ApiModelProperty(value = "秒杀商品名称") |
| | | private String goodsSkuName; |
| | | } |
New file |
| | |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.time.LocalDateTime; |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 商品秒杀表 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "商品秒杀数据传输对象", description = "商品秒杀数据传输对象") |
| | | public class GoodsSeckillUpd implements Serializable { |
| | | |
| | | |
| | | private static final long serialVersionUID = 5347721819131215157L; |
| | | |
| | | @ApiModelProperty(value = "商品秒杀id") |
| | | @NotNull(message = "商品秒杀id不能为空") |
| | | private Long id; |
| | | |
| | | |
| | | @ApiModelProperty(value = "秒杀库存") |
| | | @NotNull(message = "秒杀库存不能为空") |
| | | private Integer seckillStock; |
| | | |
| | | @ApiModelProperty(value = "限购数量") |
| | | private Integer limitNumber; |
| | | |
| | | @ApiModelProperty(value = "分享标题") |
| | | @NotBlank(message = "分享标题不能为空") |
| | | private String shareTitle; |
| | | |
| | | @ApiModelProperty(value = "分享图片") |
| | | @NotBlank(message = "分享图片不能为空") |
| | | private String sharePic; |
| | | |
| | | @ApiModelProperty(value = "秒杀开始时间", notes = "传 2024-05-21 18:18:49 不可传:2024-05-21T18:18:49 ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "秒杀结束时间", notes = "传 2024-05-21 18:18:49 不可传:2024-05-21T18:18:49 ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "排序") |
| | | private Integer sortNum; |
| | | } |
New file |
| | |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import javax.validation.constraints.NotBlank; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/5/20 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "商品系列数据传输对象", description = "商品系列数据传输对象") |
| | | public class GoodsSeriesDTO implements Serializable { |
| | | |
| | | |
| | | private static final long serialVersionUID = -286811516688205647L; |
| | | |
| | | @ApiModelProperty(value = "商品系列id", notes = "更新必传,新增不传") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "系列名称") |
| | | @NotBlank(message = "系列名称不能为空") |
| | | private String seriesName; |
| | | |
| | | } |
New file |
| | |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import com.ruoyi.common.core.web.page.BasePage; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/5/21 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = true) |
| | | @ApiModel(value = "商品系列查询对象", description = "商品系列查询对象") |
| | | public class GoodsSeriesQuery extends BasePage { |
| | | |
| | | private static final long serialVersionUID = 2265520959737199709L; |
| | | |
| | | @ApiModelProperty(value = "系列名称") |
| | | private String seriesName; |
| | | } |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/DTO/GoodsSkuDTO.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.DTO; |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
New file |
| | |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import javax.validation.constraints.NotNull; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * @author mitao |
| | | * @date 2024/5/21 |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "秒杀商品数据传输对象", description = "秒杀商品数据传输对象") |
| | | public class GoodsSkuInfoDTO implements Serializable { |
| | | |
| | | private static final long serialVersionUID = -6565529043925729311L; |
| | | |
| | | @ApiModelProperty(value = "商品id") |
| | | @NotNull(message = "商品id不能为空") |
| | | private Long goods_sku_id; |
| | | |
| | | @ApiModelProperty(value = "秒杀价格") |
| | | @NotNull(message = "秒杀价格不能为空") |
| | | private BigDecimal skillPrice; |
| | | |
| | | @ApiModelProperty(value = "秒杀库存") |
| | | @NotNull(message = "秒杀库存不能为空") |
| | | private Integer skillStock; |
| | | |
| | | @ApiModelProperty(value = "限购数量") |
| | | private Integer limitNumber; |
| | | |
| | | @ApiModelProperty(value = "排序") |
| | | private Integer sortNum; |
| | | |
| | | } |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/DTO/GoodsSkuQuery.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.DTO; |
| | | package com.ruoyi.goods.controller.management.DTO; |
| | | |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import com.ruoyi.common.core.web.page.BasePage; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/MgtGoodsBrandController.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement; |
| | | package com.ruoyi.goods.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsBrandDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsBrandQuery; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsBrandVO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsBrandDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsBrandQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsBrandVO; |
| | | import com.ruoyi.goods.service.IGoodsBrandService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
New file |
| | |
| | | package com.ruoyi.goods.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsCategoryDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsCategoryQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsCategoryVO; |
| | | import com.ruoyi.goods.service.IGoodsCategoryService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | | * 商品分类表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/mgt/goods-category") |
| | | @Api(value = "管理后台商品分类相关接口", tags = {"管理后台接口"}) |
| | | public class MgtGoodsCategoryController { |
| | | |
| | | private final IGoodsCategoryService goodsCategoryService; |
| | | |
| | | /** |
| | | * 获取商品分类列表的分页数据 |
| | | * |
| | | * @param query 商品分类查询条件,通过RequestBody接收前端传来的查询参数。 |
| | | * @return 返回一个包含商品分类分页数据的结果对象,其中数据部分为PageDTO<GoodsCategoryVO>类型。 |
| | | */ |
| | | @ApiOperation(value = " 获取商品分类列表的分页数据", notes = " 获取商品分类列表的分页数据") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<GoodsCategoryVO>> getGoodsCategoryPage( |
| | | @Validated @RequestBody GoodsCategoryQuery query) { |
| | | return R.ok(goodsCategoryService.getGoodsCategoryPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 新增/编辑商品分类。 该接口用于接收前端发送的商品分类数据,通过商品分类数据传输对象(GoodsCategoryDTO)来新增或编辑商品分类信息。 |
| | | * |
| | | * @param dto 商品分类数据传输对象,包含商品分类的详细信息,通过RequestBody接收。 使用@Validated注解进行参数验证,确保数据的完整性和正确性。 |
| | | * @return 返回操作结果,使用R<Void>作为返回类型,其中R是自定义的结果封装类,Void表示操作不返回具体数据。 如果操作成功,返回R.ok(),表示操作成功。 |
| | | */ |
| | | @ApiOperation(value = "新增/编辑 商品分类", notes = "新增/编辑 商品分类") |
| | | @PostMapping("/save") |
| | | public R<Void> saveGoodsCategory(@Validated @RequestBody GoodsCategoryDTO dto) { |
| | | goodsCategoryService.saveGoodsCategory(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除商品分类 |
| | | * |
| | | * @param id 商品分类的唯一标识符 |
| | | * @return 返回操作结果,如果操作成功,则返回一个成功的标识 |
| | | */ |
| | | @ApiOperation(value = "删除商品分类", notes = "删除商品分类") |
| | | @DeleteMapping("/{id}") |
| | | public R<Void> deleteGoodsCategory(@Validated @PathVariable("id") Long id) { |
| | | goodsCategoryService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.goods.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsFlavorTypeDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsFlavorTypeQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsFlavorTypeVO; |
| | | import com.ruoyi.goods.service.IGoodsFlavorTypeService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | | * 香型表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/mgt/goods-flavor-type") |
| | | @Api(value = "管理后台商品香型相关接口", tags = {"管理后台接口"}) |
| | | public class MgtGoodsFlavorTypeController { |
| | | |
| | | private final IGoodsFlavorTypeService goodsFlavorTypeService; |
| | | |
| | | /** |
| | | * 获取商品香型列表的分页数据 |
| | | * |
| | | * @param query 商品香型查询条件,通过验证的请求体参数 |
| | | * @return 返回商品香型列表的分页数据,封装在R对象中,其中PageDTO包含分页信息和香型数据列表 |
| | | */ |
| | | @ApiOperation(value = "获取商品香型列表的分页数据", notes = "获取商品香型列表的分页数据") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<GoodsFlavorTypeVO>> getGoodsFlavorTypePage( |
| | | @Validated @RequestBody GoodsFlavorTypeQuery query) { |
| | | return R.ok(goodsFlavorTypeService.getGoodsFlavorTypePage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加/编辑 商品香型 |
| | | * |
| | | * @param dto 商品香型数据传输对象,通过验证的请求体参数 |
| | | * @return 返回添加/编辑操作的结果,封装在R对象中 |
| | | */ |
| | | @ApiOperation(value = "添加/编辑 商品香型", notes = "添加/编辑 商品香型") |
| | | @PostMapping("/save") |
| | | public R<Void> saveGoodsFlavorType(@Validated @RequestBody GoodsFlavorTypeDTO dto) { |
| | | goodsFlavorTypeService.saveGoodsFlavorType(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除商品香型 |
| | | * |
| | | * @param id 商品香型的ID,用于指定要删除的具体商品香型 |
| | | * @return 返回操作结果,如果删除成功,则返回一个成功的响应码 |
| | | */ |
| | | @ApiOperation(value = "删除商品香型", notes = "删除商品香型") |
| | | @DeleteMapping("/{id}") |
| | | public R<Void> deleteGoodsFlavorType(@PathVariable("id") Long id) { |
| | | goodsFlavorTypeService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/MgtGoodsGroupPurchaseController.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement; |
| | | package com.ruoyi.goods.controller.management; |
| | | |
| | | |
| | | import io.swagger.annotations.Api; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/MgtGoodsInfoTitleController.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement; |
| | | package com.ruoyi.goods.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsInfoTitleDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsInfoTitleQuery; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsInfoTitleVO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsInfoTitleDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsInfoTitleQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsInfoTitleVO; |
| | | import com.ruoyi.goods.service.IGoodsInfoTitleService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
New file |
| | |
| | | package com.ruoyi.goods.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeckillDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeckillQuery; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeckillUpd; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsSeckillVO; |
| | | import com.ruoyi.goods.service.IGoodsSeckillService; |
| | | import com.ruoyi.system.api.domain.dto.ListStatusDTO; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.PutMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | | * 商品秒杀表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/mgt/goods-seckill") |
| | | @Api(value = "管理后台商品秒杀相关接口", tags = {"管理后台接口"}) |
| | | public class MgtGoodsSeckillController { |
| | | |
| | | private final IGoodsSeckillService goodsSeckillService; |
| | | |
| | | /** |
| | | * 获取秒杀商品列表的分页数据 |
| | | * |
| | | * @param query 秒杀商品查询对象 |
| | | * @return R<PageDTO < GoodsSeckillVO>> |
| | | */ |
| | | @ApiOperation(value = "获取秒杀商品列表的分页数据", notes = "获取秒杀商品列表的分页数据") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<GoodsSeckillVO>> getGoodsSeckillPage( |
| | | @Validated @RequestBody GoodsSeckillQuery query) { |
| | | return R.ok(goodsSeckillService.getGoodsSeckillPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 添加秒杀商品 |
| | | * |
| | | * @param dto 商品秒杀数据传输对象 |
| | | */ |
| | | @ApiOperation(value = "添加秒杀商品", notes = "添加秒杀商品") |
| | | @PostMapping("/add") |
| | | public R<Void> addGoodsSeckill(@Validated @RequestBody GoodsSeckillDTO dto) { |
| | | goodsSeckillService.addGoodsSeckill(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 修改秒杀商品 |
| | | * |
| | | * @param upd 商品秒杀数据传输对象 |
| | | */ |
| | | @ApiOperation(value = "修改秒杀商品", notes = "修改秒杀商品") |
| | | @PutMapping |
| | | public R<Void> updGoodsSeckill(@Validated @RequestBody GoodsSeckillUpd upd) { |
| | | goodsSeckillService.updGoodsSeckill(upd); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 上架/下架 秒杀商品 |
| | | * |
| | | * @param dto 商品上下架状态对象 |
| | | */ |
| | | @ApiOperation(value = "上架/下架 秒杀商品", notes = "上架/下架 秒杀商品") |
| | | @PutMapping("/upd-status") |
| | | public R<Void> updStatus(@Validated @RequestBody ListStatusDTO dto) { |
| | | goodsSeckillService.updStatus(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @ApiOperation("查看详情") |
| | | @GetMapping("/detail/{id}") |
| | | public R<GoodsSeckillVO> getDetail(@PathVariable("id") Long id) { |
| | | return R.ok(goodsSeckillService.getDetail(id)); |
| | | } |
| | | } |
New file |
| | |
| | | package com.ruoyi.goods.controller.management; |
| | | |
| | | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeriesDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeriesQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsSeriesVO; |
| | | import com.ruoyi.goods.service.IGoodsSeriesService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.validation.annotation.Validated; |
| | | import org.springframework.web.bind.annotation.DeleteMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | 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; |
| | | |
| | | /** |
| | | * <p> |
| | | * 系列表 前端控制器 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("/mgt/goods-series") |
| | | @Api(value = "管理后台商品系列相关接口", tags = {"管理后台接口"}) |
| | | public class MgtGoodsSeriesController { |
| | | |
| | | private final IGoodsSeriesService goodsSeriesService; |
| | | |
| | | /** |
| | | * 获取商品系列列表的分页数据 |
| | | * |
| | | * @param query 商品系列查询条件,用于筛选和排序等操作 |
| | | * @return 返回商品系列的分页数据,包含分页信息和商品系列列表 |
| | | */ |
| | | @ApiOperation(value = "获取商品系列列表的分页数据", notes = "获取商品系列列表的分页数据") |
| | | @PostMapping("/page") |
| | | public R<PageDTO<GoodsSeriesVO>> getGoodsSeriesPage( |
| | | @Validated @RequestBody GoodsSeriesQuery query) { |
| | | return R.ok(goodsSeriesService.getGoodsSeriesPage(query)); |
| | | } |
| | | |
| | | /** |
| | | * 新增/编辑商品系列。 该接口用于通过接收商品系列数据对象(GoodsSeriesDTO),来新增或编辑商品系列信息。 |
| | | * |
| | | * @param dto 商品系列数据传输对象,包含商品系列的详细信息,通过RequestBody接收。 需要进行合法性验证(@Validated)以确保数据的完整性和正确性。 |
| | | * @return R<Void> 返回一个结果对象,表示操作是否成功。如果操作成功,返回状态码200。 |
| | | */ |
| | | @ApiOperation(value = "新增/编辑 商品系列", notes = "新增/编辑 商品系列") |
| | | @PostMapping("/save") |
| | | public R<Void> saveGoodsSeries(@Validated @RequestBody GoodsSeriesDTO dto) { |
| | | goodsSeriesService.saveGoodsSeries(dto); |
| | | return R.ok(); |
| | | } |
| | | |
| | | /** |
| | | * 删除商品香型 |
| | | * |
| | | * @param id 商品香型的ID,用于指定要删除的具体商品香型 |
| | | * @return 返回操作结果,如果删除成功,则返回一个成功响应码 |
| | | */ |
| | | @ApiOperation(value = "删除商品香型", notes = "删除商品香型") |
| | | @DeleteMapping("/{id}") |
| | | public R<Void> deleteGoodsSeries(@PathVariable("id") Long id) { |
| | | goodsSeriesService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | } |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/MgtGoodsSkuController.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement; |
| | | package com.ruoyi.goods.controller.management; |
| | | |
| | | |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsInfoTitleQuery; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsSkuDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsSkuQuery; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsBrandVO; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsCategoryVO; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsFlavorTypeVO; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsInfoTitleVO; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsSeriesVO; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsSkuVO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsInfoTitleQuery; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSkuDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSkuQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsBrandVO; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsCategoryVO; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsFlavorTypeVO; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsInfoTitleVO; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsSeriesVO; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsSkuVO; |
| | | import com.ruoyi.goods.service.IGoodsBrandService; |
| | | import com.ruoyi.goods.service.IGoodsCategoryService; |
| | | import com.ruoyi.goods.service.IGoodsFlavorTypeService; |
| | |
| | | * |
| | | * @return R<List < GoodsFlavorTypeVO>> 包含商品香型列表的响应对象。 |
| | | */ |
| | | @ApiOperation(value = "获取商品香型列表", notes = "获取商品香型列表") |
| | | @GetMapping("/flavor/list") |
| | | public R<List<GoodsFlavorTypeVO>> getGoodsFlavorTypeList() { |
| | | return R.ok(goodsFlavorTypeService.getGoodsFlavorTypeList()); |
| | |
| | | * @param dto 包含需要更新状态的商品信息的数据传输对象,类型为 ListStatusDTO。 |
| | | * @return 返回一个表示操作结果的 R<Void> 对象,如果操作成功,则 R<Void>.ok() 方法返回一个成功标记。 |
| | | */ |
| | | @ApiOperation(value = "下架/上架 商品") |
| | | @ApiOperation(value = "下架/上架 商品", notes = "下架/上架 商品") |
| | | @PutMapping("/upd-status") |
| | | public R<Void> updStatus(@RequestBody ListStatusDTO dto) { |
| | | goodsSkuService.updStatus(dto); |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/VO/GoodsBrandVO.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.VO; |
| | | package com.ruoyi.goods.controller.management.VO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/VO/GoodsCategoryVO.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.VO; |
| | | package com.ruoyi.goods.controller.management.VO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/VO/GoodsFlavorTypeVO.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.VO; |
| | | package com.ruoyi.goods.controller.management.VO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/VO/GoodsInfoTitleVO.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.VO; |
| | | package com.ruoyi.goods.controller.management.VO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
New file |
| | |
| | | package com.ruoyi.goods.controller.management.VO; |
| | | |
| | | import com.ruoyi.common.core.enums.StartStatusEnum; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | | import lombok.Data; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * <p> |
| | | * 商品秒杀表 |
| | | * </p> |
| | | * |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Data |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @Accessors(chain = true) |
| | | @ApiModel(value = "商品秒杀视图对象", description = "商品秒杀视图对象") |
| | | public class GoodsSeckillVO implements Serializable { |
| | | |
| | | |
| | | private static final long serialVersionUID = 620695205462624870L; |
| | | |
| | | @ApiModelProperty(value = "商品秒杀id") |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsSkuName; |
| | | |
| | | @ApiModelProperty(value = "秒杀价格") |
| | | private BigDecimal seckillPrice; |
| | | |
| | | @ApiModelProperty(value = "已售数量") |
| | | private Integer soldQuantity; |
| | | |
| | | @ApiModelProperty(value = "秒杀库存") |
| | | private Integer seckillStock; |
| | | |
| | | @ApiModelProperty(value = "限购数量") |
| | | private Integer limitNumber; |
| | | |
| | | @ApiModelProperty(value = "排序") |
| | | private Integer sortNum; |
| | | |
| | | @ApiModelProperty(value = "分享标题") |
| | | private String shareTitle; |
| | | |
| | | @ApiModelProperty(value = "分享图片") |
| | | private String sharePic; |
| | | |
| | | @ApiModelProperty(value = "秒杀开始时间") |
| | | private LocalDateTime startTime; |
| | | |
| | | @ApiModelProperty(value = "秒杀结束时间") |
| | | private LocalDateTime endTime; |
| | | |
| | | @ApiModelProperty(value = "开始状态 0=未开始 1= 已开始 2=已结束") |
| | | private StartStatusEnum startStatus; |
| | | |
| | | @ApiModelProperty(value = "已购会员数") |
| | | private Integer numberOfPurchasedMembers; |
| | | } |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/VO/GoodsSeriesVO.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.VO; |
| | | package com.ruoyi.goods.controller.management.VO; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/controller/mamagement/VO/GoodsSkuVO.java |
| | |
| | | package com.ruoyi.goods.controller.mamagement.VO; |
| | | package com.ruoyi.goods.controller.management.VO; |
| | | |
| | | import com.ruoyi.common.core.enums.ListingStatusEnum; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsInfoTitleValueDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsInfoTitleValueDTO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import java.io.Serializable; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/GoodsBrand.java |
| | |
| | | package com.ruoyi.goods.domain.pojo; |
| | | package com.ruoyi.goods.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/GoodsCategory.java |
| | |
| | | package com.ruoyi.goods.domain.pojo; |
| | | package com.ruoyi.goods.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/GoodsFlavorType.java |
| | |
| | | package com.ruoyi.goods.domain.pojo; |
| | | package com.ruoyi.goods.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/GoodsGroupPurchase.java |
| | |
| | | package com.ruoyi.goods.domain.pojo; |
| | | package com.ruoyi.goods.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/GoodsInfoTitle.java |
| | |
| | | package com.ruoyi.goods.domain.pojo; |
| | | package com.ruoyi.goods.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/GoodsInfoTitleValue.java |
| | |
| | | package com.ruoyi.goods.domain.pojo; |
| | | package com.ruoyi.goods.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/GoodsSeckill.java |
| | |
| | | package com.ruoyi.goods.domain.pojo; |
| | | package com.ruoyi.goods.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | |
| | | @ApiModelProperty(value = "商品id") |
| | | private Long goodsSkuId; |
| | | |
| | | @ApiModelProperty(value = "商品名称") |
| | | private String goodsSkuName; |
| | | |
| | | @ApiModelProperty(value = "当前库存") |
| | | private Integer currentStock; |
| | | |
| | | @ApiModelProperty(value = "秒杀价格") |
| | | private BigDecimal seckillPrice; |
| | | |
| | | @ApiModelProperty(value = "秒杀库存") |
| | | private Integer seckillStock; |
| | | |
| | | @ApiModelProperty(value = "已售数量") |
| | | private Integer soldQuantity; |
| | | |
| | | @ApiModelProperty(value = "限购数量") |
| | | private Integer limitNumber; |
| | | |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/GoodsSeries.java |
| | |
| | | package com.ruoyi.goods.domain.pojo; |
| | | package com.ruoyi.goods.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
File was renamed from ruoyi-modules/ruoyi-goods/src/main/java/com/ruoyi/goods/domain/pojo/GoodsSku.java |
| | |
| | | package com.ruoyi.goods.domain.pojo; |
| | | package com.ruoyi.goods.domain; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.FieldFill; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | |
| | | package com.ruoyi.goods.mapper; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsBrand; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.goods.domain.GoodsBrand; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.goods.mapper; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsCategory; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.goods.domain.GoodsCategory; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.goods.mapper; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsFlavorType; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.goods.domain.GoodsFlavorType; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.goods.mapper; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsGroupPurchase; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.goods.domain.GoodsGroupPurchase; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.goods.mapper; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsInfoTitle; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.goods.domain.GoodsInfoTitle; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.goods.mapper; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsInfoTitleValue; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.goods.domain.GoodsInfoTitleValue; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.goods.mapper; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsSeckill; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsSeckillVO; |
| | | import com.ruoyi.goods.domain.GoodsSeckill; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface GoodsSeckillMapper extends BaseMapper<GoodsSeckill> { |
| | | |
| | | Page<GoodsSeckillVO> getGoodsSeckillPage(@Param("goodsSkuName") String goodsSkuName, |
| | | @Param("page") Page<GoodsSeckillVO> page); |
| | | } |
| | |
| | | package com.ruoyi.goods.mapper; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsSeries; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.goods.domain.GoodsSeries; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.goods.mapper; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsSku; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.goods.domain.GoodsSku; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface GoodsSkuMapper extends BaseMapper<GoodsSku> { |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsBrandDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsBrandQuery; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsBrandVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsBrand; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsBrandDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsBrandQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsBrandVO; |
| | | import com.ruoyi.goods.domain.GoodsBrand; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | package com.ruoyi.goods.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsCategoryVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsCategory; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsCategoryDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsCategoryQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsCategoryVO; |
| | | import com.ruoyi.goods.domain.GoodsCategory; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface IGoodsCategoryService extends IService<GoodsCategory> { |
| | | |
| | | /** |
| | | * 获取商品类别列表。 |
| | | * <p>此方法不接受任何参数,它会调用 {@code list()} 方法获取当前类别列表的副本,并将其转换为 {@code GoodsCategoryVO} 类型的列表后返回。</p> |
| | | * |
| | | * @return 返回一个 {@code List<GoodsCategoryVO>},包含当前商品类别的所有信息的副本。 |
| | | */ |
| | | List<GoodsCategoryVO> getGoodsCategoryList(); |
| | | |
| | | /** |
| | | * 获取商品类别的分页信息 |
| | | * |
| | | * @param query 查询条件,包含页码、页大小和分类名称 |
| | | * @return 分页后的商品类别数据,包装在PageDTO中 |
| | | */ |
| | | PageDTO<GoodsCategoryVO> getGoodsCategoryPage(GoodsCategoryQuery query); |
| | | |
| | | /** |
| | | * 保存或更新商品类别信息。 |
| | | * |
| | | * @param dto 商品类别数据传输对象,包含商品类别的信息。 如果dto中的id为空,则认为是新纪录,执行保存操作; 如果id不为空,则认为是更新现有纪录。 |
| | | */ |
| | | void saveGoodsCategory(GoodsCategoryDTO dto); |
| | | } |
| | |
| | | package com.ruoyi.goods.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsFlavorTypeVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsFlavorType; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsFlavorTypeDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsFlavorTypeQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsFlavorTypeVO; |
| | | import com.ruoyi.goods.domain.GoodsFlavorType; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface IGoodsFlavorTypeService extends IService<GoodsFlavorType> { |
| | | |
| | | /** |
| | | * 获取商品口味类型的列表。 |
| | | * <p>此方法通过调用 {@code list()} 方法获取原始列表,并使用 {@code BeanUtils.copyList} 方法将每个元素转换为 |
| | | * {@code GoodsFlavorTypeVO} 类型,最终返回转换后的列表。</p> |
| | | * |
| | | * @return 返回一个 {@code List<GoodsFlavorTypeVO>},包含转换后的商品口味类型信息。 |
| | | */ |
| | | List<GoodsFlavorTypeVO> getGoodsFlavorTypeList(); |
| | | |
| | | /** |
| | | * 获取商品口味类型分页数据 |
| | | * |
| | | * @param query 查询条件,包含页码、页大小和口味类型名称等 |
| | | * @return 返回口味类型分页数据传输对象(PageDTO),其中包含了分页信息和转换后的口味类型视图对象(GoodsFlavorTypeVO)列表 |
| | | */ |
| | | PageDTO<GoodsFlavorTypeVO> getGoodsFlavorTypePage(GoodsFlavorTypeQuery query); |
| | | |
| | | /** |
| | | * 保存或更新商品口味类型信息。 |
| | | * |
| | | * @param dto 商品口味类型数据传输对象,包含要保存或更新的信息。 如果dto中的id为空,则认为是新纪录,执行保存操作; 如果id不为空,则认为是更新现有纪录。 |
| | | */ |
| | | void saveGoodsFlavorType(GoodsFlavorTypeDTO dto); |
| | | } |
| | |
| | | package com.ruoyi.goods.service; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsGroupPurchase; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.goods.domain.GoodsGroupPurchase; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsInfoTitleDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsInfoTitleQuery; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsInfoTitleVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsInfoTitle; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsInfoTitleDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsInfoTitleQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsInfoTitleVO; |
| | | import com.ruoyi.goods.domain.GoodsInfoTitle; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.goods.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.goods.domain.pojo.GoodsInfoTitleValue; |
| | | import com.ruoyi.goods.domain.GoodsInfoTitleValue; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | package com.ruoyi.goods.service; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsSeckill; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeckillDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeckillQuery; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeckillUpd; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsSeckillVO; |
| | | import com.ruoyi.goods.domain.GoodsSeckill; |
| | | import com.ruoyi.system.api.domain.dto.ListStatusDTO; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface IGoodsSeckillService extends IService<GoodsSeckill> { |
| | | |
| | | /** |
| | | * 添加秒杀商品 |
| | | * |
| | | * @param dto 商品秒杀数据传输对象 |
| | | */ |
| | | void addGoodsSeckill(GoodsSeckillDTO dto); |
| | | |
| | | /** |
| | | * 获取秒杀商品列表的分页数据 |
| | | * |
| | | * @param query 秒杀商品查询对象 |
| | | * @return PageDTO<GoodsSeckillVO> |
| | | */ |
| | | PageDTO<GoodsSeckillVO> getGoodsSeckillPage(GoodsSeckillQuery query); |
| | | |
| | | /** |
| | | * 修改秒杀商品 |
| | | * |
| | | * @param upd 商品秒杀数据传输对象 |
| | | */ |
| | | void updGoodsSeckill(GoodsSeckillUpd upd); |
| | | |
| | | void updStatus(ListStatusDTO dto); |
| | | |
| | | GoodsSeckillVO getDetail(Long id); |
| | | } |
| | |
| | | package com.ruoyi.goods.service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsSeriesVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsSeries; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeriesDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeriesQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsSeriesVO; |
| | | import com.ruoyi.goods.domain.GoodsSeries; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | */ |
| | | public interface IGoodsSeriesService extends IService<GoodsSeries> { |
| | | |
| | | /** |
| | | * 获取商品系列列表的视图对象。 |
| | | * |
| | | * <p>此方法不接受任何参数,它会调用 {@code list()} 方法获取原始列表, |
| | | * 然后使用 {@code BeanUtils.copyList} 将这些实体转换为视图对象。</p> |
| | | * |
| | | * @return 返回一个 {@link List} 类型的商品系列视图对象列表。每个视图对象代表一个商品系列的简要信息。 |
| | | */ |
| | | List<GoodsSeriesVO> getGoodsSeriesList(); |
| | | |
| | | /** |
| | | * 获取商品系列的分页信息 |
| | | * |
| | | * @param query 包含分页参数和查询条件的查询对象 |
| | | * @return 返回商品系列的分页数据传输对象(DTO),包含分页信息和商品系列列表 |
| | | */ |
| | | PageDTO<GoodsSeriesVO> getGoodsSeriesPage(GoodsSeriesQuery query); |
| | | |
| | | /** |
| | | * 保存或更新商品系列信息。 |
| | | * |
| | | * @param dto 商品系列数据传输对象,包含商品系列的详细信息。 如果商品系列ID为空,则视为新记录,进行保存; 如果商品系列ID不为空,则视为更新记录,进行更新。 |
| | | */ |
| | | void saveGoodsSeries(GoodsSeriesDTO dto); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.fasterxml.jackson.core.JsonProcessingException; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsSkuDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsSkuQuery; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsSkuVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsSku; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSkuDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSkuQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsSkuVO; |
| | | import com.ruoyi.goods.domain.GoodsSku; |
| | | import com.ruoyi.system.api.domain.dto.ListStatusDTO; |
| | | |
| | | /** |
| | |
| | | * @return 无返回值。 |
| | | */ |
| | | void updStatus(ListStatusDTO dto); |
| | | |
| | | } |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsBrandDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsBrandQuery; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsBrandVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsBrand; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsBrandDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsBrandQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsBrandVO; |
| | | import com.ruoyi.goods.domain.GoodsBrand; |
| | | import com.ruoyi.goods.mapper.GoodsBrandMapper; |
| | | import com.ruoyi.goods.service.IGoodsBrandService; |
| | | import java.util.List; |
| | |
| | | .like(StringUtils.isNotEmpty(query.getBrandName()), GoodsBrand::getBrandName, |
| | | query.getBrandName()) |
| | | .page(new Page<GoodsBrand>(query.getPageCurr(), query.getPageSize())); |
| | | |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page.getTotal(), page.getPages()); |
| | | } |
| | | // 将查询结果转换为VO类的分页DTO |
| | | return PageDTO.of(page, GoodsBrandVO.class); |
| | | } |
| | |
| | | package com.ruoyi.goods.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsCategoryVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsCategory; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsCategoryDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsCategoryQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsCategoryVO; |
| | | import com.ruoyi.goods.domain.GoodsCategory; |
| | | import com.ruoyi.goods.mapper.GoodsCategoryMapper; |
| | | import com.ruoyi.goods.service.IGoodsCategoryService; |
| | | import java.util.List; |
| | |
| | | public class GoodsCategoryServiceImpl extends ServiceImpl<GoodsCategoryMapper, GoodsCategory> implements IGoodsCategoryService { |
| | | |
| | | /** |
| | | * 获取商品类别列表的副本。 |
| | | * <p>此方法不接受任何参数,它会调用 {@code list()} 方法获取当前类别列表的副本,并将其转换为 {@code GoodsCategoryVO} 类型的列表后返回。</p> |
| | | * 获取商品类别列表。 |
| | | * <p>此方法不接受任何参数,它会调用 {@code list()} 方法获取当前类别列表,并将其转换为 {@code GoodsCategoryVO} 类型的列表后返回。</p> |
| | | * |
| | | * @return 返回一个 {@code List<GoodsCategoryVO>},包含当前商品类别的所有信息的副本。 |
| | | * @return 返回一个 {@code List<GoodsCategoryVO>},包含当前商品类别的所有信息。 |
| | | */ |
| | | @Override |
| | | public List<GoodsCategoryVO> getGoodsCategoryList() { |
| | |
| | | return BeanUtils.copyList(this.list(), GoodsCategoryVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 获取商品类别的分页信息 |
| | | * |
| | | * @param query 查询条件,包含页码、页大小和分类名称 |
| | | * @return 分页后的商品类别数据,包装在PageDTO中 |
| | | */ |
| | | @Override |
| | | public PageDTO<GoodsCategoryVO> getGoodsCategoryPage(GoodsCategoryQuery query) { |
| | | Page<GoodsCategory> page = this.lambdaQuery() |
| | | .like(StringUtils.isNotEmpty(query.getCategoryName()), |
| | | GoodsCategory::getCategoryName, query.getCategoryName()) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page.getTotal(), page.getPages()); |
| | | } |
| | | return PageDTO.of(page, GoodsCategoryVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 保存或更新商品类别信息。 |
| | | * |
| | | * @param dto 商品类别数据传输对象,包含商品类别的信息。 如果dto中的id为空,则认为是新纪录,执行保存操作; 如果id不为空,则认为是更新现有纪录。 |
| | | */ |
| | | @Override |
| | | public void saveGoodsCategory(GoodsCategoryDTO dto) { |
| | | GoodsCategory goodsCategory = BeanUtils.copyBean(dto, GoodsCategory.class); |
| | | if (StringUtils.isNull(dto.getId())) { |
| | | this.save(goodsCategory); |
| | | } else { |
| | | this.updateById(goodsCategory); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.goods.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsFlavorTypeVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsFlavorType; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsFlavorTypeDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsFlavorTypeQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsFlavorTypeVO; |
| | | import com.ruoyi.goods.domain.GoodsFlavorType; |
| | | import com.ruoyi.goods.mapper.GoodsFlavorTypeMapper; |
| | | import com.ruoyi.goods.service.IGoodsFlavorTypeService; |
| | | import java.util.List; |
| | |
| | | public List<GoodsFlavorTypeVO> getGoodsFlavorTypeList() { |
| | | return BeanUtils.copyList(this.list(), GoodsFlavorTypeVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 获取商品口味类型分页数据 |
| | | * |
| | | * @param query 查询条件,包含页码、页大小和口味类型名称等 |
| | | * @return 返回口味类型分页数据传输对象(PageDTO),其中包含了分页信息和转换后的口味类型视图对象(GoodsFlavorTypeVO)列表 |
| | | */ |
| | | @Override |
| | | public PageDTO<GoodsFlavorTypeVO> getGoodsFlavorTypePage(GoodsFlavorTypeQuery query) { |
| | | Page<GoodsFlavorType> page = this.lambdaQuery() |
| | | .like(StringUtils.isNotEmpty(query.getFlavorTypeName()), |
| | | GoodsFlavorType::getFlavorTypeName, query.getFlavorTypeName()) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page.getTotal(), page.getPages()); |
| | | } |
| | | return PageDTO.of(page, GoodsFlavorTypeVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 保存或更新商品口味类型信息。 |
| | | * |
| | | * @param dto 商品口味类型数据传输对象,包含要保存或更新的信息。 如果dto中的id为空,则认为是新纪录,执行保存操作; 如果id不为空,则认为是更新现有纪录。 |
| | | */ |
| | | @Override |
| | | public void saveGoodsFlavorType(GoodsFlavorTypeDTO dto) { |
| | | GoodsFlavorType goodsFlavorType = BeanUtils.copyBean(dto, GoodsFlavorType.class); |
| | | if (StringUtils.isNull(dto.getId())) { |
| | | this.save(goodsFlavorType); |
| | | } else { |
| | | this.updateById(goodsFlavorType); |
| | | } |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.goods.service.impl; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsGroupPurchase; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.goods.domain.GoodsGroupPurchase; |
| | | import com.ruoyi.goods.mapper.GoodsGroupPurchaseMapper; |
| | | import com.ruoyi.goods.service.IGoodsGroupPurchaseService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | /** |
| | |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsInfoTitleDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsInfoTitleQuery; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsInfoTitleVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsInfoTitle; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsInfoTitleDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsInfoTitleQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsInfoTitleVO; |
| | | import com.ruoyi.goods.domain.GoodsInfoTitle; |
| | | import com.ruoyi.goods.mapper.GoodsInfoTitleMapper; |
| | | import com.ruoyi.goods.service.IGoodsInfoTitleService; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | .like(StringUtils.isNotEmpty(query.getTitleName()), GoodsInfoTitle::getTitleName, |
| | | query.getTitleName()) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page.getTotal(), page.getPages()); |
| | | } |
| | | // 将查询结果转换为VO对象的分页DTO返回 |
| | | return PageDTO.of(page, GoodsInfoTitleVO.class); |
| | | } |
| | |
| | | package com.ruoyi.goods.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.goods.domain.pojo.GoodsInfoTitleValue; |
| | | import com.ruoyi.goods.domain.GoodsInfoTitleValue; |
| | | import com.ruoyi.goods.mapper.GoodsInfoTitleValueMapper; |
| | | import com.ruoyi.goods.service.IGoodsInfoTitleValueService; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | package com.ruoyi.goods.service.impl; |
| | | |
| | | import com.ruoyi.goods.domain.pojo.GoodsSeckill; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.enums.StartStatusEnum; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeckillDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeckillQuery; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeckillUpd; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSkuInfoDTO; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsSeckillVO; |
| | | import com.ruoyi.goods.domain.GoodsSeckill; |
| | | import com.ruoyi.goods.domain.GoodsSku; |
| | | import com.ruoyi.goods.mapper.GoodsSeckillMapper; |
| | | import com.ruoyi.goods.service.IGoodsSeckillService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.goods.service.IGoodsSkuService; |
| | | import com.ruoyi.system.api.domain.dto.ListStatusDTO; |
| | | import com.ruoyi.system.api.feignClient.OrderClient; |
| | | import java.util.List; |
| | | import java.util.Optional; |
| | | import lombok.RequiredArgsConstructor; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Slf4j |
| | | @Service |
| | | @RequiredArgsConstructor |
| | | public class GoodsSeckillServiceImpl extends ServiceImpl<GoodsSeckillMapper, GoodsSeckill> implements IGoodsSeckillService { |
| | | |
| | | private final IGoodsSkuService goodsSkuService; |
| | | private final OrderClient orderClient; |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addGoodsSeckill(GoodsSeckillDTO dto) { |
| | | List<GoodsSkuInfoDTO> goodsSkuList = dto.getGoodsSkuList(); |
| | | List<GoodsSeckill> goodsSeckills = BeanUtils.copyList(dto.getGoodsSkuList(), |
| | | GoodsSeckill.class); |
| | | for (GoodsSeckill goodsSeckill : goodsSeckills) { |
| | | goodsSeckill.setShareTitle(dto.getShareTitle()); |
| | | goodsSeckill.setSharePic(dto.getSharePic()); |
| | | goodsSeckill.setStartTime(dto.getStartTime()); |
| | | goodsSeckill.setEndTime(dto.getEndTime()); |
| | | goodsSeckill.setStartStatus(StartStatusEnum.NOT_STARTED); |
| | | } |
| | | this.saveBatch(goodsSeckills); |
| | | } |
| | | |
| | | /** |
| | | * 获取秒杀商品列表的分页数据 |
| | | * |
| | | * @param query 秒杀商品查询对象 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public PageDTO<GoodsSeckillVO> getGoodsSeckillPage(GoodsSeckillQuery query) { |
| | | Page<GoodsSeckillVO> page = baseMapper.getGoodsSeckillPage(query.getGoodsSkuName(), |
| | | new Page<GoodsSeckillVO>(query.getPageCurr(), query.getPageSize()) |
| | | ); |
| | | return PageDTO.of(page); |
| | | } |
| | | |
| | | /** |
| | | * 修改秒杀商品 |
| | | * |
| | | * @param upd 商品秒杀数据传输对象 |
| | | */ |
| | | @Override |
| | | public void updGoodsSeckill(GoodsSeckillUpd upd) { |
| | | //查询秒杀商品 |
| | | GoodsSeckill goodsSeckill = this.getById(upd.getId()); |
| | | if (StringUtils.isNull(goodsSeckill)) { |
| | | throw new RuntimeException("秒杀商品不存在"); |
| | | } |
| | | GoodsSeckill goodsSeckillUpd = BeanUtils.copyBean(upd, GoodsSeckill.class); |
| | | this.updateById(goodsSeckillUpd); |
| | | } |
| | | |
| | | /** |
| | | * 上架/下架 秒杀商品 |
| | | * |
| | | * @param dto 商品上下架状态对象 |
| | | */ |
| | | @Override |
| | | public void updStatus(ListStatusDTO dto) { |
| | | this.lambdaUpdate() |
| | | .eq(GoodsSeckill::getId, dto.getId()) |
| | | .set(GoodsSeckill::getListingStatus, dto.getListingStatus()) |
| | | .update(); |
| | | } |
| | | |
| | | @Override |
| | | public GoodsSeckillVO getDetail(Long id) { |
| | | GoodsSeckill goodsSeckill = this.getById(id); |
| | | if (StringUtils.isNull(goodsSeckill)) { |
| | | throw new RuntimeException("秒杀商品不存在"); |
| | | } |
| | | GoodsSeckillVO vo = BeanUtils.copyBean(goodsSeckill, GoodsSeckillVO.class); |
| | | GoodsSku goods = goodsSkuService.getById(goodsSeckill.getGoodsSkuId()); |
| | | Optional.of(goods).ifPresent(goodsSku -> { |
| | | vo.setGoodsSkuName(goodsSku.getSkuName()); |
| | | }); |
| | | Integer num = orderClient.getSeckillMembers(goodsSeckill.getId()).getData(); |
| | | vo.setNumberOfPurchasedMembers(num); |
| | | return vo; |
| | | } |
| | | } |
| | |
| | | package com.ruoyi.goods.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.common.core.utils.StringUtils; |
| | | import com.ruoyi.common.core.utils.page.BeanUtils; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsSeriesVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsSeries; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeriesDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSeriesQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsSeriesVO; |
| | | import com.ruoyi.goods.domain.GoodsSeries; |
| | | import com.ruoyi.goods.mapper.GoodsSeriesMapper; |
| | | import com.ruoyi.goods.service.IGoodsSeriesService; |
| | | import java.util.List; |
| | |
| | | return BeanUtils.copyList(this.list(), GoodsSeriesVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 获取商品系列的分页信息 |
| | | * |
| | | * @param query 包含分页参数和查询条件的查询对象 |
| | | * @return 返回商品系列的分页数据传输对象(DTO),包含分页信息和商品系列列表 |
| | | */ |
| | | @Override |
| | | public PageDTO<GoodsSeriesVO> getGoodsSeriesPage(GoodsSeriesQuery query) { |
| | | Page<GoodsSeries> page = this.lambdaQuery() |
| | | .like(StringUtils.isNotEmpty(query.getSeriesName()), GoodsSeries::getSeriesName, |
| | | query.getSeriesName()) |
| | | .page(new Page<>(query.getPageCurr(), query.getPageSize())); |
| | | if (StringUtils.isEmpty(page.getRecords())) { |
| | | return PageDTO.empty(page.getTotal(), page.getPages()); |
| | | } |
| | | return PageDTO.of(page, GoodsSeriesVO.class); |
| | | } |
| | | |
| | | /** |
| | | * 保存或更新商品系列信息。 |
| | | * |
| | | * @param dto 商品系列数据传输对象,包含商品系列的详细信息。 如果商品系列ID为空,则视为新记录,进行保存; 如果商品系列ID不为空,则视为更新记录,进行更新。 |
| | | */ |
| | | @Override |
| | | public void saveGoodsSeries(GoodsSeriesDTO dto) { |
| | | GoodsSeries goodsSeries = BeanUtils.copyBean(dto, GoodsSeries.class); |
| | | if (StringUtils.isNull(goodsSeries.getId())) { |
| | | this.save(goodsSeries); |
| | | } else { |
| | | this.updateById(goodsSeries); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.common.core.utils.page.Checker; |
| | | import com.ruoyi.common.core.utils.page.CollUtils; |
| | | import com.ruoyi.common.core.utils.page.PageDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsInfoTitleValueDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsSkuDTO; |
| | | import com.ruoyi.goods.controller.mamagement.DTO.GoodsSkuQuery; |
| | | import com.ruoyi.goods.controller.mamagement.VO.GoodsSkuVO; |
| | | import com.ruoyi.goods.domain.pojo.GoodsInfoTitleValue; |
| | | import com.ruoyi.goods.domain.pojo.GoodsSku; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsInfoTitleValueDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSkuDTO; |
| | | import com.ruoyi.goods.controller.management.DTO.GoodsSkuQuery; |
| | | import com.ruoyi.goods.controller.management.VO.GoodsSkuVO; |
| | | import com.ruoyi.goods.domain.GoodsInfoTitleValue; |
| | | import com.ruoyi.goods.domain.GoodsSku; |
| | | import com.ruoyi.goods.mapper.GoodsSkuMapper; |
| | | import com.ruoyi.goods.service.IGoodsInfoTitleValueService; |
| | | import com.ruoyi.goods.service.IGoodsSkuService; |
| | |
| | | <?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.ruoyi.goods.mapper.GoodsSeckillMapper"> |
| | | |
| | | <select id="getGoodsSeckillPage" |
| | | resultType="com.ruoyi.goods.controller.management.VO.GoodsSeckillVO"> |
| | | select |
| | | gs.id, |
| | | gsku.goods_sku_name, |
| | | gs.seckill_price, |
| | | gs.sold_quantity, |
| | | gs.seckill_stock, |
| | | gs.limit_number, |
| | | gs.sort_num, |
| | | gs.share_title, |
| | | gs.share_pic, |
| | | gs.start_time, |
| | | gs.end_time, |
| | | gs.start_status |
| | | from t_goods_seckill gs |
| | | left join t_goods_sku gsku on gs.goods_sku_id = gsku.id |
| | | <where> |
| | | <if test="goodsSkuName != null and goodsSkuName != ''"> |
| | | and gsku.goods_sku_name like concat('%',#{goodsSkuName},'%') |
| | | </if> |
| | | </where> |
| | | order by gs.create_time desc |
| | | </select> |
| | | </mapper> |
| | |
| | | package com.ruoyi.order.controller; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.order.domain.pojo.Order; |
| | | import com.ruoyi.order.service.IOrderService; |
| | | import com.ruoyi.system.api.domain.dto.OrderDTO; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import org.apache.poi.ss.formula.functions.T; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | * @author mitao |
| | | * @since 2024-05-16 |
| | | */ |
| | | @Slf4j |
| | | @RestController |
| | | @RequestMapping("/order") |
| | | @AllArgsConstructor |
| | | public class OrderController { |
| | | @ApiModelProperty |
| | | private IOrderService iOrderService; |
| | | |
| | | private final IOrderService orderService; |
| | | @PostMapping("/saveOrderOne") |
| | | @ResponseBody |
| | | public R<T> saveOrderOne(@RequestBody OrderDTO OrderDTO) { |
| | | iOrderService.saveOrderOne(OrderDTO); |
| | | orderService.saveOrderOne(OrderDTO); |
| | | |
| | | return R.ok(); |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取某个商品的已购会员数 |
| | | * |
| | | * @param id 秒杀商品id |
| | | * @return 已购会员数 |
| | | */ |
| | | @InnerAuth |
| | | @GetMapping("/seckill-members/{id}") |
| | | R<Integer> getSeckillMembers(@PathVariable("id") Long id) { |
| | | return R.ok(orderService.getSeckillMembers(id)); |
| | | } |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "会员id") |
| | | private Long memberId; |
| | | |
| | | @ApiModelProperty(value = "会员姓名") |
| | | private String memberName; |
| | | |
| | | @ApiModelProperty(value = "联系方式") |
| | | private String phoneNumber; |
| | | |
| | | |
| | | @ApiModelProperty(value = "支付方式 1=微信 2=支付宝") |
| | | private PaymentMethodEnum paymentMethod; |
| | | |
| | |
| | | package com.ruoyi.order.mapper; |
| | | |
| | | import com.ruoyi.order.domain.pojo.Order; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.ruoyi.order.domain.pojo.Order; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | public interface OrderMapper extends BaseMapper<Order> { |
| | | |
| | | Integer getSeckillMembers(@Param("id") Long id); |
| | | } |
| | |
| | | |
| | | import com.ruoyi.order.domain.pojo.Order; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.ruoyi.system.api.domain.dto.OrderDTO; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | |
| | | void saveOrderOne(OrderDTO OrderDTO); |
| | | |
| | | Integer getSeckillMembers(Long id); |
| | | } |
| | |
| | | package com.ruoyi.order.service.impl; |
| | | |
| | | import com.ruoyi.common.core.enums.OrderStatusEnum; |
| | | import com.ruoyi.order.domain.pojo.Order; |
| | | import com.ruoyi.order.mapper.OrderMapper; |
| | | import com.ruoyi.order.service.IOrderService; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.order.util.OrderUtil; |
| | | import com.ruoyi.system.api.domain.dto.OrderDTO; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | order.setBound(OrderDTO.getBound()); |
| | | orderService.save(order); |
| | | } |
| | | @Override |
| | | public Integer getSeckillMembers(Long id) { |
| | | return baseMapper.getSeckillMembers(id); |
| | | } |
| | | } |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="com.ruoyi.order.mapper.OrderMapper"> |
| | | |
| | | <select id="getSeckillMembers" resultType="java.lang.Integer"> |
| | | select ifnull(count(1), 0) |
| | | form t_order_mall left om join t_order o |
| | | on om.order_id = o.id |
| | | where om.goods_sku_id = #{id} |
| | | group by o.member_id |
| | | </select> |
| | | </select> |
| | | </mapper> |