Browse Source

平台审核商品申请

Yangzw 7 months ago
parent
commit
863bed9c16
43 changed files with 2357 additions and 44 deletions
  1. 25 0
      feifan-module-mall/feifan-module-product-api/src/main/java/cn/newfeifan/mall/module/product/enums/spu/SpuApplyCheckStatusEnum.java
  2. 94 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/skuapply/SkuApplyController.java
  3. 82 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/skuapply/vo/SkuApplyPageReqVO.java
  4. 102 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/skuapply/vo/SkuApplyRespVO.java
  5. 77 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/skuapply/vo/SkuApplySaveReqVO.java
  6. 0 5
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spu/vo/ProductSkuSaveReqVO.java
  7. 4 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spu/vo/ProductSpuPageReqVO.java
  8. 3 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spu/vo/ProductSpuSaveReqVO.java
  9. 77 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapply/SpuApplyController.java
  10. 134 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapply/vo/SpuApplyPageReqVO.java
  11. 171 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapply/vo/SpuApplyRespVO.java
  12. 126 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapply/vo/SpuApplySaveReqVO.java
  13. 94 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapplylog/SpuApplyLogController.java
  14. 36 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapplylog/vo/SpuApplyLogPageReqVO.java
  15. 41 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapplylog/vo/SpuApplyLogRespVO.java
  16. 32 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapplylog/vo/SpuApplyLogSaveReqVO.java
  17. 39 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/convert/spuapply/SpuApplyConvert.java
  18. 109 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/dataobject/skuapply/SkuApplyDO.java
  19. 10 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/dataobject/spu/ProductSpuDO.java
  20. 176 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/dataobject/spuapply/SpuApplyDO.java
  21. 48 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/dataobject/spuapplylog/SpuApplyLogDO.java
  22. 49 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/mysql/skuapply/SkuApplyMapper.java
  23. 150 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/mysql/spuapply/SpuApplyMapper.java
  24. 29 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/mysql/spuapplylog/SpuApplyLogMapper.java
  25. 61 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/skuapply/SkuApplyService.java
  26. 77 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/skuapply/SkuApplyServiceImpl.java
  27. 7 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuService.java
  28. 33 9
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuServiceImpl.java
  29. 73 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spuapply/SpuApplyService.java
  30. 177 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spuapply/SpuApplyServiceImpl.java
  31. 53 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spuapplylog/SpuApplyLogService.java
  32. 70 0
      feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spuapplylog/SpuApplyLogServiceImpl.java
  33. 12 0
      feifan-module-mall/feifan-module-product-biz/src/main/resources/mapper/skuapply/SkuApplyMapper.xml
  34. 12 0
      feifan-module-mall/feifan-module-product-biz/src/main/resources/mapper/spuapply/SpuApplyMapper.xml
  35. 12 0
      feifan-module-mall/feifan-module-product-biz/src/main/resources/mapper/spuapplylog/SpuApplyLogMapper.xml
  36. 6 22
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/merchantapplylog/MerchantApplyLogController.java
  37. 3 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/merchantapplylog/vo/MerchantApplyLogRespVO.java
  38. 17 0
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/service/merchantapply/MerchantApplyServiceImpl.java
  39. 2 1
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/service/merchantapplylog/MerchantApplyLogService.java
  40. 23 7
      feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/service/merchantapplylog/MerchantApplyLogServiceImpl.java
  41. 5 0
      feifan-module-system/feifan-module-system-api/src/main/java/cn/newfeifan/mall/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java
  42. 3 0
      feifan-module-system/feifan-module-system-api/src/main/java/cn/newfeifan/mall/module/system/enums/sms/SmsSceneEnum.java
  43. 3 0
      feifan-module-system/feifan-module-system-biz/src/main/java/cn/newfeifan/mall/module/system/service/sms/SmsCodeServiceImpl.java

+ 25 - 0
feifan-module-mall/feifan-module-product-api/src/main/java/cn/newfeifan/mall/module/product/enums/spu/SpuApplyCheckStatusEnum.java

@@ -0,0 +1,25 @@
+package cn.newfeifan.mall.module.product.enums.spu;
+
+import lombok.AllArgsConstructor;
+import lombok.Getter;
+
+/**
+ * 商品申请审核状态表
+ */
+
+@Getter
+@AllArgsConstructor
+public enum SpuApplyCheckStatusEnum {
+
+
+    WAIT_CHECK(0, "待审核"),
+
+    CHECK_PASS(1, "审核通过"),
+
+    CHECK_FAIL(2, "审核不通过"),
+    ;
+
+
+    private final Integer status;
+    private final String mark;
+}

+ 94 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/skuapply/SkuApplyController.java

