产品模块4

This commit is contained in:
xuelijun
2025-07-29 10:25:56 +08:00
parent 203749552d
commit 61f5816910
36 changed files with 1140 additions and 958 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -13,6 +13,7 @@
<modules> <modules>
<module>tashow-infra-api</module> <module>tashow-infra-api</module>
<module>tashow-system-api</module> <module>tashow-system-api</module>
<module>tashow-product-api</module>
</modules> </modules>
</project> </project>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.tashow.cloud</groupId>
<artifactId>tashow-feign</artifactId>
<version>${revision}</version>
</parent>
<artifactId>tashow-product-api</artifactId>
<packaging>jar</packaging>
<name>${project.artifactId}</name>
<description>
infra 模块 API暴露给其它模块调用
</description>
<dependencies>
<dependency>
<groupId>com.tashow.cloud</groupId>
<artifactId>tashow-common</artifactId>
</dependency>
<!-- 参数校验 -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<optional>true</optional>
</dependency>
<!-- RPC 远程调用相关 -->
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-openfeign</artifactId>
<optional>true</optional>
</dependency>
</dependencies>
</project>

View File

@@ -0,0 +1,4 @@
/**
* infra API 包,定义暴露给其它模块的 API
*/
package com.tashow.cloud.productapi.api;

View File

@@ -0,0 +1,24 @@
package com.tashow.cloud.productapi.enums;
import com.tashow.cloud.common.enums.RpcConstants;
/**
* API 相关的枚举
*
* @author 芋道源码
*/
public class ApiConstants {
/**
* 服务名
*
* 注意,需要保证和 spring.application.name 保持一致
*/
public static final String NAME = "product-server";
public static final String PREFIX = RpcConstants.RPC_API_PREFIX + "/infra";
public static final String VERSION = "1.0.0";
}

View File

@@ -0,0 +1,20 @@
package com.tashow.cloud.productapi.enums;
/**
* Infra 字典类型的枚举类
*
* @author 芋道源码
*/
public interface DictTypeConstants {
String JOB_STATUS = "product_job_status"; // 定时任务状态的枚举
String JOB_LOG_STATUS = "product_job_log_status"; // 定时任务日志状态的枚举
String API_ERROR_LOG_PROCESS_STATUS = "product_api_error_log_process_status"; // API 错误日志的处理状态的枚举
String CONFIG_TYPE = "product_config_type"; // 参数配置类型
String BOOLEAN_STRING = "product_boolean_string"; // Boolean 是否类型
String OPERATE_TYPE = "product_operate_type"; // 操作类型
}

View File

@@ -0,0 +1,17 @@
package com.tashow.cloud.productapi.enums;
import com.tashow.cloud.common.exception.ErrorCode;
/**
* Infra 错误码枚举类
*
* infra 系统,使用 1-001-000-000 段
*/
public interface ErrorCodeConstants {
ErrorCode CATEGORY_NOT_EXISTS = new ErrorCode(10001, "产品类目不存在");
ErrorCode PROD_NOT_EXISTS = new ErrorCode(10002, "商品不存在");
ErrorCode PROD_ADDITIONAL_FEE_DATES_NOT_EXISTS = new ErrorCode(10003, "特殊日期附加费用规则不存在");
ErrorCode PROD_ADDITIONAL_FEE_PERIODS_NOT_EXISTS = new ErrorCode(10004, "特殊时段附加费用规则不存在");
}

View File

@@ -42,11 +42,12 @@
<version>2.2.20</version> <version>2.2.20</version>
</dependency> </dependency>
<!-- <dependency>-->
<!-- <groupId>com.github.jsqlparser</groupId>--> <dependency>
<!-- <artifactId>jsqlparser</artifactId>--> <groupId>com.tashow.cloud</groupId>
<!-- <version>4.5</version>--> <artifactId>tashow-framework-monitor</artifactId>
<!-- </dependency>--> </dependency>
<!-- EasyExcel 核心库 --> <!-- EasyExcel 核心库 -->
<dependency> <dependency>
@@ -55,7 +56,16 @@
<version>4.0.3</version> <version>4.0.3</version>
</dependency> </dependency>
<dependency>
<groupId>com.tashow.cloud</groupId>
<artifactId>tashow-product-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>com.tashow.cloud</groupId>
<artifactId>tashow-data-excel</artifactId>
<version>${revision}</version>
</dependency>
<!-- RPC 远程调用相关 --> <!-- RPC 远程调用相关 -->
<dependency> <dependency>
<groupId>com.tashow.cloud</groupId> <groupId>com.tashow.cloud</groupId>

View File

@@ -1,54 +1,93 @@
/*
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
*
* https://www.mall4j.com/
*
* 未经允许,不可做商业用途!
*
* 版权所有,侵权必究!
*//*
package com.tashow.cloud.product.controller; package com.tashow.cloud.product.controller;
import com.tashow.cloud.product.domain.Category; import com.tashow.cloud.product.dto.CategoryDO;
import com.tashow.cloud.product.domain.ServerResponseEntity;
import com.tashow.cloud.product.service.CategoryService; import com.tashow.cloud.product.service.CategoryService;
import jakarta.annotation.security.PermitAll; import com.tashow.cloud.product.vo.category.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping; import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RestController; import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation;
import java.util.List; import jakarta.validation.constraints.*;
import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.util.*;
import java.io.IOException;
*/ import com.tashow.cloud.common.pojo.PageParam;
/** import com.tashow.cloud.common.pojo.PageResult;
* 分类接口 import com.tashow.cloud.common.pojo.CommonResult;
* @author lanhai import com.tashow.cloud.common.util.object.BeanUtils;
*//* import static com.tashow.cloud.common.pojo.CommonResult.success;
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 产品类目")
@RestController @RestController
@RequestMapping("/category") @RequestMapping("/tz/category")
@Validated
public class CategoryController { public class CategoryController {
@Autowired @Resource
private CategoryService categoryService; private CategoryService categoryService;
*/ @PostMapping("/create")
/** @Operation(summary = "创建产品类目")
* 分类信息列表接口 @PreAuthorize("@ss.hasPermission('tz:category:create')")
*//* public CommonResult<Long> createCategory(@Valid @RequestBody CategorySaveReqVO createReqVO) {
return success(categoryService.createCategory(createReqVO));
@PermitAll
@GetMapping("/categoryInfo")
public ServerResponseEntity<List<Category>> categoryInfo() {
List<Category> categories = categoryService.tableCategory(1L);
return ServerResponseEntity.success(categories);
} }
@PutMapping("/update")
@Operation(summary = "更新产品类目")
@PreAuthorize("@ss.hasPermission('tz:category:update')")
public CommonResult<Boolean> updateCategory(@Valid @RequestBody CategorySaveReqVO updateReqVO) {
categoryService.updateCategory(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除产品类目")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('tz:category:delete')")
public CommonResult<Boolean> deleteCategory(@RequestParam("id") Long id) {
categoryService.deleteCategory(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得产品类目")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('tz:category:query')")
public CommonResult<CategoryRespVO> getCategory(@RequestParam("id") Long id) {
CategoryDO category = categoryService.getCategory(id);
return success(BeanUtils.toBean(category, CategoryRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得产品类目分页")
@PreAuthorize("@ss.hasPermission('tz:category:query')")
public CommonResult<PageResult<CategoryRespVO>> getCategoryPage(@Valid CategoryPageReqVO pageReqVO) {
PageResult<CategoryDO> pageResult = categoryService.getCategoryPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, CategoryRespVO.class));
}
/* @GetMapping("/export-excel")
@Operation(summary = "导出产品类目 Excel")
@PreAuthorize("@ss.hasPermission('tz:category:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportCategoryExcel(@Valid CategoryPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<CategoryDO> list = categoryService.getCategoryPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "产品类目.xls", "数据", CategoryRespVO.class,
BeanUtils.toBean(list, CategoryRespVO.class));
}*/
} }
*/

