diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/device/vo/DeviceSaveReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/device/vo/DeviceSaveReqVO.java index 5832e3b..5759860 100644 --- a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/device/vo/DeviceSaveReqVO.java +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/admin/device/vo/DeviceSaveReqVO.java @@ -20,14 +20,14 @@ public class DeviceSaveReqVO { private String deviceId; @Schema(description = "访问商品地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn") - @NotEmpty(message = "访问商品地址不能为空") +// @NotEmpty(message = "访问商品地址不能为空") private String productUrl; @Schema(description = "文件地址", example = "https://www.iocoder.cn") private String fileUrl; @Schema(description = "当前使用的货道或柜门编号", requiredMode = Schema.RequiredMode.REQUIRED) - @NotEmpty(message = "当前使用的货道或柜门编号不能为空") +// @NotEmpty(message = "当前使用的货道或柜门编号不能为空") private String cabinetChannel; } \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/summary/AppSummaryController.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/summary/AppSummaryController.java new file mode 100644 index 0000000..9fce749 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/summary/AppSummaryController.java @@ -0,0 +1,69 @@ +package cn.iocoder.yudao.module.product.controller.app.summary; + +import cn.hutool.core.collection.CollUtil; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.common.pojo.PageResult; +import cn.iocoder.yudao.framework.common.util.object.BeanUtils; +import cn.iocoder.yudao.module.product.controller.admin.summary.vo.SummaryPageReqVO; +import cn.iocoder.yudao.module.product.controller.admin.summary.vo.SummarySumRespVO; +import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuDetailRespVO; +import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuPageReqVO; +import cn.iocoder.yudao.module.product.controller.app.spu.vo.AppProductSpuRespVO; +import cn.iocoder.yudao.module.product.controller.app.summary.vo.AppSummaryPageReqVO; +import cn.iocoder.yudao.module.product.controller.app.summary.vo.AppSummarySumRespVO; +import cn.iocoder.yudao.module.product.dal.dataobject.sku.ProductSkuDO; +import cn.iocoder.yudao.module.product.dal.dataobject.spu.ProductSpuDO; +import cn.iocoder.yudao.module.product.enums.spu.ProductSpuStatusEnum; +import cn.iocoder.yudao.module.product.service.history.ProductBrowseHistoryService; +import cn.iocoder.yudao.module.product.service.sku.ProductSkuService; +import cn.iocoder.yudao.module.product.service.spu.ProductSpuService; +import cn.iocoder.yudao.module.product.service.summary.SummaryService; +import cn.iocoder.yudao.module.system.api.user.AdminUserApi; +import cn.iocoder.yudao.module.system.api.user.dto.AdminUserRespDTO; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.Parameter; +import io.swagger.v3.oas.annotations.tags.Tag; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; + +import javax.annotation.Resource; +import javax.annotation.security.PermitAll; +import javax.validation.Valid; +import java.util.Collections; +import java.util.List; +import java.util.Set; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success; +import static cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.SPU_NOT_ENABLE; +import static cn.iocoder.yudao.module.product.enums.ErrorCodeConstants.SPU_NOT_EXISTS; + +@Tag(name = "用户 APP - 商品汇总") +@RestController +@RequestMapping("/product/summary") +@Validated +public class AppSummaryController { + + @Resource + private SummaryService summaryService; + + + @GetMapping("/page") + @Operation(summary = "获得商品 SPU 分页") + @PermitAll + public CommonResult> getSpuPage(@Valid SummaryPageReqVO pageVO) { + PageResult pageResult = summaryService.getSummarySumPage(pageVO); + if (CollUtil.isEmpty(pageResult.getList())) { + return success(PageResult.empty(pageResult.getTotal())); + } + return success(pageResult); + } + + + +} diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/summary/vo/AppSummaryPageReqVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/summary/vo/AppSummaryPageReqVO.java new file mode 100644 index 0000000..093f566 --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/summary/vo/AppSummaryPageReqVO.java @@ -0,0 +1,66 @@ +package cn.iocoder.yudao.module.product.controller.app.summary.vo; + +import cn.iocoder.yudao.framework.common.pojo.PageParam; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.ToString; +import org.springframework.format.annotation.DateTimeFormat; + +import java.time.LocalDateTime; + +import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND; + +@Schema(description = "管理后台 - 商品汇总分页 Request VO") +@Data +@EqualsAndHashCode(callSuper = true) +@ToString(callSuper = true) +public class AppSummaryPageReqVO extends PageParam { + + @Schema(description = "商品名称", example = "芋艿") + private String name; + + @Schema(description = "设备IMEI", example = "9908") + private String deviceId; + + @Schema(description = "SKU 的条形码") + private String barCode; + + @Schema(description = "关键字") + private String keyword; + + @Schema(description = "商品简介") + private String introduction; + + @Schema(description = "商品详情", example = "你猜") + private String description; + + @Schema(description = "商品分类编号", example = "20893") + private Long categoryId; + + @Schema(description = "商品品牌编号", example = "29100") + private Integer brandId; + + @Schema(description = "商品封面图", example = "https://www.iocoder.cn") + private String picUrl; + + @Schema(description = "商品轮播图地址数组,以逗号分隔 最多上传15张") + private String sliderPicUrls; + + @Schema(description = "排序字段") + private Integer sort; + + @Schema(description = "商品价格,单位使用:分", example = "11271") + private Integer price; + + @Schema(description = "市场价,单位使用:分", example = "27021") + private Integer marketPrice; + + @Schema(description = "成本价,单位: 分", example = "17204") + private Integer costPrice; + + @Schema(description = "创建时间") + @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND) + private LocalDateTime[] createTime; + +} \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/summary/vo/AppSummarySumRespVO.java b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/summary/vo/AppSummarySumRespVO.java new file mode 100644 index 0000000..183b75d --- /dev/null +++ b/yudao-module-mall/yudao-module-product-biz/src/main/java/cn/iocoder/yudao/module/product/controller/app/summary/vo/AppSummarySumRespVO.java @@ -0,0 +1,87 @@ +package cn.iocoder.yudao.module.product.controller.app.summary.vo; + +import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; +import com.alibaba.excel.annotation.ExcelProperty; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import java.time.LocalDateTime; + +@Schema(description = "管理后台 - 商品汇总 Response VO") +@Data +@ExcelIgnoreUnannotated +public class AppSummarySumRespVO { + + @Schema(description = "商品编号,自增", requiredMode = Schema.RequiredMode.REQUIRED, example = "14448") + @ExcelProperty("商品编号,自增") + private Long id; + + @Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "芋艿") + @ExcelProperty("商品名称") + private String name; + + @Schema(description = "设备IMEI", requiredMode = Schema.RequiredMode.REQUIRED, example = "9908") + @ExcelProperty("设备IMEI") + private String deviceId; + + @Schema(description = "SKU 的条形码", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("SKU 的条形码") + private String barCode; + + @Schema(description = "关键字") + @ExcelProperty("关键字") + private String keyword; + + @Schema(description = "商品简介") + @ExcelProperty("商品简介") + private String introduction; + + @Schema(description = "商品详情", example = "你猜") + @ExcelProperty("商品详情") + private String description; + + @Schema(description = "商品分类编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "20893") + @ExcelProperty("商品分类编号") + private Long categoryId; + + @Schema(description = "商品品牌编号", example = "29100") + @ExcelProperty("商品品牌编号") + private Integer brandId; + + @Schema(description = "商品封面图", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.iocoder.cn") + @ExcelProperty("商品封面图") + private String picUrl; + + @Schema(description = "商品轮播图地址数组,以逗号分隔 最多上传15张") + @ExcelProperty("商品轮播图地址数组,以逗号分隔 最多上传15张") + private String sliderPicUrls; + + @Schema(description = "排序字段", requiredMode = Schema.RequiredMode.REQUIRED) + @ExcelProperty("排序字段") + private Integer sort; + + @Schema(description = "商品价格,单位使用:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "11271") + @ExcelProperty("商品价格,单位使用:分") + private Integer price; + + @Schema(description = "市场价,单位使用:分", example = "27021") + @ExcelProperty("市场价,单位使用:分") + private Integer marketPrice; + + @Schema(description = "成本价,单位: 分", requiredMode = Schema.RequiredMode.REQUIRED, example = "17204") + @ExcelProperty("成本价,单位: 分") + private Integer costPrice; + + @Schema(description = "创建时间") + @ExcelProperty("创建时间") + private LocalDateTime createTime; + + @Schema(description = "库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "666") + @ExcelProperty("库存") + private Integer stock; + + @Schema(description = "商品销量", requiredMode = Schema.RequiredMode.REQUIRED, example = "1024") + @ExcelProperty("商品销量") + private Integer salesCount; + +} \ No newline at end of file