@@ -0,0 +1,94 @@
+package cn.newfeifan.mall.module.product.controller.admin.skuapply;
+
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
+
+import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
+import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
+
+import cn.newfeifan.mall.module.product.controller.admin.skuapply.vo.*;
+import cn.newfeifan.mall.module.product.dal.dataobject.skuapply.SkuApplyDO;
+import cn.newfeifan.mall.module.product.service.skuapply.SkuApplyService;
+
+@Tag(name = "管理后台 - 商品sku申请")
+@RestController
+@RequestMapping("/product/sku-apply")
+@Validated
+public class SkuApplyController {
+
+    @Resource
+    private SkuApplyService skuApplyService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建商品sku申请")
+    @PreAuthorize("@ss.hasPermission('product:sku-apply:create')")
+    public CommonResult<Long> createSkuApply(@Valid @RequestBody SkuApplySaveReqVO createReqVO) {
+        return success(skuApplyService.createSkuApply(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新商品sku申请")
+    @PreAuthorize("@ss.hasPermission('product:sku-apply:update')")
+    public CommonResult<Boolean> updateSkuApply(@Valid @RequestBody SkuApplySaveReqVO updateReqVO) {
+        skuApplyService.updateSkuApply(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除商品sku申请")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('product:sku-apply:delete')")
+    public CommonResult<Boolean> deleteSkuApply(@RequestParam("id") Long id) {
+        skuApplyService.deleteSkuApply(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得商品sku申请")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('product:sku-apply:query')")
+    public CommonResult<SkuApplyRespVO> getSkuApply(@RequestParam("id") Long id) {
+        SkuApplyDO skuApply = skuApplyService.getSkuApply(id);
+        return success(BeanUtils.toBean(skuApply, SkuApplyRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得商品sku申请分页")
+    @PreAuthorize("@ss.hasPermission('product:sku-apply:query')")
+    public CommonResult<PageResult<SkuApplyRespVO>> getSkuApplyPage(@Valid SkuApplyPageReqVO pageReqVO) {
+        PageResult<SkuApplyDO> pageResult = skuApplyService.getSkuApplyPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, SkuApplyRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出商品sku申请 Excel")
+    @PreAuthorize("@ss.hasPermission('product:sku-apply:export')")
+    @OperateLog(type = EXPORT)
+    public void exportSkuApplyExcel(@Valid SkuApplyPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<SkuApplyDO> list = skuApplyService.getSkuApplyPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "商品sku申请.xls", "数据", SkuApplyRespVO.class,
+                        BeanUtils.toBean(list, SkuApplyRespVO.class));
+    }
+
+}

+ 82 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/skuapply/vo/SkuApplyPageReqVO.java

@@ -0,0 +1,82 @@
+package cn.newfeifan.mall.module.product.controller.admin.skuapply.vo;
+
+import lombok.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 商品sku申请分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class SkuApplyPageReqVO extends PageParam {
+
+    @Schema(description = "spu编号", example = "9866")
+    private Long spuApplyId;
+
+    @Schema(description = "属性数组,JSON 格式 [{propertId: , valueId: }, {propertId: , valueId: }]")
+    private String properties;
+
+    @Schema(description = "商品价格,单位:分", example = "24705")
+    private Integer price;
+
+    @Schema(description = "推广费, 单位: 分")
+    private Integer promotionFee;
+
+    @Schema(description = "备注")
+    private String mark;
+
+    @Schema(description = "市场价,单位:分", example = "24117")
+    private Integer marketPrice;
+
+    @Schema(description = "成本价,单位: 分", example = "21015")
+    private Integer costPrice;
+
+    @Schema(description = "SKU 的条形码")
+    private String barCode;
+
+    @Schema(description = "图片地址", example = "https://www.zhongxing.cn")
+    private String picUrl;
+
+    @Schema(description = "库存")
+    private Integer stock;
+
+    @Schema(description = "商品重量,单位:kg 千克")
+    private Double weight;
+
+    @Schema(description = "商品体积,单位:m^3 平米")
+    private Double volume;
+
+    @Schema(description = "一级分销的佣金,单位:分", example = "7462")
+    private Integer firstBrokeragePrice;
+
+    @Schema(description = "二级分销的佣金,单位:分", example = "32532")
+    private Integer secondBrokeragePrice;
+
+    @Schema(description = "商品销量", example = "7812")
+    private Integer salesCount;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+    @Schema(description = "店铺id", example = "25567")
+    private Long shopId;
+
+    @Schema(description = "商户id", example = "9994")
+    private Long merchantId;
+
+    @Schema(description = "高精度价格", example = "15815")
+    private BigDecimal highPrecisionPrice;
+
+    @Schema(description = "结算价,单位: 分", example = "21066")
+    private Integer settlementPrice;
+
+    @Schema(description = "高精度结算价", example = "1872")
+    private BigDecimal highPrecisionSettlementPrice;
+
+}

+ 102 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/skuapply/vo/SkuApplyRespVO.java

@@ -0,0 +1,102 @@
+package cn.newfeifan.mall.module.product.controller.admin.skuapply.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 商品sku申请 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class SkuApplyRespVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8231")
+    @ExcelProperty("主键")
+    private Long id;
+
+    @Schema(description = "spu编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "9866")
+    @ExcelProperty("spu编号")
+    private Long spuApplyId;
+
+    @Schema(description = "属性数组,JSON 格式 [{propertId: , valueId: }, {propertId: , valueId: }]")
+    @ExcelProperty("属性数组,JSON 格式 [{propertId: , valueId: }, {propertId: , valueId: }]")
+    private String properties;
+
+    @Schema(description = "商品价格,单位:分", example = "24705")
+    @ExcelProperty("商品价格,单位:分")
+    private Integer price;
+
+    @Schema(description = "推广费, 单位: 分")
+    @ExcelProperty("推广费, 单位: 分")
+    private Integer promotionFee;
+
+    @Schema(description = "备注")
+    @ExcelProperty("备注")
+    private String mark;
+
+    @Schema(description = "市场价,单位:分", example = "24117")
+    @ExcelProperty("市场价,单位:分")
+    private Integer marketPrice;
+
+    @Schema(description = "成本价,单位: 分", example = "21015")
+    @ExcelProperty("成本价,单位: 分")
+    private Integer costPrice;
+
+    @Schema(description = "SKU 的条形码")
+    @ExcelProperty("SKU 的条形码")
+    private String barCode;
+
+    @Schema(description = "图片地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.zhongxing.cn")
+    @ExcelProperty("图片地址")
+    private String picUrl;
+
+    @Schema(description = "库存")
+    @ExcelProperty("库存")
+    private Integer stock;
+
+    @Schema(description = "商品重量,单位:kg 千克")
+    @ExcelProperty("商品重量,单位:kg 千克")
+    private Double weight;
+
+    @Schema(description = "商品体积,单位:m^3 平米")
+    @ExcelProperty("商品体积,单位:m^3 平米")
+    private Double volume;
+
+    @Schema(description = "一级分销的佣金,单位:分", example = "7462")
+    @ExcelProperty("一级分销的佣金,单位:分")
+    private Integer firstBrokeragePrice;
+
+    @Schema(description = "二级分销的佣金,单位:分", example = "32532")
+    @ExcelProperty("二级分销的佣金,单位:分")
+    private Integer secondBrokeragePrice;
+
+    @Schema(description = "商品销量", example = "7812")
+    @ExcelProperty("商品销量")
+    private Integer salesCount;
+
+    @Schema(description = "创建时间")
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    @Schema(description = "店铺id", example = "25567")
+    @ExcelProperty("店铺id")
+    private Long shopId;
+
+    @Schema(description = "商户id", example = "9994")
+    @ExcelProperty("商户id")
+    private Long merchantId;
+
+    @Schema(description = "高精度价格", example = "15815")
+    @ExcelProperty("高精度价格")
+    private BigDecimal highPrecisionPrice;
+
+    @Schema(description = "结算价,单位: 分", example = "21066")
+    @ExcelProperty("结算价,单位: 分")
+    private Integer settlementPrice;
+
+    @Schema(description = "高精度结算价", example = "1872")
+    @ExcelProperty("高精度结算价")
+    private BigDecimal highPrecisionSettlementPrice;
+
+}

+ 77 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/skuapply/vo/SkuApplySaveReqVO.java

@@ -0,0 +1,77 @@
+package cn.newfeifan.mall.module.product.controller.admin.skuapply.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import javax.validation.constraints.*;
+import java.math.BigDecimal;
+
+@Schema(description = "管理后台 - 商品sku申请新增/修改 Request VO")
+@Data
+public class SkuApplySaveReqVO {
+
+    @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "8231")
+    private Long id;
+
+    @Schema(description = "spu编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "9866")
+    @NotNull(message = "spu编号不能为空")
+    private Long spuApplyId;
+
+    @Schema(description = "属性数组,JSON 格式 [{propertId: , valueId: }, {propertId: , valueId: }]")
+    private String properties;
+
+    @Schema(description = "商品价格,单位:分", example = "24705")
+    private Integer price;
+
+    @Schema(description = "推广费, 单位: 分")
+    private Integer promotionFee;
+
+    @Schema(description = "备注")
+    private String mark;
+
+    @Schema(description = "市场价,单位:分", example = "24117")
+    private Integer marketPrice;
+
+    @Schema(description = "成本价,单位: 分", example = "21015")
+    private Integer costPrice;
+
+    @Schema(description = "SKU 的条形码")
+    private String barCode;
+
+    @Schema(description = "图片地址", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.zhongxing.cn")
+    @NotEmpty(message = "图片地址不能为空")
+    private String picUrl;
+
+    @Schema(description = "库存")
+    private Integer stock;
+
+    @Schema(description = "商品重量,单位:kg 千克")
+    private Double weight;
+
+    @Schema(description = "商品体积,单位:m^3 平米")
+    private Double volume;
+
+    @Schema(description = "一级分销的佣金,单位:分", example = "7462")
+    private Integer firstBrokeragePrice;
+
+    @Schema(description = "二级分销的佣金,单位:分", example = "32532")
+    private Integer secondBrokeragePrice;
+
+    @Schema(description = "商品销量", example = "7812")
+    private Integer salesCount;
+
+    @Schema(description = "店铺id", example = "25567")
+    private Long shopId;
+
+    @Schema(description = "商户id", example = "9994")
+    private Long merchantId;
+
+    @Schema(description = "高精度价格", example = "15815")
+    private BigDecimal highPrecisionPrice;
+
+    @Schema(description = "结算价,单位: 分", example = "21066")
+    private Integer settlementPrice;
+
+    @Schema(description = "高精度结算价", example = "1872")
+    private BigDecimal highPrecisionSettlementPrice;
+
+}

+ 0 - 5
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spu/vo/ProductSkuSaveReqVO.java

@@ -5,7 +5,6 @@ import lombok.AllArgsConstructor;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 
-import javax.validation.constraints.NotEmpty;
 import javax.validation.constraints.NotNull;
 import java.math.BigDecimal;
 import java.util.List;
@@ -14,10 +13,6 @@ import java.util.List;
 @Data
 public class ProductSkuSaveReqVO {
 
-    @Schema(description = "商品 SKU 名字", requiredMode = Schema.RequiredMode.REQUIRED, example = "清凉小短袖")
-    @NotEmpty(message = "商品 SKU 名字不能为空")
-    private String name;
-
     @Schema(description = "销售价格,单位:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "1999")
     private Integer price;
 

+ 4 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spu/vo/ProductSpuPageReqVO.java

@@ -18,6 +18,10 @@ import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR
 @EqualsAndHashCode(callSuper = true)
 @ToString(callSuper = true)
 public class ProductSpuPageReqVO extends PageParam {
+    /**
+     * 待审核商品
+     */
+    public static final Integer APPLY_SPU = -1;
 
     /**
      * 出售中商品

+ 3 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spu/vo/ProductSpuSaveReqVO.java

@@ -117,4 +117,7 @@ public class ProductSpuSaveReqVO {
     @NotNull(message = "高精度不能为空")
     private Boolean highPrecision;
 
+    @Schema(description = "商品申请id", example = "26655")
+    private Long spuApplyId;
+
 }

+ 77 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapply/SpuApplyController.java

@@ -0,0 +1,77 @@
+package cn.newfeifan.mall.module.product.controller.admin.spuapply;
+
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.*;
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.module.product.controller.admin.spuapply.vo.*;
+import cn.newfeifan.mall.module.product.dal.dataobject.spuapply.SpuApplyDO;
+import cn.newfeifan.mall.module.product.service.spuapply.SpuApplyService;
+
+@Tag(name = "管理后台 - 商品spu申请")
+@RestController
+@RequestMapping("/product/spu-apply")
+@Validated
+public class SpuApplyController {
+
+    @Resource
+    private SpuApplyService spuApplyService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建商品spu申请")
+    @PreAuthorize("@ss.hasPermission('product:spu:create')")
+    public CommonResult<Long> createSpuApply(@Valid @RequestBody SpuApplySaveReqVO createReqVO) {
+        return success(spuApplyService.createSpuApply(createReqVO));
+    }
+
+    @PutMapping("/update-checkStatus")
+    @Operation(summary = "更新商品spu申请")
+    @PreAuthorize("@ss.hasPermission('product:spu-apply:update')")
+    public CommonResult<Boolean> updateSpuApplyByCheckStatus(@Valid @RequestBody SpuApplySaveReqVO updateReqVO) {
+        spuApplyService.updateSpuApplyByCheckStatus(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除商品spu申请")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('product:spu:delete')")
+    public CommonResult<Boolean> deleteSpuApply(@RequestParam("id") Long id) {
+        spuApplyService.deleteSpuApply(id);
+        return success(true);
+    }
+
+    @GetMapping("/get-detail")
+    @Operation(summary = "获得商品 spu 申请 明细")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('product:spu:query')")
+    public CommonResult<SpuApplyRespVO> getSpuApply(@RequestParam("id") Long id) {
+        return success(spuApplyService.getSpuApplyDetail(id));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得商品spu申请分页")
+    @PreAuthorize("@ss.hasPermission('product:spu:query')")
+    public CommonResult<PageResult<SpuApplyRespVO>> getSpuApplyPage(@Valid SpuApplyPageReqVO pageReqVO) {
+        PageResult<SpuApplyDO> pageResult = spuApplyService.getSpuApplyPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, SpuApplyRespVO.class));
+    }
+    @GetMapping("/getSpuTotal")
+    @Operation(summary = "获得商品spu申请数量")
+    @PreAuthorize("@ss.hasPermission('product:spu:query')")
+    public CommonResult<Long> getSpuApplyTotal() {
+        return success(spuApplyService.getSpuApplyTotal());
+    }
+
+}

+ 134 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapply/vo/SpuApplyPageReqVO.java

@@ -0,0 +1,134 @@
+package cn.newfeifan.mall.module.product.controller.admin.spuapply.vo;
+
+import lombok.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import java.math.BigDecimal;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.newfeifan.mall.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
+
+@Schema(description = "管理后台 - 商品spu申请分页 Request VO")
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+public class SpuApplyPageReqVO extends PageParam {
+
+    @Schema(description = "商品名称", example = "非繁人")
+    private String name;
+
+    @Schema(description = "关键字")
+    private String keyword;
+
+    @Schema(description = "商品简介")
+    private String introduction;
+
+    @Schema(description = "商品详情", example = "你猜")
+    private String description;
+
+    @Schema(description = "产地")
+    private String producerArea;
+
+    @Schema(description = "商品类别", example = "2")
+    private Integer spuType;
+
+    @Schema(description = "商品分类编号", example = "1734")
+    private Long categoryId;
+
+    @Schema(description = "商品品牌编号", example = "4607")
+    private Integer brandId;
+
+    @Schema(description = "商品封面图", example = "https://www.zhongxing.cn")
+    private String picUrl;
+
+    @Schema(description = "商品轮播图地址数组,以逗号分隔最多上传15张")
+    private String sliderPicUrls;
+
+    @Schema(description = "排序字段")
+    private Integer sort;
+
+    @Schema(description = "商品状态: 0 上架(开启) 1 下架(禁用)-1 回收", example = "1")
+    private Integer status;
+
+    @Schema(description = "规格类型:0 单规格 1 多规格", example = "2")
+    private Boolean specType;
+
+    @Schema(description = "商品价格,单位使用:分", example = "2808")
+    private Integer price;
+
+    @Schema(description = "市场价,单位使用:分", example = "7922")
+    private Integer marketPrice;
+
+    @Schema(description = "成本价,单位: 分", example = "17622")
+    private Integer costPrice;
+
+    @Schema(description = "库存")
+    private Integer stock;
+
+    @Schema(description = "配送方式数组")
+    private String deliveryTypes;
+
+    @Schema(description = "物流配置模板编号", example = "3169")
+    private Long deliveryTemplateId;
+
+    @Schema(description = "赠送积分")
+    private Integer giveIntegral;
+
+    @Schema(description = "分销类型", example = "1")
+    private Boolean subCommissionType;
+
+    @Schema(description = "商品销量", example = "231")
+    private Integer salesCount;
+
+    @Schema(description = "虚拟销量", example = "24880")
+    private Integer virtualSalesCount;
+
+    @Schema(description = "商品点击量", example = "18493")
+    private Integer browseCount;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+    @Schema(description = "店铺id", example = "19626")
+    private Long shopId;
+
+    @Schema(description = "商户id", example = "14569")
+    private Long merchantId;
+
+    @Schema(description = "是否隐藏。隐藏:1,不隐藏:0")
+    private Boolean hidden;
+
+    @Schema(description = "推广费, 单位: 分,值为sku中最大的推广费")
+    private Integer promotionFee;
+
+    @Schema(description = "商品支付类别(1 rmb 2积分)", example = "1")
+    private Integer spuPayType;
+
+    @Schema(description = "高精度")
+    private Boolean highPrecision;
+
+    @Schema(description = "高精度价格", example = "23692")
+    private BigDecimal highPrecisionPrice;
+
+    @Schema(description = "申请用户id", example = "22602")
+    private Long applyMemberUserId;
+
+    @Schema(description = "审核系统用户id", example = "22820")
+    private Long checkSystemUserId;
+
+    @Schema(description = "审核时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] checkTime;
+
+    @Schema(description = "审核意见")
+    private String checkComment;
+
+    @Schema(description = "审核状态:默认0表示未审核,1审核通过,2审核不通过", example = "1")
+    private Integer checkStatus;
+
+    @Schema(description = "前端请求的tab类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    private Integer tabType;
+
+}

+ 171 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapply/vo/SpuApplyRespVO.java

@@ -0,0 +1,171 @@
+package cn.newfeifan.mall.module.product.controller.admin.spuapply.vo;
+
+import cn.newfeifan.mall.framework.excel.core.annotations.DictFormat;
+import cn.newfeifan.mall.framework.excel.core.convert.DictConvert;
+import cn.newfeifan.mall.framework.excel.core.convert.MoneyConvert;
+import cn.newfeifan.mall.module.product.controller.admin.skuapply.vo.SkuApplyRespVO;
+import cn.newfeifan.mall.module.product.enums.DictTypeConstants;
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.util.*;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 商品spu申请 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class SpuApplyRespVO {
+
+    @Schema(description = "商品 SPU 编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "111")
+    @ExcelProperty("商品编号")
+    private Long id;
+
+    @Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "清凉小短袖")
+    @ExcelProperty("商品名称")
+    private String name;
+
+    @Schema(description = "关键字", requiredMode = Schema.RequiredMode.REQUIRED, example = "清凉丝滑不出汗")
+    @ExcelProperty("关键字")
+    private String keyword;
+
+    @Schema(description = "商品简介", requiredMode = Schema.RequiredMode.REQUIRED, example = "清凉小短袖简介")
+    @ExcelProperty("商品简介")
+    private String introduction;
+
+    @Schema(description = "商品详情", requiredMode = Schema.RequiredMode.REQUIRED, example = "清凉小短袖详情")
+    @ExcelProperty("商品详情")
+    private String description;
+
+    @Schema(description = "商品分类编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("商品分类编号")
+    private Long categoryId;
+
+    @Schema(description = "商品品牌编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("商品品牌编号")
+    private Long brandId;
+
+    @Schema(description = "商品封面图", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.zhongxing.cn/xx.png")
+    @ExcelProperty("商品封面图")
+    private String picUrl;
+
+    @Schema(description = "商品轮播图", requiredMode = Schema.RequiredMode.REQUIRED, example = "[https://www.zhongxing.cn/xx.png, https://www.zhongxing.cn/xxx.png]")
+    private List<String> sliderPicUrls;
+
+    @Schema(description = "排序字段", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("排序字段")
+    private Integer sort;
+
+    @Schema(description = "商品状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty(value = "商品状态", converter = DictConvert.class)
+    @DictFormat(DictTypeConstants.PRODUCT_SPU_STATUS)
+    private Integer status;
+
+    @Schema(description = "商品创建时间", requiredMode = Schema.RequiredMode.REQUIRED, example = "2023-05-24 00:00:00")
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+    // ========== SKU 相关字段 =========
+
+    @Schema(description = "规格类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
+    @ExcelProperty("规格类型")
+    private Boolean specType;
+
+    @Schema(description = "商品价格", requiredMode = Schema.RequiredMode.REQUIRED, example = "1999")
+    @ExcelProperty(value = "商品价格", converter = MoneyConvert.class)
+    private Integer price;
+
+    @Schema(description = "市场价,单位使用:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "199")
+    @ExcelProperty(value = "市场价", converter = MoneyConvert.class)
+    private Integer marketPrice;
+
+    @Schema(description = "成本价,单位使用:分", requiredMode = Schema.RequiredMode.REQUIRED, example = "19")
+    @ExcelProperty(value = "成本价", converter = MoneyConvert.class)
+    private Integer costPrice;
+
+    @Schema(description = "商品库存", requiredMode = Schema.RequiredMode.REQUIRED, example = "10000")
+    @ExcelProperty("库存")
+    private Integer stock;
+
+    @Schema(description = "SKU 数组")
+    private List<SkuApplyRespVO> skus;
+
+    // ========== 物流相关字段 =========
+
+    @Schema(description = "配送方式数组", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    private List<Integer> deliveryTypes;
+
+    @Schema(description = "物流配置模板编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "111")
+    @ExcelProperty("物流配置模板编号")
+    private Long deliveryTemplateId;
+
+    // ========== 营销相关字段 =========
+
+    @Schema(description = "赠送积分", requiredMode = Schema.RequiredMode.REQUIRED, example = "111")
+    @ExcelProperty("赠送积分")
+    private Integer giveIntegral;
+
+    @Schema(description = "分销类型", requiredMode = Schema.RequiredMode.REQUIRED, example = "true")
+    @ExcelProperty("分销类型")
+    private Boolean subCommissionType;
+
+    // ========== 统计相关字段 =========
+
+    @Schema(description = "商品销量", requiredMode = Schema.RequiredMode.REQUIRED, example = "2000")
+    @ExcelProperty("商品销量")
+    private Integer salesCount;
+
+    @Schema(description = "虚拟销量", example = "66")
+    @ExcelProperty("虚拟销量")
+    private Integer virtualSalesCount;
+
+    @Schema(description = "浏览量", requiredMode = Schema.RequiredMode.REQUIRED, example = "888")
+    @ExcelProperty("商品点击量")
+    private Integer browseCount;
+
+    @Schema(description = "产地")
+    private String producerArea;
+
+    @Schema(description = "商品类别", example = "1")
+    private Integer spuType;
+
+    @Schema(description = "店铺id", example = "20588")
+    private Long shopId;
+
+    @Schema(description = "店铺名称", example = "中星温暖")
+    private String shopName;
+
+    @Schema(description = "商户id", example = "8240")
+    private Long merchantId;
+    @Schema(description = "商品支付类别")
+    private Integer spuPayType;
+
+    @Schema(description = "高精度", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("高精度")
+    private Boolean highPrecision;
+
+    @Schema(description = "高精度价格", example = "9255")
+    @ExcelProperty("高精度价格")
+    private BigDecimal highPrecisionPrice;
+
+    @Schema(description = "申请用户id", example = "22602")
+    @ExcelProperty("申请用户id")
+    private Long applyMemberUserId;
+
+    @Schema(description = "审核系统用户id", example = "22820")
+    @ExcelProperty("审核系统用户id")
+    private Long checkSystemUserId;
+
+    @Schema(description = "审核时间")
+    @ExcelProperty("审核时间")
+    private LocalDateTime checkTime;
+
+    @Schema(description = "审核意见")
+    @ExcelProperty("审核意见")
+    private String checkComment;
+
+    @Schema(description = "审核状态:默认0表示未审核,1审核通过,2审核不通过", example = "1")
+    @ExcelProperty("审核状态:默认0表示未审核,1审核通过,2审核不通过")
+    private Integer checkStatus;
+
+}

+ 126 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapply/vo/SpuApplySaveReqVO.java

@@ -0,0 +1,126 @@
+package cn.newfeifan.mall.module.product.controller.admin.spuapply.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import javax.validation.constraints.*;
+import java.math.BigDecimal;
+import java.time.LocalDateTime;
+
+@Schema(description = "管理后台 - 商品spu申请新增/修改 Request VO")
+@Data
+public class SpuApplySaveReqVO {
+
+    @Schema(description = "商品 SPU 编号,自增", requiredMode = Schema.RequiredMode.REQUIRED, example = "9874")
+    @NotNull(message = "商品 SPU 申请 编号不能为空")
+    private Long id;
+
+    @Schema(description = "商品名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "非繁人")
+    private String name;
+
+    @Schema(description = "关键字")
+    private String keyword;
+
+    @Schema(description = "商品简介")
+    private String introduction;
+
+    @Schema(description = "商品详情", example = "你猜")
+    private String description;
+
+    @Schema(description = "产地")
+    private String producerArea;
+
+    @Schema(description = "商品类别", example = "2")
+    private Integer spuType;
+
+    @Schema(description = "商品分类编号", requiredMode = Schema.RequiredMode.REQUIRED, example = "1734")
+    private Long categoryId;
+
+    @Schema(description = "商品品牌编号", example = "4607")
+    private Integer brandId;
+
+    @Schema(description = "商品封面图", requiredMode = Schema.RequiredMode.REQUIRED, example = "https://www.zhongxing.cn")
+    private String picUrl;
+
+    @Schema(description = "商品轮播图地址数组,以逗号分隔最多上传15张")
+    private String sliderPicUrls;
+
+    @Schema(description = "排序字段", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Integer sort;
+
+    @Schema(description = "商品状态: 0 上架(开启) 1 下架(禁用)-1 回收", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    private Integer status;
+
+    @Schema(description = "规格类型:0 单规格 1 多规格", example = "2")
+    private Boolean specType;
+
+    @Schema(description = "商品价格,单位使用:分", example = "2808")
+    private Integer price;
+
+    @Schema(description = "市场价,单位使用:分", example = "7922")
+    private Integer marketPrice;
+
+    @Schema(description = "成本价,单位: 分", example = "17622")
+    private Integer costPrice;
+
+    @Schema(description = "库存", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Integer stock;
+
+    @Schema(description = "配送方式数组", requiredMode = Schema.RequiredMode.REQUIRED)
+    private String deliveryTypes;
+
+    @Schema(description = "物流配置模板编号", example = "3169")
+    private Long deliveryTemplateId;
+
+    @Schema(description = "赠送积分", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Integer giveIntegral;
+
+    @Schema(description = "分销类型", example = "1")
+    private Boolean subCommissionType;
+
+    @Schema(description = "商品销量", example = "231")
+    private Integer salesCount;
+
+    @Schema(description = "虚拟销量", example = "24880")
+    private Integer virtualSalesCount;
+
+    @Schema(description = "商品点击量", example = "18493")
+    private Integer browseCount;
+
+    @Schema(description = "店铺id", example = "19626")
+    private Long shopId;
+
+    @Schema(description = "商户id", example = "14569")
+    private Long merchantId;
+
+    @Schema(description = "是否隐藏。隐藏:1,不隐藏:0", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Boolean hidden;
+
+    @Schema(description = "推广费, 单位: 分,值为sku中最大的推广费")
+    private Integer promotionFee;
+
+    @Schema(description = "商品支付类别(1 rmb 2积分)", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    private Integer spuPayType;
+
+    @Schema(description = "高精度", requiredMode = Schema.RequiredMode.REQUIRED)
+    private Boolean highPrecision;
+
+    @Schema(description = "高精度价格", example = "23692")
+    private BigDecimal highPrecisionPrice;
+
+    @Schema(description = "申请用户id", example = "22602")
+    private Long applyMemberUserId;
+
+    @Schema(description = "审核系统用户id", example = "22820")
+    private Long checkSystemUserId;
+
+    @Schema(description = "审核时间")
+    private LocalDateTime checkTime;
+
+    @Schema(description = "审核意见")
+    private String checkComment;
+
+    @Schema(description = "审核状态:默认0表示未审核,1审核通过,2审核不通过", example = "1")
+    @NotNull(message = "审核状态必填")
+    private Integer checkStatus;
+
+}

+ 94 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapplylog/SpuApplyLogController.java

@@ -0,0 +1,94 @@
+package cn.newfeifan.mall.module.product.controller.admin.spuapplylog;
+
+import org.springframework.web.bind.annotation.*;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.security.access.prepost.PreAuthorize;
+import io.swagger.v3.oas.annotations.tags.Tag;
+import io.swagger.v3.oas.annotations.Parameter;
+import io.swagger.v3.oas.annotations.Operation;
+
+import javax.validation.*;
+import javax.servlet.http.*;
+import java.util.*;
+import java.io.IOException;
+
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.pojo.CommonResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
+
+import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
+
+import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
+import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
+
+import cn.newfeifan.mall.module.product.controller.admin.spuapplylog.vo.*;
+import cn.newfeifan.mall.module.product.dal.dataobject.spuapplylog.SpuApplyLogDO;
+import cn.newfeifan.mall.module.product.service.spuapplylog.SpuApplyLogService;
+
+@Tag(name = "管理后台 - 商品审核记录")
+@RestController
+@RequestMapping("/product/spu-apply-log")
+@Validated
+public class SpuApplyLogController {
+
+    @Resource
+    private SpuApplyLogService spuApplyLogService;
+
+    @PostMapping("/create")
+    @Operation(summary = "创建商品审核记录")
+    @PreAuthorize("@ss.hasPermission('product:spu-apply-log:create')")
+    public CommonResult<Long> createSpuApplyLog(@Valid @RequestBody SpuApplyLogSaveReqVO createReqVO) {
+        return success(spuApplyLogService.createSpuApplyLog(createReqVO));
+    }
+
+    @PutMapping("/update")
+    @Operation(summary = "更新商品审核记录")
+    @PreAuthorize("@ss.hasPermission('product:spu-apply-log:update')")
+    public CommonResult<Boolean> updateSpuApplyLog(@Valid @RequestBody SpuApplyLogSaveReqVO updateReqVO) {
+        spuApplyLogService.updateSpuApplyLog(updateReqVO);
+        return success(true);
+    }
+
+    @DeleteMapping("/delete")
+    @Operation(summary = "删除商品审核记录")
+    @Parameter(name = "id", description = "编号", required = true)
+    @PreAuthorize("@ss.hasPermission('product:spu-apply-log:delete')")
+    public CommonResult<Boolean> deleteSpuApplyLog(@RequestParam("id") Long id) {
+        spuApplyLogService.deleteSpuApplyLog(id);
+        return success(true);
+    }
+
+    @GetMapping("/get")
+    @Operation(summary = "获得商品审核记录")
+    @Parameter(name = "id", description = "编号", required = true, example = "1024")
+    @PreAuthorize("@ss.hasPermission('product:spu-apply-log:query')")
+    public CommonResult<SpuApplyLogRespVO> getSpuApplyLog(@RequestParam("id") Long id) {
+        SpuApplyLogDO spuApplyLog = spuApplyLogService.getSpuApplyLog(id);
+        return success(BeanUtils.toBean(spuApplyLog, SpuApplyLogRespVO.class));
+    }
+
+    @GetMapping("/page")
+    @Operation(summary = "获得商品审核记录分页")
+    @PreAuthorize("@ss.hasPermission('product:spu:query')")
+    public CommonResult<PageResult<SpuApplyLogRespVO>> getSpuApplyLogPage(@Valid SpuApplyLogPageReqVO pageReqVO) {
+        PageResult<SpuApplyLogDO> pageResult = spuApplyLogService.getSpuApplyLogPage(pageReqVO);
+        return success(BeanUtils.toBean(pageResult, SpuApplyLogRespVO.class));
+    }
+
+    @GetMapping("/export-excel")
+    @Operation(summary = "导出商品审核记录 Excel")
+    @PreAuthorize("@ss.hasPermission('product:spu-apply-log:export')")
+    @OperateLog(type = EXPORT)
+    public void exportSpuApplyLogExcel(@Valid SpuApplyLogPageReqVO pageReqVO,
+              HttpServletResponse response) throws IOException {
+        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        List<SpuApplyLogDO> list = spuApplyLogService.getSpuApplyLogPage(pageReqVO).getList();
+        // 导出 Excel
+        ExcelUtils.write(response, "商品审核记录.xls", "数据", SpuApplyLogRespVO.class,
+                        BeanUtils.toBean(list, SpuApplyLogRespVO.class));
+    }
+
+}

+ 36 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapplylog/vo/SpuApplyLogPageReqVO.java

@@ -0,0 +1,36 @@
+package cn.newfeifan.mall.module.product.controller.admin.spuapplylog.vo;
+
+import lombok.*;
+import io.swagger.v3.oas.annotations.media.Schema;
+import cn.newfeifan.mall.framework.common.pojo.PageParam;
+import org.springframework.format.annotation.DateTimeFormat;
+import java.time.LocalDateTime;
+
+import static cn.newfeifan.mall.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 SpuApplyLogPageReqVO extends PageParam {
+
+    @Schema(description = "申请状态  0:申请中 1:通过 2:未通过", example = "1")
+    private Integer status;
+
+    @Schema(description = "商品申请id", example = "1516")
+    private Long productSpuApplyId;
+
+    @Schema(description = "审核系统用户id", example = "28003")
+    private Long checkSystemUserId;
+
+    @Schema(description = "审核意见")
+    private String checkComment;
+
+    @Schema(description = "修改的json对象")
+    private String changeJsonObject;
+
+    @Schema(description = "创建时间")
+    @DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
+    private LocalDateTime[] createTime;
+
+}

+ 41 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapplylog/vo/SpuApplyLogRespVO.java

@@ -0,0 +1,41 @@
+package cn.newfeifan.mall.module.product.controller.admin.spuapplylog.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import java.time.LocalDateTime;
+import com.alibaba.excel.annotation.*;
+
+@Schema(description = "管理后台 - 商品审核记录 Response VO")
+@Data
+@ExcelIgnoreUnannotated
+public class SpuApplyLogRespVO {
+
+    @Schema(description = "spu审核记录id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3825")
+    @ExcelProperty("spu审核记录id")
+    private Long id;
+
+    @Schema(description = "申请状态  0:申请中 1:通过 2:未通过", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @ExcelProperty("申请状态  0:申请中 1:通过 2:未通过")
+    private Integer status;
+
+    @Schema(description = "商品申请id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1516")
+    @ExcelProperty("商品申请id")
+    private Long productSpuApplyId;
+
+    @Schema(description = "审核系统用户id", example = "28003")
+    @ExcelProperty("审核系统用户id")
+    private Long checkSystemUserId;
+
+    @Schema(description = "审核意见")
+    @ExcelProperty("审核意见")
+    private String checkComment;
+
+    @Schema(description = "修改的json对象")
+    @ExcelProperty("修改的json对象")
+    private String changeJsonObject;
+
+    @Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
+    @ExcelProperty("创建时间")
+    private LocalDateTime createTime;
+
+}

+ 32 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/controller/admin/spuapplylog/vo/SpuApplyLogSaveReqVO.java

@@ -0,0 +1,32 @@
+package cn.newfeifan.mall.module.product.controller.admin.spuapplylog.vo;
+
+import io.swagger.v3.oas.annotations.media.Schema;
+import lombok.*;
+import javax.validation.constraints.*;
+
+@Schema(description = "管理后台 - 商品审核记录新增/修改 Request VO")
+@Data
+@Builder
+public class SpuApplyLogSaveReqVO {
+
+    @Schema(description = "spu审核记录id", requiredMode = Schema.RequiredMode.REQUIRED, example = "3825")
+    private Long id;
+
+    @Schema(description = "申请状态  0:申请中 1:通过 2:未通过", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
+    @NotNull(message = "申请状态  0:申请中 1:通过 2:未通过不能为空")
+    private Integer status;
+
+    @Schema(description = "商品申请id", requiredMode = Schema.RequiredMode.REQUIRED, example = "1516")
+    @NotNull(message = "商品申请id不能为空")
+    private Long productSpuApplyId;
+
+    @Schema(description = "审核系统用户id", example = "28003")
+    private Long checkSystemUserId;
+
+    @Schema(description = "审核意见")
+    private String checkComment;
+
+    @Schema(description = "修改的json对象")
+    private String changeJsonObject;
+
+}

+ 39 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/convert/spuapply/SpuApplyConvert.java

@@ -0,0 +1,39 @@
+package cn.newfeifan.mall.module.product.convert.spuapply;
+
+import cn.newfeifan.mall.framework.common.util.collection.CollectionUtils;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+import cn.newfeifan.mall.module.product.controller.admin.skuapply.vo.SkuApplyRespVO;
+import cn.newfeifan.mall.module.product.controller.admin.spuapply.vo.SpuApplyRespVO;
+import cn.newfeifan.mall.module.product.dal.dataobject.skuapply.SkuApplyDO;
+import cn.newfeifan.mall.module.product.dal.dataobject.spuapply.SpuApplyDO;
+import org.mapstruct.Mapper;
+import org.mapstruct.factory.Mappers;
+
+import java.util.List;
+import java.util.Map;
+
+import static cn.newfeifan.mall.framework.common.util.collection.CollectionUtils.convertMultiMap;
+
+/**
+ * 商品 SPU 申请 Convert
+ *
+ * @author 非繁源码
+ */
+
+@Mapper
+public interface SpuApplyConvert {
+
+    SpuApplyConvert INSTANCE = Mappers.getMapper(SpuApplyConvert.class);
+
+    default SpuApplyRespVO convert(SpuApplyDO spu, List<SkuApplyDO> skus) {
+        SpuApplyRespVO spuVO = BeanUtils.toBean(spu, SpuApplyRespVO.class);
+        spuVO.setSkus(BeanUtils.toBean(skus, SkuApplyRespVO.class));
+        return spuVO;
+    }
+
+    default List<SpuApplyRespVO> convertForSpuDetailRespListVO(List<SpuApplyDO> spus, List<SkuApplyDO> skus) {
+        Map<Long, List<SkuApplyDO>> skuMultiMap = convertMultiMap(skus, SkuApplyDO::getSpuApplyId);
+        return CollectionUtils.convertList(spus, spu -> convert(spu, skuMultiMap.get(spu.getId())));
+    }
+
+}

+ 109 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/dataobject/skuapply/SkuApplyDO.java

@@ -0,0 +1,109 @@
+package cn.newfeifan.mall.module.product.dal.dataobject.skuapply;
+
+import lombok.*;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 商品sku申请 DO
+ *
+ * @author 非繁人
+ */
+@TableName("product_sku_apply")
+@KeySequence("product_sku_apply_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SkuApplyDO extends BaseDO {
+
+    /**
+     * 主键
+     */
+    @TableId
+    private Long id;
+    /**
+     * spu编号
+     */
+    private Long spuApplyId;
+    /**
+     * 属性数组,JSON 格式 [{propertId: , valueId: }, {propertId: , valueId: }]
+     */
+    private String properties;
+    /**
+     * 商品价格,单位:分
+     */
+    private Integer price;
+    /**
+     * 推广费, 单位: 分
+     */
+    private Integer promotionFee;
+    /**
+     * 备注
+     */
+    private String mark;
+    /**
+     * 市场价,单位:分
+     */
+    private Integer marketPrice;
+    /**
+     * 成本价,单位: 分
+     */
+    private Integer costPrice;
+    /**
+     * SKU 的条形码
+     */
+    private String barCode;
+    /**
+     * 图片地址
+     */
+    private String picUrl;
+    /**
+     * 库存
+     */
+    private Integer stock;
+    /**
+     * 商品重量,单位:kg 千克
+     */
+    private Double weight;
+    /**
+     * 商品体积,单位:m^3 平米
+     */
+    private Double volume;
+    /**
+     * 一级分销的佣金,单位:分
+     */
+    private Integer firstBrokeragePrice;
+    /**
+     * 二级分销的佣金,单位:分
+     */
+    private Integer secondBrokeragePrice;
+    /**
+     * 商品销量
+     */
+    private Integer salesCount;
+    /**
+     * 店铺id
+     */
+    private Long shopId;
+    /**
+     * 商户id
+     */
+    private Long merchantId;
+    /**
+     * 高精度价格
+     */
+    private BigDecimal highPrecisionPrice;
+    /**
+     * 结算价,单位: 分
+     */
+    private Integer settlementPrice;
+    /**
+     * 高精度结算价
+     */
+    private BigDecimal highPrecisionSettlementPrice;
+
+}

+ 10 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/dataobject/spu/ProductSpuDO.java

@@ -39,6 +39,12 @@ public class ProductSpuDO extends BaseDO {
 
     // ========== 基本信息 =========
 
+    /**
+     * 推广费, 单位: 分,值为sku中最大的推广费
+     *
+     */
+    private Integer promotionFee;
+
     /**
      * 商品名称
      */
@@ -191,4 +197,8 @@ public class ProductSpuDO extends BaseDO {
      */
     private BigDecimal highPrecisionPrice;
 
+    /**
+     * 商品申请id
+     */
+    private Long spuApplyId;
 }

+ 176 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/dataobject/spuapply/SpuApplyDO.java

@@ -0,0 +1,176 @@
+package cn.newfeifan.mall.module.product.dal.dataobject.spuapply;
+
+import lombok.*;
+import java.time.LocalDateTime;
+import java.math.BigDecimal;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 商品spu申请 DO
+ *
+ * @author 非繁人
+ */
+@TableName("product_spu_apply")
+@KeySequence("product_spu_apply_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SpuApplyDO extends BaseDO {
+
+    /**
+     * 商品 SPU 编号,自增
+     */
+    @TableId
+    private Long id;
+    /**
+     * 商品名称
+     */
+    private String name;
+    /**
+     * 关键字
+     */
+    private String keyword;
+    /**
+     * 商品简介
+     */
+    private String introduction;
+    /**
+     * 商品详情
+     */
+    private String description;
+    /**
+     * 产地
+     */
+    private String producerArea;
+    /**
+     * 商品类别
+     */
+    private Integer spuType;
+    /**
+     * 商品分类编号
+     */
+    private Long categoryId;
+    /**
+     * 商品品牌编号
+     */
+    private Integer brandId;
+    /**
+     * 商品封面图
+     */
+    private String picUrl;
+    /**
+     * 商品轮播图地址
+ 数组,以逗号分隔
+ 最多上传15张
+     */
+    private String sliderPicUrls;
+    /**
+     * 排序字段
+     */
+    private Integer sort;
+    /**
+     * 商品状态: 0 上架(开启) 1 下架(禁用)-1 回收
+     */
+    private Integer status;
+    /**
+     * 规格类型:0 单规格 1 多规格
+     */
+    private Boolean specType;
+    /**
+     * 商品价格,单位使用:分
+     */
+    private Integer price;
+    /**
+     * 市场价,单位使用:分
+     */
+    private Integer marketPrice;
+    /**
+     * 成本价,单位: 分
+     */
+    private Integer costPrice;
+    /**
+     * 库存
+     */
+    private Integer stock;
+    /**
+     * 配送方式数组
+     */
+    private String deliveryTypes;
+    /**
+     * 物流配置模板编号
+     */
+    private Long deliveryTemplateId;
+    /**
+     * 赠送积分
+     */
+    private Integer giveIntegral;
+    /**
+     * 分销类型
+     */
+    private Boolean subCommissionType;
+    /**
+     * 商品销量
+     */
+    private Integer salesCount;
+    /**
+     * 虚拟销量
+     */
+    private Integer virtualSalesCount;
+    /**
+     * 商品点击量
+     */
+    private Integer browseCount;
+    /**
+     * 店铺id
+     */
+    private Long shopId;
+    /**
+     * 商户id
+     */
+    private Long merchantId;
+    /**
+     * 是否隐藏。隐藏:1,不隐藏:0
+     */
+    private Boolean hidden;
+    /**
+     * 推广费, 单位: 分,值为sku中最大的推广费
+     */
+    private Integer promotionFee;
+    /**
+     * 商品支付类别(1 rmb 2积分)
+     */
+    private Integer spuPayType;
+    /**
+     * 高精度
+     */
+    private Boolean highPrecision;
+    /**
+     * 高精度价格
+     */
+    private BigDecimal highPrecisionPrice;
+    /**
+     * 申请用户id
+     */
+    private Long applyMemberUserId;
+    /**
+     * 审核系统用户id
+     */
+    private Long checkSystemUserId;
+    /**
+     * 审核时间
+     */
+    private LocalDateTime checkTime;
+    /**
+     * 审核意见
+     */
+    private String checkComment;
+    /**
+     * 审核状态:默认0表示未审核,1审核通过,2审核不通过
+     */
+    private Integer checkStatus;
+
+}

+ 48 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/dataobject/spuapplylog/SpuApplyLogDO.java

@@ -0,0 +1,48 @@
+package cn.newfeifan.mall.module.product.dal.dataobject.spuapplylog;
+
+import lombok.*;
+import com.baomidou.mybatisplus.annotation.*;
+import cn.newfeifan.mall.framework.mybatis.core.dataobject.BaseDO;
+
+/**
+ * 商品审核记录 DO
+ *
+ * @author 非繁人
+ */
+@TableName("product_spu_apply_log")
+@KeySequence("product_spu_apply_log_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ToString(callSuper = true)
+@Builder
+@NoArgsConstructor
+@AllArgsConstructor
+public class SpuApplyLogDO extends BaseDO {
+
+    /**
+     * spu审核记录id
+     */
+    @TableId
+    private Long id;
+    /**
+     * 申请状态  0:申请中 1:通过 2:未通过
+     */
+    private Integer status;
+    /**
+     * 商品申请id
+     */
+    private Long productSpuApplyId;
+    /**
+     * 审核系统用户id
+     */
+    private Long checkSystemUserId;
+    /**
+     * 审核意见
+     */
+    private String checkComment;
+    /**
+     * 修改的json对象
+     */
+    private String changeJsonObject;
+
+}

+ 49 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/mysql/skuapply/SkuApplyMapper.java

@@ -0,0 +1,49 @@
+package cn.newfeifan.mall.module.product.dal.mysql.skuapply;
+
+import java.util.*;
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
+import cn.newfeifan.mall.module.product.dal.dataobject.skuapply.SkuApplyDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.product.controller.admin.skuapply.vo.*;
+
+/**
+ * 商品sku申请 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface SkuApplyMapper extends BaseMapperX<SkuApplyDO> {
+
+    default PageResult<SkuApplyDO> selectPage(SkuApplyPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<SkuApplyDO>()
+                .eqIfPresent(SkuApplyDO::getSpuApplyId, reqVO.getSpuApplyId())
+                .eqIfPresent(SkuApplyDO::getProperties, reqVO.getProperties())
+                .eqIfPresent(SkuApplyDO::getPrice, reqVO.getPrice())
+                .eqIfPresent(SkuApplyDO::getPromotionFee, reqVO.getPromotionFee())
+                .eqIfPresent(SkuApplyDO::getMark, reqVO.getMark())
+                .eqIfPresent(SkuApplyDO::getMarketPrice, reqVO.getMarketPrice())
+                .eqIfPresent(SkuApplyDO::getCostPrice, reqVO.getCostPrice())
+                .eqIfPresent(SkuApplyDO::getBarCode, reqVO.getBarCode())
+                .eqIfPresent(SkuApplyDO::getPicUrl, reqVO.getPicUrl())
+                .eqIfPresent(SkuApplyDO::getStock, reqVO.getStock())
+                .eqIfPresent(SkuApplyDO::getWeight, reqVO.getWeight())
+                .eqIfPresent(SkuApplyDO::getVolume, reqVO.getVolume())
+                .eqIfPresent(SkuApplyDO::getFirstBrokeragePrice, reqVO.getFirstBrokeragePrice())
+                .eqIfPresent(SkuApplyDO::getSecondBrokeragePrice, reqVO.getSecondBrokeragePrice())
+                .eqIfPresent(SkuApplyDO::getSalesCount, reqVO.getSalesCount())
+                .betweenIfPresent(SkuApplyDO::getCreateTime, reqVO.getCreateTime())
+                .eqIfPresent(SkuApplyDO::getShopId, reqVO.getShopId())
+                .eqIfPresent(SkuApplyDO::getMerchantId, reqVO.getMerchantId())
+                .eqIfPresent(SkuApplyDO::getHighPrecisionPrice, reqVO.getHighPrecisionPrice())
+                .eqIfPresent(SkuApplyDO::getSettlementPrice, reqVO.getSettlementPrice())
+                .eqIfPresent(SkuApplyDO::getHighPrecisionSettlementPrice, reqVO.getHighPrecisionSettlementPrice())
+                .orderByDesc(SkuApplyDO::getId));
+    }
+
+    default List<SkuApplyDO> selectListBySpuId(Long spuApplyId){
+        return selectList(SkuApplyDO::getSpuApplyId, spuApplyId);
+    }
+}

+ 150 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/mysql/spuapply/SpuApplyMapper.java

@@ -0,0 +1,150 @@
+package cn.newfeifan.mall.module.product.dal.mysql.spuapply;
+
+
+import cn.hutool.core.util.ObjectUtil;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
+import cn.newfeifan.mall.module.product.controller.admin.spu.vo.ProductSpuPageReqVO;
+import cn.newfeifan.mall.module.product.dal.dataobject.spuapply.SpuApplyDO;
+import cn.newfeifan.mall.module.product.enums.ProductConstants;
+import cn.newfeifan.mall.module.product.enums.spu.ProductSpuStatusEnum;
+import cn.newfeifan.mall.module.product.enums.spu.SpuApplyCheckStatusEnum;
+import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.product.controller.admin.spuapply.vo.*;
+import org.apache.ibatis.annotations.Select;
+
+/**
+ * 商品spu申请 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface SpuApplyMapper extends BaseMapperX<SpuApplyDO> {
+
+    default PageResult<SpuApplyDO> selectPage(SpuApplyPageReqVO reqVO) {
+        Integer tabType = reqVO.getTabType();
+        LambdaQueryWrapperX<SpuApplyDO> wrapper = new LambdaQueryWrapperX<SpuApplyDO>()
+                .likeIfPresent(SpuApplyDO::getName, reqVO.getName())
+                .eqIfPresent(SpuApplyDO::getKeyword, reqVO.getKeyword())
+                .eqIfPresent(SpuApplyDO::getIntroduction, reqVO.getIntroduction())
+                .eqIfPresent(SpuApplyDO::getDescription, reqVO.getDescription())
+                .eqIfPresent(SpuApplyDO::getProducerArea, reqVO.getProducerArea())
+                .eqIfPresent(SpuApplyDO::getSpuType, reqVO.getSpuType())
+                .eqIfPresent(SpuApplyDO::getCategoryId, reqVO.getCategoryId())
+                .eqIfPresent(SpuApplyDO::getBrandId, reqVO.getBrandId())
+                .eqIfPresent(SpuApplyDO::getPicUrl, reqVO.getPicUrl())
+                .eqIfPresent(SpuApplyDO::getSliderPicUrls, reqVO.getSliderPicUrls())
+                .eqIfPresent(SpuApplyDO::getSort, reqVO.getSort())
+                .eqIfPresent(SpuApplyDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(SpuApplyDO::getSpecType, reqVO.getSpecType())
+                .eqIfPresent(SpuApplyDO::getPrice, reqVO.getPrice())
+                .eqIfPresent(SpuApplyDO::getMarketPrice, reqVO.getMarketPrice())
+                .eqIfPresent(SpuApplyDO::getCostPrice, reqVO.getCostPrice())
+                .eqIfPresent(SpuApplyDO::getStock, reqVO.getStock())
+                .eqIfPresent(SpuApplyDO::getDeliveryTypes, reqVO.getDeliveryTypes())
+                .eqIfPresent(SpuApplyDO::getDeliveryTemplateId, reqVO.getDeliveryTemplateId())
+                .eqIfPresent(SpuApplyDO::getGiveIntegral, reqVO.getGiveIntegral())
+                .eqIfPresent(SpuApplyDO::getSubCommissionType, reqVO.getSubCommissionType())
+                .eqIfPresent(SpuApplyDO::getSalesCount, reqVO.getSalesCount())
+                .eqIfPresent(SpuApplyDO::getVirtualSalesCount, reqVO.getVirtualSalesCount())
+                .eqIfPresent(SpuApplyDO::getBrowseCount, reqVO.getBrowseCount())
+                .betweenIfPresent(SpuApplyDO::getCreateTime, reqVO.getCreateTime())
+                .eqIfPresent(SpuApplyDO::getShopId, reqVO.getShopId())
+                .eqIfPresent(SpuApplyDO::getMerchantId, reqVO.getMerchantId())
+                .eqIfPresent(SpuApplyDO::getHidden, reqVO.getHidden())
+                .eqIfPresent(SpuApplyDO::getPromotionFee, reqVO.getPromotionFee())
+                .eqIfPresent(SpuApplyDO::getSpuPayType, reqVO.getSpuPayType())
+                .eqIfPresent(SpuApplyDO::getHighPrecision, reqVO.getHighPrecision())
+                .eqIfPresent(SpuApplyDO::getHighPrecisionPrice, reqVO.getHighPrecisionPrice())
+                .eqIfPresent(SpuApplyDO::getApplyMemberUserId, reqVO.getApplyMemberUserId())
+                .eqIfPresent(SpuApplyDO::getCheckSystemUserId, reqVO.getCheckSystemUserId())
+                .betweenIfPresent(SpuApplyDO::getCheckTime, reqVO.getCheckTime())
+                .eqIfPresent(SpuApplyDO::getCheckComment, reqVO.getCheckComment())
+                .orderByDesc(SpuApplyDO::getId);
+
+        if(reqVO.getCheckStatus().equals(1)){
+            wrapper.ne(SpuApplyDO::getCheckStatus, 0);
+        }else{
+            wrapper.eq(SpuApplyDO::getCheckStatus, 0);
+        }
+        appendTabQuery(tabType, wrapper);
+
+        return selectPage(reqVO, wrapper);
+    }
+
+    /**
+     * 添加后台 Tab 选项的查询条件
+     *
+     * @param tabType 标签类型
+     * @param query   查询条件
+     */
+    static void appendTabQuery(Integer tabType, LambdaQueryWrapperX<SpuApplyDO> query) {
+        // 出售中商品
+        if (ObjectUtil.equals(ProductSpuPageReqVO.FOR_SALE, tabType)) {
+            query.eqIfPresent(SpuApplyDO::getStatus, ProductSpuStatusEnum.ENABLE.getStatus());
+        }
+        // 仓储中商品
+        if (ObjectUtil.equals(ProductSpuPageReqVO.IN_WAREHOUSE, tabType)) {
+            query.eqIfPresent(SpuApplyDO::getStatus, ProductSpuStatusEnum.DISABLE.getStatus());
+        }
+        // 已售空商品
+        if (ObjectUtil.equals(ProductSpuPageReqVO.SOLD_OUT, tabType)) {
+            query.eqIfPresent(SpuApplyDO::getStock, 0);
+        }
+        // 警戒库存
+        if (ObjectUtil.equals(ProductSpuPageReqVO.ALERT_STOCK, tabType)) {
+            query.le(SpuApplyDO::getStock, ProductConstants.ALERT_STOCK)
+                    // 如果库存触发警戒库存且状态为回收站的话则不在警戒库存列表展示
+                    .notIn(SpuApplyDO::getStatus, ProductSpuStatusEnum.RECYCLE.getStatus());
+        }
+        // 回收站
+        if (ObjectUtil.equals(ProductSpuPageReqVO.RECYCLE_BIN, tabType)) {
+            query.eqIfPresent(SpuApplyDO::getStatus, ProductSpuStatusEnum.RECYCLE.getStatus());
+        }
+    }
+
+    @Select("select name from sale_shop where id=#{id}")
+    String selectShopNameById(Long id);
+
+    default Long selectCount(Integer checkStatus, ProductSpuPageReqVO pageVO){
+        return selectCount(new LambdaQueryWrapperX<SpuApplyDO>()
+                .eq(SpuApplyDO::getCheckStatus, checkStatus)
+                .likeIfPresent(SpuApplyDO::getName, pageVO.getName())
+                .eqIfPresent(SpuApplyDO::getShopId, pageVO.getShopId())
+                .eqIfPresent(SpuApplyDO::getCategoryId, pageVO.getCategoryId())
+                .eqIfPresent(SpuApplyDO::getMerchantId, pageVO.getMerchantId())
+                .betweenIfPresent(SpuApplyDO::getCreateTime, pageVO.getCreateTime())
+        );
+    }
+
+    default Long selectCount(SFunction<SpuApplyDO, ?> field, Object value, ProductSpuPageReqVO pageVO){
+        return selectCount(new LambdaQueryWrapperX<SpuApplyDO>()
+                .eq(field, value)
+                .likeIfPresent(SpuApplyDO::getName, pageVO.getName())
+                .eqIfPresent(SpuApplyDO::getShopId, pageVO.getShopId())
+                .eqIfPresent(SpuApplyDO::getCategoryId, pageVO.getCategoryId())
+                .eqIfPresent(SpuApplyDO::getMerchantId, pageVO.getMerchantId())
+                .betweenIfPresent(SpuApplyDO::getCreateTime, pageVO.getCreateTime())
+                .ne(SpuApplyDO::getCheckStatus, SpuApplyCheckStatusEnum.WAIT_CHECK.getStatus())
+        );
+    }
+
+    default Long selectCount(ProductSpuPageReqVO pageVO) {
+        LambdaQueryWrapperX<SpuApplyDO> queryWrapper = new LambdaQueryWrapperX<>();
+        // 库存小于等于警戒库存
+        queryWrapper
+                .likeIfPresent(SpuApplyDO::getName, pageVO.getName())
+                .eqIfPresent(SpuApplyDO::getShopId, pageVO.getShopId())
+                .eqIfPresent(SpuApplyDO::getCategoryId, pageVO.getCategoryId())
+                .eqIfPresent(SpuApplyDO::getMerchantId, pageVO.getMerchantId())
+                .betweenIfPresent(SpuApplyDO::getCreateTime, pageVO.getCreateTime())
+                .le(SpuApplyDO::getStock, ProductConstants.ALERT_STOCK)
+                // 如果库存触发警戒库存且状态为回收站的话则不计入触发警戒库存的个数
+                .notIn(SpuApplyDO::getStatus, ProductSpuStatusEnum.RECYCLE.getStatus())
+                .ne(SpuApplyDO::getCheckStatus, SpuApplyCheckStatusEnum.WAIT_CHECK.getStatus())
+        ;
+        return selectCount(queryWrapper);
+    }
+}

+ 29 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/dal/mysql/spuapplylog/SpuApplyLogMapper.java

@@ -0,0 +1,29 @@
+package cn.newfeifan.mall.module.product.dal.mysql.spuapplylog;
+
+
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.mybatis.core.query.LambdaQueryWrapperX;
+import cn.newfeifan.mall.framework.mybatis.core.mapper.BaseMapperX;
+import cn.newfeifan.mall.module.product.dal.dataobject.spuapplylog.SpuApplyLogDO;
+import org.apache.ibatis.annotations.Mapper;
+import cn.newfeifan.mall.module.product.controller.admin.spuapplylog.vo.*;
+
+/**
+ * 商品审核记录 Mapper
+ *
+ * @author 非繁人
+ */
+@Mapper
+public interface SpuApplyLogMapper extends BaseMapperX<SpuApplyLogDO> {
+
+    default PageResult<SpuApplyLogDO> selectPage(SpuApplyLogPageReqVO reqVO) {
+        return selectPage(reqVO, new LambdaQueryWrapperX<SpuApplyLogDO>()
+                .eqIfPresent(SpuApplyLogDO::getStatus, reqVO.getStatus())
+                .eqIfPresent(SpuApplyLogDO::getProductSpuApplyId, reqVO.getProductSpuApplyId())
+                .eqIfPresent(SpuApplyLogDO::getCheckSystemUserId, reqVO.getCheckSystemUserId())
+                .eqIfPresent(SpuApplyLogDO::getCheckComment, reqVO.getCheckComment())
+                .betweenIfPresent(SpuApplyLogDO::getCreateTime, reqVO.getCreateTime())
+                .orderByDesc(SpuApplyLogDO::getId));
+    }
+
+}

+ 61 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/skuapply/SkuApplyService.java

@@ -0,0 +1,61 @@
+package cn.newfeifan.mall.module.product.service.skuapply;
+
+import java.util.*;
+import javax.validation.*;
+import cn.newfeifan.mall.module.product.controller.admin.skuapply.vo.*;
+import cn.newfeifan.mall.module.product.dal.dataobject.skuapply.SkuApplyDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+/**
+ * 商品sku申请 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface SkuApplyService {
+
+    /**
+     * 创建商品sku申请
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createSkuApply(@Valid SkuApplySaveReqVO createReqVO);
+
+    /**
+     * 更新商品sku申请
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateSkuApply(@Valid SkuApplySaveReqVO updateReqVO);
+
+    /**
+     * 删除商品sku申请
+     *
+     * @param id 编号
+     */
+    void deleteSkuApply(Long id);
+
+    /**
+     * 获得商品sku申请
+     *
+     * @param id 编号
+     * @return 商品sku申请
+     */
+    SkuApplyDO getSkuApply(Long id);
+
+    /**
+     * 获得商品sku申请分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 商品sku申请分页
+     */
+    PageResult<SkuApplyDO> getSkuApplyPage(SkuApplyPageReqVO pageReqVO);
+
+    /**
+     * 获得商品 SKU 申请 集合
+     *
+     * @param spuApplyId spu 申请 编号
+     * @return 商品sku 申请 集合
+     */
+    List<SkuApplyDO> getSkuListBySpuId(Long spuApplyId);
+}

+ 77 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/skuapply/SkuApplyServiceImpl.java

@@ -0,0 +1,77 @@
+package cn.newfeifan.mall.module.product.service.skuapply;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+
+import java.util.*;
+import cn.newfeifan.mall.module.product.controller.admin.skuapply.vo.*;
+import cn.newfeifan.mall.module.product.dal.dataobject.skuapply.SkuApplyDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.mall.module.product.dal.mysql.skuapply.SkuApplyMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.mall.module.product.enums.ErrorCodeConstants.*;
+
+/**
+ * 商品sku申请 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class SkuApplyServiceImpl implements SkuApplyService {
+
+    @Resource
+    private SkuApplyMapper skuApplyMapper;
+
+    @Override
+    public Long createSkuApply(SkuApplySaveReqVO createReqVO) {
+        // 插入
+        SkuApplyDO skuApply = BeanUtils.toBean(createReqVO, SkuApplyDO.class);
+        skuApplyMapper.insert(skuApply);
+        // 返回
+        return skuApply.getId();
+    }
+
+    @Override
+    public void updateSkuApply(SkuApplySaveReqVO updateReqVO) {
+        // 校验存在
+        validateSkuApplyExists(updateReqVO.getId());
+        // 更新
+        SkuApplyDO updateObj = BeanUtils.toBean(updateReqVO, SkuApplyDO.class);
+        skuApplyMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteSkuApply(Long id) {
+        // 校验存在
+        validateSkuApplyExists(id);
+        // 删除
+        skuApplyMapper.deleteById(id);
+    }
+
+    private void validateSkuApplyExists(Long id) {
+        if (skuApplyMapper.selectById(id) == null) {
+            throw exception(SKU_APPLY_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public SkuApplyDO getSkuApply(Long id) {
+        return skuApplyMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<SkuApplyDO> getSkuApplyPage(SkuApplyPageReqVO pageReqVO) {
+        return skuApplyMapper.selectPage(pageReqVO);
+    }
+
+    @Override
+    public List<SkuApplyDO> getSkuListBySpuId(Long spuApplyId) {
+        return skuApplyMapper.selectListBySpuId(spuApplyId);
+    }
+
+}

+ 7 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuService.java

@@ -142,4 +142,11 @@ public interface ProductSpuService {
     void updateBrowseCount(Long id, int incrCount);
 
     PageResult<ProductSpuRespVO> getFavoriteByUser(ProductSpuPageReqVO pageVO);
+
+    /**
+     * 根据申请id获取商品
+     * @param applyId 申请id
+     * @return spu
+     */
+    ProductSpuDO getSpuByApplyId(Long applyId);
 }

+ 33 - 9
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spu/ProductSpuServiceImpl.java

@@ -11,7 +11,9 @@ import cn.newfeifan.mall.module.product.controller.admin.spu.vo.*;
 import cn.newfeifan.mall.module.product.controller.app.spu.vo.AppProductSpuPageReqVO;
 import cn.newfeifan.mall.module.product.dal.dataobject.category.ProductCategoryDO;
 import cn.newfeifan.mall.module.product.dal.dataobject.spu.ProductSpuDO;
+import cn.newfeifan.mall.module.product.dal.dataobject.spuapply.SpuApplyDO;
 import cn.newfeifan.mall.module.product.dal.mysql.spu.ProductSpuMapper;
+import cn.newfeifan.mall.module.product.dal.mysql.spuapply.SpuApplyMapper;
 import cn.newfeifan.mall.module.product.enums.spu.ProductSpuStatusEnum;
 import cn.newfeifan.mall.module.product.service.category.ProductCategoryService;
 import cn.newfeifan.mall.module.product.service.favorite.ProductFavoriteService;
@@ -52,6 +54,8 @@ public class ProductSpuServiceImpl implements ProductSpuService {
 
     @Resource
     private ProductFavoriteService favoriteService;
+    @Resource
+    private SpuApplyMapper spuApplyMapper;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -61,10 +65,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
 //        brandService.validateProductBrand(createReqVO.getBrandId());
 
         // 根据商户ID查询对应的店铺ID
-        // todo 后续如果存在多店铺的情况下
-
-
-
+        // todo 后续如果存在多店铺的情况
 
 
         // 校验 SKU
@@ -74,6 +75,7 @@ public class ProductSpuServiceImpl implements ProductSpuService {
         ProductSpuDO spu = BeanUtils.toBean(createReqVO, ProductSpuDO.class);
         // 初始化 SPU 中 SKU 相关属性
         initSpuFromSkus(spu, skuSaveReqList);
+
         // 插入 SPU
         productSpuMapper.insert(spu);
         // 插入 SKU
@@ -97,6 +99,20 @@ public class ProductSpuServiceImpl implements ProductSpuService {
         // 更新 SPU
         ProductSpuDO updateObj = BeanUtils.toBean(updateReqVO, ProductSpuDO.class);
         initSpuFromSkus(updateObj, skuSaveReqList);
+
+        //最大推广费, 单位: 分  add by Ben
+        Integer maxPromotionFee = 0;
+
+        for (ProductSkuSaveReqVO productSkuSaveReqVO : skuSaveReqList) {
+            productSkuSaveReqVO.setShopId(updateReqVO.getShopId());
+            productSkuSaveReqVO.setMerchantId(updateReqVO.getMerchantId());
+
+            Integer skuPromotionFee = productSkuSaveReqVO.getPromotionFee();
+            if(skuPromotionFee>maxPromotionFee)
+                maxPromotionFee=skuPromotionFee;
+        }
+
+        updateObj.setPromotionFee(maxPromotionFee);
         productSpuMapper.updateById(updateObj);
         // 批量更新 SKU
         productSkuService.updateSkuList(updateObj.getId(), updateReqVO.getSkus());
@@ -182,6 +198,11 @@ public class ProductSpuServiceImpl implements ProductSpuService {
         return BeanUtils.toBean(productSpuDOPageResult, ProductSpuRespVO.class);
     }
 
+    @Override
+    public ProductSpuDO getSpuByApplyId(Long applyId) {
+        return productSpuMapper.selectOne(ProductSpuDO::getSpuApplyId, applyId);
+    }
+
     @Override
     @Transactional(rollbackFor = Exception.class)
     public void deleteSpu(Long id) {
@@ -271,21 +292,24 @@ public class ProductSpuServiceImpl implements ProductSpuService {
     @Override
     public Map<Integer, Long> getTabsCount(ProductSpuPageReqVO pageVO) {
         Map<Integer, Long> counts = Maps.newLinkedHashMapWithExpectedSize(5);
+        counts.put(ProductSpuPageReqVO.APPLY_SPU,
+                spuApplyMapper.selectCount(0,pageVO));
+
         // 查询销售中的商品数量
         counts.put(ProductSpuPageReqVO.FOR_SALE,
-                productSpuMapper.selectCount(ProductSpuDO::getStatus, ProductSpuStatusEnum.ENABLE.getStatus(),pageVO));
+                spuApplyMapper.selectCount(SpuApplyDO::getStatus, ProductSpuStatusEnum.ENABLE.getStatus(),pageVO));
         // 查询仓库中的商品数量
         counts.put(ProductSpuPageReqVO.IN_WAREHOUSE,
-                productSpuMapper.selectCount(ProductSpuDO::getStatus, ProductSpuStatusEnum.DISABLE.getStatus(),pageVO));
+                spuApplyMapper.selectCount(SpuApplyDO::getStatus, ProductSpuStatusEnum.DISABLE.getStatus(),pageVO));
         // 查询售空的商品数量
         counts.put(ProductSpuPageReqVO.SOLD_OUT,
-                productSpuMapper.selectCount(ProductSpuDO::getStock, 0,pageVO));
+                spuApplyMapper.selectCount(SpuApplyDO::getStock, 0,pageVO));
         // 查询触发警戒库存的商品数量
         counts.put(ProductSpuPageReqVO.ALERT_STOCK,
-                productSpuMapper.selectCount(pageVO));
+                spuApplyMapper.selectCount(pageVO));
         // 查询回收站中的商品数量
         counts.put(ProductSpuPageReqVO.RECYCLE_BIN,
-                productSpuMapper.selectCount(ProductSpuDO::getStatus, ProductSpuStatusEnum.RECYCLE.getStatus(),pageVO));
+                spuApplyMapper.selectCount(SpuApplyDO::getStatus, ProductSpuStatusEnum.RECYCLE.getStatus(),pageVO));
         return counts;
     }
 

+ 73 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spuapply/SpuApplyService.java

@@ -0,0 +1,73 @@
+package cn.newfeifan.mall.module.product.service.spuapply;
+
+import javax.validation.*;
+import cn.newfeifan.mall.module.product.controller.admin.spuapply.vo.*;
+import cn.newfeifan.mall.module.product.dal.dataobject.spuapply.SpuApplyDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+/**
+ * 商品spu申请 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface SpuApplyService {
+
+    /**
+     * 创建商品spu申请
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createSpuApply(@Valid SpuApplySaveReqVO createReqVO);
+
+    /**
+     * 更新商品spu申请
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateSpuApplyByCheckStatus(@Valid SpuApplySaveReqVO updateReqVO);
+
+    /**
+     * 删除商品spu申请
+     *
+     * @param id 编号
+     */
+    void deleteSpuApply(Long id);
+
+    /**
+     * 获得商品spu申请
+     *
+     * @param id 编号
+     * @return 商品spu申请
+     */
+    SpuApplyDO getSpuApply(Long id);
+
+    /**
+     * 获得商品spu申请分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 商品spu申请分页
+     */
+    PageResult<SpuApplyDO> getSpuApplyPage(SpuApplyPageReqVO pageReqVO);
+
+    /**
+     * 获得商品 SPU 申请
+     *
+     * @param id 编号
+     * @return 商品 SPU 申请
+     */
+    SpuApplyDO getSpu(Long id);
+
+    /**
+     * 获得商品 SPU 申请详情
+     * @param id id
+     * @return 申请详情
+     */
+    SpuApplyRespVO getSpuApplyDetail(Long id);
+
+    /**
+     * 获得商品 SPU 申请数量
+     * @return 数量
+     */
+    Long getSpuApplyTotal();
+}

+ 177 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spuapply/SpuApplyServiceImpl.java

@@ -0,0 +1,177 @@
+package cn.newfeifan.mall.module.product.service.spuapply;
+
+import cn.newfeifan.mall.module.product.controller.admin.spu.vo.ProductSpuSaveReqVO;
+import cn.newfeifan.mall.module.product.controller.admin.spuapplylog.vo.SpuApplyLogSaveReqVO;
+import cn.newfeifan.mall.module.product.convert.spuapply.SpuApplyConvert;
+import cn.newfeifan.mall.module.product.dal.dataobject.skuapply.SkuApplyDO;
+import cn.newfeifan.mall.module.product.dal.dataobject.spu.ProductSpuDO;
+import cn.newfeifan.mall.module.product.enums.spu.SpuApplyCheckStatusEnum;
+import cn.newfeifan.mall.module.product.service.skuapply.SkuApplyService;
+import cn.newfeifan.mall.module.product.service.spu.ProductSpuService;
+import cn.newfeifan.mall.module.product.service.spuapplylog.SpuApplyLogService;
+import cn.newfeifan.mall.module.system.api.sms.SmsCodeApi;
+import cn.newfeifan.mall.module.system.api.sms.dto.code.SmsCodeSendReqDTO;
+import cn.newfeifan.mall.module.system.dal.dataobject.user.AdminUserDO;
+import cn.newfeifan.mall.module.system.enums.sms.SmsSceneEnum;
+import cn.newfeifan.mall.module.system.service.user.AdminUserService;
+import com.alibaba.fastjson.JSON;
+import org.springframework.stereotype.Service;
+
+import javax.annotation.Resource;
+
+import org.springframework.validation.annotation.Validated;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.time.LocalDateTime;
+import java.util.*;
+
+import cn.newfeifan.mall.module.product.controller.admin.spuapply.vo.*;
+import cn.newfeifan.mall.module.product.dal.dataobject.spuapply.SpuApplyDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.mall.module.product.dal.mysql.spuapply.SpuApplyMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.mall.framework.common.util.servlet.ServletUtils.getClientIP;
+import static cn.newfeifan.mall.framework.security.core.util.SecurityFrameworkUtils.getLoginUserId;
+import static cn.newfeifan.mall.module.product.enums.ErrorCodeConstants.*;
+
+/**
+ * 商品spu申请 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class SpuApplyServiceImpl implements SpuApplyService {
+
+    @Resource
+    private SpuApplyMapper spuApplyMapper;
+    @Resource
+    private SkuApplyService skuApplyService;
+    @Resource
+    private SpuApplyLogService spuApplyLogService;
+    @Resource
+    private ProductSpuService spuService;
+    @Resource
+    private AdminUserService adminUserService;
+    @Resource
+    private SmsCodeApi smsCodeApi;
+
+    @Override
+    public Long createSpuApply(SpuApplySaveReqVO createReqVO) {
+        // 插入
+        SpuApplyDO spuApply = BeanUtils.toBean(createReqVO, SpuApplyDO.class);
+        spuApplyMapper.insert(spuApply);
+        // 返回
+        return spuApply.getId();
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public void updateSpuApplyByCheckStatus(SpuApplySaveReqVO updateReqVO) {
+        // 校验存在
+        SpuApplyRespVO spuApplyDetail = getSpuApplyDetail(updateReqVO.getId());
+        if (spuApplyDetail == null) {
+            throw exception(SPU_APPLY_NOT_EXISTS);
+        }
+
+        // 更新
+        SpuApplyDO updateObj = BeanUtils.toBean(updateReqVO, SpuApplyDO.class);
+        Long loginUserId = getLoginUserId();
+        updateObj.setCheckSystemUserId(loginUserId);
+        updateObj.setCheckTime(LocalDateTime.now());
+        spuApplyMapper.updateById(updateObj);
+
+        //如果审核通过 同步修改商品
+        if (updateReqVO.getCheckStatus().equals(SpuApplyCheckStatusEnum.CHECK_PASS.getStatus())) {
+
+            ProductSpuDO spu = spuService.getSpuByApplyId(updateReqVO.getId());
+
+            if (spu != null) {
+                spuService.updateSpu(BeanUtils.toBean(spuApplyDetail, ProductSpuSaveReqVO.class));
+            } else {
+                ProductSpuSaveReqVO bean = BeanUtils.toBean(spuApplyDetail, ProductSpuSaveReqVO.class);
+                bean.setSpuApplyId(updateReqVO.getId());
+                spuService.createSpu(bean);
+            }
+
+        }
+
+        // 记录审核
+        spuApplyLogService.createSpuApplyLog(SpuApplyLogSaveReqVO.builder()
+                .status(updateReqVO.getCheckStatus())
+                .productSpuApplyId(updateReqVO.getId())
+                .checkComment(updateReqVO.getCheckComment())
+                .checkSystemUserId(loginUserId)
+                .changeJsonObject(JSON.toJSONString(spuApplyDetail))
+                .build());
+
+        AdminUserDO user = adminUserService.getUser(updateReqVO.getApplyMemberUserId());
+        SmsCodeSendReqDTO smsCodeSendReqDTO = SmsCodeSendReqDTO.builder()
+                .mobile(user.getMobile())
+                .createIp(getClientIP())
+                .name(spuApplyDetail.getName())
+                .build();
+        if (updateReqVO.getCheckStatus().equals(SpuApplyCheckStatusEnum.CHECK_PASS.getStatus())) {
+            smsCodeSendReqDTO.setScene(SmsSceneEnum.SPU_APPLY_SUCCESS.getScene());
+        } else {
+            smsCodeSendReqDTO.setScene(SmsSceneEnum.SPU_APPLY_ERROR.getScene());
+        }
+        // 发送短信
+        smsCodeApi.sendSmsCode(smsCodeSendReqDTO);
+    }
+
+    @Override
+    public void deleteSpuApply(Long id) {
+        // 校验存在
+        validateSpuApplyExists(id);
+        // 删除
+        spuApplyMapper.deleteById(id);
+    }
+
+    private void validateSpuApplyExists(Long id) {
+        if (spuApplyMapper.selectById(id) == null) {
+            throw exception(SPU_APPLY_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public SpuApplyDO getSpuApply(Long id) {
+        return spuApplyMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<SpuApplyDO> getSpuApplyPage(SpuApplyPageReqVO pageReqVO) {
+        return spuApplyMapper.selectPage(pageReqVO);
+    }
+
+    @Override
+    public SpuApplyDO getSpu(Long id) {
+        return spuApplyMapper.selectById(id);
+    }
+
+    @Override
+    public SpuApplyRespVO getSpuApplyDetail(Long id) {
+        // 获得商品 SPU 申请
+        SpuApplyDO spu = getSpu(id);
+        if (spu == null) {
+            return null;
+        }
+        // 查询商品 SKU
+        List<SkuApplyDO> skus = skuApplyService.getSkuListBySpuId(spu.getId());
+
+        String shopName = spuApplyMapper.selectShopNameById(spu.getShopId());
+
+        SpuApplyRespVO convert = SpuApplyConvert.INSTANCE.convert(spu, skus);
+        convert.setShopName(shopName);
+        return convert;
+    }
+
+    @Override
+    public Long getSpuApplyTotal() {
+        return spuApplyMapper.selectCount(SpuApplyDO::getCheckStatus, SpuApplyCheckStatusEnum.WAIT_CHECK.getStatus());
+    }
+
+}

+ 53 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spuapplylog/SpuApplyLogService.java

@@ -0,0 +1,53 @@
+package cn.newfeifan.mall.module.product.service.spuapplylog;
+
+import javax.validation.*;
+import cn.newfeifan.mall.module.product.controller.admin.spuapplylog.vo.*;
+import cn.newfeifan.mall.module.product.dal.dataobject.spuapplylog.SpuApplyLogDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+
+/**
+ * 商品审核记录 Service 接口
+ *
+ * @author 非繁人
+ */
+public interface SpuApplyLogService {
+
+    /**
+     * 创建商品审核记录
+     *
+     * @param createReqVO 创建信息
+     * @return 编号
+     */
+    Long createSpuApplyLog(@Valid SpuApplyLogSaveReqVO createReqVO);
+
+    /**
+     * 更新商品审核记录
+     *
+     * @param updateReqVO 更新信息
+     */
+    void updateSpuApplyLog(@Valid SpuApplyLogSaveReqVO updateReqVO);
+
+    /**
+     * 删除商品审核记录
+     *
+     * @param id 编号
+     */
+    void deleteSpuApplyLog(Long id);
+
+    /**
+     * 获得商品审核记录
+     *
+     * @param id 编号
+     * @return 商品审核记录
+     */
+    SpuApplyLogDO getSpuApplyLog(Long id);
+
+    /**
+     * 获得商品审核记录分页
+     *
+     * @param pageReqVO 分页查询
+     * @return 商品审核记录分页
+     */
+    PageResult<SpuApplyLogDO> getSpuApplyLogPage(SpuApplyLogPageReqVO pageReqVO);
+
+}

+ 70 - 0
feifan-module-mall/feifan-module-product-biz/src/main/java/cn/newfeifan/mall/module/product/service/spuapplylog/SpuApplyLogServiceImpl.java

@@ -0,0 +1,70 @@
+package cn.newfeifan.mall.module.product.service.spuapplylog;
+
+import org.springframework.stereotype.Service;
+import javax.annotation.Resource;
+import org.springframework.validation.annotation.Validated;
+import cn.newfeifan.mall.module.product.controller.admin.spuapplylog.vo.*;
+import cn.newfeifan.mall.module.product.dal.dataobject.spuapplylog.SpuApplyLogDO;
+import cn.newfeifan.mall.framework.common.pojo.PageResult;
+import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
+
+import cn.newfeifan.mall.module.product.dal.mysql.spuapplylog.SpuApplyLogMapper;
+
+import static cn.newfeifan.mall.framework.common.exception.util.ServiceExceptionUtil.exception;
+import static cn.newfeifan.mall.module.product.enums.ErrorCodeConstants.*;
+
+/**
+ * 商品审核记录 Service 实现类
+ *
+ * @author 非繁人
+ */
+@Service
+@Validated
+public class SpuApplyLogServiceImpl implements SpuApplyLogService {
+
+    @Resource
+    private SpuApplyLogMapper spuApplyLogMapper;
+
+    @Override
+    public Long createSpuApplyLog(SpuApplyLogSaveReqVO createReqVO) {
+        // 插入
+        SpuApplyLogDO spuApplyLog = BeanUtils.toBean(createReqVO, SpuApplyLogDO.class);
+        spuApplyLogMapper.insert(spuApplyLog);
+        // 返回
+        return spuApplyLog.getId();
+    }
+
+    @Override
+    public void updateSpuApplyLog(SpuApplyLogSaveReqVO updateReqVO) {
+        // 校验存在
+        validateSpuApplyLogExists(updateReqVO.getId());
+        // 更新
+        SpuApplyLogDO updateObj = BeanUtils.toBean(updateReqVO, SpuApplyLogDO.class);
+        spuApplyLogMapper.updateById(updateObj);
+    }
+
+    @Override
+    public void deleteSpuApplyLog(Long id) {
+        // 校验存在
+        validateSpuApplyLogExists(id);
+        // 删除
+        spuApplyLogMapper.deleteById(id);
+    }
+
+    private void validateSpuApplyLogExists(Long id) {
+        if (spuApplyLogMapper.selectById(id) == null) {
+            throw exception(SPU_APPLY_LOG_NOT_EXISTS);
+        }
+    }
+
+    @Override
+    public SpuApplyLogDO getSpuApplyLog(Long id) {
+        return spuApplyLogMapper.selectById(id);
+    }
+
+    @Override
+    public PageResult<SpuApplyLogDO> getSpuApplyLogPage(SpuApplyLogPageReqVO pageReqVO) {
+        return spuApplyLogMapper.selectPage(pageReqVO);
+    }
+
+}

+ 12 - 0
feifan-module-mall/feifan-module-product-biz/src/main/resources/mapper/skuapply/SkuApplyMapper.xml

@@ -0,0 +1,12 @@
+<?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="cn.newfeifan.mall.module.product.dal.mysql.skuapply.SkuApplyMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 12 - 0
feifan-module-mall/feifan-module-product-biz/src/main/resources/mapper/spuapply/SpuApplyMapper.xml

@@ -0,0 +1,12 @@
+<?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="cn.newfeifan.mall.module.product.dal.mysql.spuapply.SpuApplyMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 12 - 0
feifan-module-mall/feifan-module-product-biz/src/main/resources/mapper/spuapplylog/SpuApplyLogMapper.xml

@@ -0,0 +1,12 @@
+<?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="cn.newfeifan.mall.module.product.dal.mysql.spuapplylog.SpuApplyLogMapper">
+
+    <!--
+        一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
+        无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
+        代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
+        文档可见:https://www.zhongxing.cn/MyBatis/x-plugins/
+     -->
+
+</mapper>

+ 6 - 22
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/merchantapplylog/MerchantApplyLogController.java

@@ -13,9 +13,6 @@ import io.swagger.v3.oas.annotations.Parameter;
 import io.swagger.v3.oas.annotations.Operation;
 
 import javax.validation.*;
-import javax.servlet.http.*;
-import java.util.*;
-import java.io.IOException;
 
 import cn.newfeifan.mall.framework.common.pojo.PageParam;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
@@ -23,11 +20,6 @@ import cn.newfeifan.mall.framework.common.pojo.CommonResult;
 import cn.newfeifan.mall.framework.common.util.object.BeanUtils;
 import static cn.newfeifan.mall.framework.common.pojo.CommonResult.success;
 
-import cn.newfeifan.mall.framework.excel.core.util.ExcelUtils;
-
-import cn.newfeifan.mall.framework.operatelog.core.annotations.OperateLog;
-import static cn.newfeifan.mall.framework.operatelog.core.enums.OperateTypeEnum.*;
-
 import cn.newfeifan.mall.sale.dal.dataobject.merchantapplylog.MerchantApplyLogDO;
 
 @Tag(name = "管理后台 - 商户审核记录")
@@ -76,21 +68,13 @@ public class MerchantApplyLogController {
     @Operation(summary = "获得商户审核记录分页")
     @PreAuthorize("@ss.hasPermission('sale:merchant-apply-log:query')")
     public CommonResult<PageResult<MerchantApplyLogRespVO>> getMerchantApplyLogPage(@Valid MerchantApplyLogPageReqVO pageReqVO) {
-        PageResult<MerchantApplyLogDO> pageResult = merchantApplyLogService.getMerchantApplyLogPage(pageReqVO);
-        return success(BeanUtils.toBean(pageResult, MerchantApplyLogRespVO.class));
-    }
 
-    @GetMapping("/export-excel")
-    @Operation(summary = "导出商户审核记录 Excel")
-    @PreAuthorize("@ss.hasPermission('sale:merchant-apply-log:export')")
-    @OperateLog(type = EXPORT)
-    public void exportMerchantApplyLogExcel(@Valid MerchantApplyLogPageReqVO pageReqVO,
-              HttpServletResponse response) throws IOException {
-        pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
-        List<MerchantApplyLogDO> list = merchantApplyLogService.getMerchantApplyLogPage(pageReqVO).getList();
-        // 导出 Excel
-        ExcelUtils.write(response, "商户审核记录.xls", "数据", MerchantApplyLogRespVO.class,
-                        BeanUtils.toBean(list, MerchantApplyLogRespVO.class));
+        if(pageReqVO.getMerchantApplyId() == null) {
+            pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
+        }
+
+        PageResult<MerchantApplyLogRespVO> pageResult = merchantApplyLogService.getMerchantApplyLogPage(pageReqVO);
+        return success(pageResult);
     }
 
 }

+ 3 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/controller/admin/merchantapplylog/vo/MerchantApplyLogRespVO.java

@@ -34,4 +34,7 @@ public class MerchantApplyLogRespVO {
     @ExcelProperty("创建时间")
     private LocalDateTime createTime;
 
+    @Schema(description = "审核人名称")
+    private String checkName;
+
 }

+ 17 - 0
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/service/merchantapply/MerchantApplyServiceImpl.java

@@ -123,6 +123,14 @@ public class MerchantApplyServiceImpl implements MerchantApplyService {
                 updateDO.setCheckStatus(MerchantApplyCheckStatusEnum.WAIT_AUDIT.getType());
                 merchantApplyMapper.updateById(updateDO);
 
+                MerchantApplyLogSaveReqVO build = MerchantApplyLogSaveReqVO.builder()
+                        .status(MerchantApplyCheckStatusEnum.AUDIT_PASS.getType())
+                        .merchantApplyId(updateDO.getId())
+                        .checkComment(updateDO.getCheckComment())
+                        .checkSystemUserId(loginUserId)
+                        .build();
+                merchantApplyLogService.createMerchantApplyLog(build);
+
                 // todo 商户审核通过向上级发送微信信息
                 sentWxChantMessageToThSystemUser(updateDO,MerchantApplyCheckPersonStatusEnum.TWO.getUserid());
                 return;
@@ -132,6 +140,14 @@ public class MerchantApplyServiceImpl implements MerchantApplyService {
                 updateDO.setCheckStatus(MerchantApplyCheckStatusEnum.WAIT_AUDIT.getType());
                 merchantApplyMapper.updateById(updateDO);
 
+                MerchantApplyLogSaveReqVO build = MerchantApplyLogSaveReqVO.builder()
+                        .status(MerchantApplyCheckStatusEnum.AUDIT_PASS.getType())
+                        .merchantApplyId(updateDO.getId())
+                        .checkComment(updateDO.getCheckComment())
+                        .checkSystemUserId(loginUserId)
+                        .build();
+                merchantApplyLogService.createMerchantApplyLog(build);
+
                 // todo 商户审核通过向上级发送微信信息
                 sentWxChantMessageToThSystemUser(updateDO,MerchantApplyCheckPersonStatusEnum.THREE.getUserid());
 
@@ -147,6 +163,7 @@ public class MerchantApplyServiceImpl implements MerchantApplyService {
                 .status(updateDO.getCheckStatus())
                 .merchantApplyId(updateDO.getId())
                 .checkComment(updateDO.getCheckComment())
+                .checkSystemUserId(loginUserId)
                 .build();
         merchantApplyLogService.createMerchantApplyLog(build);
 

+ 2 - 1
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/service/merchantapplylog/MerchantApplyLogService.java

@@ -2,6 +2,7 @@ package cn.newfeifan.mall.sale.service.merchantapplylog;
 
 import javax.validation.*;
 import cn.newfeifan.mall.sale.controller.admin.merchantapplylog.vo.MerchantApplyLogPageReqVO;
+import cn.newfeifan.mall.sale.controller.admin.merchantapplylog.vo.MerchantApplyLogRespVO;
 import cn.newfeifan.mall.sale.controller.admin.merchantapplylog.vo.MerchantApplyLogSaveReqVO;
 import cn.newfeifan.mall.sale.dal.dataobject.merchantapplylog.MerchantApplyLogDO;
 import cn.newfeifan.mall.framework.common.pojo.PageResult;
@@ -49,6 +50,6 @@ public interface MerchantApplyLogService {
      * @param pageReqVO 分页查询
      * @return 商户审核记录分页
      */
-    PageResult<MerchantApplyLogDO> getMerchantApplyLogPage(MerchantApplyLogPageReqVO pageReqVO);
+    PageResult<MerchantApplyLogRespVO> getMerchantApplyLogPage(MerchantApplyLogPageReqVO pageReqVO);
 
 }

+ 23 - 7
feifan-module-sale/feifan-module-sale-biz/src/main/java/cn/newfeifan/mall/sale/service/merchantapplylog/MerchantApplyLogServiceImpl.java

@@ -1,6 +1,9 @@
 package cn.newfeifan.mall.sale.service.merchantapplylog;
 
+import cn.newfeifan.mall.module.system.dal.dataobject.user.AdminUserDO;
+import cn.newfeifan.mall.module.system.service.user.AdminUserService;
 import cn.newfeifan.mall.sale.controller.admin.merchantapplylog.vo.MerchantApplyLogPageReqVO;
+import cn.newfeifan.mall.sale.controller.admin.merchantapplylog.vo.MerchantApplyLogRespVO;
 import cn.newfeifan.mall.sale.controller.admin.merchantapplylog.vo.MerchantApplyLogSaveReqVO;
 import cn.newfeifan.mall.sale.dal.dataobject.merchant.MerchantDO;
 import cn.newfeifan.mall.sale.dal.dataobject.merchantapply.MerchantApplyDO;
@@ -37,6 +40,9 @@ public class MerchantApplyLogServiceImpl implements MerchantApplyLogService {
     @Resource
     private MerchantApplyService merchantApplyService;
 
+    @Resource
+    AdminUserService adminUserService;
+
     @Override
     public Long createMerchantApplyLog(MerchantApplyLogSaveReqVO createReqVO) {
         // 插入
@@ -79,19 +85,29 @@ public class MerchantApplyLogServiceImpl implements MerchantApplyLogService {
     }
 
     @Override
-    public PageResult<MerchantApplyLogDO> getMerchantApplyLogPage(MerchantApplyLogPageReqVO pageReqVO) {
+    public PageResult<MerchantApplyLogRespVO> getMerchantApplyLogPage(MerchantApplyLogPageReqVO pageReqVO) {
+
+        if(pageReqVO.getMerchantApplyId() == null){
+            MerchantDO merchant = merchantService.getMerchant(pageReqVO.getMerchantId());
 
-        MerchantDO merchant = merchantService.getMerchant(pageReqVO.getMerchantId());
+            MerchantApplyDO merchantApply = merchantApplyService.getMerchantApply(merchant.getMerchantApplyId());
 
-        MerchantApplyDO merchantApply = merchantApplyService.getMerchantApply(merchant.getMerchantApplyId());
+            if (merchantApply == null) {
+                return PageResult.empty();
+            }
 
-        if (merchantApply == null) {
-            return PageResult.empty();
+            pageReqVO.setMerchantApplyId(merchantApply.getId());
         }
 
-        pageReqVO.setMerchantApplyId(merchantApply.getId());
+        PageResult<MerchantApplyLogDO> result = merchantApplyLogMapper.selectPage(pageReqVO);
+        PageResult<MerchantApplyLogRespVO> bean = BeanUtils.toBean(result, MerchantApplyLogRespVO.class);
+
+        for (MerchantApplyLogRespVO respVO : bean.getList()) {
+            AdminUserDO user = adminUserService.getUser(respVO.getCheckSystemUserId());
+            respVO.setCheckName(user.getNickname());
+        }
 
-        return merchantApplyLogMapper.selectPage(pageReqVO);
+        return bean;
     }
 
 }

+ 5 - 0
feifan-module-system/feifan-module-system-api/src/main/java/cn/newfeifan/mall/module/system/api/sms/dto/code/SmsCodeSendReqDTO.java

@@ -42,4 +42,9 @@ public class SmsCodeSendReqDTO {
      */
     private LocalDateTime sendTime;
 
+    /**
+     * 名称
+     */
+    private String name;
+
 }

+ 3 - 0
feifan-module-system/feifan-module-system-api/src/main/java/cn/newfeifan/mall/module/system/enums/sms/SmsSceneEnum.java

@@ -21,6 +21,9 @@ public enum SmsSceneEnum implements IntArrayValuable {
     MEMBER_UPDATE_PASSWORD(3, "user-update-password", "会员用户 - 修改密码"),
     MEMBER_RESET_PASSWORD(4, "user-reset-password", "会员用户 - 忘记密码"),
     MEMBER_WITHDRAWAL_ERROR(6, "user-withdrawal-error", "会员用户 - 提现失败时发送通知给用户"),
+    SPU_APPLY_INFORM(7, "spu-apply-inform", "系统用户 - 商品审核申请通知"),
+    SPU_APPLY_ERROR(8, "spu-apply-error", "系统用户 - 商品审核驳回通知"),
+    SPU_APPLY_SUCCESS(9, "spu-apply-success", "系统用户 - 商品审核通过通知"),
 
     ADMIN_MEMBER_LOGIN(21, "admin-sms-login", "后台用户 - 手机号登录");
 

+ 3 - 0
feifan-module-system/feifan-module-system-biz/src/main/java/cn/newfeifan/mall/module/system/service/sms/SmsCodeServiceImpl.java

@@ -52,6 +52,9 @@ public class SmsCodeServiceImpl implements SmsCodeService {
         if (reqDTO.getScene().equals(SmsSceneEnum.MEMBER_WITHDRAWAL_ERROR.getScene())) {
             DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
             map = MapUtil.of("time", formatter.format(reqDTO.getSendTime()));
+        } else if(reqDTO.getScene().equals(SmsSceneEnum.SPU_APPLY_ERROR.getScene()) ||
+        reqDTO.getScene().equals(SmsSceneEnum.SPU_APPLY_SUCCESS.getScene())){
+            map = MapUtil.of("name", reqDTO.getName());
         } else {
             // 创建验证码
             String code = createSmsCode(reqDTO.getMobile(), reqDTO.getScene(), reqDTO.getCreateIp());