View File

@@ -0,0 +1,97 @@
package com.tashow.cloud.product.controller;
import com.tashow.cloud.product.dto.ProdAdditionalFeeDatesDO;
import com.tashow.cloud.product.service.ProdAdditionalFeeDatesService;
import com.tashow.cloud.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesPageReqVO;
import com.tashow.cloud.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesRespVO;
import com.tashow.cloud.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesSaveReqVO;
import org.springframework.web.bind.annotation.*;
import jakarta.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 jakarta.validation.constraints.*;
import jakarta.validation.*;
import jakarta.servlet.http.*;
import java.util.*;
import java.io.IOException;
import com.tashow.cloud.common.pojo.PageParam;
import com.tashow.cloud.common.pojo.PageResult;
import com.tashow.cloud.common.pojo.CommonResult;
import com.tashow.cloud.common.util.object.BeanUtils;
import static com.tashow.cloud.common.pojo.CommonResult.success;
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.*;
@Tag(name = "管理后台 - 特殊日期附加费用规则")
@RestController
@RequestMapping("/tz/prod-additional-fee-dates")
@Validated
public class ProdAdditionalFeeDatesController {
@Resource
private ProdAdditionalFeeDatesService prodAdditionalFeeDatesService;
@PostMapping("/create")
@Operation(summary = "创建特殊日期附加费用规则")
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-dates:create')")
public CommonResult<Long> createProdAdditionalFeeDates(@Valid @RequestBody ProdAdditionalFeeDatesSaveReqVO createReqVO) {
return success(prodAdditionalFeeDatesService.createProdAdditionalFeeDates(createReqVO));
}
@PutMapping("/update")
@Operation(summary = "更新特殊日期附加费用规则")
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-dates:update')")
public CommonResult<Boolean> updateProdAdditionalFeeDates(@Valid @RequestBody ProdAdditionalFeeDatesSaveReqVO updateReqVO) {
prodAdditionalFeeDatesService.updateProdAdditionalFeeDates(updateReqVO);
return success(true);
}
@DeleteMapping("/delete")
@Operation(summary = "删除特殊日期附加费用规则")
@Parameter(name = "id", description = "编号", required = true)
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-dates:delete')")
public CommonResult<Boolean> deleteProdAdditionalFeeDates(@RequestParam("id") Long id) {
prodAdditionalFeeDatesService.deleteProdAdditionalFeeDates(id);
return success(true);
}
@GetMapping("/get")
@Operation(summary = "获得特殊日期附加费用规则")
@Parameter(name = "id", description = "编号", required = true, example = "1024")
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-dates:query')")
public CommonResult<ProdAdditionalFeeDatesRespVO> getProdAdditionalFeeDates(@RequestParam("id") Long id) {
ProdAdditionalFeeDatesDO prodAdditionalFeeDates = prodAdditionalFeeDatesService.getProdAdditionalFeeDates(id);
return success(BeanUtils.toBean(prodAdditionalFeeDates, ProdAdditionalFeeDatesRespVO.class));
}
@GetMapping("/page")
@Operation(summary = "获得特殊日期附加费用规则分页")
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-dates:query')")
public CommonResult<PageResult<ProdAdditionalFeeDatesRespVO>> getProdAdditionalFeeDatesPage(@Valid ProdAdditionalFeeDatesPageReqVO pageReqVO) {
PageResult<ProdAdditionalFeeDatesDO> pageResult = prodAdditionalFeeDatesService.getProdAdditionalFeeDatesPage(pageReqVO);
return success(BeanUtils.toBean(pageResult, ProdAdditionalFeeDatesRespVO.class));
}
@GetMapping("/export-excel")
@Operation(summary = "导出特殊日期附加费用规则 Excel")
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-dates:export')")
@ApiAccessLog(operateType = EXPORT)
public void exportProdAdditionalFeeDatesExcel(@Valid ProdAdditionalFeeDatesPageReqVO pageReqVO,
HttpServletResponse response) throws IOException {
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
List<ProdAdditionalFeeDatesDO> list = prodAdditionalFeeDatesService.getProdAdditionalFeeDatesPage(pageReqVO).getList();
// 导出 Excel
ExcelUtils.write(response, "特殊日期附加费用规则.xls", "数据", ProdAdditionalFeeDatesRespVO.class,
BeanUtils.toBean(list, ProdAdditionalFeeDatesRespVO.class));
}
}

View File

@@ -1,125 +0,0 @@
package com.tashow.cloud.product.domain;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
/**
* Entity基类
*
* @author ruoyi
*/
public class BaseEntity implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 搜索值
*/
@JsonIgnore
@TableField(exist = false)
private String searchValue;
/**
* 创建者
*/
@TableField(fill = FieldFill.INSERT)
private String createBy;
/**
* 创建时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(fill = FieldFill.INSERT)
private Date createTime;
/**
* 更新者
*/
@TableField(fill = FieldFill.INSERT_UPDATE)
private String updateBy;
/**
* 更新时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(fill = FieldFill.INSERT_UPDATE)
private Date updateTime;
/**
* 备注
*/
private String remark;
/**
* 请求参数
*/
@JsonInclude(JsonInclude.Include.NON_EMPTY)
@TableField(exist = false)
private Map<String, Object> params;
public String getSearchValue() {
return searchValue;
}
public void setSearchValue(String searchValue) {
this.searchValue = searchValue;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public Map<String, Object> getParams() {
if (params == null) {
params = new HashMap<>();
}
return params;
}
public void setParams(Map<String, Object> params) {
this.params = params;
}
}

View File

@@ -1,142 +0,0 @@
/*
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
*
* https://www.mall4j.com/
*
* 未经允许,不可做商业用途!
*
* 版权所有,侵权必究!
*//*
package com.tashow.cloud.product.domain;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.Data;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
*/
/**
* @author lanhai
*//*
@Data
@TableName("tz_category")
public class Category implements Serializable {
*/
/**
* 类目ID
*//*
private Long categoryId;
*/
/**
* 店铺ID
*//*
private Long shopId;
*/
/**
* 父节点
*//*
private Long parentId;
*/
/**
* 产品类目名称
*//*
private String categoryName;
*/
/**
* 类目图标
*//*
private String icon;
*/
/**
* 类目的显示图片
*//*
private String pic;
*/
/**
* 类目描述
*//*
private String describe;
*/
/**
* 标签
*//*
private String tag;
*/
/**
* 排序
*//*
private Integer seq;
*/
/**
* 默认是1表示正常状态,0为下线状态
*//*
private Integer status;
*/
/**
* 创建时间
*//*
private Date createTime;
*/
/**
* 创建时间
*//*
private String creator;
*/
/**
* 分类层级
*//*
private Integer grade;
*/
/**
* 更新时间
*//*
private Date updateTime;
*/
/**
* 修改人
*//*
private String updater;
private static final long serialVersionUID = 1L;
}
*/

View File

@@ -1,200 +0,0 @@
package com.tashow.cloud.product.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
/**
* 商品对象 prod
*
* @author ruoyi
* @date 2025-07-25
*/
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Prod extends BaseEntity {
private static final long serialVersionUID=1L;
/**
* 产品ID
*/
@ApiModelProperty(value = "产品ID", position = 0)
private Long prodId;
/**
* 商品名称
*/
@ApiModelProperty(value = "商品名称", position = 1)
private String prodName;
/**
* 展示的权重
*/
@ApiModelProperty(value = "商品简称", position = 2)
private String abbreviation;
/**
* 展示的权重
*/
@ApiModelProperty(value = "seo标题", position = 3)
private String seoName;
/**
* 展示的权重
*/
@ApiModelProperty(value = "seo搜索", position = 4)
private String seoSearch;
/**
* 展示的权重
*/
@ApiModelProperty(value = "关键词", position = 5)
private String keyword;
/**
* 展示的权重
*/
@ApiModelProperty(value = "店铺id", position = 6)
private Long shopId;
/**
* 展示的权重
*/
@ApiModelProperty(value = "简要描述,卖点等", position = 7)
private String brief;
/**
* 展示的权重
*/
@ApiModelProperty(value = "品牌", position = 8)
private String brand;
/**
* 展示的权重
*/
@ApiModelProperty(value = "详细描述", position = 9)
private String content;
/**
* 展示的权重
*/
@ApiModelProperty(value = "商品编号", position = 10)
private String prodNumber;
/**
* 展示的权重
*/
@ApiModelProperty(value = "商品主图", position = 11)
private String pic;
/**
* 展示的权重
*/
@ApiModelProperty(value = "商品轮播图片,以,分割", position = 12)
private String imgs;
/**
* 展示的权重
*/
@ApiModelProperty(value = "默认是1表示正常状态, -1表示删除, 0下架", position = 13)
private Long status;
/**
* 展示的权重
*/
@ApiModelProperty(value = "商品分类", position = 14)
private Long categoryId;
/**
* 展示的权重
*/
@ApiModelProperty(value = "销量", position = 15)
private Long soldNum;
/**
* 展示的权重
*/
@ApiModelProperty(value = "分享图", position = 16)
private String shareImage;
/**
* 展示的权重
*/
@ApiModelProperty(value = "分享话术", position = 17)
private String shareContent;
/**
* 展示的权重
*/
@ApiModelProperty(value = "是否开启区域0关1开", position = 18)
private Integer regionSwitch;
/**
* 展示的权重
*/
@ApiModelProperty(value = "是否特殊时段0关1开", position = 19)
private Integer additionalSwitch;
/**
* 展示的权重
*/
@ApiModelProperty(value = "是否特殊日期节假日周末什么的0关1开", position = 20)
private Integer additionalFeeSwitch;
/**
* 展示的权重
*/
@ApiModelProperty(value = "是否紧急响应服务0关1开", position = 21)
private Integer emergencySwitch;
/**
* 展示的权重
*/
@ApiModelProperty(value = "是否预约0关1开", position = 22)
private Integer reservationSwitch;
/**
* 展示的权重
*/
@ApiModelProperty(value = "是否接单上线0关1开", position = 23)
private Integer orderLimitSwitch;
/**
* 展示的权重
*/
@ApiModelProperty(value = "是否开启体重配置0关1开", position = 24)
private Integer weightSwitch;
/**
* 展示的权重
*/
@ApiModelProperty(value = "版本 乐观锁", position = 29)
private Long version;
/**
* 展示的权重
*/
@ApiModelProperty(value = "展示的权重", position = 30)
private Long top;
}

View File

@@ -1,19 +0,0 @@
/*
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
*
* https://www.mall4j.com/
*
* 未经允许,不可做商业用途!
*
* 版权所有,侵权必究!
*/
package com.tashow.cloud.product.domain;
/**
* @author lanhai
*/
public interface ResponseCode {
int SUCCESS = 1;
int FAIL = -1;
}

View File

@@ -1,69 +0,0 @@
/*
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
*
* https://www.mall4j.com/
*
* 未经允许,不可做商业用途!
*
* 版权所有,侵权必究!
*/
package com.tashow.cloud.product.domain;
/**
* @author FrozenWatermelon
* @date 2020/7/9
*/
public enum ResponseEnum {
/**
* ok
*/
OK("00000", "ok"),
SHOW_FAIL("A00001", "cw"),
/**
* 用于直接显示提示用户的错误,内容由输入内容决定
*/
/**
* 用于直接显示提示系统的成功,内容由输入内容决定
*/
SHOW_SUCCESS("A00002", ""),
/**
* 未授权
*/
UNAUTHORIZED("A00004", "Unauthorized"),
/**
* 服务器出了点小差
*/
EXCEPTION("A00005", "服务器出了点小差"),
/**
* 方法参数没有校验,内容由输入内容决定
*/
METHOD_ARGUMENT_NOT_VALID("A00014", "方法参数没有校验");
private final String code;
private final String msg;
public String value() {
return code;
}
public String getMsg() {
return msg;
}
ResponseEnum(String code, String msg) {
this.code = code;
this.msg = msg;
}
@Override
public String toString() {
return "ResponseEnum{" + "code='" + code + '\'' + ", msg='" + msg + '\'' + "} " + super.toString();
}
}

View File

@@ -1,198 +0,0 @@
/*
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
*
* https://www.mall4j.com/
*
* 未经允许,不可做商业用途!
*
* 版权所有,侵权必究!
*/
package com.tashow.cloud.product.domain;
import lombok.extern.slf4j.Slf4j;
import java.io.Serializable;
import java.util.Objects;
/**
* @author lanhai
*/
@Slf4j
public class ServerResponseEntity<T> implements Serializable {
/**
* 状态码
*/
private String code;
/**
* 信息
*/
private String msg;
/**
* 数据
*/
private T data;
/**
* 版本
*/
private String version;
/**
* 时间
*/
private Long timestamp;
private String sign;
public String getSign() {
return sign;
}
public void setSign(String sign) {
this.sign = sign;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
public String getMsg() {
return msg;
}
public void setMsg(String msg) {
this.msg = msg;
}
public T getData() {
return data;
}
public ServerResponseEntity setData(T data) {
this.data = data;
return this;
}
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
public Long getTimestamp() {
return timestamp;
}
public void setTimestamp(Long timestamp) {
this.timestamp = timestamp;
}
public boolean isSuccess() {
return Objects.equals(ResponseEnum.OK.value(), this.code);
}
public boolean isFail() {
return !Objects.equals(ResponseEnum.OK.value(), this.code);
}
public ServerResponseEntity() {
// 版本号
this.version = "mall4j.v230424";
}
public static <T> ServerResponseEntity<T> success(T data) {
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
serverResponseEntity.setData(data);
serverResponseEntity.setCode(ResponseEnum.OK.value());
return serverResponseEntity;
}
public static <T> ServerResponseEntity<T> success() {
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
serverResponseEntity.setCode(ResponseEnum.OK.value());
serverResponseEntity.setMsg(ResponseEnum.OK.getMsg());
return serverResponseEntity;
}
public static <T> ServerResponseEntity<T> success(Integer code, T data) {
return success(String.valueOf(code), data);
}
public static <T> ServerResponseEntity<T> success(String code, T data) {
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
serverResponseEntity.setCode(code);
serverResponseEntity.setData(data);
return serverResponseEntity;
}
/**
* 前端显示失败消息
* @param msg 失败消息
* @return
*/
public static <T> ServerResponseEntity<T> showFailMsg(String msg) {
log.error(msg);
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
serverResponseEntity.setMsg(msg);
serverResponseEntity.setCode(ResponseEnum.SHOW_FAIL.value());
return serverResponseEntity;
}
public static <T> ServerResponseEntity<T> fail(ResponseEnum responseEnum) {
log.error(responseEnum.toString());
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
serverResponseEntity.setMsg(responseEnum.getMsg());
serverResponseEntity.setCode(responseEnum.value());
return serverResponseEntity;
}
public static <T> ServerResponseEntity<T> fail(ResponseEnum responseEnum, T data) {
log.error(responseEnum.toString());
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
serverResponseEntity.setMsg(responseEnum.getMsg());
serverResponseEntity.setCode(responseEnum.value());
serverResponseEntity.setData(data);
return serverResponseEntity;
}
public static <T> ServerResponseEntity<T> fail(String code, String msg, T data) {
log.error(msg);
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
serverResponseEntity.setMsg(msg);
serverResponseEntity.setCode(code);
serverResponseEntity.setData(data);
return serverResponseEntity;
}
public static <T> ServerResponseEntity<T> fail(String code, String msg) {
return fail(code, msg, null);
}
public static <T> ServerResponseEntity<T> fail(Integer code, T data) {
ServerResponseEntity<T> serverResponseEntity = new ServerResponseEntity<>();
serverResponseEntity.setCode(String.valueOf(code));
serverResponseEntity.setData(data);
return serverResponseEntity;
}
@Override
public String toString() {
return "ServerResponseEntity{" +
"code='" + code + '\'' +
", msg='" + msg + '\'' +
", data=" + data +
", version='" + version + '\'' +
", timestamp=" + timestamp +
", sign='" + sign + '\'' +
'}';
}
}

View File

@@ -0,0 +1,71 @@
package com.tashow.cloud.product.dto;
import lombok.*;
import java.util.*;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
/**
* 产品类目 DO
*
* @author 芋道源码
*/
@TableName("tz_category")
@KeySequence("tz_category_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class CategoryDO extends BaseDO {
/**
* 类目ID
*/
@TableId
private Long categoryId;
/**
* 店铺ID
*/
private Long shopId;
/**
* 父节点
*/
private Long parentId;
/**
* 产品类目名称
*/
private String categoryName;
/**
* 类目图标
*/
private String icon;
/**
* 类目的显示图片
*/
private String pic;
/**
* 类目描述
*/
private String describe;
/**
* 标签
*/
private String tag;
/**
* 排序
*/
private Integer seq;
/**
* 默认是1表示正常状态,0为下线状态
*/
private Integer status;
/**
* 分类层级
*/
private Integer grade;
}

View File

@@ -0,0 +1,72 @@
package com.tashow.cloud.product.dto;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.*;
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
/**
* 特殊日期附加费用规则 DO
*
* @author 芋道源码
*/
@TableName("tz_prod_additional_fee_dates")
@KeySequence("tz_prod_additional_fee_dates_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class ProdAdditionalFeeDatesDO extends BaseDO {
/**
* 特殊日期规则的唯一标识符
*/
@TableId
private Long id;
/**
* 商品id
*/
private Long prodId;
/**
* 名称
*/
private String name;
/**
* 日期类型0'自定义日期范围':1'指定日期':2'法定节假日',3'固定休息日'
*/
private Boolean dateType;
/**
* 自定义日期时间段JSON格式存储
*/
private String customTimeSlots;
/**
* 指定日期JSON格式存储
*/
private String specificDates;
/**
* 收费方式
*/
private String chargeMode;
/**
* 价格或上浮百分比
*/
private BigDecimal price;
/**
* 是否启用该规则
*/
private Boolean isEnabled;
/**
* 创建时间
*/
private LocalDateTime createdAt;
/**
* 更新时间
*/
private LocalDateTime updatedAt;
}

View File

@@ -1,46 +1,21 @@
/*
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
*
* https://www.mall4j.com/
*
* 未经允许,不可做商业用途!
*
* 版权所有,侵权必究!
*//*
package com.tashow.cloud.product.mapper; package com.tashow.cloud.product.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import java.util.*;
import com.tashow.cloud.product.domain.Category;
import java.util.List; import com.tashow.cloud.common.pojo.PageResult;
import com.tashow.cloud.mybatis.mybatis.core.query.LambdaQueryWrapperX;
import com.tashow.cloud.mybatis.mybatis.core.mapper.BaseMapperX;
import com.tashow.cloud.product.dto.CategoryDO;
import org.apache.ibatis.annotations.Mapper;
*/
/** /**
* @author lanhai * 产品类目 Mapper
*//*
public interface CategoryMapper extends BaseMapper<Category> {
*/
/**
* 根据父级id获取分类列表
* *
* @param parentId * @author 芋道源码
* @return
*//*
List<Category> listByParentId(Long parentId);
*/ */
/** @Mapper
* 根据店铺id获取分类列表 public interface CategoryMapper extends BaseMapperX<CategoryDO> {
*
* @param shopId
* @return
*//*
List<Category> tableCategory(Long shopId);
}*/
}

View File

@@ -0,0 +1,20 @@
package com.tashow.cloud.product.mapper;
import java.util.*;
import com.tashow.cloud.common.pojo.PageResult;
import com.tashow.cloud.mybatis.mybatis.core.query.LambdaQueryWrapperX;
import com.tashow.cloud.mybatis.mybatis.core.mapper.BaseMapperX;
import com.tashow.cloud.product.dto.ProdAdditionalFeeDatesDO;
import org.apache.ibatis.annotations.Mapper;
/**
* 特殊日期附加费用规则 Mapper
*
* @author 芋道源码
*/
@Mapper
public interface ProdAdditionalFeeDatesMapper extends BaseMapperX<ProdAdditionalFeeDatesDO> {
}

View File

@@ -1,71 +1,57 @@
/*
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
*
* https://www.mall4j.com/
*
* 未经允许,不可做商业用途!
*
* 版权所有,侵权必究!
*//*
package com.tashow.cloud.product.service; package com.tashow.cloud.product.service;
import com.baomidou.mybatisplus.extension.service.IService; import java.util.*;
import com.tashow.cloud.product.domain.Category;
import java.util.List; import com.tashow.cloud.product.dto.CategoryDO;
import com.tashow.cloud.product.vo.category.CategoryPageReqVO;
import com.tashow.cloud.product.vo.category.CategorySaveReqVO;
import jakarta.validation.*;
import com.tashow.cloud.common.pojo.PageResult;
import com.tashow.cloud.common.pojo.PageParam;
*/
/** /**
* @author lanhai * 产品类目 Service 接口
* 商品分类 *
*//* * @author 芋道源码
public interface CategoryService extends IService<Category> {
*/ */
/** public interface CategoryService {
* 根据parentId获取分类
* @param parentId 0 一级分类
* @return
*//*
List<Category> listByParentId(Long parentId);
/**
* 创建产品类目
*
* @param createReqVO 创建信息
* @return 编号
*/ */
/** Long createCategory(@Valid CategorySaveReqVO createReqVO);
* 获取用于页面表单展现的category列表根据seq排序
* @param shopId 店铺id
* @return
*//*
List<Category> tableCategory(Long shopId);
/**
* 更新产品类目
*
* @param updateReqVO 更新信息
*/ */
/** void updateCategory(@Valid CategorySaveReqVO updateReqVO);
* 保存分类、品牌、参数
* @param category
*//*
void saveCategory(Category category);
/**
* 删除产品类目
*
* @param id 编号
*/ */
/** void deleteCategory(Long id);
* 修改分类、品牌、参数
* @param category
*//*
void updateCategory(Category category);
/**
* 获得产品类目
*
* @param id 编号
* @return 产品类目
*/ */
/** CategoryDO getCategory(Long id);
* 删除分类、品牌、参数 以及分类对应的图片
* @param categoryId 分类id
*//*
void deleteCategory(Long categoryId); /**
* 获得产品类目分页
*
* @param pageReqVO 分页查询
* @return 产品类目分页
*/
PageResult<CategoryDO> getCategoryPage(CategoryPageReqVO pageReqVO);
} }
*/

View File

@@ -0,0 +1,57 @@
package com.tashow.cloud.product.service;
import java.util.*;
import com.tashow.cloud.product.dto.ProdAdditionalFeeDatesDO;
import com.tashow.cloud.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesPageReqVO;
import com.tashow.cloud.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesSaveReqVO;
import jakarta.validation.*;
import com.tashow.cloud.common.pojo.PageResult;
import com.tashow.cloud.common.pojo.PageParam;
/**
* 特殊日期附加费用规则 Service 接口
*
* @author 芋道源码
*/
public interface ProdAdditionalFeeDatesService {
/**
* 创建特殊日期附加费用规则
*
* @param createReqVO 创建信息
* @return 编号
*/
Long createProdAdditionalFeeDates(@Valid ProdAdditionalFeeDatesSaveReqVO createReqVO);
/**
* 更新特殊日期附加费用规则
*
* @param updateReqVO 更新信息
*/
void updateProdAdditionalFeeDates(@Valid ProdAdditionalFeeDatesSaveReqVO updateReqVO);
/**
* 删除特殊日期附加费用规则
*
* @param id 编号
*/
void deleteProdAdditionalFeeDates(Long id);
/**
* 获得特殊日期附加费用规则
*
* @param id 编号
* @return 特殊日期附加费用规则
*/
ProdAdditionalFeeDatesDO getProdAdditionalFeeDates(Long id);
/**
* 获得特殊日期附加费用规则分页
*
* @param pageReqVO 分页查询
* @return 特殊日期附加费用规则分页
*/
PageResult<ProdAdditionalFeeDatesDO> getProdAdditionalFeeDatesPage(ProdAdditionalFeeDatesPageReqVO pageReqVO);
}

View File

@@ -1,79 +1,78 @@
/*
* Copyright (c) 2018-2999 广州市蓝海创新科技有限公司 All rights reserved.
*
* https://www.mall4j.com/
*
* 未经允许,不可做商业用途!
*
* 版权所有,侵权必究!
*//*
package com.tashow.cloud.product.service.impl; package com.tashow.cloud.product.service.impl;
import cn.hutool.core.collection.CollUtil; import com.tashow.cloud.common.exception.ErrorCode;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.tashow.cloud.product.dto.CategoryDO;
import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.google.common.collect.Lists;
import com.tashow.cloud.product.domain.Category;
import com.tashow.cloud.product.mapper.CategoryMapper; import com.tashow.cloud.product.mapper.CategoryMapper;
import com.tashow.cloud.product.service.CategoryService; import com.tashow.cloud.product.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired; import com.tashow.cloud.product.vo.category.CategoryPageReqVO;
import com.tashow.cloud.product.vo.category.CategorySaveReqVO;
import com.tashow.cloud.productapi.enums.ErrorCodeConstants;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import java.util.Date; import java.util.*;
import java.util.List;
import java.util.Map; import com.tashow.cloud.common.pojo.PageResult;
import java.util.stream.Collectors; import com.tashow.cloud.common.pojo.PageParam;
import com.tashow.cloud.common.util.object.BeanUtils;
import static com.tashow.cloud.common.exception.util.ServiceExceptionUtil.exception;
*/
/** /**
* @author lanhai * 产品类目 Service 实现类
*//* *
* @author 芋道源码
*/
@Service @Service
public class CategoryServiceImpl extends ServiceImpl<CategoryMapper, Category> implements CategoryService { @Validated
public class CategoryServiceImpl implements CategoryService {
@Autowired @Resource
private CategoryMapper categoryMapper; private CategoryMapper categoryMapper;
@Override @Override
public List<Category> listByParentId(Long parentId) { public Long createCategory(CategorySaveReqVO createReqVO) {
return categoryMapper.listByParentId(parentId); // 插入
} CategoryDO category = BeanUtils.toBean(createReqVO, CategoryDO.class);
@Override
public List<Category> tableCategory(Long shopId) {
return categoryMapper.tableCategory(shopId);
}
@Override
@Transactional(rollbackFor = Exception.class)
public void saveCategory(Category category) {
category.setCreateTime(new Date());
// 保存分类信息
categoryMapper.insert(category); categoryMapper.insert(category);
// 返回
return category.getCategoryId();
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) public void updateCategory(CategorySaveReqVO updateReqVO) {
public void updateCategory(Category category) { // 校验存在
Category dbCategory = categoryMapper.selectById(category.getCategoryId()); validateCategoryExists(updateReqVO.getCategoryId());
category.setUpdateTime(new Date()); // 更新
// 保存分类信息 CategoryDO updateObj = BeanUtils.toBean(updateReqVO, CategoryDO.class);
categoryMapper.updateById(category); categoryMapper.updateById(updateObj);
} }
@Override @Override
@Transactional(rollbackFor = Exception.class) public void deleteCategory(Long id) {
public void deleteCategory(Long categoryId) { // 校验存在
Category category = categoryMapper.selectById(categoryId); validateCategoryExists(id);
categoryMapper.deleteById(categoryId); // 删除
categoryMapper.deleteById(id);
} }
private void validateCategoryExists(Long id) {
if (categoryMapper.selectById(id) == null) {
throw exception(ErrorCodeConstants.CATEGORY_NOT_EXISTS);
}
}
@Override
public CategoryDO getCategory(Long id) {
return categoryMapper.selectById(id);
}
@Override
public PageResult<CategoryDO> getCategoryPage(CategoryPageReqVO pageReqVO) {
return null;
}
} }
*/

View File

@@ -0,0 +1,76 @@
package com.tashow.cloud.product.service.impl;
import com.tashow.cloud.product.dto.ProdAdditionalFeeDatesDO;
import com.tashow.cloud.product.mapper.ProdAdditionalFeeDatesMapper;
import com.tashow.cloud.product.service.ProdAdditionalFeeDatesService;
import com.tashow.cloud.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesPageReqVO;
import com.tashow.cloud.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesSaveReqVO;
import com.tashow.cloud.productapi.enums.ErrorCodeConstants;
import org.springframework.stereotype.Service;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import com.tashow.cloud.common.pojo.PageResult;
import com.tashow.cloud.common.pojo.PageParam;
import com.tashow.cloud.common.util.object.BeanUtils;
import static com.tashow.cloud.common.exception.util.ServiceExceptionUtil.exception;
/**
* 特殊日期附加费用规则 Service 实现类
*
* @author 芋道源码
*/
@Service
@Validated
public class ProdAdditionalFeeDatesServiceImpl implements ProdAdditionalFeeDatesService {
@Resource
private ProdAdditionalFeeDatesMapper prodAdditionalFeeDatesMapper;
@Override
public Long createProdAdditionalFeeDates(ProdAdditionalFeeDatesSaveReqVO createReqVO) {
// 插入
ProdAdditionalFeeDatesDO prodAdditionalFeeDates = BeanUtils.toBean(createReqVO, ProdAdditionalFeeDatesDO.class);
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDates);
// 返回
return prodAdditionalFeeDates.getId();
}
@Override
public void updateProdAdditionalFeeDates(ProdAdditionalFeeDatesSaveReqVO updateReqVO) {
// 校验存在
validateProdAdditionalFeeDatesExists(updateReqVO.getId());
// 更新
ProdAdditionalFeeDatesDO updateObj = BeanUtils.toBean(updateReqVO, ProdAdditionalFeeDatesDO.class);
prodAdditionalFeeDatesMapper.updateById(updateObj);
}
@Override
public void deleteProdAdditionalFeeDates(Long id) {
// 校验存在
validateProdAdditionalFeeDatesExists(id);
// 删除
prodAdditionalFeeDatesMapper.deleteById(id);
}
private void validateProdAdditionalFeeDatesExists(Long id) {
if (prodAdditionalFeeDatesMapper.selectById(id) == null) {
throw exception(ErrorCodeConstants.PROD_ADDITIONAL_FEE_DATES_NOT_EXISTS);
}
}
@Override
public ProdAdditionalFeeDatesDO getProdAdditionalFeeDates(Long id) {
return prodAdditionalFeeDatesMapper.selectById(id);
}
@Override
public PageResult<ProdAdditionalFeeDatesDO> getProdAdditionalFeeDatesPage(ProdAdditionalFeeDatesPageReqVO pageReqVO) {
return null;
}
}

View File

@@ -74,7 +74,6 @@ public class ProdServiceImpl implements ProdService {
@Override @Override
public PageResult<ProdDO> getProdPage(ProdPageReqVO pageReqVO) { public PageResult<ProdDO> getProdPage(ProdPageReqVO pageReqVO) {
IPage<ProdDO> prodPageList = prodMapper.getProdPageList(MyBatisUtils.buildPage(pageReqVO), pageReqVO); IPage<ProdDO> prodPageList = prodMapper.getProdPageList(MyBatisUtils.buildPage(pageReqVO), pageReqVO);
return new PageResult<>(prodPageList.getRecords(),prodPageList.getTotal()); return new PageResult<>(prodPageList.getRecords(),prodPageList.getTotal());
} }

View File

@@ -0,0 +1,52 @@
package com.tashow.cloud.product.vo.category;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.tashow.cloud.common.pojo.PageParam;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 产品类目分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class CategoryPageReqVO extends PageParam {
@Schema(description = "店铺ID", example = "22369")
private Long shopId;
@Schema(description = "父节点", example = "16509")
private Long parentId;
@Schema(description = "产品类目名称", example = "王五")
private String categoryName;
@Schema(description = "类目图标")
private String icon;
@Schema(description = "类目的显示图片")
private String pic;
@Schema(description = "类目描述")
private String describe;
@Schema(description = "标签")
private String tag;
@Schema(description = "排序")
private Integer seq;
@Schema(description = "默认是1表示正常状态,0为下线状态", example = "1")
private Integer status;
@Schema(description = "创建时间")
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
private LocalDateTime[] createTime;
@Schema(description = "分类层级")
private Integer grade;
}

View File

@@ -0,0 +1,63 @@
package com.tashow.cloud.product.vo.category;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 产品类目 Response VO")
@Data
@ExcelIgnoreUnannotated
public class CategoryRespVO {
@Schema(description = "类目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15856")
@ExcelProperty("类目ID")
private Long categoryId;
@Schema(description = "店铺ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22369")
@ExcelProperty("店铺ID")
private Long shopId;
@Schema(description = "父节点", requiredMode = Schema.RequiredMode.REQUIRED, example = "16509")
@ExcelProperty("父节点")
private Long parentId;
@Schema(description = "产品类目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@ExcelProperty("产品类目名称")
private String categoryName;
@Schema(description = "类目图标")
@ExcelProperty("类目图标")
private String icon;
@Schema(description = "类目的显示图片")
@ExcelProperty("类目的显示图片")
private String pic;
@Schema(description = "类目描述")
@ExcelProperty("类目描述")
private String describe;
@Schema(description = "标签")
@ExcelProperty("标签")
private String tag;
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("排序")
private Integer seq;
@Schema(description = "默认是1表示正常状态,0为下线状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@ExcelProperty("默认是1表示正常状态,0为下线状态")
private Integer status;
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("创建时间")
private LocalDateTime createTime;
@Schema(description = "分类层级", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("分类层级")
private Integer grade;
}

View File

@@ -0,0 +1,51 @@
package com.tashow.cloud.product.vo.category;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
@Schema(description = "管理后台 - 产品类目新增/修改 Request VO")
@Data
public class CategorySaveReqVO {
@Schema(description = "类目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "15856")
private Long categoryId;
@Schema(description = "店铺ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "22369")
@NotNull(message = "店铺ID不能为空")
private Long shopId;
@Schema(description = "父节点", requiredMode = Schema.RequiredMode.REQUIRED, example = "16509")
@NotNull(message = "父节点不能为空")
private Long parentId;
@Schema(description = "产品类目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
@NotEmpty(message = "产品类目名称不能为空")
private String categoryName;
@Schema(description = "类目图标")
private String icon;
@Schema(description = "类目的显示图片")
private String pic;
@Schema(description = "类目描述")
private String describe;
@Schema(description = "标签")
private String tag;
@Schema(description = "排序", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "排序不能为空")
private Integer seq;
@Schema(description = "默认是1表示正常状态,0为下线状态", requiredMode = Schema.RequiredMode.REQUIRED, example = "1")
@NotNull(message = "默认是1表示正常状态,0为下线状态不能为空")
private Integer status;
@Schema(description = "分类层级", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "分类层级不能为空")
private Integer grade;
}

View File

@@ -0,0 +1,49 @@
package com.tashow.cloud.product.vo.prodadditionalfeedates;
import lombok.*;
import java.util.*;
import io.swagger.v3.oas.annotations.media.Schema;
import com.tashow.cloud.common.pojo.PageParam;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
@Schema(description = "管理后台 - 特殊日期附加费用规则分页 Request VO")
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
public class ProdAdditionalFeeDatesPageReqVO extends PageParam {
@Schema(description = "商品id", example = "24324")
private Long prodId;
@Schema(description = "名称", example = "赵六")
private String name;
@Schema(description = "日期类型0'自定义日期范围':1'指定日期':2'法定节假日',3'固定休息日'", example = "2")
private Boolean dateType;
@Schema(description = "自定义日期时间段JSON格式存储")
private String customTimeSlots;
@Schema(description = "指定日期JSON格式存储")
private String specificDates;
@Schema(description = "收费方式")
private String chargeMode;
@Schema(description = "价格或上浮百分比", example = "17305")
private BigDecimal price;
@Schema(description = "是否启用该规则")
private Boolean isEnabled;
@Schema(description = "创建时间")
private LocalDateTime createdAt;
@Schema(description = "更新时间")
private LocalDateTime updatedAt;
}

View File

@@ -0,0 +1,60 @@
package com.tashow.cloud.product.vo.prodadditionalfeedates;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
import com.alibaba.excel.annotation.*;
@Schema(description = "管理后台 - 特殊日期附加费用规则 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ProdAdditionalFeeDatesRespVO {
@Schema(description = "特殊日期规则的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "1445")
@ExcelProperty("特殊日期规则的唯一标识符")
private Long id;
@Schema(description = "商品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24324")
@ExcelProperty("商品id")
private Long prodId;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@ExcelProperty("名称")
private String name;
@Schema(description = "日期类型0'自定义日期范围':1'指定日期':2'法定节假日',3'固定休息日'", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@ExcelProperty("日期类型0'自定义日期范围':1'指定日期':2'法定节假日',3'固定休息日'")
private Boolean dateType;
@Schema(description = "自定义日期时间段JSON格式存储")
@ExcelProperty("自定义日期时间段JSON格式存储")
private String customTimeSlots;
@Schema(description = "指定日期JSON格式存储")
@ExcelProperty("指定日期JSON格式存储")
private String specificDates;
@Schema(description = "收费方式", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("收费方式")
private String chargeMode;
@Schema(description = "价格或上浮百分比", example = "17305")
@ExcelProperty("价格或上浮百分比")
private BigDecimal price;
@Schema(description = "是否启用该规则", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("是否启用该规则")
private Boolean isEnabled;
@Schema(description = "创建时间")
@ExcelProperty("创建时间")
private LocalDateTime createdAt;
@Schema(description = "更新时间")
@ExcelProperty("更新时间")
private LocalDateTime updatedAt;
}

View File

@@ -0,0 +1,53 @@
package com.tashow.cloud.product.vo.prodadditionalfeedates;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import java.util.*;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDateTime;
@Schema(description = "管理后台 - 特殊日期附加费用规则新增/修改 Request VO")
@Data
public class ProdAdditionalFeeDatesSaveReqVO {
@Schema(description = "特殊日期规则的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "1445")
private Long id;
@Schema(description = "商品id", requiredMode = Schema.RequiredMode.REQUIRED, example = "24324")
@NotNull(message = "商品id不能为空")
private Long prodId;
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "赵六")
@NotEmpty(message = "名称不能为空")
private String name;
@Schema(description = "日期类型0'自定义日期范围':1'指定日期':2'法定节假日',3'固定休息日'", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
@NotNull(message = "日期类型0'自定义日期范围':1'指定日期':2'法定节假日',3'固定休息日'不能为空")
private Boolean dateType;
@Schema(description = "自定义日期时间段JSON格式存储")
private String customTimeSlots;
@Schema(description = "指定日期JSON格式存储")
private String specificDates;
@Schema(description = "收费方式", requiredMode = Schema.RequiredMode.REQUIRED)
@NotEmpty(message = "收费方式不能为空")
private String chargeMode;
@Schema(description = "价格或上浮百分比", example = "17305")
private BigDecimal price;
@Schema(description = "是否启用该规则", requiredMode = Schema.RequiredMode.REQUIRED)
@NotNull(message = "是否启用该规则不能为空")
private Boolean isEnabled;
@Schema(description = "创建时间")
private LocalDateTime createdAt;
@Schema(description = "更新时间")
private LocalDateTime updatedAt;
}

View File

@@ -0,0 +1,76 @@
<configuration>
<!-- 引用 Spring Boot 的 logback 基础配置 -->
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<!-- 变量 yudao.info.base-package基础业务包 -->
<springProperty scope="context" name="tashow.info.base-package" source="tashow.info.base-package"/>
<!-- 格式化输出:%d 表示日期,%X{tid} SkWalking 链路追踪编号,%thread 表示线程名,%-5level级别从左显示 5 个字符宽度,%msg日志消息%n是换行符 -->
<property name="PATTERN_DEFAULT" value="%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} | %highlight(${LOG_LEVEL_PATTERN:-%5p} ${PID:- }) | %boldYellow(%thread [%tid]) %boldGreen(%-40.40logger{39}) | %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}"/>
<!-- 控制台 Appender -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">     
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
<pattern>${PATTERN_DEFAULT}</pattern>
</layout>
</encoder>
</appender>
<!-- 文件 Appender -->
<!-- 参考 Spring Boot 的 file-appender.xml 编写 -->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
<pattern>${PATTERN_DEFAULT}</pattern>
</layout>
</encoder>
<!-- 日志文件名 -->
<file>${LOG_FILE}</file>
<rollingPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!-- 滚动后的日志文件名 -->
<fileNamePattern>${LOGBACK_ROLLINGPOLICY_FILE_NAME_PATTERN:-${LOG_FILE}.%d{yyyy-MM-dd}.%i.gz}</fileNamePattern>
<!-- 启动服务时,是否清理历史日志,一般不建议清理 -->
<cleanHistoryOnStart>${LOGBACK_ROLLINGPOLICY_CLEAN_HISTORY_ON_START:-false}</cleanHistoryOnStart>
<!-- 日志文件,到达多少容量,进行滚动 -->
<maxFileSize>${LOGBACK_ROLLINGPOLICY_MAX_FILE_SIZE:-10MB}</maxFileSize>
<!-- 日志文件的总大小0 表示不限制 -->
<totalSizeCap>${LOGBACK_ROLLINGPOLICY_TOTAL_SIZE_CAP:-0}</totalSizeCap>
<!-- 日志文件的保留天数 -->
<maxHistory>${LOGBACK_ROLLINGPOLICY_MAX_HISTORY:-30}</maxHistory>
</rollingPolicy>
</appender>
<!-- 异步写入日志,提升性能 -->
<appender name="ASYNC" class="ch.qos.logback.classic.AsyncAppender">
<!-- 不丢失日志。默认的,如果队列的 80% 已满,则会丢弃 TRACT、DEBUG、INFO 级别的日志 -->
<discardingThreshold>0</discardingThreshold>
<!-- 更改默认的队列的深度,该值会影响性能。默认值为 256 -->
<queueSize>256</queueSize>
<appender-ref ref="FILE"/>
</appender>
<!-- SkyWalking GRPC 日志收集实现日志中心。注意SkyWalking 8.4.0 版本开始支持 -->
<appender name="GRPC" class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.log.GRPCLogClientAppender">
<encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
<layout class="org.apache.skywalking.apm.toolkit.log.logback.v1.x.TraceIdPatternLogbackLayout">
<pattern>${PATTERN_DEFAULT}</pattern>
</layout>
</encoder>
</appender>
<!-- 本地环境 -->
<springProfile name="local">
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="GRPC"/> <!-- 本地环境下,如果不想接入 SkyWalking 日志服务,可以注释掉本行 -->
<appender-ref ref="ASYNC"/> <!-- 本地环境下,如果不想打印日志,可以注释掉本行 -->
</root>
</springProfile>
<!-- 其它环境 -->
<springProfile name="dev,test,stage,prod,default">
<root level="INFO">
<appender-ref ref="STDOUT"/>
<appender-ref ref="ASYNC"/>
<appender-ref ref="GRPC"/>
</root>
</springProfile>
</configuration>

View File

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

View File

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