初始化
This commit is contained in:
121
tashow-module/tashow-module-product/pom.xml
Normal file
121
tashow-module/tashow-module-product/pom.xml
Normal file
@@ -0,0 +1,121 @@
|
||||
<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-module</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>tashow-module-product</artifactId>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<!-- Registry 注册中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- Config 配置中心相关 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba.cloud</groupId>
|
||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||
</dependency>
|
||||
<!-- 防止进入swagger页面报类型转换错误,排除3.0.0中的引用,手动增加1.6.2版本 -->
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>1.6.2</version>
|
||||
</dependency>
|
||||
<!-- Swagger Core -->
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-core</artifactId>
|
||||
<version>2.2.20</version>
|
||||
</dependency>
|
||||
|
||||
<!-- Swagger Models -->
|
||||
<dependency>
|
||||
<groupId>io.swagger.core.v3</groupId>
|
||||
<artifactId>swagger-models</artifactId>
|
||||
<version>2.2.20</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-framework-monitor</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- EasyExcel 核心库 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>easyexcel</artifactId>
|
||||
<version>4.0.3</version>
|
||||
</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 远程调用相关 -->
|
||||
<dependency>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-framework-rpc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-data-mybatis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-framework-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-framework-env</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-framework-websocket</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-data-redis</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tashow.cloud</groupId>
|
||||
<artifactId>tashow-framework-security</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-actuator</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<version>${spring.boot.version}</version>
|
||||
<configuration>
|
||||
<mainClass>com.tashow.cloud.product.ProductServerApplication</mainClass>
|
||||
</configuration>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.tashow.cloud.product;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
/**
|
||||
* 应用服务启动类
|
||||
*/
|
||||
@SpringBootApplication
|
||||
public class ProductServerApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(ProductServerApplication.class, args);
|
||||
System.out.println("产品启动成功");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.tashow.cloud.product.api;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDO;
|
||||
import com.tashow.cloud.product.service.CategoryService;
|
||||
import com.tashow.cloud.productapi.api.product.CategoryApi;
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDto;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import java.util.List;
|
||||
|
||||
@RestController // 提供 RESTful API 接口,给 Feign 调用
|
||||
@Validated
|
||||
public class CategoryApiImpl implements CategoryApi {
|
||||
|
||||
@Resource
|
||||
private CategoryService categoryService;
|
||||
|
||||
@Override
|
||||
public List<CategoryDO> categoryList(Integer grade, Long categoryId,String categoryName, Integer status) {
|
||||
return categoryService.categoryList(grade, categoryId,categoryName, status);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDO;
|
||||
import com.tashow.cloud.product.service.CategoryService;
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDto;
|
||||
import com.tashow.cloud.productapi.api.product.vo.CategorySaveReqVO;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 产品类目")
|
||||
@RestController
|
||||
@RequestMapping("/product/category")
|
||||
@Validated
|
||||
public class CategoryController {
|
||||
|
||||
@Resource
|
||||
private CategoryService categoryService;
|
||||
|
||||
/**
|
||||
* 获取菜单页面的表
|
||||
* @return
|
||||
*/
|
||||
@PermitAll
|
||||
@GetMapping("/categoryList")
|
||||
public CommonResult<List<CategoryDO>> categoryList(@RequestParam(value = "grade", required = false) Integer grade,
|
||||
@RequestParam(value = "categoryId", required = false) Long categoryId,
|
||||
@RequestParam(value = "categoryName", required = false) String categoryName,
|
||||
@RequestParam(value = "status", required = false) Integer status) {
|
||||
return success(categoryService.categoryList(grade, categoryId,categoryName, status));
|
||||
}
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建产品类目")
|
||||
@PermitAll
|
||||
public CommonResult<Long> createCategory(@Valid @RequestBody CategorySaveReqVO createReqVO) {
|
||||
return success(categoryService.createCategory(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新产品类目")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateCategory(@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));
|
||||
}*/
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeeDatesDO;
|
||||
import com.tashow.cloud.product.service.ProdAdditionalFeeDatesService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
|
||||
@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));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeePeriodsDO;
|
||||
import com.tashow.cloud.product.service.ProdAdditionalFeePeriodsService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 特殊时段附加费用规则")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-additional-fee-periods")
|
||||
@Validated
|
||||
public class ProdAdditionalFeePeriodsController {
|
||||
|
||||
@Resource
|
||||
private ProdAdditionalFeePeriodsService prodAdditionalFeePeriodsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建特殊时段附加费用规则")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-periods:create')")
|
||||
public CommonResult<Long> createProdAdditionalFeePeriods(@Valid @RequestBody ProdAdditionalFeePeriodsSaveReqVO createReqVO) {
|
||||
return success(prodAdditionalFeePeriodsService.createProdAdditionalFeePeriods(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新特殊时段附加费用规则")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-periods:update')")
|
||||
public CommonResult<Boolean> updateProdAdditionalFeePeriods(@Valid @RequestBody ProdAdditionalFeePeriodsSaveReqVO updateReqVO) {
|
||||
prodAdditionalFeePeriodsService.updateProdAdditionalFeePeriods(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除特殊时段附加费用规则")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-periods:delete')")
|
||||
public CommonResult<Boolean> deleteProdAdditionalFeePeriods(@RequestParam("id") Long id) {
|
||||
prodAdditionalFeePeriodsService.deleteProdAdditionalFeePeriods(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得特殊时段附加费用规则")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-periods:query')")
|
||||
public CommonResult<ProdAdditionalFeePeriodsRespVO> getProdAdditionalFeePeriods(@RequestParam("id") Long id) {
|
||||
ProdAdditionalFeePeriodsDO prodAdditionalFeePeriods = prodAdditionalFeePeriodsService.getProdAdditionalFeePeriods(id);
|
||||
return success(BeanUtils.toBean(prodAdditionalFeePeriods, ProdAdditionalFeePeriodsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得特殊时段附加费用规则分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-periods:query')")
|
||||
public CommonResult<PageResult<ProdAdditionalFeePeriodsRespVO>> getProdAdditionalFeePeriodsPage(@Valid ProdAdditionalFeePeriodsPageReqVO pageReqVO) {
|
||||
PageResult<ProdAdditionalFeePeriodsDO> pageResult = prodAdditionalFeePeriodsService.getProdAdditionalFeePeriodsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProdAdditionalFeePeriodsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出特殊时段附加费用规则 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-additional-fee-periods:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProdAdditionalFeePeriodsExcel(@Valid ProdAdditionalFeePeriodsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProdAdditionalFeePeriodsDO> list = prodAdditionalFeePeriodsService.getProdAdditionalFeePeriodsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "特殊时段附加费用规则.xls", "数据", ProdAdditionalFeePeriodsRespVO.class,
|
||||
BeanUtils.toBean(list, ProdAdditionalFeePeriodsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,161 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.product.mapper.ProdMapper;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdDO;
|
||||
import com.tashow.cloud.product.service.ProdService;
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.*;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO;
|
||||
import com.tashow.cloud.productapi.enums.BaseEnum;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 商品")
|
||||
@RestController
|
||||
@RequestMapping("/product/prod")
|
||||
@Validated
|
||||
public class ProdController {
|
||||
|
||||
@Resource
|
||||
private ProdService prodService;
|
||||
@Resource
|
||||
private ProdMapper prodMapper;
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建商品")
|
||||
@PermitAll
|
||||
public CommonResult<Long> createProd(@Valid @RequestBody ProdSaveReqVO createReqVO) {
|
||||
return success(prodService.createProd(createReqVO));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PostMapping("/createProdService")
|
||||
@Operation(summary = "创建商品服务配置")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> createProdService(@Valid @RequestBody ProdServiceVO prodServiceVO) {
|
||||
prodService.createProdService(prodServiceVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/uptateProdService")
|
||||
@Operation(summary = "修改商品服务配置")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> uptateProdService(@Valid @RequestBody ProdServiceInfoVO prodServiceInfoVO) {
|
||||
prodService.uptateProdService(prodServiceInfoVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/getProdService")
|
||||
@Operation(summary = "获得商品服务信息")
|
||||
@Parameter(name = "prodId", description = "商品id", required = true, example = "1024")
|
||||
@PermitAll
|
||||
public CommonResult<ProdServiceVO> getProd(@RequestParam("prodId") Long prodId) {
|
||||
ProdServiceVO prodServiceVO = prodService.getProdService(prodId);
|
||||
return success(prodServiceVO);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新商品")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateProd(@RequestBody ProdSaveReqVO updateReqVO) {
|
||||
prodService.updateProd(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除商品")
|
||||
@PermitAll
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
public CommonResult<Boolean> deleteProd(@RequestParam("id") Long id) {
|
||||
prodService.deleteProd(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@DeleteMapping("/deleteSkuList")
|
||||
@Operation(summary = "批量删除商品")
|
||||
@Parameter(name = "ids", description = "商品id", required = true)
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> deleteSkuList(@RequestParam("ids") List<Long> ids) {
|
||||
for(Long id:ids){
|
||||
ProdDO prod = new ProdDO();
|
||||
prod.setProdId(id);
|
||||
prod.setDeleted(BaseEnum.YES_ONE.getKey());
|
||||
prod.setDeleteTime(new Date());
|
||||
// 删除
|
||||
prodMapper.deleteById(prod);
|
||||
}
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/updateSkuShelfList")
|
||||
@Operation(summary = "批量上下架")
|
||||
@Parameter(name = "status", description = "默认是1,正常状态(出售中), 0:下架(仓库中) 2:待审核", required = true)
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateSkuShelfList(@RequestParam("ids") List<Long> ids,@RequestParam("status") Integer status) {
|
||||
for(Long id:ids){
|
||||
ProdDO prod = new ProdDO();
|
||||
prod.setProdId(id);
|
||||
prod.setStatus(status);
|
||||
prodMapper.updateById(prod);
|
||||
}
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得商品")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tashow-module-product:prod:query')")
|
||||
public CommonResult<ProdRespVO> getProd(@RequestParam("id") Long id) {
|
||||
ProdDO prod = prodService.getProd(id);
|
||||
return success(BeanUtils.toBean(prod, ProdRespVO.class));
|
||||
}*/
|
||||
|
||||
@PermitAll
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得商品分页")
|
||||
public CommonResult<PageResult<ProdListVO>> getProdPage(ProdPageReqVO pageReqVO) {
|
||||
PageResult<ProdListVO> pageResult = prodService.getProdPage(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
@GetMapping("/getProdRecycleBinPageList")
|
||||
@Operation(summary = "获得商品回收站分页列表")
|
||||
public CommonResult<PageResult<ProdRestoreListVO>> getProdRecycleBinPageList(ProdRecycleBinVO prodRecycleBinVO) {
|
||||
PageResult<ProdRestoreListVO> pageResult = prodService.getProdRecycleBinPageList(prodRecycleBinVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/restoreProdList")
|
||||
@Operation(summary = "恢复商品")
|
||||
@Parameter(name = "ids", description = "商品id集合", required = true)
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> restoreProdList(@RequestParam("ids") List<Long> ids) {
|
||||
prodService.restoreProdList(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseDO;
|
||||
import com.tashow.cloud.product.service.ProdEmergencyResponseService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyResponsePageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyResponseRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyResponseSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 商品紧急响应服务设置")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-emergency-response")
|
||||
@Validated
|
||||
public class ProdEmergencyResponseController {
|
||||
|
||||
@Resource
|
||||
private ProdEmergencyResponseService prodEmergencyResponseService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建商品紧急响应服务设置")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response:create')")
|
||||
public CommonResult<Long> createProdEmergencyResponse(@Valid @RequestBody ProdEmergencyResponseSaveReqVO createReqVO) {
|
||||
return success(prodEmergencyResponseService.createProdEmergencyResponse(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新商品紧急响应服务设置")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response:update')")
|
||||
public CommonResult<Boolean> updateProdEmergencyResponse(@Valid @RequestBody ProdEmergencyResponseSaveReqVO updateReqVO) {
|
||||
prodEmergencyResponseService.updateProdEmergencyResponse(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除商品紧急响应服务设置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response:delete')")
|
||||
public CommonResult<Boolean> deleteProdEmergencyResponse(@RequestParam("id") Long id) {
|
||||
prodEmergencyResponseService.deleteProdEmergencyResponse(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得商品紧急响应服务设置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response:query')")
|
||||
public CommonResult<ProdEmergencyResponseRespVO> getProdEmergencyResponse(@RequestParam("id") Long id) {
|
||||
ProdEmergencyResponseDO prodEmergencyResponse = prodEmergencyResponseService.getProdEmergencyResponse(id);
|
||||
return success(BeanUtils.toBean(prodEmergencyResponse, ProdEmergencyResponseRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得商品紧急响应服务设置分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response:query')")
|
||||
public CommonResult<PageResult<ProdEmergencyResponseRespVO>> getProdEmergencyResponsePage(@Valid ProdEmergencyResponsePageReqVO pageReqVO) {
|
||||
PageResult<ProdEmergencyResponseDO> pageResult = prodEmergencyResponseService.getProdEmergencyResponsePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProdEmergencyResponseRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出商品紧急响应服务设置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProdEmergencyResponseExcel(@Valid ProdEmergencyResponsePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProdEmergencyResponseDO> list = prodEmergencyResponseService.getProdEmergencyResponsePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "商品紧急响应服务设置.xls", "数据", ProdEmergencyResponseRespVO.class,
|
||||
BeanUtils.toBean(list, ProdEmergencyResponseRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import com.tashow.cloud.product.service.ProdEmergencyResponseIntervalsService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 紧急响应时间区间设置")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-emergency-response-intervals")
|
||||
@Validated
|
||||
public class ProdEmergencyResponseIntervalsController {
|
||||
|
||||
@Resource
|
||||
private ProdEmergencyResponseIntervalsService prodEmergencyResponseIntervalsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建紧急响应时间区间设置")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response-intervals:create')")
|
||||
public CommonResult<Long> createProdEmergencyResponseIntervals(@Valid @RequestBody ProdEmergencyResponseIntervalsSaveReqVO createReqVO) {
|
||||
return success(prodEmergencyResponseIntervalsService.createProdEmergencyResponseIntervals(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新紧急响应时间区间设置")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response-intervals:update')")
|
||||
public CommonResult<Boolean> updateProdEmergencyResponseIntervals(@Valid @RequestBody ProdEmergencyResponseIntervalsSaveReqVO updateReqVO) {
|
||||
prodEmergencyResponseIntervalsService.updateProdEmergencyResponseIntervals(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除紧急响应时间区间设置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response-intervals:delete')")
|
||||
public CommonResult<Boolean> deleteProdEmergencyResponseIntervals(@RequestParam("id") Long id) {
|
||||
prodEmergencyResponseIntervalsService.deleteProdEmergencyResponseIntervals(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得紧急响应时间区间设置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response-intervals:query')")
|
||||
public CommonResult<ProdEmergencyResponseIntervalsRespVO> getProdEmergencyResponseIntervals(@RequestParam("id") Long id) {
|
||||
ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals = prodEmergencyResponseIntervalsService.getProdEmergencyResponseIntervals(id);
|
||||
return success(BeanUtils.toBean(prodEmergencyResponseIntervals, ProdEmergencyResponseIntervalsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得紧急响应时间区间设置分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response-intervals:query')")
|
||||
public CommonResult<PageResult<ProdEmergencyResponseIntervalsRespVO>> getProdEmergencyResponseIntervalsPage(@Valid ProdEmergencyResponseIntervalsPageReqVO pageReqVO) {
|
||||
PageResult<ProdEmergencyResponseIntervalsDO> pageResult = prodEmergencyResponseIntervalsService.getProdEmergencyResponseIntervalsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProdEmergencyResponseIntervalsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出紧急响应时间区间设置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-emergency-response-intervals:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProdEmergencyResponseIntervalsExcel(@Valid ProdEmergencyResponseIntervalsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProdEmergencyResponseIntervalsDO> list = prodEmergencyResponseIntervalsService.getProdEmergencyResponseIntervalsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "紧急响应时间区间设置.xls", "数据", ProdEmergencyResponseIntervalsRespVO.class,
|
||||
BeanUtils.toBean(list, ProdEmergencyResponseIntervalsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,121 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import com.tashow.cloud.product.service.ProdPropService;
|
||||
import com.tashow.cloud.product.service.ProdPropValueService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodprop.ProdPropRespVO;
|
||||
import com.tashow.cloud.productapi.enums.ProdPropRule;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 商品属性")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-prop")
|
||||
@Validated
|
||||
public class ProdPropController {
|
||||
|
||||
@Resource
|
||||
private ProdPropService prodPropService;
|
||||
@Resource
|
||||
private ProdPropValueService prodPropValueService;
|
||||
|
||||
/* @PostMapping("/create")
|
||||
@Operation(summary = "创建商品属性")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop:create')")
|
||||
public CommonResult<Boolean> createProdProp(@Valid @RequestBody ProdPropSaveReqVO createReqVO) {
|
||||
prodPropService.saveProdPropAndValues(createReqVO);
|
||||
return success(true);
|
||||
}*/
|
||||
|
||||
|
||||
@GetMapping("/getProdPropList")
|
||||
@Operation(summary = "获得商品属性列表")
|
||||
public CommonResult<List<ProdPropDO>> getProdPropList(@Valid ProdPropRespVO pageReqVO) {
|
||||
LambdaQueryWrapper<ProdPropDO> wrapper = new LambdaQueryWrapper<>();
|
||||
// 处理规格名称模糊查询
|
||||
if (StrUtil.isNotBlank(pageReqVO.getPropName())) {
|
||||
wrapper.like(ProdPropDO::getPropName, pageReqVO.getPropName());
|
||||
}
|
||||
wrapper.eq(ProdPropDO::getRule, ProdPropRule.SPEC.value());
|
||||
//TODO 获取当前登录用户
|
||||
wrapper.eq(ProdPropDO::getShopId, 1L);
|
||||
/*// 获取当前登录用户
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
SysUser sysUser = sysUserService.selectUserById(userId);
|
||||
|
||||
if (sysUser.getShopId() != 100) {
|
||||
wrapper.eq(ProdProp::getShopId, sysUser.getShopId());
|
||||
}*/
|
||||
List<ProdPropDO> list = prodPropService.list(wrapper);
|
||||
list.forEach(prop -> {
|
||||
List<ProdPropValueDO> values = prodPropValueService.list(
|
||||
new LambdaQueryWrapper<ProdPropValueDO>()
|
||||
.eq(ProdPropValueDO::getPropId, prop.getPropId())
|
||||
);
|
||||
prop.setProdPropValues(values);
|
||||
});
|
||||
return success(list);
|
||||
}
|
||||
|
||||
/* @PutMapping("/update")
|
||||
@Operation(summary = "更新商品属性")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop:update')")
|
||||
public CommonResult<Boolean> updateProdProp(@Valid @RequestBody ProdPropSaveReqVO updateReqVO) {
|
||||
prodPropService.updateProdProp(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除商品属性")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop:delete')")
|
||||
public CommonResult<Boolean> deleteProdProp(@RequestParam("id") Long id) {
|
||||
prodPropService.deleteProdProp(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得商品属性")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop:query')")
|
||||
public CommonResult<ProdPropRespVO> getProdProp(@RequestParam("id") Long id) {
|
||||
ProdPropDO prodProp = prodPropService.getProdProp(id);
|
||||
return success(BeanUtils.toBean(prodProp, ProdPropRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得商品属性分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop:query')")
|
||||
public CommonResult<PageResult<ProdPropRespVO>> getProdPropPage(@Valid ProdPropPageReqVO pageReqVO) {
|
||||
PageResult<ProdPropDO> pageResult = prodPropService.getProdPropPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProdPropRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出商品属性 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProdPropExcel(@Valid ProdPropPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProdPropDO> list = prodPropService.getProdPropPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "商品属性.xls", "数据", ProdPropRespVO.class,
|
||||
BeanUtils.toBean(list, ProdPropRespVO.class));
|
||||
}*/
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import com.tashow.cloud.product.service.ProdPropValueService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProdPropValuePageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProdPropValueRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProdPropValueSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 属性规则")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-prop-value")
|
||||
@Validated
|
||||
public class ProdPropValueController {
|
||||
|
||||
@Resource
|
||||
private ProdPropValueService prodPropValueService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建属性规则")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop-value:create')")
|
||||
public CommonResult<Long> createProdPropValue(@Valid @RequestBody ProdPropValueSaveReqVO createReqVO) {
|
||||
return success(prodPropValueService.createProdPropValue(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新属性规则")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop-value:update')")
|
||||
public CommonResult<Boolean> updateProdPropValue(@Valid @RequestBody ProdPropValueSaveReqVO updateReqVO) {
|
||||
prodPropValueService.updateProdPropValue(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除属性规则")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop-value:delete')")
|
||||
public CommonResult<Boolean> deleteProdPropValue(@RequestParam("id") Long id) {
|
||||
prodPropValueService.deleteProdPropValue(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得属性规则")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop-value:query')")
|
||||
public CommonResult<ProdPropValueRespVO> getProdPropValue(@RequestParam("id") Long id) {
|
||||
ProdPropValueDO prodPropValue = prodPropValueService.getProdPropValue(id);
|
||||
return success(BeanUtils.toBean(prodPropValue, ProdPropValueRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得属性规则分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop-value:query')")
|
||||
public CommonResult<PageResult<ProdPropValueRespVO>> getProdPropValuePage(@Valid ProdPropValuePageReqVO pageReqVO) {
|
||||
PageResult<ProdPropValueDO> pageResult = prodPropValueService.getProdPropValuePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProdPropValueRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出属性规则 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-prop-value:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProdPropValueExcel(@Valid ProdPropValuePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProdPropValueDO> list = prodPropValueService.getProdPropValuePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "属性规则.xls", "数据", ProdPropValueRespVO.class,
|
||||
BeanUtils.toBean(list, ProdPropValueRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdReservationConfigDO;
|
||||
import com.tashow.cloud.product.service.ProdReservationConfigService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationConfigPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationConfigRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationConfigSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 商品预约配置")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-reservation-config")
|
||||
@Validated
|
||||
public class ProdReservationConfigController {
|
||||
|
||||
@Resource
|
||||
private ProdReservationConfigService prodReservationConfigService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建商品预约配置")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-reservation-config:create')")
|
||||
public CommonResult<Long> createProdReservationConfig(@Valid @RequestBody ProdReservationConfigSaveReqVO createReqVO) {
|
||||
return success(prodReservationConfigService.createProdReservationConfig(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新商品预约配置")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-reservation-config:update')")
|
||||
public CommonResult<Boolean> updateProdReservationConfig(@Valid @RequestBody ProdReservationConfigSaveReqVO updateReqVO) {
|
||||
prodReservationConfigService.updateProdReservationConfig(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除商品预约配置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-reservation-config:delete')")
|
||||
public CommonResult<Boolean> deleteProdReservationConfig(@RequestParam("id") Long id) {
|
||||
prodReservationConfigService.deleteProdReservationConfig(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得商品预约配置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-reservation-config:query')")
|
||||
public CommonResult<ProdReservationConfigRespVO> getProdReservationConfig(@RequestParam("id") Long id) {
|
||||
ProdReservationConfigDO prodReservationConfig = prodReservationConfigService.getProdReservationConfig(id);
|
||||
return success(BeanUtils.toBean(prodReservationConfig, ProdReservationConfigRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得商品预约配置分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-reservation-config:query')")
|
||||
public CommonResult<PageResult<ProdReservationConfigRespVO>> getProdReservationConfigPage(@Valid ProdReservationConfigPageReqVO pageReqVO) {
|
||||
PageResult<ProdReservationConfigDO> pageResult = prodReservationConfigService.getProdReservationConfigPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProdReservationConfigRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出商品预约配置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-reservation-config:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProdReservationConfigExcel(@Valid ProdReservationConfigPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProdReservationConfigDO> list = prodReservationConfigService.getProdReservationConfigPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "商品预约配置.xls", "数据", ProdReservationConfigRespVO.class,
|
||||
BeanUtils.toBean(list, ProdReservationConfigRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdServiceAreaRelevanceDO;
|
||||
import com.tashow.cloud.product.service.ProdServiceAreaRelevanceService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodservicearearelevance.ProdServiceAreaRelevancePageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodservicearearelevance.ProdServiceAreaRelevanceRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodservicearearelevance.ProdServiceAreaRelevanceSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 商品与服务区域关联")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-service-area-relevance")
|
||||
@Validated
|
||||
public class ProdServiceAreaRelevanceController {
|
||||
|
||||
@Resource
|
||||
private ProdServiceAreaRelevanceService prodServiceAreaRelevanceService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建商品与服务区域关联")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-area-relevance:create')")
|
||||
public CommonResult<Long> createProdServiceAreaRelevance(@Valid @RequestBody ProdServiceAreaRelevanceSaveReqVO createReqVO) {
|
||||
return success(prodServiceAreaRelevanceService.createProdServiceAreaRelevance(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新商品与服务区域关联")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-area-relevance:update')")
|
||||
public CommonResult<Boolean> updateProdServiceAreaRelevance(@Valid @RequestBody ProdServiceAreaRelevanceSaveReqVO updateReqVO) {
|
||||
prodServiceAreaRelevanceService.updateProdServiceAreaRelevance(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除商品与服务区域关联")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-area-relevance:delete')")
|
||||
public CommonResult<Boolean> deleteProdServiceAreaRelevance(@RequestParam("id") Long id) {
|
||||
prodServiceAreaRelevanceService.deleteProdServiceAreaRelevance(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得商品与服务区域关联")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-area-relevance:query')")
|
||||
public CommonResult<ProdServiceAreaRelevanceRespVO> getProdServiceAreaRelevance(@RequestParam("id") Long id) {
|
||||
ProdServiceAreaRelevanceDO prodServiceAreaRelevance = prodServiceAreaRelevanceService.getProdServiceAreaRelevance(id);
|
||||
return success(BeanUtils.toBean(prodServiceAreaRelevance, ProdServiceAreaRelevanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得商品与服务区域关联分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-area-relevance:query')")
|
||||
public CommonResult<PageResult<ProdServiceAreaRelevanceRespVO>> getProdServiceAreaRelevancePage(@Valid ProdServiceAreaRelevancePageReqVO pageReqVO) {
|
||||
PageResult<ProdServiceAreaRelevanceDO> pageResult = prodServiceAreaRelevanceService.getProdServiceAreaRelevancePage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProdServiceAreaRelevanceRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出商品与服务区域关联 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-area-relevance:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProdServiceAreaRelevanceExcel(@Valid ProdServiceAreaRelevancePageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProdServiceAreaRelevanceDO> list = prodServiceAreaRelevanceService.getProdServiceAreaRelevancePage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "商品与服务区域关联.xls", "数据", ProdServiceAreaRelevanceRespVO.class,
|
||||
BeanUtils.toBean(list, ProdServiceAreaRelevanceRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdServiceAreasDO;
|
||||
import com.tashow.cloud.product.service.ProdServiceAreasService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 服务区域")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-service-areas")
|
||||
@Validated
|
||||
public class ProdServiceAreasController {
|
||||
|
||||
@Resource
|
||||
private ProdServiceAreasService prodServiceAreasService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建服务区域")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-areas:create')")
|
||||
public CommonResult<Long> createProdServiceAreas(@Valid @RequestBody ProdServiceAreasSaveReqVO createReqVO) {
|
||||
return success(prodServiceAreasService.createProdServiceAreas(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新服务区域")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-areas:update')")
|
||||
public CommonResult<Boolean> updateProdServiceAreas(@Valid @RequestBody ProdServiceAreasSaveReqVO updateReqVO) {
|
||||
prodServiceAreasService.updateProdServiceAreas(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除服务区域")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-areas:delete')")
|
||||
public CommonResult<Boolean> deleteProdServiceAreas(@RequestParam("id") Long id) {
|
||||
prodServiceAreasService.deleteProdServiceAreas(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得服务区域")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-areas:query')")
|
||||
public CommonResult<ProdServiceAreasRespVO> getProdServiceAreas(@RequestParam("id") Long id) {
|
||||
ProdServiceAreasDO prodServiceAreas = prodServiceAreasService.getProdServiceAreas(id);
|
||||
return success(BeanUtils.toBean(prodServiceAreas, ProdServiceAreasRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得服务区域分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-areas:query')")
|
||||
public CommonResult<PageResult<ProdServiceAreasRespVO>> getProdServiceAreasPage(@Valid ProdServiceAreasPageReqVO pageReqVO) {
|
||||
PageResult<ProdServiceAreasDO> pageResult = prodServiceAreasService.getProdServiceAreasPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProdServiceAreasRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出服务区域 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-areas:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProdServiceAreasExcel(@Valid ProdServiceAreasPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProdServiceAreasDO> list = prodServiceAreasService.getProdServiceAreasPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "服务区域.xls", "数据", ProdServiceAreasRespVO.class,
|
||||
BeanUtils.toBean(list, ProdServiceAreasRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdServiceOverAreaRulesDO;
|
||||
import com.tashow.cloud.product.service.ProdServiceOverAreaRulesService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceoverarearules.ProdServiceOverAreaRulesPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceoverarearules.ProdServiceOverAreaRulesRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceoverarearules.ProdServiceOverAreaRulesSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 超区规则")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-service-over-area-rules")
|
||||
@Validated
|
||||
public class ProdServiceOverAreaRulesController {
|
||||
|
||||
@Resource
|
||||
private ProdServiceOverAreaRulesService prodServiceOverAreaRulesService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建超区规则")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-over-area-rules:create')")
|
||||
public CommonResult<Long> createProdServiceOverAreaRules(@Valid @RequestBody ProdServiceOverAreaRulesSaveReqVO createReqVO) {
|
||||
return success(prodServiceOverAreaRulesService.createProdServiceOverAreaRules(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新超区规则")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-over-area-rules:update')")
|
||||
public CommonResult<Boolean> updateProdServiceOverAreaRules(@Valid @RequestBody ProdServiceOverAreaRulesSaveReqVO updateReqVO) {
|
||||
prodServiceOverAreaRulesService.updateProdServiceOverAreaRules(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除超区规则")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-over-area-rules:delete')")
|
||||
public CommonResult<Boolean> deleteProdServiceOverAreaRules(@RequestParam("id") Long id) {
|
||||
prodServiceOverAreaRulesService.deleteProdServiceOverAreaRules(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得超区规则")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-over-area-rules:query')")
|
||||
public CommonResult<ProdServiceOverAreaRulesRespVO> getProdServiceOverAreaRules(@RequestParam("id") Long id) {
|
||||
ProdServiceOverAreaRulesDO prodServiceOverAreaRules = prodServiceOverAreaRulesService.getProdServiceOverAreaRules(id);
|
||||
return success(BeanUtils.toBean(prodServiceOverAreaRules, ProdServiceOverAreaRulesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得超区规则分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-over-area-rules:query')")
|
||||
public CommonResult<PageResult<ProdServiceOverAreaRulesRespVO>> getProdServiceOverAreaRulesPage(@Valid ProdServiceOverAreaRulesPageReqVO pageReqVO) {
|
||||
PageResult<ProdServiceOverAreaRulesDO> pageResult = prodServiceOverAreaRulesService.getProdServiceOverAreaRulesPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProdServiceOverAreaRulesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出超区规则 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-service-over-area-rules:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProdServiceOverAreaRulesExcel(@Valid ProdServiceOverAreaRulesPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProdServiceOverAreaRulesDO> list = prodServiceOverAreaRulesService.getProdServiceOverAreaRulesPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "超区规则.xls", "数据", ProdServiceOverAreaRulesRespVO.class,
|
||||
BeanUtils.toBean(list, ProdServiceOverAreaRulesRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdTagsDO;
|
||||
import com.tashow.cloud.product.service.ProdTagsService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodtags.ProdTagsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodtags.ProdTagsRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodtags.ProdTagsSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 商品和标签管理")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-tags")
|
||||
@Validated
|
||||
public class ProdTagsController {
|
||||
|
||||
@Resource
|
||||
private ProdTagsService prodTagsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建商品和标签管理")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-tags:create')")
|
||||
public CommonResult<Long> createProdTags(@Valid @RequestBody ProdTagsSaveReqVO createReqVO) {
|
||||
return success(prodTagsService.createProdTags(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新商品和标签管理")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-tags:update')")
|
||||
public CommonResult<Boolean> updateProdTags(@Valid @RequestBody ProdTagsSaveReqVO updateReqVO) {
|
||||
prodTagsService.updateProdTags(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除商品和标签管理")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-tags:delete')")
|
||||
public CommonResult<Boolean> deleteProdTags(@RequestParam("id") Long id) {
|
||||
prodTagsService.deleteProdTags(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得商品和标签管理")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-tags:query')")
|
||||
public CommonResult<ProdTagsRespVO> getProdTags(@RequestParam("id") Long id) {
|
||||
ProdTagsDO prodTags = prodTagsService.getProdTags(id);
|
||||
return success(BeanUtils.toBean(prodTags, ProdTagsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得商品和标签管理分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-tags:query')")
|
||||
public CommonResult<PageResult<ProdTagsRespVO>> getProdTagsPage(@Valid ProdTagsPageReqVO pageReqVO) {
|
||||
PageResult<ProdTagsDO> pageResult = prodTagsService.getProdTagsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProdTagsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出商品和标签管理 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-tags:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProdTagsExcel(@Valid ProdTagsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProdTagsDO> list = prodTagsService.getProdTagsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "商品和标签管理.xls", "数据", ProdTagsRespVO.class,
|
||||
BeanUtils.toBean(list, ProdTagsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdWeightRangePricesDO;
|
||||
import com.tashow.cloud.product.service.ProdWeightRangePricesService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 体重区间价格")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-weight-range-prices")
|
||||
@Validated
|
||||
public class ProdWeightRangePricesController {
|
||||
|
||||
@Resource
|
||||
private ProdWeightRangePricesService prodWeightRangePricesService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建体重区间价格")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-weight-range-prices:create')")
|
||||
public CommonResult<Long> createProdWeightRangePrices(@Valid @RequestBody ProdWeightRangePricesSaveReqVO createReqVO) {
|
||||
return success(prodWeightRangePricesService.createProdWeightRangePrices(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新体重区间价格")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-weight-range-prices:update')")
|
||||
public CommonResult<Boolean> updateProdWeightRangePrices(@Valid @RequestBody ProdWeightRangePricesSaveReqVO updateReqVO) {
|
||||
prodWeightRangePricesService.updateProdWeightRangePrices(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除体重区间价格")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-weight-range-prices:delete')")
|
||||
public CommonResult<Boolean> deleteProdWeightRangePrices(@RequestParam("id") Long id) {
|
||||
prodWeightRangePricesService.deleteProdWeightRangePrices(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得体重区间价格")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-weight-range-prices:query')")
|
||||
public CommonResult<ProdWeightRangePricesRespVO> getProdWeightRangePrices(@RequestParam("id") Long id) {
|
||||
ProdWeightRangePricesDO prodWeightRangePrices = prodWeightRangePricesService.getProdWeightRangePrices(id);
|
||||
return success(BeanUtils.toBean(prodWeightRangePrices, ProdWeightRangePricesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得体重区间价格分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-weight-range-prices:query')")
|
||||
public CommonResult<PageResult<ProdWeightRangePricesRespVO>> getProdWeightRangePricesPage(@Valid ProdWeightRangePricesPageReqVO pageReqVO) {
|
||||
PageResult<ProdWeightRangePricesDO> pageResult = prodWeightRangePricesService.getProdWeightRangePricesPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProdWeightRangePricesRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出体重区间价格 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:prod-weight-range-prices:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProdWeightRangePricesExcel(@Valid ProdWeightRangePricesPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProdWeightRangePricesDO> list = prodWeightRangePricesService.getProdWeightRangePricesPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "体重区间价格.xls", "数据", ProdWeightRangePricesRespVO.class,
|
||||
BeanUtils.toBean(list, ProdWeightRangePricesRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProductOrderLimitDO;
|
||||
import com.tashow.cloud.product.service.ProductOrderLimitService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.productorderlimit.ProductOrderLimitPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.productorderlimit.ProductOrderLimitRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.productorderlimit.ProductOrderLimitSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 商品接单上限设置")
|
||||
@RestController
|
||||
@RequestMapping("/tz/product-order-limit")
|
||||
@Validated
|
||||
public class ProductOrderLimitController {
|
||||
|
||||
@Resource
|
||||
private ProductOrderLimitService productOrderLimitService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建商品接单上限设置")
|
||||
@PreAuthorize("@ss.hasPermission('tz:product-order-limit:create')")
|
||||
public CommonResult<Long> createProductOrderLimit(@Valid @RequestBody ProductOrderLimitSaveReqVO createReqVO) {
|
||||
return success(productOrderLimitService.createProductOrderLimit(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新商品接单上限设置")
|
||||
@PreAuthorize("@ss.hasPermission('tz:product-order-limit:update')")
|
||||
public CommonResult<Boolean> updateProductOrderLimit(@Valid @RequestBody ProductOrderLimitSaveReqVO updateReqVO) {
|
||||
productOrderLimitService.updateProductOrderLimit(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除商品接单上限设置")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:product-order-limit:delete')")
|
||||
public CommonResult<Boolean> deleteProductOrderLimit(@RequestParam("id") Long id) {
|
||||
productOrderLimitService.deleteProductOrderLimit(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得商品接单上限设置")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:product-order-limit:query')")
|
||||
public CommonResult<ProductOrderLimitRespVO> getProductOrderLimit(@RequestParam("id") Long id) {
|
||||
ProductOrderLimitDO productOrderLimit = productOrderLimitService.getProductOrderLimit(id);
|
||||
return success(BeanUtils.toBean(productOrderLimit, ProductOrderLimitRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得商品接单上限设置分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:product-order-limit:query')")
|
||||
public CommonResult<PageResult<ProductOrderLimitRespVO>> getProductOrderLimitPage(@Valid ProductOrderLimitPageReqVO pageReqVO) {
|
||||
PageResult<ProductOrderLimitDO> pageResult = productOrderLimitService.getProductOrderLimitPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ProductOrderLimitRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出商品接单上限设置 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:product-order-limit:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportProductOrderLimitExcel(@Valid ProductOrderLimitPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ProductOrderLimitDO> list = productOrderLimitService.getProductOrderLimitPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "商品接单上限设置.xls", "数据", ProductOrderLimitRespVO.class,
|
||||
BeanUtils.toBean(list, ProductOrderLimitRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ShopDetailDO;
|
||||
import com.tashow.cloud.product.service.ShopDetailService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.shopdetail
|
||||
.ShopDetailPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.shopdetail
|
||||
.ShopDetailRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.shopdetail
|
||||
.ShopDetailSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 店铺信息")
|
||||
@RestController
|
||||
@RequestMapping("/tz/shop-detail")
|
||||
@Validated
|
||||
public class ShopDetailController {
|
||||
|
||||
@Resource
|
||||
private ShopDetailService shopDetailService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建店铺信息")
|
||||
@PreAuthorize("@ss.hasPermission('tz:shop-detail:create')")
|
||||
public CommonResult<Long> createShopDetail(@Valid @RequestBody ShopDetailSaveReqVO createReqVO) {
|
||||
return success(shopDetailService.createShopDetail(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新店铺信息")
|
||||
@PreAuthorize("@ss.hasPermission('tz:shop-detail:update')")
|
||||
public CommonResult<Boolean> updateShopDetail(@Valid @RequestBody ShopDetailSaveReqVO updateReqVO) {
|
||||
shopDetailService.updateShopDetail(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除店铺信息")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:shop-detail:delete')")
|
||||
public CommonResult<Boolean> deleteShopDetail(@RequestParam("id") Long id) {
|
||||
shopDetailService.deleteShopDetail(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得店铺信息")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:shop-detail:query')")
|
||||
public CommonResult<ShopDetailRespVO> getShopDetail(@RequestParam("id") Long id) {
|
||||
ShopDetailDO shopDetail = shopDetailService.getShopDetail(id);
|
||||
return success(BeanUtils.toBean(shopDetail, ShopDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得店铺信息分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:shop-detail:query')")
|
||||
public CommonResult<PageResult<ShopDetailRespVO>> getShopDetailPage(@Valid ShopDetailPageReqVO pageReqVO) {
|
||||
PageResult<ShopDetailDO> pageResult = shopDetailService.getShopDetailPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, ShopDetailRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出店铺信息 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:shop-detail:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportShopDetailExcel(@Valid ShopDetailPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<ShopDetailDO> list = shopDetailService.getShopDetailPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "店铺信息.xls", "数据", ShopDetailRespVO.class,
|
||||
BeanUtils.toBean(list, ShopDetailRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,314 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.product.mapper.ProdPropMapper;
|
||||
import com.tashow.cloud.product.mapper.ProdPropValueMapper;
|
||||
import com.tashow.cloud.productapi.api.product.dto.*;
|
||||
import com.tashow.cloud.product.mapper.SkuMapper;
|
||||
import com.tashow.cloud.product.service.ProdExtendService;
|
||||
import com.tashow.cloud.product.service.ProdPropService;
|
||||
import com.tashow.cloud.product.service.ProdPropValueService;
|
||||
import com.tashow.cloud.product.service.SkuService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPropRecycleBinVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.*;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.annotation.security.PermitAll;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
|
||||
@Tag(name = "管理后台 - 单品SKU")
|
||||
@RestController
|
||||
@RequestMapping("/product/sku")
|
||||
@Validated
|
||||
public class SkuController {
|
||||
|
||||
@Resource
|
||||
private SkuService skuService;
|
||||
|
||||
@Resource
|
||||
private ProdPropService prodPropService;
|
||||
@Resource
|
||||
private ProdPropValueService prodPropValueService;
|
||||
|
||||
@Resource
|
||||
private ProdExtendService prodExtendService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ProdPropValueMapper prodPropValueMapper;
|
||||
@Resource
|
||||
private ProdPropMapper prodPropMapper;
|
||||
|
||||
@Resource
|
||||
private SkuMapper skuMapper;
|
||||
|
||||
/* @PostMapping("/create")
|
||||
@Operation(summary = "创建单品SKU")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku:create')")
|
||||
public CommonResult<Long> createSku(@Valid @RequestBody SkuSaveReqVO createReqVO) {
|
||||
return success(skuService.createSku(createReqVO));
|
||||
}*/
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新单品SKU")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateSku(@RequestBody SkuSaveReqVO updateReqVO) {
|
||||
skuService.updateSku(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/updateProp")
|
||||
@Operation(summary = "新增统一保存sku规格")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateProp(@Valid @RequestBody SkuPropVO skuPropVO) {
|
||||
skuService.updateProp(skuPropVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/updatePropValue")
|
||||
@Operation(summary = "修改属性下面规格值")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updatePropValue(@RequestParam("id") Long id,@RequestParam("propValue") String propValue) {
|
||||
skuService.updatePropVal(id,propValue);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/updateProdProp")
|
||||
@Operation(summary = "修改属性规格值")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateProdProp(@RequestParam("id") Long id,@RequestParam("propName") String propName) {
|
||||
ProdPropDO prodPropDO = new ProdPropDO();
|
||||
prodPropDO.setId( id);
|
||||
prodPropDO.setPropName(propName);
|
||||
prodPropMapper.updateById(prodPropDO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getSKuPropList")
|
||||
@Operation(summary = "获取sku规格")
|
||||
@PermitAll
|
||||
@Parameter(name = "prodId", description = "商品id", required = true)
|
||||
public CommonResult<SkuPropInfoVO> getSKuPropList(@RequestParam("prodId") Long prodId) {
|
||||
return success(skuService.getSKuPropList(prodId));
|
||||
}
|
||||
|
||||
|
||||
@PermitAll
|
||||
@GetMapping("/getPropRecycleBinList")
|
||||
@Operation(summary = "获取规格回收站")
|
||||
public CommonResult<PageResult<ProPropRecycleBinVO>> getSKuPropRecycleBinList(ProPageReqVO proPageReqVO) {
|
||||
PageResult<ProPropRecycleBinVO> pageResult = skuService.getSKuPropRecycleBinList(proPageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@PostMapping("/restorePropList")
|
||||
@Operation(summary = "恢复规格")
|
||||
@Parameter(name = "ids", description = "规格id集合", required = true)
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> restorePropList(@RequestParam("ids") List<Long> ids) {
|
||||
skuService.restorePropList(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/deleteProp")
|
||||
@Operation(summary = "删除规格值")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> deleteProp(@RequestParam("id") Long id) {
|
||||
skuService.deleteProp(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/disableProp")
|
||||
@Operation(summary = "禁用或者启用规格值")
|
||||
@Parameter(name = "id", description = "规格id")
|
||||
@Parameter(name = "state", description = "状态0禁用1启用")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> disableProp(@RequestParam("id") Long id,@RequestParam("state") Integer state) {
|
||||
skuService.disableProp(id,state);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除单品SKU")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> deleteSku(@RequestParam("id") Long id) {
|
||||
skuService.deleteSku(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/deleteSkuList")
|
||||
@Operation(summary = "批量删除SKU")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> deleteSkuList(@RequestParam("ids") List<Long> ids) {
|
||||
skuService.deleteSkus(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/updateSkuShelf")
|
||||
@Operation(summary = "修改单品上下架")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@Parameter(name = "isShelf", description = "是否上下架(0下架 1上架)", required = true)
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateSkuShelf(@RequestParam("id") Long id,@RequestParam("isShelf") Integer isShelf) {
|
||||
skuService.updatSkuIsShelf(id,isShelf);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/updateSkuShelfList")
|
||||
@Operation(summary = "批量上下架")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Parameter(name = "isShelf", description = "是否上下架(0下架 1上架)", required = true)
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateSkuShelfList(@RequestParam("ids") List<Long> ids,@RequestParam("isShelf") Integer isShelf) {
|
||||
for(Long id:ids){
|
||||
SkuDO sku = new SkuDO();
|
||||
sku.setSkuId(id);
|
||||
sku.setIsShelf(isShelf);
|
||||
skuMapper.updateById(sku);
|
||||
}
|
||||
skuService.updatSkuIsShelfs(ids,isShelf);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得单品SKU")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PermitAll
|
||||
public CommonResult<SkuRespVO> getSku(@RequestParam("id") Long id) {
|
||||
SkuDO sku = skuService.getSku(id);
|
||||
return success(BeanUtils.toBean(sku, SkuRespVO.class));
|
||||
}
|
||||
|
||||
@PermitAll
|
||||
@GetMapping("/getSkuRecycleBinPageList")
|
||||
@Operation(summary = "获得SKU回收站分页列表")
|
||||
public CommonResult<PageResult<SkuRecycleBinVO>> getSkuRecycleBinPageList(@Valid SkuPageReqVO pageReqVO) {
|
||||
PageResult<SkuRecycleBinVO> pageResult = skuService.getSkuRecycleBinPageList(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/restoreSkuList")
|
||||
@Operation(summary = "恢复SKU")
|
||||
@Parameter(name = "ids", description = "skuids", required = true)
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> restoreSkuList(@RequestParam("ids") List<Long> ids) {
|
||||
skuService.restoreSkuList(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@PermitAll
|
||||
@GetMapping("/getSkuPageList")
|
||||
@Operation(summary = "获得SKU分页列表")
|
||||
public CommonResult<PageResult<SkuDO>> getSkuPageList(@Valid SkuPageReqVO pageReqVO) {
|
||||
PageResult<SkuDO> pageResult = skuService.getSkuPageList(pageReqVO);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* @PermitAll
|
||||
@GetMapping("/getSkuRecycleBinPageList")
|
||||
@Operation(summary = "获得SKU回收站分页列表")
|
||||
public CommonResult<PageResult<SkuRecycleBinVO>> getSkuRecycleBinPageList(@Valid SkuPageReqVO pageReqVO) {
|
||||
PageResult<SkuRecycleBinVO> pageResult = skuService.getSkuRecycleBinPageList(pageReqVO);
|
||||
return success(pageResult);
|
||||
}*/
|
||||
|
||||
|
||||
@PostMapping("/createSkuExtend")
|
||||
@Operation(summary = "创建sku扩展服务配置")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> createSkuExtend(@Valid @RequestBody SkuExtendVO skuExtendVO) {
|
||||
skuService.createSkuExtend(skuExtendVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/getSkuExtend")
|
||||
@Operation(summary = "获取sku扩展服务配置信息")
|
||||
@Parameter(name = "formId", description = "表单id", required = true, example = "1")
|
||||
@PermitAll
|
||||
public CommonResult<SkuExtendVO> getSkuExtend(@RequestParam("formId") Integer formId) {
|
||||
SkuExtendVO skuExtendVO =skuService.getSkuExtend(formId);
|
||||
return success(skuExtendVO);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/updateServiceDetails")
|
||||
@Operation(summary = "修改扩展服务信息配置(遗体接运扩展服务,遗体清洁配置,追思告别配置,骨灰处理配置......)")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateServiceDetails(@RequestBody List<SkuServiceDetailsDO> skuServiceDetailsList) {
|
||||
skuService.updateServiceDetails(skuServiceDetailsList);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/updateMaterial")
|
||||
@Operation(summary = "修物料配置")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateMaterial(@RequestBody List<SkuServiceMaterialDO> skuServiceMaterialList) {
|
||||
skuService.updateMaterial(skuServiceMaterialList);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/updateTransportAdress")
|
||||
@Operation(summary = "修改接运地址配置")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateTransportAdress(@RequestBody List<SkuServiceTransportDO> skuServiceTransportDOList) {
|
||||
skuService.updateTransportAdress(skuServiceTransportDOList);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/updateDeliver")
|
||||
@Operation(summary = "修改配送方式")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateDeliver(@RequestBody List<SkuServiceDeliverDO> skuServiceDeliverList) {
|
||||
skuService.updateDeliver(skuServiceDeliverList);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
/* @GetMapping("/page")
|
||||
@Operation(summary = "获得单品SKU分页")
|
||||
public CommonResult<PageResult<SkuRespVO>> getSkuPage(@Valid SkuPageReqVO pageReqVO) {
|
||||
PageResult<SkuDO> pageResult = skuService.getSkuPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SkuRespVO.class));
|
||||
}*/
|
||||
/*
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出单品SKU Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSkuExcel(@Valid SkuPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SkuDO> list = skuService.getSkuPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "单品SKU.xls", "数据", SkuRespVO.class,
|
||||
BeanUtils.toBean(list, SkuRespVO.class));
|
||||
}*/
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceDeliverDO;
|
||||
import com.tashow.cloud.product.service.SkuServiceDeliverService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedeliver.SkuServiceDeliverPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedeliver.SkuServiceDeliverRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedeliver.SkuServiceDeliverSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 服务交付方式")
|
||||
@RestController
|
||||
@RequestMapping("/tz/sku-service-deliver")
|
||||
@Validated
|
||||
public class SkuServiceDeliverController {
|
||||
|
||||
@Resource
|
||||
private SkuServiceDeliverService skuServiceDeliverService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建服务交付方式")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-deliver:create')")
|
||||
public CommonResult<Long> createSkuServiceDeliver(@Valid @RequestBody SkuServiceDeliverSaveReqVO createReqVO) {
|
||||
return success(skuServiceDeliverService.createSkuServiceDeliver(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新服务交付方式")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-deliver:update')")
|
||||
public CommonResult<Boolean> updateSkuServiceDeliver(@Valid @RequestBody SkuServiceDeliverSaveReqVO updateReqVO) {
|
||||
skuServiceDeliverService.updateSkuServiceDeliver(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除服务交付方式")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-deliver:delete')")
|
||||
public CommonResult<Boolean> deleteSkuServiceDeliver(@RequestParam("id") Long id) {
|
||||
skuServiceDeliverService.deleteSkuServiceDeliver(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得服务交付方式")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-deliver:query')")
|
||||
public CommonResult<SkuServiceDeliverRespVO> getSkuServiceDeliver(@RequestParam("id") Long id) {
|
||||
SkuServiceDeliverDO skuServiceDeliver = skuServiceDeliverService.getSkuServiceDeliver(id);
|
||||
return success(BeanUtils.toBean(skuServiceDeliver, SkuServiceDeliverRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得服务交付方式分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-deliver:query')")
|
||||
public CommonResult<PageResult<SkuServiceDeliverRespVO>> getSkuServiceDeliverPage(@Valid SkuServiceDeliverPageReqVO pageReqVO) {
|
||||
PageResult<SkuServiceDeliverDO> pageResult = skuServiceDeliverService.getSkuServiceDeliverPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SkuServiceDeliverRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出服务交付方式 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-deliver:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSkuServiceDeliverExcel(@Valid SkuServiceDeliverPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SkuServiceDeliverDO> list = skuServiceDeliverService.getSkuServiceDeliverPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "服务交付方式.xls", "数据", SkuServiceDeliverRespVO.class,
|
||||
BeanUtils.toBean(list, SkuServiceDeliverRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceDetailsDO;
|
||||
import com.tashow.cloud.product.service.SkuServiceDetailsService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedetails.SkuServiceDetailsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedetails.SkuServiceDetailsRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedetails.SkuServiceDetailsSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 服务详情")
|
||||
@RestController
|
||||
@RequestMapping("/tz/sku-service-details")
|
||||
@Validated
|
||||
public class SkuServiceDetailsController {
|
||||
|
||||
@Resource
|
||||
private SkuServiceDetailsService skuServiceDetailsService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建服务详情")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-details:create')")
|
||||
public CommonResult<Long> createSkuServiceDetails(@Valid @RequestBody SkuServiceDetailsSaveReqVO createReqVO) {
|
||||
return success(skuServiceDetailsService.createSkuServiceDetails(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新服务详情")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-details:update')")
|
||||
public CommonResult<Boolean> updateSkuServiceDetails(@Valid @RequestBody SkuServiceDetailsSaveReqVO updateReqVO) {
|
||||
skuServiceDetailsService.updateSkuServiceDetails(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除服务详情")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-details:delete')")
|
||||
public CommonResult<Boolean> deleteSkuServiceDetails(@RequestParam("id") Long id) {
|
||||
skuServiceDetailsService.deleteSkuServiceDetails(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得服务详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-details:query')")
|
||||
public CommonResult<SkuServiceDetailsRespVO> getSkuServiceDetails(@RequestParam("id") Long id) {
|
||||
SkuServiceDetailsDO skuServiceDetails = skuServiceDetailsService.getSkuServiceDetails(id);
|
||||
return success(BeanUtils.toBean(skuServiceDetails, SkuServiceDetailsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得服务详情分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-details:query')")
|
||||
public CommonResult<PageResult<SkuServiceDetailsRespVO>> getSkuServiceDetailsPage(@Valid SkuServiceDetailsPageReqVO pageReqVO) {
|
||||
PageResult<SkuServiceDetailsDO> pageResult = skuServiceDetailsService.getSkuServiceDetailsPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SkuServiceDetailsRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出服务详情 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-details:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSkuServiceDetailsExcel(@Valid SkuServiceDetailsPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SkuServiceDetailsDO> list = skuServiceDetailsService.getSkuServiceDetailsPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "服务详情.xls", "数据", SkuServiceDetailsRespVO.class,
|
||||
BeanUtils.toBean(list, SkuServiceDetailsRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,94 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceMaterialDO;
|
||||
import com.tashow.cloud.product.service.SkuServiceMaterialService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicematerial.SkuServiceMaterialPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicematerial.SkuServiceMaterialRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicematerial.SkuServiceMaterialSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 服务物料详情")
|
||||
@RestController
|
||||
@RequestMapping("/tz/sku-service-material")
|
||||
@Validated
|
||||
public class SkuServiceMaterialController {
|
||||
|
||||
@Resource
|
||||
private SkuServiceMaterialService skuServiceMaterialService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建服务物料详情")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-material:create')")
|
||||
public CommonResult<Long> createSkuServiceMaterial(@Valid @RequestBody SkuServiceMaterialSaveReqVO createReqVO) {
|
||||
return success(skuServiceMaterialService.createSkuServiceMaterial(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新服务物料详情")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-material:update')")
|
||||
public CommonResult<Boolean> updateSkuServiceMaterial(@Valid @RequestBody SkuServiceMaterialSaveReqVO updateReqVO) {
|
||||
skuServiceMaterialService.updateSkuServiceMaterial(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除服务物料详情")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-material:delete')")
|
||||
public CommonResult<Boolean> deleteSkuServiceMaterial(@RequestParam("id") Long id) {
|
||||
skuServiceMaterialService.deleteSkuServiceMaterial(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得服务物料详情")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-material:query')")
|
||||
public CommonResult<SkuServiceMaterialRespVO> getSkuServiceMaterial(@RequestParam("id") Long id) {
|
||||
SkuServiceMaterialDO skuServiceMaterial = skuServiceMaterialService.getSkuServiceMaterial(id);
|
||||
return success(BeanUtils.toBean(skuServiceMaterial, SkuServiceMaterialRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得服务物料详情分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-material:query')")
|
||||
public CommonResult<PageResult<SkuServiceMaterialRespVO>> getSkuServiceMaterialPage(@Valid SkuServiceMaterialPageReqVO pageReqVO) {
|
||||
PageResult<SkuServiceMaterialDO> pageResult = skuServiceMaterialService.getSkuServiceMaterialPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SkuServiceMaterialRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出服务物料详情 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-material:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSkuServiceMaterialExcel(@Valid SkuServiceMaterialPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SkuServiceMaterialDO> list = skuServiceMaterialService.getSkuServiceMaterialPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "服务物料详情.xls", "数据", SkuServiceMaterialRespVO.class,
|
||||
BeanUtils.toBean(list, SkuServiceMaterialRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceTransportDO;
|
||||
import com.tashow.cloud.product.service.SkuServiceTransportService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicetransport.SkuServiceTransportPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicetransport.SkuServiceTransportRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicetransport.SkuServiceTransportSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 服务遗体运输")
|
||||
@RestController
|
||||
@RequestMapping("/tz/sku-service-transport")
|
||||
@Validated
|
||||
public class SkuServiceTransportController {
|
||||
|
||||
@Resource
|
||||
private SkuServiceTransportService skuServiceTransportService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建服务遗体运输")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-transport:create')")
|
||||
public CommonResult<Long> createSkuServiceTransport(@Valid @RequestBody SkuServiceTransportSaveReqVO createReqVO) {
|
||||
return success(skuServiceTransportService.createSkuServiceTransport(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新服务遗体运输")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-transport:update')")
|
||||
public CommonResult<Boolean> updateSkuServiceTransport(@Valid @RequestBody SkuServiceTransportSaveReqVO updateReqVO) {
|
||||
skuServiceTransportService.updateSkuServiceTransport(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除服务遗体运输")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-transport:delete')")
|
||||
public CommonResult<Boolean> deleteSkuServiceTransport(@RequestParam("id") Long id) {
|
||||
skuServiceTransportService.deleteSkuServiceTransport(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得服务遗体运输")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-transport:query')")
|
||||
public CommonResult<SkuServiceTransportRespVO> getSkuServiceTransport(@RequestParam("id") Long id) {
|
||||
SkuServiceTransportDO skuServiceTransport = skuServiceTransportService.getSkuServiceTransport(id);
|
||||
return success(BeanUtils.toBean(skuServiceTransport, SkuServiceTransportRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得服务遗体运输分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-transport:query')")
|
||||
public CommonResult<PageResult<SkuServiceTransportRespVO>> getSkuServiceTransportPage(@Valid SkuServiceTransportPageReqVO pageReqVO) {
|
||||
PageResult<SkuServiceTransportDO> pageResult = skuServiceTransportService.getSkuServiceTransportPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SkuServiceTransportRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出服务遗体运输 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-service-transport:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSkuServiceTransportExcel(@Valid SkuServiceTransportPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SkuServiceTransportDO> list = skuServiceTransportService.getSkuServiceTransportPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "服务遗体运输.xls", "数据", SkuServiceTransportRespVO.class,
|
||||
BeanUtils.toBean(list, SkuServiceTransportRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
package com.tashow.cloud.product.controller.admin;
|
||||
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServicesFormDO;
|
||||
import com.tashow.cloud.product.service.SkuServicesFormService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicesform.SkuServicesFormPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicesform.SkuServicesFormRespVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicesform.SkuServicesFormSaveReqVO;
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.EXPORT;
|
||||
|
||||
@Tag(name = "管理后台 - 商品SKU扩展服务表单")
|
||||
@RestController
|
||||
@RequestMapping("/tz/sku-services-form")
|
||||
@Validated
|
||||
public class SkuServicesFormController {
|
||||
|
||||
@Resource
|
||||
private SkuServicesFormService skuServicesFormService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建商品SKU扩展服务表单")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-services-form:create')")
|
||||
public CommonResult<Long> createSkuServicesForm(@Valid @RequestBody SkuServicesFormSaveReqVO createReqVO) {
|
||||
return success(skuServicesFormService.createSkuServicesForm(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新商品SKU扩展服务表单")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-services-form:update')")
|
||||
public CommonResult<Boolean> updateSkuServicesForm(@Valid @RequestBody SkuServicesFormSaveReqVO updateReqVO) {
|
||||
skuServicesFormService.updateSkuServicesForm(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除商品SKU扩展服务表单")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-services-form:delete')")
|
||||
public CommonResult<Boolean> deleteSkuServicesForm(@RequestParam("id") Long id) {
|
||||
skuServicesFormService.deleteSkuServicesForm(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得商品SKU扩展服务表单")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-services-form:query')")
|
||||
public CommonResult<SkuServicesFormRespVO> getSkuServicesForm(@RequestParam("id") Long id) {
|
||||
SkuServicesFormDO skuServicesForm = skuServicesFormService.getSkuServicesForm(id);
|
||||
return success(BeanUtils.toBean(skuServicesForm, SkuServicesFormRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得商品SKU扩展服务表单分页")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-services-form:query')")
|
||||
public CommonResult<PageResult<SkuServicesFormRespVO>> getSkuServicesFormPage(@Valid SkuServicesFormPageReqVO pageReqVO) {
|
||||
PageResult<SkuServicesFormDO> pageResult = skuServicesFormService.getSkuServicesFormPage(pageReqVO);
|
||||
return success(BeanUtils.toBean(pageResult, SkuServicesFormRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出商品SKU扩展服务表单 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('tz:sku-services-form:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportSkuServicesFormExcel(@Valid SkuServicesFormPageReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||
List<SkuServicesFormDO> list = skuServicesFormService.getSkuServicesFormPage(pageReqVO).getList();
|
||||
// 导出 Excel
|
||||
ExcelUtils.write(response, "商品SKU扩展服务表单.xls", "数据", SkuServicesFormRespVO.class,
|
||||
BeanUtils.toBean(list, SkuServicesFormRespVO.class));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
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.productapi.api.product.dto.CategoryDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDto;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
/**
|
||||
* 产品类目 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface CategoryMapper extends BaseMapperX<CategoryDO> {
|
||||
|
||||
/**
|
||||
* 根据条件查询类目列表
|
||||
*/
|
||||
List<CategoryDO> selectCategoryList(@Param("grade") Integer grade,
|
||||
@Param("categoryId") Long categoryId,
|
||||
@Param("categoryName") String categoryName,
|
||||
@Param("status") Integer status,
|
||||
@Param("shopId") Long shopId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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.productapi.api.product.dto.ProdAdditionalFeeDatesDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 特殊日期附加费用规则 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdAdditionalFeeDatesMapper extends BaseMapperX<ProdAdditionalFeeDatesDO> {
|
||||
|
||||
/**
|
||||
* 删除关联
|
||||
*/
|
||||
public int deleteAdditionalFeeDates(@Param("prodId")Long prodId,@Param("type")Integer type);
|
||||
|
||||
}
|
||||
@@ -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.productapi.api.product.dto.ProdAdditionalFeePeriodsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 特殊时段附加费用规则 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdAdditionalFeePeriodsMapper extends BaseMapperX<ProdAdditionalFeePeriodsDO> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 紧急响应时间区间设置 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdEmergencyResponseIntervalsMapper extends BaseMapperX<ProdEmergencyResponseIntervalsDO> {
|
||||
|
||||
/**
|
||||
* 删除关联
|
||||
*/
|
||||
public int deleteIntervals(@Param("configId")Long configId);
|
||||
}
|
||||
@@ -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.productapi.api.product.dto.ProdEmergencyResponseDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 商品紧急响应服务设置 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdEmergencyResponseMapper extends BaseMapperX<ProdEmergencyResponseDO> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tashow.cloud.product.mapper;
|
||||
|
||||
import com.tashow.cloud.mybatis.mybatis.core.mapper.BaseMapperX;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdExtendDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 属性规则 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdExtendMapper extends BaseMapperX<ProdExtendDO> {
|
||||
// 自定义更新方法(可选)
|
||||
int updateByProdId(@Param("prodId") Long prodId,
|
||||
@Param("isDisable") Integer isDisable,
|
||||
@Param("isExpire") Integer isExpire);
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tashow.cloud.product.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.productapi.api.product.dto.*;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdListVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdRestoreListVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdServiceVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 商品 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdMapper extends BaseMapperX<ProdDO> {
|
||||
|
||||
IPage<ProdListVO> getProdPageList(Page<?> page,@Param("createTime") String[] createTime
|
||||
, @Param("prodName") String prodName
|
||||
, @Param("shopId") Long shopId
|
||||
, @Param("status") Integer status
|
||||
, @Param("categoryId") Long categoryId);
|
||||
|
||||
ProdServiceVO selectProdService(@Param("prodId") Long prodId);
|
||||
|
||||
ProdServiceVO selectProdServiceInfo(@Param("prodId") Long prodId);
|
||||
|
||||
IPage<ProdRestoreListVO> getProdRecycleBinPageList(Page<?> page, @Param("deleteTime") String[] deleteTime
|
||||
, @Param("prodName") String prodName);
|
||||
|
||||
|
||||
void batchRestoreProd(@Param("ids") List<Long> ids);
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
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.productapi.api.product.dto.ProdPropDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 商品属性 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdPropMapper extends BaseMapperX<ProdPropDO> {
|
||||
|
||||
/**
|
||||
* 根据店铺id和属性名称获取商品属性
|
||||
* @param propName
|
||||
* @param prodId
|
||||
* @param rule
|
||||
* @return
|
||||
*/
|
||||
ProdPropDO getProdPropByPropNameAndShopId(@Param("propName") String propName, @Param("prodId") Integer prodId, @Param("rule") Integer rule);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.tashow.cloud.product.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
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.productapi.api.product.dto.ProdPropValueDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPropRecycleBinVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 属性规则 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdPropValueMapper extends BaseMapperX<ProdPropValueDO> {
|
||||
|
||||
/**
|
||||
* 插入商品属性数值
|
||||
* @param propId
|
||||
* @param prodPropValues
|
||||
*/
|
||||
void insertPropValues(@Param("propId") Long propId, @Param("prodPropValues") List<ProdPropValueDO> prodPropValues);
|
||||
|
||||
List<ProdPropValueDO> selectSalesValuesByProdId(@Param("prodId") Long prodId);
|
||||
|
||||
List<ProdPropValueDO> selectSalesValuesByState(@Param("prodId") Long prodId);
|
||||
|
||||
void batchMarkDeleted(@Param("ids") List<Long> ids);
|
||||
|
||||
int deleteProdPropValueById( @Param("id")Long id);
|
||||
|
||||
List<ProdPropValueDO> selectRestoreProp(@Param("prodId") Long prodId);
|
||||
|
||||
IPage<ProPropRecycleBinVO> getSKuPropRecycleBinList(Page<?> page, @Param("prodId") Long prodId,@Param("propValue")String propValue);
|
||||
|
||||
List<ProdPropValueDO> getskuListByPropValueIds(@Param("ids")List<Long> ids);
|
||||
|
||||
void restorePropValue(@Param("ids") List<Long> ids);
|
||||
|
||||
int getMaxPropValue(@Param("propId")Long propId);
|
||||
|
||||
// 根据商品 ID 更新销售属性值的 state(仅 rule=1 的)
|
||||
void updateStateByProdId(@Param("prodId") Long prodId, @Param("state") Integer state);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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.productapi.api.product.dto.ProdReservationConfigDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 商品预约配置 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdReservationConfigMapper extends BaseMapperX<ProdReservationConfigDO> {
|
||||
|
||||
|
||||
/**
|
||||
* 删除关联
|
||||
*/
|
||||
public int deleteReservationConfig(@Param("prodId")Long prodId);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
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.productapi.api.product.dto.ProdServiceAreaRelevanceDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 商品与服务区域关联 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdServiceAreaRelevanceMapper extends BaseMapperX<ProdServiceAreaRelevanceDO> {
|
||||
|
||||
/**
|
||||
* 删除关联
|
||||
*/
|
||||
public int deleteRelevance(@Param("prodId")Long prodId);
|
||||
}
|
||||
@@ -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.productapi.api.product.dto.ProdServiceAreasDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 服务区域 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdServiceAreasMapper extends BaseMapperX<ProdServiceAreasDO> {
|
||||
|
||||
|
||||
}
|
||||
@@ -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.productapi.api.product.dto.ProdServiceOverAreaRulesDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 超区规则 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdServiceOverAreaRulesMapper extends BaseMapperX<ProdServiceOverAreaRulesDO> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
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.productapi.api.product.dto.ProdTagsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 商品和标签管理 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdTagsMapper extends BaseMapperX<ProdTagsDO> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
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.productapi.api.product.dto.ProdWeightRangePricesDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 体重区间价格 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdWeightRangePricesMapper extends BaseMapperX<ProdWeightRangePricesDO> {
|
||||
|
||||
|
||||
/**
|
||||
* 删除关联
|
||||
*/
|
||||
public int deleteWeightRangePrices(@Param("prodId")Long prodId);
|
||||
}
|
||||
@@ -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.productapi.api.product.dto.ProductOrderLimitDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 商品接单上限设置 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProductOrderLimitMapper extends BaseMapperX<ProductOrderLimitDO> {
|
||||
|
||||
|
||||
}
|
||||
@@ -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.productapi.api.product.dto.ShopDetailDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 店铺信息 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ShopDetailMapper extends BaseMapperX<ShopDetailDO> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
package com.tashow.cloud.product.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.mapper.BaseMapperX;
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 单品SKU Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface SkuMapper extends BaseMapperX<SkuDO> {
|
||||
|
||||
IPage<SkuRecycleBinVO> getSkuRecycleBinPageList(Page<?> page, @Param("prodId") Long prodId, @Param("properties")String properties);
|
||||
|
||||
IPage<SkuDO> getSkuPageList(Page<?> page, @Param("prodId") Long prodId,@Param("skuId") Long skuId, @Param("properties")String properties);
|
||||
|
||||
|
||||
List<SkuDO> getSkuListByName( @Param("prodId")Long prodId , @Param("propertiesName")String propertiesName);
|
||||
|
||||
List<String> selectPropertiesByProdIdAndNotDeleted( @Param("prodId")Long prodId);
|
||||
|
||||
List<String> selectPropertiesByProdIdShelf( @Param("prodId")Long prodId);
|
||||
|
||||
int deleteBySkuId( @Param("skuId")Long skuId);
|
||||
|
||||
void batchSkuDeleted(@Param("ids") List<Long> ids);
|
||||
|
||||
void updateSkuDeleted(@Param("skuId") Long skuId);
|
||||
|
||||
|
||||
List<SkuDO> getskuListBySkuIds( @Param("ids")List<Long> ids);
|
||||
|
||||
List<SkuDO> getskuListByDeleted( @Param("prodId")Long prodId,@Param("ids")List<Long> ids);
|
||||
|
||||
void batchSkuRecover(@Param("ids") List<Long> ids);
|
||||
|
||||
// 查询商品下所有 SKU 的 is_shelf 状态(未删除)
|
||||
List<Integer> selectShelfStatusByProdId(@Param("prodId") Long prodId);
|
||||
}
|
||||
@@ -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.productapi.api.product.dto.SkuServiceDeliverDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 服务交付方式 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface SkuServiceDeliverMapper extends BaseMapperX<SkuServiceDeliverDO> {
|
||||
|
||||
void deleteDelivers(Long serviceId);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
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.productapi.api.product.dto.SkuServiceDetailsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 服务详情 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface SkuServiceDetailsMapper extends BaseMapperX<SkuServiceDetailsDO> {
|
||||
|
||||
void deleteDetails(Long serviceId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
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.productapi.api.product.dto.SkuServiceMaterialDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 服务物料详情 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface SkuServiceMaterialMapper extends BaseMapperX<SkuServiceMaterialDO> {
|
||||
|
||||
|
||||
void deleteMaterials(Long serviceId);
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
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.productapi.api.product.dto.SkuServiceTransportDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 服务遗体运输 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface SkuServiceTransportMapper extends BaseMapperX<SkuServiceTransportDO> {
|
||||
|
||||
|
||||
void deleteTransports(Long serviceId);
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
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.productapi.api.product.dto.SkuDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServicesFormDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuServiceExtendVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 商品SKU扩展服务表单 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface SkuServicesFormMapper extends BaseMapperX<SkuServicesFormDO> {
|
||||
|
||||
List<SkuServiceExtendVO> selectSkuServiceExtendWithDetails(Integer formId);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDto;
|
||||
import com.tashow.cloud.productapi.api.product.vo.CategoryPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.CategorySaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 产品类目 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface CategoryService extends IService<CategoryDO> {
|
||||
|
||||
|
||||
List<CategoryDO> categoryList(Integer grade, Long categoryId,String categoryName, Integer status);
|
||||
|
||||
|
||||
/**
|
||||
* 创建产品类目
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createCategory(@Valid CategorySaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新产品类目
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateCategory(@Valid CategorySaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除产品类目
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteCategory(Long id);
|
||||
|
||||
/**
|
||||
* 获得产品类目
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 产品类目
|
||||
*/
|
||||
CategoryDO getCategory(Long id);
|
||||
|
||||
/**
|
||||
* 获得产品类目分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 产品类目分页
|
||||
*/
|
||||
PageResult<CategoryDO> getCategoryPage(CategoryPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeeDatesDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.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);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeePeriodsDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 特殊时段附加费用规则 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdAdditionalFeePeriodsService {
|
||||
|
||||
/**
|
||||
* 创建特殊时段附加费用规则
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProdAdditionalFeePeriods(@Valid ProdAdditionalFeePeriodsSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新特殊时段附加费用规则
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProdAdditionalFeePeriods(@Valid ProdAdditionalFeePeriodsSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除特殊时段附加费用规则
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProdAdditionalFeePeriods(Long id);
|
||||
|
||||
/**
|
||||
* 获得特殊时段附加费用规则
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 特殊时段附加费用规则
|
||||
*/
|
||||
ProdAdditionalFeePeriodsDO getProdAdditionalFeePeriods(Long id);
|
||||
|
||||
/**
|
||||
* 获得特殊时段附加费用规则分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 特殊时段附加费用规则分页
|
||||
*/
|
||||
PageResult<ProdAdditionalFeePeriodsDO> getProdAdditionalFeePeriodsPage(ProdAdditionalFeePeriodsPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 紧急响应时间区间设置 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdEmergencyResponseIntervalsService {
|
||||
|
||||
/**
|
||||
* 创建紧急响应时间区间设置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProdEmergencyResponseIntervals(@Valid ProdEmergencyResponseIntervalsSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新紧急响应时间区间设置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProdEmergencyResponseIntervals(@Valid ProdEmergencyResponseIntervalsSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除紧急响应时间区间设置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProdEmergencyResponseIntervals(Long id);
|
||||
|
||||
/**
|
||||
* 获得紧急响应时间区间设置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 紧急响应时间区间设置
|
||||
*/
|
||||
ProdEmergencyResponseIntervalsDO getProdEmergencyResponseIntervals(Long id);
|
||||
|
||||
/**
|
||||
* 获得紧急响应时间区间设置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 紧急响应时间区间设置分页
|
||||
*/
|
||||
PageResult<ProdEmergencyResponseIntervalsDO> getProdEmergencyResponseIntervalsPage(ProdEmergencyResponseIntervalsPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyResponsePageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyResponseSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 商品紧急响应服务设置 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdEmergencyResponseService {
|
||||
|
||||
/**
|
||||
* 创建商品紧急响应服务设置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProdEmergencyResponse(@Valid ProdEmergencyResponseSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新商品紧急响应服务设置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProdEmergencyResponse(@Valid ProdEmergencyResponseSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除商品紧急响应服务设置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProdEmergencyResponse(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品紧急响应服务设置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 商品紧急响应服务设置
|
||||
*/
|
||||
ProdEmergencyResponseDO getProdEmergencyResponse(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品紧急响应服务设置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 商品紧急响应服务设置分页
|
||||
*/
|
||||
PageResult<ProdEmergencyResponseDO> getProdEmergencyResponsePage(ProdEmergencyResponsePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdExtendDO;
|
||||
|
||||
|
||||
/**
|
||||
* 商品属性 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdExtendService extends IService<ProdExtendDO> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdSaveReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodprop.ProdPropPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodprop.ProdPropSaveReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuPropVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 商品属性 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdPropService extends IService<ProdPropDO> {
|
||||
|
||||
/**
|
||||
* 创建商品属性
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProdProp(@Valid ProdPropSaveReqVO createReqVO);
|
||||
|
||||
void saveProdPropAndValues(ProdSaveReqVO createReqVO);
|
||||
|
||||
|
||||
|
||||
void updateProdPropAndValues(SkuPropVO skuPropVO);
|
||||
/**
|
||||
* 更新商品属性
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProdProp(@Valid ProdPropSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除商品属性
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProdProp(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品属性
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 商品属性
|
||||
*/
|
||||
ProdPropDO getProdProp(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品属性分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 商品属性分页
|
||||
*/
|
||||
PageResult<ProdPropDO> getProdPropPage(ProdPropPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProdPropValuePageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProdPropValueSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 属性规则 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdPropValueService extends IService<ProdPropValueDO> {
|
||||
|
||||
/**
|
||||
* 创建属性规则
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProdPropValue(@Valid ProdPropValueSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新属性规则
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProdPropValue(@Valid ProdPropValueSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除属性规则
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProdPropValue(Long id);
|
||||
|
||||
/**
|
||||
* 获得属性规则
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 属性规则
|
||||
*/
|
||||
ProdPropValueDO getProdPropValue(Long id);
|
||||
|
||||
/**
|
||||
* 获得属性规则分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 属性规则分页
|
||||
*/
|
||||
PageResult<ProdPropValueDO> getProdPropValuePage(ProdPropValuePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdReservationConfigDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationConfigPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationConfigSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 商品预约配置 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdReservationConfigService {
|
||||
|
||||
/**
|
||||
* 创建商品预约配置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProdReservationConfig(@Valid ProdReservationConfigSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新商品预约配置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProdReservationConfig(@Valid ProdReservationConfigSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除商品预约配置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProdReservationConfig(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品预约配置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 商品预约配置
|
||||
*/
|
||||
ProdReservationConfigDO getProdReservationConfig(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品预约配置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 商品预约配置分页
|
||||
*/
|
||||
PageResult<ProdReservationConfigDO> getProdReservationConfigPage(ProdReservationConfigPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.*;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 商品 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdService {
|
||||
|
||||
/**
|
||||
* 创建商品
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProd(@Valid ProdSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 创建商品服务配置
|
||||
*
|
||||
* @param prodServiceVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
void createProdService(@Valid ProdServiceVO prodServiceVO);
|
||||
|
||||
|
||||
/**
|
||||
* 修改商品服务配置
|
||||
*
|
||||
* @param prodServiceInfoVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
void uptateProdService(@Valid ProdServiceInfoVO prodServiceInfoVO);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取商品服务配置
|
||||
*
|
||||
* @param prodId 商品id
|
||||
* @return 编号
|
||||
*/
|
||||
ProdServiceVO getProdService(@Valid Long prodId);
|
||||
|
||||
/**
|
||||
* 更新商品
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProd(@Valid ProdSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProd(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 商品
|
||||
*/
|
||||
ProdDO getProd(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 商品分页
|
||||
*/
|
||||
PageResult<ProdListVO> getProdPage(ProdPageReqVO pageReqVO);
|
||||
|
||||
PageResult<ProdRestoreListVO> getProdRecycleBinPageList(ProdRecycleBinVO prodRecycleBinVO);
|
||||
|
||||
/**
|
||||
* 恢复商品
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
void restoreProdList(List<Long> ids);
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdServiceAreaRelevanceDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodservicearearelevance.ProdServiceAreaRelevancePageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodservicearearelevance.ProdServiceAreaRelevanceSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 商品与服务区域关联 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdServiceAreaRelevanceService {
|
||||
|
||||
/**
|
||||
* 创建商品与服务区域关联
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProdServiceAreaRelevance(@Valid ProdServiceAreaRelevanceSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新商品与服务区域关联
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProdServiceAreaRelevance(@Valid ProdServiceAreaRelevanceSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除商品与服务区域关联
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProdServiceAreaRelevance(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品与服务区域关联
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 商品与服务区域关联
|
||||
*/
|
||||
ProdServiceAreaRelevanceDO getProdServiceAreaRelevance(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品与服务区域关联分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 商品与服务区域关联分页
|
||||
*/
|
||||
PageResult<ProdServiceAreaRelevanceDO> getProdServiceAreaRelevancePage(ProdServiceAreaRelevancePageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdServiceAreasDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 服务区域 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdServiceAreasService extends IService<ProdServiceAreasDO> {
|
||||
|
||||
/**
|
||||
* 创建服务区域
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProdServiceAreas(@Valid ProdServiceAreasSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新服务区域
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProdServiceAreas(@Valid ProdServiceAreasSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除服务区域
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProdServiceAreas(Long id);
|
||||
|
||||
/**
|
||||
* 获得服务区域
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 服务区域
|
||||
*/
|
||||
ProdServiceAreasDO getProdServiceAreas(Long id);
|
||||
|
||||
/**
|
||||
* 获得服务区域分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 服务区域分页
|
||||
*/
|
||||
PageResult<ProdServiceAreasDO> getProdServiceAreasPage(ProdServiceAreasPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdServiceOverAreaRulesDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceoverarearules.ProdServiceOverAreaRulesPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceoverarearules.ProdServiceOverAreaRulesSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 超区规则 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdServiceOverAreaRulesService {
|
||||
|
||||
/**
|
||||
* 创建超区规则
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProdServiceOverAreaRules(@Valid ProdServiceOverAreaRulesSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新超区规则
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProdServiceOverAreaRules(@Valid ProdServiceOverAreaRulesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除超区规则
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProdServiceOverAreaRules(Long id);
|
||||
|
||||
/**
|
||||
* 获得超区规则
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 超区规则
|
||||
*/
|
||||
ProdServiceOverAreaRulesDO getProdServiceOverAreaRules(Long id);
|
||||
|
||||
/**
|
||||
* 获得超区规则分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 超区规则分页
|
||||
*/
|
||||
PageResult<ProdServiceOverAreaRulesDO> getProdServiceOverAreaRulesPage(ProdServiceOverAreaRulesPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdTagsDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodtags.ProdTagsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodtags.ProdTagsSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 商品和标签管理 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdTagsService {
|
||||
|
||||
/**
|
||||
* 创建商品和标签管理
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProdTags(@Valid ProdTagsSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新商品和标签管理
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProdTags(@Valid ProdTagsSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除商品和标签管理
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProdTags(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品和标签管理
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 商品和标签管理
|
||||
*/
|
||||
ProdTagsDO getProdTags(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品和标签管理分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 商品和标签管理分页
|
||||
*/
|
||||
PageResult<ProdTagsDO> getProdTagsPage(ProdTagsPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdWeightRangePricesDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 体重区间价格 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProdWeightRangePricesService {
|
||||
|
||||
/**
|
||||
* 创建体重区间价格
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProdWeightRangePrices(@Valid ProdWeightRangePricesSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新体重区间价格
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProdWeightRangePrices(@Valid ProdWeightRangePricesSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除体重区间价格
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProdWeightRangePrices(Long id);
|
||||
|
||||
/**
|
||||
* 获得体重区间价格
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 体重区间价格
|
||||
*/
|
||||
ProdWeightRangePricesDO getProdWeightRangePrices(Long id);
|
||||
|
||||
/**
|
||||
* 获得体重区间价格分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 体重区间价格分页
|
||||
*/
|
||||
PageResult<ProdWeightRangePricesDO> getProdWeightRangePricesPage(ProdWeightRangePricesPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProductOrderLimitDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.productorderlimit.ProductOrderLimitPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.productorderlimit.ProductOrderLimitSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 商品接单上限设置 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ProductOrderLimitService {
|
||||
|
||||
/**
|
||||
* 创建商品接单上限设置
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createProductOrderLimit(@Valid ProductOrderLimitSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新商品接单上限设置
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateProductOrderLimit(@Valid ProductOrderLimitSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除商品接单上限设置
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteProductOrderLimit(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品接单上限设置
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 商品接单上限设置
|
||||
*/
|
||||
ProductOrderLimitDO getProductOrderLimit(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品接单上限设置分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 商品接单上限设置分页
|
||||
*/
|
||||
PageResult<ProductOrderLimitDO> getProductOrderLimitPage(ProductOrderLimitPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ShopDetailDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.shopdetail
|
||||
.ShopDetailPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.shopdetail
|
||||
.ShopDetailSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 店铺信息 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface ShopDetailService {
|
||||
|
||||
/**
|
||||
* 创建店铺信息
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createShopDetail(@Valid ShopDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新店铺信息
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateShopDetail(@Valid ShopDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除店铺信息
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteShopDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得店铺信息
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 店铺信息
|
||||
*/
|
||||
ShopDetailDO getShopDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得店铺信息分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 店铺信息分页
|
||||
*/
|
||||
PageResult<ShopDetailDO> getShopDetailPage(ShopDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.*;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPropRecycleBinVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.*;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
/**
|
||||
* 单品SKU Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface SkuService {
|
||||
|
||||
/**
|
||||
* 创建单品SKU
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createSku(@Valid SkuSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 创建sku扩展服务配置
|
||||
*
|
||||
* @param skuExtendVO 更新信息
|
||||
*/
|
||||
void createSkuExtend(@Valid SkuExtendVO skuExtendVO);
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 创建sku扩展服务配置
|
||||
*
|
||||
* @param formId 更新信息
|
||||
*/
|
||||
SkuExtendVO getSkuExtend(Integer formId);
|
||||
|
||||
|
||||
/**
|
||||
* 更新单品SKU
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSku(@Valid SkuSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 更新sku规格
|
||||
*
|
||||
* @param skuPropVO 更新信息
|
||||
*/
|
||||
void updateProp(SkuPropVO skuPropVO);
|
||||
|
||||
|
||||
void updatePropVal(Long id, String propValue);
|
||||
|
||||
/**
|
||||
* 删除规格值
|
||||
*
|
||||
* @param id 删除规格值
|
||||
*/
|
||||
void deleteProp(Long id);
|
||||
|
||||
/**
|
||||
* 禁用规格值
|
||||
*
|
||||
* @param id 删除规格值
|
||||
*/
|
||||
void disableProp(Long id,Integer state);
|
||||
|
||||
|
||||
|
||||
SkuPropInfoVO getSKuPropList(Long prodId);
|
||||
|
||||
PageResult<ProPropRecycleBinVO> getSKuPropRecycleBinList(ProPageReqVO proPageReqVO);
|
||||
/**
|
||||
* 删除单品SKU
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSku(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除删SKU
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
void deleteSkus(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 恢复SKU
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
void restoreSkuList(List<Long> ids);
|
||||
/**
|
||||
* 恢复规格
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
void restorePropList(List<Long> ids);
|
||||
|
||||
|
||||
/**
|
||||
* 删除单品SKU
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void updatSkuIsShelf(Long id,Integer isShelf);
|
||||
|
||||
/**
|
||||
* 批量删除删SKU
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
void updatSkuIsShelfs(List<Long> ids,Integer isShelf);
|
||||
|
||||
|
||||
/**
|
||||
* 获得单品SKU
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 单品SKU
|
||||
*/
|
||||
SkuDO getSku(Long id);
|
||||
|
||||
|
||||
|
||||
PageResult<SkuRecycleBinVO> getSkuRecycleBinPageList(SkuPageReqVO pageReqVO);
|
||||
|
||||
|
||||
PageResult<SkuDO> getSkuPageList(SkuPageReqVO pageReqVO);
|
||||
/**
|
||||
* 获得单品SKU分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 单品SKU分页
|
||||
*/
|
||||
PageResult<SkuDO> getSkuPage(SkuPageReqVO pageReqVO);
|
||||
|
||||
|
||||
/**
|
||||
* 创建sku扩展服务配置
|
||||
*
|
||||
* @param skuServiceDetailsList 更新信息
|
||||
*/
|
||||
void updateServiceDetails(List<SkuServiceDetailsDO> skuServiceDetailsList);
|
||||
|
||||
|
||||
/**
|
||||
* 修物料配置
|
||||
*
|
||||
* @param skuServiceMaterialList 更新信息
|
||||
*/
|
||||
void updateMaterial(List<SkuServiceMaterialDO> skuServiceMaterialList);
|
||||
|
||||
|
||||
/**
|
||||
* 修改接运地址配置
|
||||
*
|
||||
* @param skuServiceTransportDOList 更新信息
|
||||
*/
|
||||
void updateTransportAdress( List<SkuServiceTransportDO> skuServiceTransportDOList);
|
||||
|
||||
/**
|
||||
* 修改配送方式
|
||||
*
|
||||
* @param skuServiceDeliverList 更新信息
|
||||
*/
|
||||
void updateDeliver(List<SkuServiceDeliverDO> skuServiceDeliverList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceDeliverDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedeliver.SkuServiceDeliverPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedeliver.SkuServiceDeliverSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 服务交付方式 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface SkuServiceDeliverService {
|
||||
|
||||
/**
|
||||
* 创建服务交付方式
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createSkuServiceDeliver(@Valid SkuServiceDeliverSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新服务交付方式
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSkuServiceDeliver(@Valid SkuServiceDeliverSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除服务交付方式
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSkuServiceDeliver(Long id);
|
||||
|
||||
/**
|
||||
* 获得服务交付方式
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 服务交付方式
|
||||
*/
|
||||
SkuServiceDeliverDO getSkuServiceDeliver(Long id);
|
||||
|
||||
/**
|
||||
* 获得服务交付方式分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 服务交付方式分页
|
||||
*/
|
||||
PageResult<SkuServiceDeliverDO> getSkuServiceDeliverPage(SkuServiceDeliverPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceDetailsDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedetails.SkuServiceDetailsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedetails.SkuServiceDetailsSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 服务详情 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface SkuServiceDetailsService {
|
||||
|
||||
/**
|
||||
* 创建服务详情
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createSkuServiceDetails(@Valid SkuServiceDetailsSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新服务详情
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSkuServiceDetails(@Valid SkuServiceDetailsSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除服务详情
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSkuServiceDetails(Long id);
|
||||
|
||||
/**
|
||||
* 获得服务详情
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 服务详情
|
||||
*/
|
||||
SkuServiceDetailsDO getSkuServiceDetails(Long id);
|
||||
|
||||
/**
|
||||
* 获得服务详情分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 服务详情分页
|
||||
*/
|
||||
PageResult<SkuServiceDetailsDO> getSkuServiceDetailsPage(SkuServiceDetailsPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceMaterialDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicematerial.SkuServiceMaterialPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicematerial.SkuServiceMaterialSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 服务物料详情 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface SkuServiceMaterialService {
|
||||
|
||||
/**
|
||||
* 创建服务物料详情
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createSkuServiceMaterial(@Valid SkuServiceMaterialSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新服务物料详情
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSkuServiceMaterial(@Valid SkuServiceMaterialSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除服务物料详情
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSkuServiceMaterial(Long id);
|
||||
|
||||
/**
|
||||
* 获得服务物料详情
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 服务物料详情
|
||||
*/
|
||||
SkuServiceMaterialDO getSkuServiceMaterial(Long id);
|
||||
|
||||
/**
|
||||
* 获得服务物料详情分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 服务物料详情分页
|
||||
*/
|
||||
PageResult<SkuServiceMaterialDO> getSkuServiceMaterialPage(SkuServiceMaterialPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceTransportDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicetransport.SkuServiceTransportPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicetransport.SkuServiceTransportSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 服务遗体运输 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface SkuServiceTransportService {
|
||||
|
||||
/**
|
||||
* 创建服务遗体运输
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createSkuServiceTransport(@Valid SkuServiceTransportSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新服务遗体运输
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSkuServiceTransport(@Valid SkuServiceTransportSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除服务遗体运输
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSkuServiceTransport(Long id);
|
||||
|
||||
/**
|
||||
* 获得服务遗体运输
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 服务遗体运输
|
||||
*/
|
||||
SkuServiceTransportDO getSkuServiceTransport(Long id);
|
||||
|
||||
/**
|
||||
* 获得服务遗体运输分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 服务遗体运输分页
|
||||
*/
|
||||
PageResult<SkuServiceTransportDO> getSkuServiceTransportPage(SkuServiceTransportPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServicesFormDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicesform.SkuServicesFormPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicesform.SkuServicesFormSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
|
||||
/**
|
||||
* 商品SKU扩展服务表单 Service 接口
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
public interface SkuServicesFormService {
|
||||
|
||||
/**
|
||||
* 创建商品SKU扩展服务表单
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
Long createSkuServicesForm(@Valid SkuServicesFormSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新商品SKU扩展服务表单
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateSkuServicesForm(@Valid SkuServicesFormSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除商品SKU扩展服务表单
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteSkuServicesForm(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品SKU扩展服务表单
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 商品SKU扩展服务表单
|
||||
*/
|
||||
SkuServicesFormDO getSkuServicesForm(Long id);
|
||||
|
||||
/**
|
||||
* 获得商品SKU扩展服务表单分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 商品SKU扩展服务表单分页
|
||||
*/
|
||||
PageResult<SkuServicesFormDO> getSkuServicesFormPage(SkuServicesFormPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,91 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.tashow.cloud.common.exception.ErrorCode;
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import com.tashow.cloud.product.mapper.CategoryMapper;
|
||||
import com.tashow.cloud.product.mapper.ProdPropValueMapper;
|
||||
import com.tashow.cloud.product.service.CategoryService;
|
||||
import com.tashow.cloud.productapi.api.product.dto.CategoryDto;
|
||||
import com.tashow.cloud.productapi.api.product.vo.CategoryPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.CategorySaveReqVO;
|
||||
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 CategoryServiceImpl extends ServiceImpl<CategoryMapper, CategoryDO> implements CategoryService {
|
||||
|
||||
@Resource
|
||||
private CategoryMapper categoryMapper;
|
||||
|
||||
@Override
|
||||
public List<CategoryDO> categoryList(Integer grade, Long categoryId,String categoryName, Integer status) {
|
||||
List<CategoryDO> categoryMenuList =categoryMapper.selectCategoryList(grade, categoryId,categoryName, status,1L);
|
||||
return categoryMenuList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Long createCategory(CategorySaveReqVO createReqVO) {
|
||||
// 插入
|
||||
CategoryDO category = BeanUtils.toBean(createReqVO, CategoryDO.class);
|
||||
category.setShopId(1L);
|
||||
categoryMapper.insert(category);
|
||||
// 返回
|
||||
return category.getCategoryId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateCategory(CategorySaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateCategoryExists(updateReqVO.getCategoryId());
|
||||
// 更新
|
||||
CategoryDO updateObj = BeanUtils.toBean(updateReqVO, CategoryDO.class);
|
||||
categoryMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteCategory(Long id) {
|
||||
// 校验存在
|
||||
validateCategoryExists(id);
|
||||
// 删除
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeeDatesDO;
|
||||
import com.tashow.cloud.product.mapper.ProdAdditionalFeeDatesMapper;
|
||||
import com.tashow.cloud.product.service.ProdAdditionalFeeDatesService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeDatesPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.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;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeePeriodsDO;
|
||||
import com.tashow.cloud.product.mapper.ProdAdditionalFeePeriodsMapper;
|
||||
import com.tashow.cloud.product.service.ProdAdditionalFeePeriodsService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsSaveReqVO;
|
||||
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 ProdAdditionalFeePeriodsServiceImpl implements ProdAdditionalFeePeriodsService {
|
||||
|
||||
@Resource
|
||||
private ProdAdditionalFeePeriodsMapper prodAdditionalFeePeriodsMapper;
|
||||
|
||||
@Override
|
||||
public Long createProdAdditionalFeePeriods(ProdAdditionalFeePeriodsSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdAdditionalFeePeriodsDO prodAdditionalFeePeriods = BeanUtils.toBean(createReqVO, ProdAdditionalFeePeriodsDO.class);
|
||||
prodAdditionalFeePeriodsMapper.insert(prodAdditionalFeePeriods);
|
||||
// 返回
|
||||
return prodAdditionalFeePeriods.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProdAdditionalFeePeriods(ProdAdditionalFeePeriodsSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdAdditionalFeePeriodsExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProdAdditionalFeePeriodsDO updateObj = BeanUtils.toBean(updateReqVO, ProdAdditionalFeePeriodsDO.class);
|
||||
prodAdditionalFeePeriodsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProdAdditionalFeePeriods(Long id) {
|
||||
// 校验存在
|
||||
validateProdAdditionalFeePeriodsExists(id);
|
||||
// 删除
|
||||
prodAdditionalFeePeriodsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProdAdditionalFeePeriodsExists(Long id) {
|
||||
if (prodAdditionalFeePeriodsMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PROD_ADDITIONAL_FEE_PERIODS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdAdditionalFeePeriodsDO getProdAdditionalFeePeriods(Long id) {
|
||||
return prodAdditionalFeePeriodsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdAdditionalFeePeriodsDO> getProdAdditionalFeePeriodsPage(ProdAdditionalFeePeriodsPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import com.tashow.cloud.product.mapper.ProdEmergencyResponseIntervalsMapper;
|
||||
import com.tashow.cloud.product.service.ProdEmergencyResponseIntervalsService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsSaveReqVO;
|
||||
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 ProdEmergencyResponseIntervalsServiceImpl implements ProdEmergencyResponseIntervalsService {
|
||||
|
||||
@Resource
|
||||
private ProdEmergencyResponseIntervalsMapper prodEmergencyResponseIntervalsMapper;
|
||||
|
||||
@Override
|
||||
public Long createProdEmergencyResponseIntervals(ProdEmergencyResponseIntervalsSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals = BeanUtils.toBean(createReqVO, ProdEmergencyResponseIntervalsDO.class);
|
||||
prodEmergencyResponseIntervalsMapper.insert(prodEmergencyResponseIntervals);
|
||||
// 返回
|
||||
return prodEmergencyResponseIntervals.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProdEmergencyResponseIntervals(ProdEmergencyResponseIntervalsSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdEmergencyResponseIntervalsExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProdEmergencyResponseIntervalsDO updateObj = BeanUtils.toBean(updateReqVO, ProdEmergencyResponseIntervalsDO.class);
|
||||
prodEmergencyResponseIntervalsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProdEmergencyResponseIntervals(Long id) {
|
||||
// 校验存在
|
||||
validateProdEmergencyResponseIntervalsExists(id);
|
||||
// 删除
|
||||
prodEmergencyResponseIntervalsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProdEmergencyResponseIntervalsExists(Long id) {
|
||||
if (prodEmergencyResponseIntervalsMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PROD_EMERGENCY_RESPONSE_INTERVALS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdEmergencyResponseIntervalsDO getProdEmergencyResponseIntervals(Long id) {
|
||||
return prodEmergencyResponseIntervalsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdEmergencyResponseIntervalsDO> getProdEmergencyResponseIntervalsPage(ProdEmergencyResponseIntervalsPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseDO;
|
||||
import com.tashow.cloud.product.mapper.ProdEmergencyResponseMapper;
|
||||
import com.tashow.cloud.product.service.ProdEmergencyResponseService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyResponsePageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyResponseSaveReqVO;
|
||||
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 ProdEmergencyResponseServiceImpl implements ProdEmergencyResponseService {
|
||||
|
||||
@Resource
|
||||
private ProdEmergencyResponseMapper prodEmergencyResponseMapper;
|
||||
|
||||
@Override
|
||||
public Long createProdEmergencyResponse(ProdEmergencyResponseSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdEmergencyResponseDO prodEmergencyResponse = BeanUtils.toBean(createReqVO, ProdEmergencyResponseDO.class);
|
||||
prodEmergencyResponseMapper.insert(prodEmergencyResponse);
|
||||
// 返回
|
||||
return prodEmergencyResponse.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProdEmergencyResponse(ProdEmergencyResponseSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdEmergencyResponseExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProdEmergencyResponseDO updateObj = BeanUtils.toBean(updateReqVO, ProdEmergencyResponseDO.class);
|
||||
prodEmergencyResponseMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProdEmergencyResponse(Long id) {
|
||||
// 校验存在
|
||||
validateProdEmergencyResponseExists(id);
|
||||
// 删除
|
||||
prodEmergencyResponseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProdEmergencyResponseExists(Long id) {
|
||||
if (prodEmergencyResponseMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PROD_EMERGENCY_RESPONSE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdEmergencyResponseDO getProdEmergencyResponse(Long id) {
|
||||
return prodEmergencyResponseMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdEmergencyResponseDO> getProdEmergencyResponsePage(ProdEmergencyResponsePageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdExtendDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import com.tashow.cloud.product.mapper.ProdExtendMapper;
|
||||
import com.tashow.cloud.product.mapper.ProdPropValueMapper;
|
||||
import com.tashow.cloud.product.service.ProdExtendService;
|
||||
import com.tashow.cloud.product.service.ProdPropValueService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
|
||||
/**
|
||||
* 超区规则 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class ProdExtendServiceImpl extends ServiceImpl<ProdExtendMapper, ProdExtendDO> implements ProdExtendService {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,136 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import com.tashow.cloud.product.mapper.ProdPropMapper;
|
||||
import com.tashow.cloud.product.mapper.ProdPropValueMapper;
|
||||
import com.tashow.cloud.product.service.ProdPropService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.ProdSaveReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodprop.ProdPropPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodprop.ProdPropSaveReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuPropVO;
|
||||
import com.tashow.cloud.productapi.enums.BaseEnum;
|
||||
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 ProdPropServiceImpl extends ServiceImpl<ProdPropMapper, ProdPropDO> implements ProdPropService {
|
||||
|
||||
@Resource
|
||||
private ProdPropMapper prodPropMapper;
|
||||
@Resource
|
||||
private ProdPropValueMapper prodPropValueMapper;
|
||||
|
||||
@Override
|
||||
public Long createProdProp(ProdPropSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdPropDO prodProp = BeanUtils.toBean(createReqVO, ProdPropDO.class);
|
||||
prodPropMapper.insert(prodProp);
|
||||
// 返回
|
||||
return prodProp.getPropId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void saveProdPropAndValues(ProdSaveReqVO createReqVOInfo) {
|
||||
|
||||
for (ProdPropSaveReqVO createReqVO : createReqVOInfo.getProdPropSaveReqVO()){
|
||||
ProdPropDO dbProdProp = prodPropMapper.getProdPropByPropNameAndShopId(createReqVO.getPropName(), createReqVO.getProdId(), createReqVO.getRule());
|
||||
if (dbProdProp != null) {
|
||||
throw new RuntimeException("已有相同名称规格");
|
||||
}
|
||||
ProdPropDO prodProp = BeanUtils.toBean(createReqVO, ProdPropDO.class);
|
||||
prodProp.setProdId(createReqVOInfo.getProdId());
|
||||
prodPropMapper.insert(prodProp);
|
||||
if (CollUtil.isEmpty(createReqVO.getProdPropValues())) {
|
||||
return;
|
||||
}
|
||||
for (ProdPropValueDO prodPropValueDO : createReqVO.getProdPropValues()){
|
||||
prodPropValueDO.setPropId(prodProp.getId());
|
||||
prodPropValueMapper.insert(prodPropValueDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateProdPropAndValues(SkuPropVO skuPropVO) {
|
||||
for (ProdPropSaveReqVO createReqVO : skuPropVO.getProdPropSaveReqVO()){
|
||||
ProdPropDO dbProdProp = prodPropMapper.getProdPropByPropNameAndShopId(createReqVO.getPropName(), createReqVO.getProdId(), createReqVO.getRule());
|
||||
if (dbProdProp != null) {
|
||||
throw new RuntimeException("已有相同名称规格");
|
||||
}
|
||||
ProdPropDO prodProp = BeanUtils.toBean(createReqVO, ProdPropDO.class);
|
||||
if(Objects.equals(BaseEnum.YES_ONE.getKey(),createReqVO.getIsExist())){
|
||||
prodPropMapper.insert(prodProp);
|
||||
}else {
|
||||
prodPropMapper.updateById(prodProp);
|
||||
}
|
||||
if (CollUtil.isEmpty(createReqVO.getProdPropValues())) {
|
||||
return;
|
||||
}
|
||||
for (ProdPropValueDO prodPropValueDO : createReqVO.getProdPropValues()){
|
||||
if(Objects.equals(BaseEnum.YES_ONE.getKey(),prodPropValueDO.getIsExist())){
|
||||
prodPropValueDO.setPropId(prodProp.getId());
|
||||
prodPropValueMapper.insert(prodPropValueDO);
|
||||
}else {
|
||||
prodPropValueMapper.updateById(prodPropValueDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateProdProp(ProdPropSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdPropExists(updateReqVO.getPropId());
|
||||
// 更新
|
||||
ProdPropDO updateObj = BeanUtils.toBean(updateReqVO, ProdPropDO.class);
|
||||
prodPropMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProdProp(Long id) {
|
||||
// 校验存在
|
||||
validateProdPropExists(id);
|
||||
// 删除
|
||||
prodPropMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProdPropExists(Long id) {
|
||||
if (prodPropMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PROD_PROP_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdPropDO getProdProp(Long id) {
|
||||
return prodPropMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdPropDO> getProdPropPage(ProdPropPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import com.tashow.cloud.product.mapper.ProdPropMapper;
|
||||
import com.tashow.cloud.product.mapper.ProdPropValueMapper;
|
||||
import com.tashow.cloud.product.service.ProdPropValueService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProdPropValuePageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProdPropValueSaveReqVO;
|
||||
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 ProdPropValueServiceImpl extends ServiceImpl<ProdPropValueMapper, ProdPropValueDO> implements ProdPropValueService {
|
||||
|
||||
@Resource
|
||||
private ProdPropValueMapper prodPropValueMapper;
|
||||
|
||||
@Override
|
||||
public Long createProdPropValue(ProdPropValueSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdPropValueDO prodPropValue = BeanUtils.toBean(createReqVO, ProdPropValueDO.class);
|
||||
prodPropValueMapper.insert(prodPropValue);
|
||||
// 返回
|
||||
return prodPropValue.getPropId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProdPropValue(ProdPropValueSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdPropValueExists(updateReqVO.getPropId());
|
||||
// 更新
|
||||
ProdPropValueDO updateObj = BeanUtils.toBean(updateReqVO, ProdPropValueDO.class);
|
||||
prodPropValueMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProdPropValue(Long id) {
|
||||
// 校验存在
|
||||
validateProdPropValueExists(id);
|
||||
// 删除
|
||||
prodPropValueMapper.deleteProdPropValueById(id);
|
||||
}
|
||||
|
||||
private void validateProdPropValueExists(Long id) {
|
||||
if (prodPropValueMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PROD_PROP_VALUE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdPropValueDO getProdPropValue(Long id) {
|
||||
return prodPropValueMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdPropValueDO> getProdPropValuePage(ProdPropValuePageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdReservationConfigDO;
|
||||
import com.tashow.cloud.product.mapper.ProdReservationConfigMapper;
|
||||
import com.tashow.cloud.product.service.ProdReservationConfigService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationConfigPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationConfigSaveReqVO;
|
||||
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 ProdReservationConfigServiceImpl implements ProdReservationConfigService {
|
||||
|
||||
@Resource
|
||||
private ProdReservationConfigMapper prodReservationConfigMapper;
|
||||
|
||||
@Override
|
||||
public Long createProdReservationConfig(ProdReservationConfigSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdReservationConfigDO prodReservationConfig = BeanUtils.toBean(createReqVO, ProdReservationConfigDO.class);
|
||||
prodReservationConfigMapper.insert(prodReservationConfig);
|
||||
// 返回
|
||||
return prodReservationConfig.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProdReservationConfig(ProdReservationConfigSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdReservationConfigExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProdReservationConfigDO updateObj = BeanUtils.toBean(updateReqVO, ProdReservationConfigDO.class);
|
||||
prodReservationConfigMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProdReservationConfig(Long id) {
|
||||
// 校验存在
|
||||
validateProdReservationConfigExists(id);
|
||||
// 删除
|
||||
prodReservationConfigMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProdReservationConfigExists(Long id) {
|
||||
if (prodReservationConfigMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PROD_RESERVATION_CONFIG_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdReservationConfigDO getProdReservationConfig(Long id) {
|
||||
return prodReservationConfigMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdReservationConfigDO> getProdReservationConfigPage(ProdReservationConfigPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdServiceAreaRelevanceDO;
|
||||
import com.tashow.cloud.product.mapper.ProdServiceAreaRelevanceMapper;
|
||||
import com.tashow.cloud.product.service.ProdServiceAreaRelevanceService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodservicearearelevance.ProdServiceAreaRelevancePageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodservicearearelevance.ProdServiceAreaRelevanceSaveReqVO;
|
||||
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 ProdServiceAreaRelevanceServiceImpl implements ProdServiceAreaRelevanceService {
|
||||
|
||||
@Resource
|
||||
private ProdServiceAreaRelevanceMapper prodServiceAreaRelevanceMapper;
|
||||
|
||||
@Override
|
||||
public Long createProdServiceAreaRelevance(ProdServiceAreaRelevanceSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdServiceAreaRelevanceDO prodServiceAreaRelevance = BeanUtils.toBean(createReqVO, ProdServiceAreaRelevanceDO.class);
|
||||
prodServiceAreaRelevanceMapper.insert(prodServiceAreaRelevance);
|
||||
// 返回
|
||||
return prodServiceAreaRelevance.getProdId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProdServiceAreaRelevance(ProdServiceAreaRelevanceSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdServiceAreaRelevanceExists(updateReqVO.getProdId());
|
||||
// 更新
|
||||
ProdServiceAreaRelevanceDO updateObj = BeanUtils.toBean(updateReqVO, ProdServiceAreaRelevanceDO.class);
|
||||
prodServiceAreaRelevanceMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProdServiceAreaRelevance(Long id) {
|
||||
// 校验存在
|
||||
validateProdServiceAreaRelevanceExists(id);
|
||||
// 删除
|
||||
prodServiceAreaRelevanceMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProdServiceAreaRelevanceExists(Long id) {
|
||||
if (prodServiceAreaRelevanceMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PROD_SERVICE_AREA_RELEVANCE_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdServiceAreaRelevanceDO getProdServiceAreaRelevance(Long id) {
|
||||
return prodServiceAreaRelevanceMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdServiceAreaRelevanceDO> getProdServiceAreaRelevancePage(ProdServiceAreaRelevancePageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdServiceAreasDO;
|
||||
import com.tashow.cloud.product.mapper.ProdPropMapper;
|
||||
import com.tashow.cloud.product.mapper.ProdServiceAreasMapper;
|
||||
import com.tashow.cloud.product.service.ProdServiceAreasService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasSaveReqVO;
|
||||
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 ProdServiceAreasServiceImpl extends ServiceImpl<ProdServiceAreasMapper, ProdServiceAreasDO> implements ProdServiceAreasService {
|
||||
|
||||
@Resource
|
||||
private ProdServiceAreasMapper prodServiceAreasMapper;
|
||||
|
||||
@Override
|
||||
public Long createProdServiceAreas(ProdServiceAreasSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdServiceAreasDO prodServiceAreas = BeanUtils.toBean(createReqVO, ProdServiceAreasDO.class);
|
||||
prodServiceAreasMapper.insert(prodServiceAreas);
|
||||
// 返回
|
||||
return prodServiceAreas.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProdServiceAreas(ProdServiceAreasSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdServiceAreasExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProdServiceAreasDO updateObj = BeanUtils.toBean(updateReqVO, ProdServiceAreasDO.class);
|
||||
prodServiceAreasMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProdServiceAreas(Long id) {
|
||||
// 校验存在
|
||||
validateProdServiceAreasExists(id);
|
||||
// 删除
|
||||
prodServiceAreasMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProdServiceAreasExists(Long id) {
|
||||
if (prodServiceAreasMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PROD_SERVICE_AREAS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdServiceAreasDO getProdServiceAreas(Long id) {
|
||||
return prodServiceAreasMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdServiceAreasDO> getProdServiceAreasPage(ProdServiceAreasPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,512 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.tashow.cloud.common.util.date.DateUtils;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.util.MyBatisUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.*;
|
||||
import com.tashow.cloud.product.mapper.*;
|
||||
import com.tashow.cloud.product.service.ProdPropService;
|
||||
import com.tashow.cloud.product.service.ProdService;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.*;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationInfoReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO;
|
||||
import com.tashow.cloud.productapi.enums.BaseEnum;
|
||||
import lombok.val;
|
||||
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 ProdServiceImpl implements ProdService {
|
||||
|
||||
@Resource
|
||||
private ProdMapper prodMapper;
|
||||
@Resource
|
||||
private SkuMapper skuMapper;
|
||||
@Resource
|
||||
private ProdPropService prodPropService;
|
||||
@Resource
|
||||
private ProdServiceAreasMapper prodServiceAreasMapper;
|
||||
@Resource
|
||||
private ProdServiceAreaRelevanceMapper prodServiceAreaRelevanceMapper;
|
||||
@Resource
|
||||
private ProdServiceOverAreaRulesMapper prodServiceOverAreaRulesMapper;
|
||||
@Resource
|
||||
private ProdReservationConfigMapper prodReservationConfigMapper;
|
||||
@Resource
|
||||
private ProdEmergencyResponseIntervalsMapper prodEmergencyResponseIntervalsMapper;
|
||||
@Resource
|
||||
private ProdEmergencyResponseMapper prodEmergencyResponseMapper;
|
||||
@Resource
|
||||
private ProductOrderLimitMapper productOrderLimitMapper;
|
||||
@Resource
|
||||
private ProdAdditionalFeeDatesMapper prodAdditionalFeeDatesMapper;
|
||||
@Resource
|
||||
private ProdAdditionalFeePeriodsMapper prodAdditionalFeePeriodsMapper;
|
||||
@Resource
|
||||
private ProdWeightRangePricesMapper prodWeightRangePricesMapper;
|
||||
@Resource
|
||||
private ProdExtendMapper prodExtendMapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public Long createProd(ProdSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdDO prod = BeanUtils.toBean(createReqVO, ProdDO.class);
|
||||
prodMapper.insert(prod);
|
||||
//保存sku
|
||||
if (CollectionUtil.isNotEmpty(createReqVO.getSkuList())) {
|
||||
List<SkuDO> skuList = createReqVO.getSkuList();
|
||||
for (SkuDO sku : skuList) {
|
||||
sku.setProdId(prod.getProdId());
|
||||
}
|
||||
skuMapper.insertBatch(skuList);
|
||||
}
|
||||
createReqVO.setProdId(prod.getProdId());
|
||||
//保存规格
|
||||
prodPropService.saveProdPropAndValues(createReqVO);
|
||||
ProdExtendDO prodExtendDO = new ProdExtendDO();
|
||||
prodExtendDO.setIsExpire(BaseEnum.YES_ONE.getKey());
|
||||
prodExtendDO.setIsExpire(BaseEnum.YES_ONE.getKey());
|
||||
prodExtendDO.setProdId(prod.getProdId());
|
||||
prodExtendMapper.insert(prodExtendDO);
|
||||
// 返回
|
||||
return prod.getProdId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void createProdService(ProdServiceVO prodServiceVO) {
|
||||
ProdDO prodDO = new ProdDO();
|
||||
prodDO.setProdId(prodServiceVO.getProdId());
|
||||
//服务区域设置
|
||||
if (Objects.equals(prodServiceVO.getRegionSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
prodDO.setRegionSwitch(BaseEnum.YES_ONE.getKey());
|
||||
//保存区域设置信息
|
||||
ProdServiceOverAreaRulesDO prodServiceOverAreaRules = BeanUtils.toBean(prodServiceVO.getProdServiceAreasInfo(), ProdServiceOverAreaRulesDO.class);
|
||||
prodServiceOverAreaRules.setProdId(prodDO.getProdId());
|
||||
prodServiceOverAreaRulesMapper.insert(prodServiceOverAreaRules);
|
||||
//保存区域
|
||||
List<String> areaNameList = prodServiceVO.getProdServiceAreasInfo().getAreaNameList();
|
||||
for (String areaName : areaNameList) {
|
||||
//查询区域信息
|
||||
ProdServiceAreasDO prodServiceAreas = prodServiceAreasMapper.selectOne(new LambdaQueryWrapper<ProdServiceAreasDO>()
|
||||
.eq(ProdServiceAreasDO::getAreaName, areaName)
|
||||
);
|
||||
if (prodServiceAreas != null) {
|
||||
//插入关联表
|
||||
prodServiceAreaRelevanceMapper.insert(new ProdServiceAreaRelevanceDO()
|
||||
.setProdId(prodDO.getProdId())
|
||||
.setAreaId(prodServiceAreas.getId())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
//预约设置设置
|
||||
/*if (Objects.equals(prodServiceVO.getReservationSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
prodDO.setReservationSwitch(BaseEnum.YES_ONE.getKey());
|
||||
ProdReservationInfoVO prodReservationConfigDO = prodServiceVO.getProdReservationConfig();
|
||||
prodReservationConfigDO.setProdId(prodDO.getProdId());
|
||||
prodReservationConfigMapper.insert(prodReservationConfigDO);
|
||||
}*/
|
||||
//紧急响应设置
|
||||
if (Objects.equals(prodServiceVO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
prodDO.setEmergencySwitch(BaseEnum.YES_ONE.getKey());
|
||||
// 插入
|
||||
ProdEmergencyResponseDO prodEmergencyResponse = BeanUtils.toBean(prodServiceVO.prodEmergencyInfoVO, ProdEmergencyResponseDO.class);
|
||||
prodEmergencyResponse.setProdId(prodDO.getProdId());
|
||||
prodEmergencyResponseMapper.insert(prodEmergencyResponse);
|
||||
for (ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals : prodServiceVO.prodEmergencyInfoVO.getProdEmergencyResponseIntervalsList()) {
|
||||
prodEmergencyResponseIntervals.setConfigId(prodEmergencyResponse.getId());
|
||||
prodEmergencyResponseIntervalsMapper.insert(prodEmergencyResponseIntervals);
|
||||
}
|
||||
}
|
||||
//接单上线设置
|
||||
if (Objects.equals(prodServiceVO.getOrderLimitSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
prodDO.setOrderLimitSwitch(BaseEnum.YES_ONE.getKey());
|
||||
ProductOrderLimitDO productOrderLimit = prodServiceVO.productOrderLimitVO;
|
||||
productOrderLimit.setProdId(prodDO.getProdId());
|
||||
productOrderLimitMapper.insert(productOrderLimit);
|
||||
}
|
||||
//特殊时段设置
|
||||
if (Objects.equals(prodServiceVO.getAdditionalSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
prodDO.setAdditionalSwitch(BaseEnum.YES_ONE.getKey());
|
||||
for (ProdAdditionalFeeDatesDO prodAdditionalFeeDates : prodServiceVO.getProdAdditionalFeeDatesList()) {
|
||||
prodAdditionalFeeDates.setProdId(prodServiceVO.getProdId());
|
||||
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDates);
|
||||
}
|
||||
}
|
||||
//特殊日期设置
|
||||
if (Objects.equals(prodServiceVO.getAdditionalFeeSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
prodDO.setAdditionalFeeSwitch(BaseEnum.YES_ONE.getKey());
|
||||
for (ProdAdditionalFeePeriodsDO prodAdditionalFeePeriods : prodServiceVO.getProdAdditionalFeePeriodsList()) {
|
||||
prodAdditionalFeePeriods.setProdId(prodServiceVO.getProdId());
|
||||
prodAdditionalFeePeriodsMapper.insert(prodAdditionalFeePeriods);
|
||||
}
|
||||
}
|
||||
//体重设置
|
||||
/* if (Objects.equals(prodServiceVO.getWeightSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
prodDO.setWeightSwitch(BaseEnum.YES_ONE.getKey());
|
||||
ProdWeightRangePricesDO prodWeightRangePrices = prodServiceVO.prodWeightConfig;
|
||||
prodWeightRangePrices.setProdId(prodDO.getProdId());
|
||||
prodWeightRangePricesMapper.insert(prodWeightRangePrices);
|
||||
}*/
|
||||
prodMapper.updateById(prodDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void uptateProdService(ProdServiceInfoVO prodServiceVO) {
|
||||
|
||||
ProdDO prod = BeanUtils.toBean(prodServiceVO, ProdDO.class);
|
||||
//服务区域设置
|
||||
if (Objects.equals(prodServiceVO.getRegionSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
ProdServiceOverAreaRulesDO overAreaRules = prodServiceOverAreaRulesMapper.selectOne(new LambdaQueryWrapper<ProdServiceOverAreaRulesDO>()
|
||||
.eq(ProdServiceOverAreaRulesDO::getProdId, prodServiceVO.getProdId()));
|
||||
if (overAreaRules == null) {
|
||||
prod.setRegionSwitch(BaseEnum.YES_ONE.getKey());
|
||||
//保存区域设置信息
|
||||
ProdServiceOverAreaRulesDO prodServiceOverAreaRules = BeanUtils.toBean(prodServiceVO.getProdServiceAreasInfo(), ProdServiceOverAreaRulesDO.class);
|
||||
prodServiceOverAreaRules.setProdId(prod.getProdId());
|
||||
prodServiceOverAreaRulesMapper.insert(prodServiceOverAreaRules);
|
||||
//保存区域
|
||||
List<String> areaNameList = prodServiceVO.getProdServiceAreasInfo().getAreaNameList();
|
||||
for (String areaName : areaNameList) {
|
||||
//查询区域信息
|
||||
ProdServiceAreasDO prodServiceAreas = prodServiceAreasMapper.selectOne(new LambdaQueryWrapper<ProdServiceAreasDO>()
|
||||
.eq(ProdServiceAreasDO::getAreaName, areaName)
|
||||
);
|
||||
if (prodServiceAreas != null) {
|
||||
//插入关联表
|
||||
prodServiceAreaRelevanceMapper.insert(new ProdServiceAreaRelevanceDO()
|
||||
.setProdId(prod.getProdId())
|
||||
.setAreaId(prodServiceAreas.getId())
|
||||
);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//保存区域设置信息
|
||||
ProdServiceOverAreaRulesDO prodServiceOverAreaRules = BeanUtils.toBean(prodServiceVO.getProdServiceAreasInfo(), ProdServiceOverAreaRulesDO.class);
|
||||
prodServiceOverAreaRules.setProdId(prodServiceVO.getProdId());
|
||||
prodServiceOverAreaRulesMapper.updateById(prodServiceOverAreaRules);
|
||||
//先批量删除区域关联表
|
||||
prodServiceAreaRelevanceMapper.deleteRelevance(prodServiceVO.getProdId());
|
||||
//保存区域
|
||||
List<String> areaNameList = prodServiceVO.getProdServiceAreasInfo().getAreaNameList();
|
||||
for (String areaName : areaNameList) {
|
||||
//查询区域信息
|
||||
ProdServiceAreasDO prodServiceAreas = prodServiceAreasMapper.selectOne(new LambdaQueryWrapper<ProdServiceAreasDO>()
|
||||
.eq(ProdServiceAreasDO::getAreaName, areaName)
|
||||
);
|
||||
if (prodServiceAreas != null) {
|
||||
//插入关联表
|
||||
prodServiceAreaRelevanceMapper.insert(new ProdServiceAreaRelevanceDO()
|
||||
.setProdId(prodServiceVO.getProdId())
|
||||
.setAreaId(prodServiceAreas.getId())
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
//预约设置设置
|
||||
if (Objects.equals(prodServiceVO.getReservationSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
ProdReservationConfigDO reservationConfig = prodReservationConfigMapper.selectOne(new LambdaQueryWrapper<ProdReservationConfigDO>()
|
||||
.eq(ProdReservationConfigDO::getProdId, prodServiceVO.getProdId()));
|
||||
ProdReservationInfoReqVO prodReservationInfoVO = prodServiceVO.getProdReservationConfig();
|
||||
if (reservationConfig == null) {
|
||||
prod.setReservationSwitch(BaseEnum.YES_ONE.getKey());
|
||||
ProdReservationConfigDO prodReservationConfigDO = BeanUtils.toBean(prodReservationInfoVO, ProdReservationConfigDO.class);
|
||||
prodReservationConfigDO.setProdId(prod.getProdId());
|
||||
prodReservationConfigDO.setTimeSlot(prodReservationInfoVO.getTimeBook().getTimeSlot());
|
||||
prodReservationConfigDO.setReservationTimeSlots(prodReservationInfoVO.getTimeBook().getReservationTimeSlots());
|
||||
prodReservationConfigMapper.insert(prodReservationConfigDO);
|
||||
//先删除在新增
|
||||
prodAdditionalFeeDatesMapper.deleteAdditionalFeeDates(prod.getProdId(), 2);
|
||||
if (prodServiceVO.getProdReservationConfig().getProdReservationBlackList() != null) {
|
||||
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdReservationConfig().getProdReservationBlackList()) {
|
||||
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
|
||||
prodAdditionalFeeDatesDO.setProdId(prod.getProdId());
|
||||
prodAdditionalFeeDatesDO.setType(2);
|
||||
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDatesDO);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ProdReservationConfigDO prodReservationConfigDO = BeanUtils.toBean(prodServiceVO.getProdReservationConfig(), ProdReservationConfigDO.class);
|
||||
prodReservationConfigDO.setTimeSlot(prodReservationInfoVO.getTimeBook().getTimeSlot());
|
||||
prodReservationConfigDO.setReservationTimeSlots(prodReservationInfoVO.getTimeBook().getReservationTimeSlots());
|
||||
prodReservationConfigMapper.updateById(prodReservationConfigDO);
|
||||
//先删除在新增
|
||||
prodAdditionalFeeDatesMapper.deleteAdditionalFeeDates(prod.getProdId(), 2);
|
||||
if (prodServiceVO.getProdReservationConfig().getProdReservationBlackList() != null) {
|
||||
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdReservationConfig().getProdReservationBlackList()) {
|
||||
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
|
||||
prodAdditionalFeeDatesDO.setProdId(prod.getProdId());
|
||||
prodAdditionalFeeDatesDO.setType(2);
|
||||
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDatesDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//紧急响应设置
|
||||
if (Objects.equals(prodServiceVO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
ProdEmergencyResponseDO rmergencyResponse = prodEmergencyResponseMapper.selectOne(new LambdaQueryWrapper<ProdEmergencyResponseDO>()
|
||||
.eq(ProdEmergencyResponseDO::getProdId, prodServiceVO.getProdId()));
|
||||
if (rmergencyResponse == null) {
|
||||
prod.setEmergencySwitch(BaseEnum.YES_ONE.getKey());
|
||||
// 插入
|
||||
ProdEmergencyResponseDO prodEmergencyResponse = BeanUtils.toBean(prodServiceVO.getProdEmergencyInfoVO(), ProdEmergencyResponseDO.class);
|
||||
prodEmergencyResponse.setProdId(prod.getProdId());
|
||||
prodEmergencyResponseMapper.insert(prodEmergencyResponse);
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList() != null) {
|
||||
for (ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals : prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList()) {
|
||||
prodEmergencyResponseIntervals.setId(null);
|
||||
prodEmergencyResponseIntervals.setConfigId(prodEmergencyResponse.getId());
|
||||
prodEmergencyResponseIntervals.setProdId(prod.getProdId());
|
||||
prodEmergencyResponseIntervalsMapper.insert(prodEmergencyResponseIntervals);
|
||||
}
|
||||
}
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList() != null) {
|
||||
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList()) {
|
||||
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
|
||||
prodAdditionalFeeDatesDO.setId(null);
|
||||
prodAdditionalFeeDatesDO.setProdId(prod.getProdId());
|
||||
prodAdditionalFeeDatesDO.setType(3);
|
||||
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDatesDO);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ProdEmergencyResponseDO prodEmergencyResponse = BeanUtils.toBean(prodServiceVO.getProdEmergencyInfoVO(), ProdEmergencyResponseDO.class);
|
||||
if (prodEmergencyResponse != null) {
|
||||
prodEmergencyResponseMapper.updateById(prodEmergencyResponse);
|
||||
prodEmergencyResponseIntervalsMapper.deleteIntervals(prodEmergencyResponse.getId());
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList() != null) {
|
||||
for (ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals : prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList()) {
|
||||
prodEmergencyResponseIntervals.setId(null);
|
||||
prodEmergencyResponseIntervals.setConfigId(prodEmergencyResponse.getId());
|
||||
prodEmergencyResponseIntervals.setProdId(prod.getProdId());
|
||||
prodEmergencyResponseIntervalsMapper.insert(prodEmergencyResponseIntervals);
|
||||
}
|
||||
}
|
||||
//先删除在新增
|
||||
prodAdditionalFeeDatesMapper.deleteAdditionalFeeDates(prod.getProdId(), 3);
|
||||
if (prodServiceVO.getProdReservationConfig().getProdReservationBlackList() != null) {
|
||||
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdReservationConfig().getProdReservationBlackList()) {
|
||||
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
|
||||
prodAdditionalFeeDatesDO.setId(null);
|
||||
prodAdditionalFeeDatesDO.setProdId(prod.getProdId());
|
||||
prodAdditionalFeeDatesDO.setType(3);
|
||||
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDatesDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//接单上线设置
|
||||
if (Objects.equals(prodServiceVO.getOrderLimitSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
ProductOrderLimitDO orderLimit = productOrderLimitMapper.selectOne(new LambdaQueryWrapper<ProductOrderLimitDO>()
|
||||
.eq(ProductOrderLimitDO::getProdId, prodServiceVO.getProdId()));
|
||||
if (orderLimit == null) {
|
||||
prod.setOrderLimitSwitch(BaseEnum.YES_ONE.getKey());
|
||||
ProductOrderLimitDO productOrderLimit = prodServiceVO.getProductOrderLimitVO();
|
||||
productOrderLimit.setProdId(prod.getProdId());
|
||||
productOrderLimitMapper.insert(productOrderLimit);
|
||||
} else {
|
||||
productOrderLimitMapper.updateById(prodServiceVO.getProductOrderLimitVO());
|
||||
}
|
||||
}
|
||||
//特殊时段设置
|
||||
if (Objects.equals(prodServiceVO.getAdditionalSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
if (prodServiceVO.getProdAdditionalFeeDatesList() != null)
|
||||
for (ProdAdditionalFeeDatesDO prodAdditionalFeeDates : prodServiceVO.getProdAdditionalFeeDatesList()) {
|
||||
if (prodAdditionalFeeDates.getId() == null) {
|
||||
prodAdditionalFeeDates.setProdId(prodServiceVO.getProdId());
|
||||
prodAdditionalFeeDates.setType(1);
|
||||
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDates);
|
||||
} else {
|
||||
prodAdditionalFeeDatesMapper.updateById(prodAdditionalFeeDates);
|
||||
}
|
||||
}
|
||||
}
|
||||
//特殊日期设置
|
||||
if (Objects.equals(prodServiceVO.getAdditionalFeeSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
for (ProdAdditionalFeePeriodsDO prodAdditionalFeePeriods : prodServiceVO.getProdAdditionalFeePeriodsList()) {
|
||||
if (prodAdditionalFeePeriods.getId() == null) {
|
||||
prodAdditionalFeePeriods.setProdId(prodServiceVO.getProdId());
|
||||
prodAdditionalFeePeriodsMapper.insert(prodAdditionalFeePeriods);
|
||||
} else {
|
||||
prodAdditionalFeePeriodsMapper.updateById(prodAdditionalFeePeriods);
|
||||
}
|
||||
}
|
||||
}
|
||||
//体重设置
|
||||
if (Objects.equals(prodServiceVO.getWeightSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
prod.setWeightSwitch(prodServiceVO.getWeightSwitch());
|
||||
ProdExtendDO prodExtendDO = prodExtendMapper.selectOne(ProdExtendDO::getProdId, prod.getProdId());
|
||||
if (prodExtendDO != null) {
|
||||
prodExtendDO.setIsWeightCharge(prodServiceVO.getProdWeightConfig().getIsWeightCharge());
|
||||
prodExtendMapper.updateById(prodExtendDO);
|
||||
} else {
|
||||
prodExtendDO = new ProdExtendDO();
|
||||
prodExtendDO.setProdId(prod.getProdId());
|
||||
prodExtendDO.setIsWeightCharge(prodServiceVO.getProdWeightConfig().getIsWeightCharge());
|
||||
prodExtendMapper.insert(prodExtendDO);
|
||||
}
|
||||
prodWeightRangePricesMapper.deleteWeightRangePrices(prod.getProdId());
|
||||
if (prodServiceVO.getProdWeightConfig().getProdWeightConfigList() != null) {
|
||||
for (ProdWeightRangePricesDO prodWeightRangePricesDO : prodServiceVO.getProdWeightConfig().getProdWeightConfigList()) {
|
||||
prodWeightRangePricesDO.setProdId(prod.getProdId());
|
||||
prodWeightRangePricesMapper.insert(prodWeightRangePricesDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
prodMapper.updateById(prod);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdServiceVO getProdService(Long prodId) {
|
||||
ProdDO prodDO = prodMapper.selectById(prodId);
|
||||
ProdServiceVO prodServiceVO = prodMapper.selectProdService(prodDO.getProdId());
|
||||
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getId()== null) {
|
||||
prodServiceVO.setProdEmergencyInfoVO(null);
|
||||
}else {
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getId()!= null&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList().size()== 0) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseIntervalsList(new ArrayList<>());
|
||||
}
|
||||
if (prodServiceVO.getProdEmergencyInfoVO().getId()!= null&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList().get(0).isEmpty()) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseBlackList(new ArrayList<>());
|
||||
}
|
||||
}
|
||||
if (prodServiceVO.getProdAdditionalFeeDatesList().get(0).getId()==null) {
|
||||
prodServiceVO.setProdAdditionalFeeDatesList(new ArrayList<>());
|
||||
}
|
||||
if (prodServiceVO.getProdAdditionalFeePeriodsList().get(0).getId()==null) {
|
||||
prodServiceVO.setProdAdditionalFeePeriodsList(new ArrayList<>());
|
||||
}
|
||||
return prodServiceVO;
|
||||
/* if (prodDO != null && prodDO.getRegionSwitch() == BaseEnum.YES_ONE.getKey()) {
|
||||
ProdServiceVO prodServiceVO = prodMapper.selectProdService(prodDO.getProdId());
|
||||
if (Objects.equals(prodDO.getReservationSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdReservationConfig().getProdReservationBlackList().get(0).isEmpty()) {
|
||||
ProdReservationInfoVO prodReservationInfoVO = prodServiceVO.getProdReservationConfig();
|
||||
prodReservationInfoVO.setProdReservationBlackList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList().get(0).isEmpty()) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseIntervalsList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getAdditionalSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeeDatesList().get(0).isEmpty()) {
|
||||
prodServiceVO.setProdAdditionalFeeDatesList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getAdditionalFeeSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeePeriodsList().get(0).isEmpty()) {
|
||||
prodServiceVO.setProdAdditionalFeePeriodsList(new ArrayList<>());
|
||||
}
|
||||
return prodServiceVO;
|
||||
} else {
|
||||
ProdServiceVO prodServiceVO = prodMapper.selectProdServiceInfo(prodDO.getProdId());
|
||||
if (Objects.equals(prodDO.getReservationSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdReservationConfig()!=null&&prodServiceVO.getProdReservationConfig().getProdReservationBlackList().get(0).isEmpty()) {
|
||||
ProdReservationInfoVO prodReservationInfoVO = prodServiceVO.getProdReservationConfig();
|
||||
prodReservationInfoVO.setProdReservationBlackList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdEmergencyInfoVO()!=null&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList().get(0).isEmpty()) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseIntervalsList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdEmergencyInfoVO()!=null&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList().get(0).isEmpty()) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseBlackList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getAdditionalSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeeDatesList()!=null&&prodServiceVO.getProdAdditionalFeeDatesList().get(0).isEmpty()) {
|
||||
prodServiceVO.setProdAdditionalFeeDatesList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getAdditionalFeeSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeePeriodsList()!=null&&prodServiceVO.getProdAdditionalFeePeriodsList().get(0).isEmpty()) {
|
||||
prodServiceVO.setProdAdditionalFeePeriodsList(new ArrayList<>());
|
||||
}
|
||||
return prodServiceVO;
|
||||
}*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProd(ProdSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdExists(updateReqVO.getProdId());
|
||||
// 更新
|
||||
ProdDO updateObj = BeanUtils.toBean(updateReqVO, ProdDO.class);
|
||||
prodMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProd(Long id) {
|
||||
// 校验存在
|
||||
validateProdExists(id);
|
||||
ProdDO prod = new ProdDO();
|
||||
prod.setProdId(id);
|
||||
prod.setDeleted(BaseEnum.YES_ONE.getKey());
|
||||
prod.setDeleteTime(new Date());
|
||||
// 删除
|
||||
prodMapper.deleteById(prod);
|
||||
}
|
||||
|
||||
private void validateProdExists(Long id) {
|
||||
if (prodMapper.selectById(id) == null) {
|
||||
//throw exception(100, "商品不存在");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdDO getProd(Long id) {
|
||||
return prodMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdListVO> getProdPage(ProdPageReqVO pageReqVO) {
|
||||
IPage<ProdListVO> prodPageList = prodMapper.getProdPageList(MyBatisUtils.buildPage(pageReqVO),
|
||||
pageReqVO.getCreateTime(), pageReqVO.getProdName(), pageReqVO.getShopId(), pageReqVO.getStatus(), pageReqVO.getCategoryId());
|
||||
return new PageResult<>(prodPageList.getRecords(), prodPageList.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdRestoreListVO> getProdRecycleBinPageList(ProdRecycleBinVO prodRecycleBinVO) {
|
||||
IPage<ProdRestoreListVO> prodPageList = prodMapper.getProdRecycleBinPageList(MyBatisUtils.buildPage(prodRecycleBinVO), prodRecycleBinVO.getDeleteTime(), prodRecycleBinVO.getProdName());
|
||||
for (ProdRestoreListVO prodPage : prodPageList.getRecords()) {
|
||||
if (prodPage.getDeleteTime() != null) {
|
||||
prodPage.setRemainingDays(DateUtils.getRemainingDays(prodPage.getDeleteTime()));
|
||||
}
|
||||
}
|
||||
return new PageResult<>(prodPageList.getRecords(), prodPageList.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreProdList(List<Long> ids) {
|
||||
prodMapper.batchRestoreProd(ids);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdServiceOverAreaRulesDO;
|
||||
import com.tashow.cloud.product.mapper.ProdServiceOverAreaRulesMapper;
|
||||
import com.tashow.cloud.product.service.ProdServiceOverAreaRulesService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceoverarearules.ProdServiceOverAreaRulesPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceoverarearules.ProdServiceOverAreaRulesSaveReqVO;
|
||||
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 ProdServiceOverAreaRulesServiceImpl implements ProdServiceOverAreaRulesService {
|
||||
|
||||
@Resource
|
||||
private ProdServiceOverAreaRulesMapper prodServiceOverAreaRulesMapper;
|
||||
|
||||
@Override
|
||||
public Long createProdServiceOverAreaRules(ProdServiceOverAreaRulesSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdServiceOverAreaRulesDO prodServiceOverAreaRules = BeanUtils.toBean(createReqVO, ProdServiceOverAreaRulesDO.class);
|
||||
prodServiceOverAreaRulesMapper.insert(prodServiceOverAreaRules);
|
||||
// 返回
|
||||
return prodServiceOverAreaRules.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProdServiceOverAreaRules(ProdServiceOverAreaRulesSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdServiceOverAreaRulesExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProdServiceOverAreaRulesDO updateObj = BeanUtils.toBean(updateReqVO, ProdServiceOverAreaRulesDO.class);
|
||||
prodServiceOverAreaRulesMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProdServiceOverAreaRules(Long id) {
|
||||
// 校验存在
|
||||
validateProdServiceOverAreaRulesExists(id);
|
||||
// 删除
|
||||
prodServiceOverAreaRulesMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProdServiceOverAreaRulesExists(Long id) {
|
||||
if (prodServiceOverAreaRulesMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PROD_SERVICE_OVER_AREA_RULES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdServiceOverAreaRulesDO getProdServiceOverAreaRules(Long id) {
|
||||
return prodServiceOverAreaRulesMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdServiceOverAreaRulesDO> getProdServiceOverAreaRulesPage(ProdServiceOverAreaRulesPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdTagsDO;
|
||||
import com.tashow.cloud.product.mapper.ProdTagsMapper;
|
||||
import com.tashow.cloud.product.service.ProdTagsService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodtags.ProdTagsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodtags.ProdTagsSaveReqVO;
|
||||
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 ProdTagsServiceImpl implements ProdTagsService {
|
||||
|
||||
@Resource
|
||||
private ProdTagsMapper prodTagsMapper;
|
||||
|
||||
@Override
|
||||
public Long createProdTags(ProdTagsSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdTagsDO prodTags = BeanUtils.toBean(createReqVO, ProdTagsDO.class);
|
||||
prodTagsMapper.insert(prodTags);
|
||||
// 返回
|
||||
return prodTags.getProductId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProdTags(ProdTagsSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdTagsExists(updateReqVO.getProductId());
|
||||
// 更新
|
||||
ProdTagsDO updateObj = BeanUtils.toBean(updateReqVO, ProdTagsDO.class);
|
||||
prodTagsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProdTags(Long id) {
|
||||
// 校验存在
|
||||
validateProdTagsExists(id);
|
||||
// 删除
|
||||
prodTagsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProdTagsExists(Long id) {
|
||||
if (prodTagsMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PROD_TAGS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdTagsDO getProdTags(Long id) {
|
||||
return prodTagsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdTagsDO> getProdTagsPage(ProdTagsPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdWeightRangePricesDO;
|
||||
import com.tashow.cloud.product.mapper.ProdWeightRangePricesMapper;
|
||||
import com.tashow.cloud.product.service.ProdWeightRangePricesService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesSaveReqVO;
|
||||
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 ProdWeightRangePricesServiceImpl implements ProdWeightRangePricesService {
|
||||
|
||||
@Resource
|
||||
private ProdWeightRangePricesMapper prodWeightRangePricesMapper;
|
||||
|
||||
@Override
|
||||
public Long createProdWeightRangePrices(ProdWeightRangePricesSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProdWeightRangePricesDO prodWeightRangePrices = BeanUtils.toBean(createReqVO, ProdWeightRangePricesDO.class);
|
||||
prodWeightRangePricesMapper.insert(prodWeightRangePrices);
|
||||
// 返回
|
||||
return prodWeightRangePrices.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProdWeightRangePrices(ProdWeightRangePricesSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProdWeightRangePricesExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProdWeightRangePricesDO updateObj = BeanUtils.toBean(updateReqVO, ProdWeightRangePricesDO.class);
|
||||
prodWeightRangePricesMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProdWeightRangePrices(Long id) {
|
||||
// 校验存在
|
||||
validateProdWeightRangePricesExists(id);
|
||||
// 删除
|
||||
prodWeightRangePricesMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProdWeightRangePricesExists(Long id) {
|
||||
if (prodWeightRangePricesMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PROD_WEIGHT_RANGE_PRICES_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdWeightRangePricesDO getProdWeightRangePrices(Long id) {
|
||||
return prodWeightRangePricesMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProdWeightRangePricesDO> getProdWeightRangePricesPage(ProdWeightRangePricesPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProductOrderLimitDO;
|
||||
import com.tashow.cloud.product.mapper.ProductOrderLimitMapper;
|
||||
import com.tashow.cloud.product.service.ProductOrderLimitService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.productorderlimit.ProductOrderLimitPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.productorderlimit.ProductOrderLimitSaveReqVO;
|
||||
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 ProductOrderLimitServiceImpl implements ProductOrderLimitService {
|
||||
|
||||
@Resource
|
||||
private ProductOrderLimitMapper productOrderLimitMapper;
|
||||
|
||||
@Override
|
||||
public Long createProductOrderLimit(ProductOrderLimitSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ProductOrderLimitDO productOrderLimit = BeanUtils.toBean(createReqVO, ProductOrderLimitDO.class);
|
||||
productOrderLimitMapper.insert(productOrderLimit);
|
||||
// 返回
|
||||
return productOrderLimit.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateProductOrderLimit(ProductOrderLimitSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateProductOrderLimitExists(updateReqVO.getId());
|
||||
// 更新
|
||||
ProductOrderLimitDO updateObj = BeanUtils.toBean(updateReqVO, ProductOrderLimitDO.class);
|
||||
productOrderLimitMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteProductOrderLimit(Long id) {
|
||||
// 校验存在
|
||||
validateProductOrderLimitExists(id);
|
||||
// 删除
|
||||
productOrderLimitMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateProductOrderLimitExists(Long id) {
|
||||
if (productOrderLimitMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.PRODUCT_ORDER_LIMIT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProductOrderLimitDO getProductOrderLimit(Long id) {
|
||||
return productOrderLimitMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProductOrderLimitDO> getProductOrderLimitPage(ProductOrderLimitPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.ShopDetailDO;
|
||||
import com.tashow.cloud.product.mapper.ShopDetailMapper;
|
||||
import com.tashow.cloud.product.service.ShopDetailService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.shopdetail
|
||||
.ShopDetailPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.shopdetail
|
||||
.ShopDetailSaveReqVO;
|
||||
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 ShopDetailServiceImpl implements ShopDetailService {
|
||||
|
||||
@Resource
|
||||
private ShopDetailMapper shopDetailMapper;
|
||||
|
||||
@Override
|
||||
public Long createShopDetail(ShopDetailSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
ShopDetailDO shopDetail = BeanUtils.toBean(createReqVO, ShopDetailDO.class);
|
||||
shopDetailMapper.insert(shopDetail);
|
||||
// 返回
|
||||
return shopDetail.getShopId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateShopDetail(ShopDetailSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateShopDetailExists(updateReqVO.getShopId());
|
||||
// 更新
|
||||
ShopDetailDO updateObj = BeanUtils.toBean(updateReqVO, ShopDetailDO.class);
|
||||
shopDetailMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteShopDetail(Long id) {
|
||||
// 校验存在
|
||||
validateShopDetailExists(id);
|
||||
// 删除
|
||||
shopDetailMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateShopDetailExists(Long id) {
|
||||
if (shopDetailMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.SHOP_DETAIL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ShopDetailDO getShopDetail(Long id) {
|
||||
return shopDetailMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ShopDetailDO> getShopDetailPage(ShopDetailPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceDeliverDO;
|
||||
import com.tashow.cloud.product.mapper.SkuServiceDeliverMapper;
|
||||
import com.tashow.cloud.product.service.SkuServiceDeliverService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedeliver.SkuServiceDeliverPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedeliver.SkuServiceDeliverSaveReqVO;
|
||||
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 SkuServiceDeliverServiceImpl implements SkuServiceDeliverService {
|
||||
|
||||
@Resource
|
||||
private SkuServiceDeliverMapper skuServiceDeliverMapper;
|
||||
|
||||
@Override
|
||||
public Long createSkuServiceDeliver(SkuServiceDeliverSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SkuServiceDeliverDO skuServiceDeliver = BeanUtils.toBean(createReqVO, SkuServiceDeliverDO.class);
|
||||
skuServiceDeliverMapper.insert(skuServiceDeliver);
|
||||
// 返回
|
||||
return skuServiceDeliver.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSkuServiceDeliver(SkuServiceDeliverSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSkuServiceDeliverExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SkuServiceDeliverDO updateObj = BeanUtils.toBean(updateReqVO, SkuServiceDeliverDO.class);
|
||||
skuServiceDeliverMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSkuServiceDeliver(Long id) {
|
||||
// 校验存在
|
||||
validateSkuServiceDeliverExists(id);
|
||||
// 删除
|
||||
skuServiceDeliverMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateSkuServiceDeliverExists(Long id) {
|
||||
if (skuServiceDeliverMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.SKU_SERVICE_DELIVER_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkuServiceDeliverDO getSkuServiceDeliver(Long id) {
|
||||
return skuServiceDeliverMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SkuServiceDeliverDO> getSkuServiceDeliverPage(SkuServiceDeliverPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceDetailsDO;
|
||||
import com.tashow.cloud.product.mapper.SkuServiceDetailsMapper;
|
||||
import com.tashow.cloud.product.service.SkuServiceDetailsService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedetails.SkuServiceDetailsPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicedetails.SkuServiceDetailsSaveReqVO;
|
||||
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 SkuServiceDetailsServiceImpl implements SkuServiceDetailsService {
|
||||
|
||||
@Resource
|
||||
private SkuServiceDetailsMapper skuServiceDetailsMapper;
|
||||
|
||||
@Override
|
||||
public Long createSkuServiceDetails(SkuServiceDetailsSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SkuServiceDetailsDO skuServiceDetails = BeanUtils.toBean(createReqVO, SkuServiceDetailsDO.class);
|
||||
skuServiceDetailsMapper.insert(skuServiceDetails);
|
||||
// 返回
|
||||
return skuServiceDetails.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSkuServiceDetails(SkuServiceDetailsSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSkuServiceDetailsExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SkuServiceDetailsDO updateObj = BeanUtils.toBean(updateReqVO, SkuServiceDetailsDO.class);
|
||||
skuServiceDetailsMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSkuServiceDetails(Long id) {
|
||||
// 校验存在
|
||||
validateSkuServiceDetailsExists(id);
|
||||
// 删除
|
||||
skuServiceDetailsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateSkuServiceDetailsExists(Long id) {
|
||||
if (skuServiceDetailsMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.SKU_SERVICE_DETAILS_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkuServiceDetailsDO getSkuServiceDetails(Long id) {
|
||||
return skuServiceDetailsMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SkuServiceDetailsDO> getSkuServiceDetailsPage(SkuServiceDetailsPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,972 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.tashow.cloud.common.util.date.DateUtils;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.util.MyBatisUtils;
|
||||
import com.tashow.cloud.productapi.api.product.dto.*;
|
||||
import com.tashow.cloud.product.mapper.*;
|
||||
import com.tashow.cloud.product.service.ProdExtendService;
|
||||
import com.tashow.cloud.product.service.ProdPropService;
|
||||
import com.tashow.cloud.product.service.ProdPropValueService;
|
||||
import com.tashow.cloud.product.service.SkuService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPropRecycleBinVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.*;
|
||||
import com.tashow.cloud.productapi.enums.BaseEnum;
|
||||
import com.tashow.cloud.productapi.enums.ErrorCodeConstants;
|
||||
import com.tashow.cloud.productapi.enums.ServiceTypeEnum;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
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 java.util.stream.Collectors;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 单品SKU Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SkuServiceImpl implements SkuService {
|
||||
|
||||
@Resource
|
||||
private SkuMapper skuMapper;
|
||||
@Resource
|
||||
private SkuServiceDetailsMapper skuServiceDetailsMapper;
|
||||
@Resource
|
||||
private SkuServicesFormMapper skuServicesFormMapper;
|
||||
@Resource
|
||||
private SkuServiceMaterialMapper skuServiceMaterialMapper;
|
||||
@Resource
|
||||
private SkuServiceTransportMapper skuServiceTransportMapper;
|
||||
@Resource
|
||||
private SkuServiceDeliverMapper skuServiceDeliverMapper;
|
||||
@Resource
|
||||
private ProdPropService prodPropService;
|
||||
@Resource
|
||||
private ProdExtendMapper prodExtendMapper;
|
||||
@Resource
|
||||
private ProdPropValueService prodPropValueService;
|
||||
@Resource
|
||||
private ProdExtendService prodExtendService;
|
||||
@Resource
|
||||
private ProdPropValueMapper prodPropValueMapper;
|
||||
@Resource
|
||||
private ProdPropMapper prodPropMapper;
|
||||
|
||||
@Override
|
||||
public Long createSku(SkuSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SkuDO sku = BeanUtils.toBean(createReqVO, SkuDO.class);
|
||||
skuMapper.insert(sku);
|
||||
// 返回
|
||||
return sku.getSkuId();
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void createSkuExtend(SkuExtendVO skuExtendVO) {
|
||||
//接运车辆配置
|
||||
if (Objects.equals(skuExtendVO.getTransportCarSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
SkuServicesFormDO skuServicesFormDO = new SkuServicesFormDO();
|
||||
skuServicesFormDO.setServiceName(ServiceTypeEnum.TRANSPORT_CAR_CONFIG.getDescription());
|
||||
skuServicesFormDO.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesFormDO.setType(ServiceTypeEnum.TRANSPORT_CAR_CONFIG.getCode());
|
||||
skuServicesFormDO.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesFormDO);
|
||||
for (SkuServiceDetailsDO skuServiceDetailsDO : skuExtendVO.getTransportCarList()) {
|
||||
skuServiceDetailsDO.setServiceId(skuServicesFormDO.getId());
|
||||
skuServiceDetailsMapper.insert(skuServiceDetailsDO);
|
||||
}
|
||||
SkuServicesFormDO skuServicesForm = new SkuServicesFormDO();
|
||||
skuServicesForm.setServiceName(ServiceTypeEnum.TRANSPORT_CAR_MATERIAL.getDescription());
|
||||
skuServicesForm.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesForm.setType(ServiceTypeEnum.TRANSPORT_CAR_MATERIAL.getCode());
|
||||
skuServicesForm.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesForm);
|
||||
for (SkuServiceMaterialDO skuServiceMaterialDO : skuExtendVO.getTransportCarMaterialList()) {
|
||||
skuServiceMaterialDO.setServiceId(skuServicesForm.getId());
|
||||
skuServiceMaterialMapper.insert(skuServiceMaterialDO);
|
||||
}
|
||||
}
|
||||
//遗体运输目的地配置
|
||||
if (Objects.equals(skuExtendVO.getTrafficSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
SkuServicesFormDO skuServicesFormDO = new SkuServicesFormDO();
|
||||
skuServicesFormDO.setServiceName(ServiceTypeEnum.BODY_TRANSPORT_CONFIG.getDescription());
|
||||
skuServicesFormDO.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesFormDO.setType(ServiceTypeEnum.BODY_TRANSPORT_CONFIG.getCode());
|
||||
skuServicesFormDO.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesFormDO);
|
||||
for (SkuServiceTransportDO skuServiceTransportDO : skuExtendVO.getTrafficList()) {
|
||||
skuServiceTransportDO.setServiceId(skuServicesFormDO.getId());
|
||||
skuServiceTransportMapper.insert(skuServiceTransportDO);
|
||||
}
|
||||
SkuServicesFormDO skuServicesForm = new SkuServicesFormDO();
|
||||
skuServicesForm.setServiceName(ServiceTypeEnum.BODY_TRANSPORT_MATERIAL.getDescription());
|
||||
skuServicesForm.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesForm.setType(ServiceTypeEnum.BODY_TRANSPORT_MATERIAL.getCode());
|
||||
skuServicesForm.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesForm);
|
||||
for (SkuServiceMaterialDO skuServiceMaterialDO : skuExtendVO.getTrafficMaterialList()) {
|
||||
skuServiceMaterialDO.setServiceId(skuServicesForm.getId());
|
||||
skuServiceMaterialMapper.insert(skuServiceMaterialDO);
|
||||
}
|
||||
}
|
||||
//遗体清洁配置
|
||||
if (Objects.equals(skuExtendVO.getCleanSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
SkuServicesFormDO skuServicesFormDO = new SkuServicesFormDO();
|
||||
skuServicesFormDO.setServiceName(ServiceTypeEnum.BODY_CLEAN_CONFIG.getDescription());
|
||||
skuServicesFormDO.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesFormDO.setType(ServiceTypeEnum.BODY_CLEAN_CONFIG.getCode());
|
||||
skuServicesFormDO.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesFormDO);
|
||||
for (SkuServiceDetailsDO skuServiceDetails : skuExtendVO.getCleanList()) {
|
||||
skuServiceDetails.setServiceId(skuServicesFormDO.getId());
|
||||
skuServiceDetailsMapper.insert(skuServiceDetails);
|
||||
}
|
||||
SkuServicesFormDO skuServicesForm = new SkuServicesFormDO();
|
||||
skuServicesForm.setServiceName(ServiceTypeEnum.BODY_CLEAN_MATERIAL.getDescription());
|
||||
skuServicesForm.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesForm.setType(ServiceTypeEnum.BODY_CLEAN_MATERIAL.getCode());
|
||||
skuServicesForm.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesForm);
|
||||
for (SkuServiceMaterialDO skuServiceMaterialDO : skuExtendVO.getCleanMaterialList()) {
|
||||
skuServiceMaterialDO.setServiceId(skuServicesForm.getId());
|
||||
skuServiceMaterialMapper.insert(skuServiceMaterialDO);
|
||||
}
|
||||
}
|
||||
//追思告别配置
|
||||
if (Objects.equals(skuExtendVO.getReflectionSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
SkuServicesFormDO skuServicesFormDO = new SkuServicesFormDO();
|
||||
skuServicesFormDO.setServiceName(ServiceTypeEnum.MEMORIAL_CONFIG.getDescription());
|
||||
skuServicesFormDO.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesFormDO.setType(ServiceTypeEnum.MEMORIAL_CONFIG.getCode());
|
||||
skuServicesFormDO.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesFormDO);
|
||||
for (SkuServiceDetailsDO skuServiceDetails : skuExtendVO.getReflectionList()) {
|
||||
skuServiceDetails.setServiceId(skuServicesFormDO.getId());
|
||||
skuServiceDetailsMapper.insert(skuServiceDetails);
|
||||
}
|
||||
SkuServicesFormDO skuServicesForm = new SkuServicesFormDO();
|
||||
skuServicesForm.setServiceName(ServiceTypeEnum.MEMORIAL_MATERIAL.getDescription());
|
||||
skuServicesForm.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesForm.setType(ServiceTypeEnum.MEMORIAL_MATERIAL.getCode());
|
||||
skuServicesForm.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesForm);
|
||||
for (SkuServiceMaterialDO skuServiceMaterialDO : skuExtendVO.getReflectionMaterialList()) {
|
||||
skuServiceMaterialDO.setServiceId(skuServicesForm.getId());
|
||||
skuServiceMaterialMapper.insert(skuServiceMaterialDO);
|
||||
}
|
||||
}
|
||||
|
||||
//遗体火化配置
|
||||
if (Objects.equals(skuExtendVO.getCremationSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
SkuServicesFormDO skuServicesFormDO = new SkuServicesFormDO();
|
||||
skuServicesFormDO.setServiceName(ServiceTypeEnum.CREMATION_CONFIG.getDescription());
|
||||
skuServicesFormDO.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesFormDO.setType(ServiceTypeEnum.CREMATION_CONFIG.getCode());
|
||||
skuServicesFormDO.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesFormDO);
|
||||
for (SkuServiceDetailsDO skuServiceDetails : skuExtendVO.getCremationList()) {
|
||||
skuServiceDetails.setServiceId(skuServicesFormDO.getId());
|
||||
skuServiceDetailsMapper.insert(skuServiceDetails);
|
||||
}
|
||||
SkuServicesFormDO skuServicesForm = new SkuServicesFormDO();
|
||||
skuServicesForm.setServiceName(ServiceTypeEnum.CREMATION_MATERIAL.getDescription());
|
||||
skuServicesForm.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesForm.setType(ServiceTypeEnum.CREMATION_MATERIAL.getCode());
|
||||
skuServicesForm.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesForm);
|
||||
for (SkuServiceMaterialDO skuServiceMaterialDO : skuExtendVO.getCremationMaterialList()) {
|
||||
skuServiceMaterialDO.setServiceId(skuServicesForm.getId());
|
||||
skuServiceMaterialMapper.insert(skuServiceMaterialDO);
|
||||
}
|
||||
}
|
||||
|
||||
//骨灰处理配置
|
||||
if (Objects.equals(skuExtendVO.getAshProcessingSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
SkuServicesFormDO skuServicesFormDO = new SkuServicesFormDO();
|
||||
skuServicesFormDO.setServiceName(ServiceTypeEnum.ASH_PROCESSING_CONFIG.getDescription());
|
||||
skuServicesFormDO.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesFormDO.setType(ServiceTypeEnum.ASH_PROCESSING_CONFIG.getCode());
|
||||
skuServicesFormDO.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesFormDO);
|
||||
for (SkuServiceDetailsDO skuServiceDetails : skuExtendVO.getAshProcessingList()) {
|
||||
skuServiceDetails.setServiceId(skuServicesFormDO.getId());
|
||||
skuServiceDetailsMapper.insert(skuServiceDetails);
|
||||
}
|
||||
SkuServicesFormDO skuForm = new SkuServicesFormDO();
|
||||
skuForm.setServiceName(ServiceTypeEnum.ASH_PROCESSING_DELIVERY.getDescription());
|
||||
skuForm.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuForm.setType(ServiceTypeEnum.ASH_PROCESSING_DELIVERY.getCode());
|
||||
skuForm.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuForm);
|
||||
for (SkuServiceDeliverDO skuServiceDeliverDO : skuExtendVO.getAshProcessingDeliverList()) {
|
||||
skuServiceDeliverDO.setServiceId(skuForm.getId());
|
||||
skuServiceDeliverMapper.insert(skuServiceDeliverDO);
|
||||
}
|
||||
SkuServicesFormDO skuServicesForm = new SkuServicesFormDO();
|
||||
skuServicesForm.setServiceName(ServiceTypeEnum.ASH_PROCESSING_MATERIAL.getDescription());
|
||||
skuServicesForm.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesForm.setType(ServiceTypeEnum.ASH_PROCESSING_MATERIAL.getCode());
|
||||
skuServicesForm.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesForm);
|
||||
for (SkuServiceMaterialDO skuServiceMaterialDO : skuExtendVO.getAshProcessingMaterialList()) {
|
||||
skuServiceMaterialDO.setServiceId(skuServicesForm.getId());
|
||||
skuServiceMaterialMapper.insert(skuServiceMaterialDO);
|
||||
}
|
||||
}
|
||||
|
||||
//骨灰装殓配置
|
||||
if (Objects.equals(skuExtendVO.getBoneashSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
SkuServicesFormDO skuServicesFormDO = new SkuServicesFormDO();
|
||||
skuServicesFormDO.setServiceName(ServiceTypeEnum.BONE_ASH_CONFIG.getDescription());
|
||||
skuServicesFormDO.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesFormDO.setType(ServiceTypeEnum.BONE_ASH_CONFIG.getCode());
|
||||
skuServicesFormDO.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesFormDO);
|
||||
for (SkuServiceDetailsDO skuServiceDetails : skuExtendVO.getBoneashList()) {
|
||||
skuServiceDetails.setServiceId(skuServicesFormDO.getId());
|
||||
skuServiceDetailsMapper.insert(skuServiceDetails);
|
||||
}
|
||||
}
|
||||
|
||||
//纪念品配置
|
||||
if (Objects.equals(skuExtendVO.getSouvenirSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
SkuServicesFormDO skuServicesFormDO = new SkuServicesFormDO();
|
||||
skuServicesFormDO.setServiceName(ServiceTypeEnum.SOUVENIR_CONFIG.getDescription());
|
||||
skuServicesFormDO.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuServicesFormDO.setType(ServiceTypeEnum.SOUVENIR_CONFIG.getCode());
|
||||
skuServicesFormDO.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuServicesFormDO);
|
||||
for (SkuServiceDetailsDO skuServiceDetails : skuExtendVO.getSouvenirList()) {
|
||||
skuServiceDetails.setServiceId(skuServicesFormDO.getId());
|
||||
skuServiceDetailsMapper.insert(skuServiceDetails);
|
||||
}
|
||||
SkuServicesFormDO skuForm = new SkuServicesFormDO();
|
||||
skuForm.setServiceName(ServiceTypeEnum.SOUVENIR_DELIVERY.getDescription());
|
||||
skuForm.setIsEnabled(BaseEnum.YES_ONE.getKey());
|
||||
skuForm.setType(ServiceTypeEnum.SOUVENIR_DELIVERY.getCode());
|
||||
skuForm.setName(skuExtendVO.getSkuFormName());
|
||||
skuServicesFormMapper.insert(skuForm);
|
||||
for (SkuServiceDeliverDO skuServiceDeliverDO : skuExtendVO.getSouvenirDeliverList()) {
|
||||
skuServiceDeliverDO.setServiceId(skuForm.getId());
|
||||
skuServiceDeliverMapper.insert(skuServiceDeliverDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkuExtendVO getSkuExtend(Integer formId) {
|
||||
// 1. 查询所有与 formId 相关的扩展服务配置(已包含详情、物料等关联数据)
|
||||
List<SkuServiceExtendVO> skuServiceExtendVOList = skuServicesFormMapper.selectSkuServiceExtendWithDetails(formId);
|
||||
|
||||
// 2. 创建返回对象
|
||||
SkuExtendVO skuExtendVO = new SkuExtendVO();
|
||||
// 可以设置 skuFormName,如果 formId 能关联到表单名称的话
|
||||
// skuExtendVO.setSkuFormName(...);
|
||||
|
||||
// 3. 遍历查询结果,按类型分类赋值
|
||||
for (SkuServiceExtendVO skuServiceExtendVO : skuServiceExtendVOList) {
|
||||
// 注意:数据库中 type 是 tinyint,但 VO 中定义为 String,需要转换或比较字符串
|
||||
// 枚举中 code 是 int,所以最好将 VO 的 type 转为 Integer 进行比较
|
||||
Integer typeCode;
|
||||
try {
|
||||
typeCode = Integer.valueOf(skuServiceExtendVO.getType());
|
||||
} catch (NumberFormatException e) {
|
||||
// 如果 type 无法转为数字,跳过这条记录或记录日志
|
||||
continue;
|
||||
}
|
||||
|
||||
// 使用 switch 或 if-else 根据 typeCode 赋值
|
||||
if (ServiceTypeEnum.TRANSPORT_CAR_CONFIG.getCode() == typeCode) {
|
||||
// 接运车辆配置
|
||||
skuExtendVO.setTransportCarSwitch(skuServiceExtendVO.getIsEnabled());
|
||||
skuExtendVO.setTransportCarList(skuServiceExtendVO.getSkuServiceDetailsDOList());
|
||||
|
||||
} else if (ServiceTypeEnum.TRANSPORT_CAR_MATERIAL.getCode() == typeCode) {
|
||||
if (ObjectUtils.isEmpty(skuExtendVO.getTransportCarMaterialList())) {
|
||||
skuExtendVO.setTransportCarMaterialList(skuServiceExtendVO.getSkuServiceMaterialDOList());
|
||||
}
|
||||
} else if (ServiceTypeEnum.BODY_TRANSPORT_CONFIG.getCode() == typeCode) {
|
||||
// 遗体运输目的地配置
|
||||
skuExtendVO.setTrafficSwitch(skuServiceExtendVO.getIsEnabled());
|
||||
skuExtendVO.setTrafficList(skuServiceExtendVO.getSkuServiceTransportDOList()); // 注意:这里用 TransportDO
|
||||
|
||||
} else if (ServiceTypeEnum.BODY_TRANSPORT_MATERIAL.getCode() == typeCode) {
|
||||
// 遗体运输目的地物料
|
||||
if (ObjectUtils.isEmpty(skuExtendVO.getTrafficMaterialList())) {
|
||||
skuExtendVO.setTrafficMaterialList(skuServiceExtendVO.getSkuServiceMaterialDOList());
|
||||
}
|
||||
|
||||
} else if (ServiceTypeEnum.BODY_CLEAN_CONFIG.getCode() == typeCode) {
|
||||
// 遗体清洁配置
|
||||
skuExtendVO.setCleanSwitch(skuServiceExtendVO.getIsEnabled());
|
||||
skuExtendVO.setCleanList(skuServiceExtendVO.getSkuServiceDetailsDOList());
|
||||
|
||||
} else if (ServiceTypeEnum.BODY_CLEAN_MATERIAL.getCode() == typeCode) {
|
||||
// 遗体清洁物料
|
||||
if (ObjectUtils.isEmpty(skuExtendVO.getCleanMaterialList())) {
|
||||
skuExtendVO.setCleanMaterialList(skuServiceExtendVO.getSkuServiceMaterialDOList());
|
||||
}
|
||||
} else if (ServiceTypeEnum.MEMORIAL_CONFIG.getCode() == typeCode) {
|
||||
// 追思告别配置
|
||||
skuExtendVO.setReflectionSwitch(skuServiceExtendVO.getIsEnabled());
|
||||
skuExtendVO.setReflectionList(skuServiceExtendVO.getSkuServiceDetailsDOList());
|
||||
} else if (ServiceTypeEnum.MEMORIAL_MATERIAL.getCode() == typeCode) {
|
||||
// 追思告别物料
|
||||
if (ObjectUtils.isEmpty(skuExtendVO.getReflectionMaterialList())) {
|
||||
skuExtendVO.setReflectionMaterialList(skuServiceExtendVO.getSkuServiceMaterialDOList());
|
||||
}
|
||||
} else if (ServiceTypeEnum.CREMATION_CONFIG.getCode() == typeCode) {
|
||||
// 遗体火化配置
|
||||
skuExtendVO.setCremationSwitch(skuServiceExtendVO.getIsEnabled());
|
||||
skuExtendVO.setCremationList(skuServiceExtendVO.getSkuServiceDetailsDOList());
|
||||
} else if (ServiceTypeEnum.CREMATION_MATERIAL.getCode() == typeCode) {
|
||||
// 遗体火化物料
|
||||
if (ObjectUtils.isEmpty(skuExtendVO.getCremationMaterialList())) {
|
||||
skuExtendVO.setCremationMaterialList(skuServiceExtendVO.getSkuServiceMaterialDOList());
|
||||
}
|
||||
|
||||
} else if (ServiceTypeEnum.ASH_PROCESSING_CONFIG.getCode() == typeCode) {
|
||||
// 骨灰处理配置
|
||||
skuExtendVO.setAshProcessingSwitch(skuServiceExtendVO.getIsEnabled());
|
||||
skuExtendVO.setAshProcessingList(skuServiceExtendVO.getSkuServiceDetailsDOList());
|
||||
|
||||
} else if (ServiceTypeEnum.ASH_PROCESSING_DELIVERY.getCode() == typeCode) {
|
||||
// 骨灰处理配送方式 (补充)
|
||||
if (ObjectUtils.isEmpty(skuExtendVO.getAshProcessingDeliverList())) {
|
||||
skuExtendVO.setAshProcessingDeliverList(skuServiceExtendVO.getSkuServiceDeliverDOList());
|
||||
}
|
||||
} else if (ServiceTypeEnum.ASH_PROCESSING_MATERIAL.getCode() == typeCode) {
|
||||
// 骨灰处理物料
|
||||
if (ObjectUtils.isEmpty(skuExtendVO.getAshProcessingMaterialList())) {
|
||||
skuExtendVO.setAshProcessingMaterialList(skuServiceExtendVO.getSkuServiceMaterialDOList());
|
||||
}
|
||||
} else if (ServiceTypeEnum.BONE_ASH_CONFIG.getCode() == typeCode) {
|
||||
// 骨灰装殓配置
|
||||
skuExtendVO.setBoneashSwitch(skuServiceExtendVO.getIsEnabled());
|
||||
skuExtendVO.setBoneashList(skuServiceExtendVO.getSkuServiceDetailsDOList());
|
||||
// 注意:骨灰装殓是否有物料?根据你的 DO 列表,没有 material 字段
|
||||
|
||||
} else if (ServiceTypeEnum.SOUVENIR_CONFIG.getCode() == typeCode) {
|
||||
// 纪念品配置
|
||||
skuExtendVO.setSouvenirSwitch(skuServiceExtendVO.getIsEnabled());
|
||||
skuExtendVO.setSouvenirList(skuServiceExtendVO.getSkuServiceDetailsDOList());
|
||||
} else if (ServiceTypeEnum.SOUVENIR_DELIVERY.getCode() == typeCode) {
|
||||
// 纪念品配送方式 (补充)
|
||||
if (ObjectUtils.isEmpty(skuExtendVO.getSouvenirDeliverList())) {
|
||||
skuExtendVO.setSouvenirDeliverList(skuServiceExtendVO.getSkuServiceDeliverDOList());
|
||||
}
|
||||
}
|
||||
// 可以添加 default 处理未知类型
|
||||
}
|
||||
|
||||
// 4. 返回组装好的对象
|
||||
return skuExtendVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSku(SkuSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSkuExists(updateReqVO.getSkuId());
|
||||
// 更新
|
||||
SkuDO updateObj = BeanUtils.toBean(updateReqVO, SkuDO.class);
|
||||
skuMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateProp(SkuPropVO skuPropVO) {
|
||||
//保存sku
|
||||
if (CollectionUtil.isNotEmpty(skuPropVO.getSkuList())) {
|
||||
List<SkuDO> skuList = skuPropVO.getSkuList();
|
||||
List<SkuDO> skuListNew = new ArrayList<>();
|
||||
for (SkuDO sku : skuList) {
|
||||
if (Objects.equals(BaseEnum.YES_ONE.getKey(), sku.getIsExist())) {
|
||||
sku.setProdId(skuPropVO.getProdId());
|
||||
skuListNew.add(sku);
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(skuListNew)) {
|
||||
skuMapper.insertBatch(skuListNew);
|
||||
}
|
||||
}
|
||||
prodExtendMapper.updateByProdId(skuPropVO.getProdId(), skuPropVO.getIsDisable(), skuPropVO.getIsExpire());
|
||||
//保存规格
|
||||
prodPropService.updateProdPropAndValues(skuPropVO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updatePropVal(Long id, String propValue) {
|
||||
ProdPropValueDO prodPropValueDO = prodPropValueMapper.selectById(id);
|
||||
ProdPropDO prodPropDO =prodPropMapper.selectById(prodPropValueDO.getPropId());
|
||||
List<SkuDO> skuDOList = skuMapper.getSkuListByName(prodPropDO.getProdId(),prodPropValueDO.getPropValue());
|
||||
for (SkuDO skuDO : skuDOList) {
|
||||
if (skuDO.getProperties() != null) {
|
||||
String[] split = skuDO.getProperties().split(",");
|
||||
for (String s : split) {
|
||||
if (s.equals(prodPropValueDO.getPropValue())) {
|
||||
skuDO.setProperties(propValue);
|
||||
skuDO.setSkuName(propValue);
|
||||
skuMapper.updateById(skuDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
prodPropValueDO.setPropValue(propValue);
|
||||
prodPropValueMapper.updateById(prodPropValueDO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deleteProp(Long id) {
|
||||
ProdPropValueDO prodPropValueDO = prodPropValueService.getById(id);
|
||||
ProdPropDO prodPropDO =prodPropMapper.selectById(prodPropValueDO.getPropId());
|
||||
prodPropValueService.deleteProdPropValue(id);
|
||||
List<SkuDO> skuDOList = skuMapper.getSkuListByName(prodPropDO.getProdId(),prodPropValueDO.getPropValue());
|
||||
List<Long> skuids = new ArrayList<>();
|
||||
for (SkuDO skuDO : skuDOList) {
|
||||
if (skuDO.getProperties() != null) {
|
||||
String[] split = skuDO.getProperties().split(",");
|
||||
for (String s : split) {
|
||||
if (s.equals(prodPropValueDO.getPropValue())) {
|
||||
skuids.add(skuDO.getSkuId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(skuids)) {
|
||||
skuMapper.batchSkuDeleted(skuids);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableProp(Long id, Integer state) {
|
||||
ProdPropValueDO prodPropValueDO = prodPropValueService.getById(id);
|
||||
prodPropValueDO.setState(state);
|
||||
prodPropValueService.updateById(prodPropValueDO);
|
||||
ProdPropDO prodPropDO =prodPropMapper.selectById(prodPropValueDO.getPropId());
|
||||
if (Objects.equals(BaseEnum.NO_ZERO.getKey(), state)) {
|
||||
List<SkuDO> skuDOList = skuMapper.getSkuListByName(prodPropDO.getProdId(),prodPropValueDO.getPropValue());
|
||||
List<SkuDO> skuDOList1 = new ArrayList<>();
|
||||
for (SkuDO skuDO : skuDOList) {
|
||||
if (skuDO.getProperties() != null) {
|
||||
String[] split = skuDO.getProperties().split(",");
|
||||
for (String s : split) {
|
||||
if (s.equals(prodPropValueDO.getPropValue())) {
|
||||
skuDO.setIsShelf(BaseEnum.NO_ZERO.getKey());
|
||||
skuDOList1.add(skuDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(skuDOList1)) {
|
||||
skuMapper.updateBatch(skuDOList1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public SkuPropInfoVO getSKuPropList(Long prodId) {
|
||||
LambdaQueryWrapper<ProdPropDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProdPropDO::getProdId, prodId);
|
||||
wrapper.eq(ProdPropDO::getState, BaseEnum.YES_ONE.getKey())
|
||||
.orderByAsc(ProdPropDO::getSort);
|
||||
List<ProdPropDO> list = prodPropService.list(wrapper);
|
||||
list.forEach(prop -> {
|
||||
List<ProdPropValueDO> values = prodPropValueService.list(
|
||||
new LambdaQueryWrapper<ProdPropValueDO>()
|
||||
.eq(ProdPropValueDO::getPropId, prop.getId())
|
||||
.eq(ProdPropValueDO::getDeleted, BaseEnum.NO_ZERO.getKey())
|
||||
.orderByAsc(ProdPropValueDO::getSort)
|
||||
);
|
||||
prop.setProdPropValues(values);
|
||||
});
|
||||
SkuPropInfoVO skuPropInfoVO = new SkuPropInfoVO();
|
||||
skuPropInfoVO.setProdId(prodId);
|
||||
skuPropInfoVO.setProdPropSaveReqVO(list);
|
||||
ProdExtendDO prodExtendDO = prodExtendService.getOne(new LambdaQueryWrapper<ProdExtendDO>().eq(ProdExtendDO::getProdId, prodId));
|
||||
skuPropInfoVO.setIsDisable(prodExtendDO.getIsDisable());
|
||||
skuPropInfoVO.setIsExpire(prodExtendDO.getIsExpire());
|
||||
return skuPropInfoVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ProPropRecycleBinVO> getSKuPropRecycleBinList(ProPageReqVO proPageReqVO) {
|
||||
IPage<ProPropRecycleBinVO> prodPageList = prodPropValueMapper.getSKuPropRecycleBinList(MyBatisUtils.buildPage(proPageReqVO), proPageReqVO.getProdId(), proPageReqVO.getPropValue());
|
||||
for (ProPropRecycleBinVO prodPage : prodPageList.getRecords()) {
|
||||
if (prodPage.getDeleteTime() != null) {
|
||||
prodPage.setRemainingDays(DateUtils.getRemainingDays(prodPage.getDeleteTime()));
|
||||
}
|
||||
}
|
||||
return new PageResult<>(prodPageList.getRecords(), prodPageList.getTotal());
|
||||
}
|
||||
|
||||
/* @Override
|
||||
public SkuPropInfoVO getSKuPropList(Long prodId, Integer isExpire, Integer state) {
|
||||
if (prodId == null) {
|
||||
throw new IllegalArgumentException("prodId 不能为空");
|
||||
}
|
||||
|
||||
// 1. 查询商品扩展信息(用于默认值)
|
||||
ProdExtendDO extendDO = prodExtendService.getOne(
|
||||
new LambdaQueryWrapper<ProdExtendDO>().eq(ProdExtendDO::getProdId, prodId)
|
||||
);
|
||||
if (extendDO == null) {
|
||||
// 如果没有扩展信息,可返回空 VO 或抛异常,根据业务决定
|
||||
return buildEmptySkuPropInfoVO(prodId);
|
||||
}
|
||||
|
||||
// 2. 设置默认值:isExpire 和 state
|
||||
Integer finalIsExpire = isExpire != null ? isExpire : extendDO.getIsExpire();
|
||||
Integer finalState = state != null ? state : extendDO.getIsDisable(); // 注意:这里你用的是 isDisable 当 state?需确认业务逻辑
|
||||
|
||||
// 3. 查询有效属性列表
|
||||
LambdaQueryWrapper<ProdPropDO> propWrapper = new LambdaQueryWrapper<>();
|
||||
propWrapper.eq(ProdPropDO::getProdId, prodId)
|
||||
.eq(ProdPropDO::getState, BaseEnum.YES_ONE.getKey()) // 只查启用的属性
|
||||
.orderByAsc(ProdPropDO::getSort);
|
||||
|
||||
List<ProdPropDO> propList = prodPropService.list(propWrapper);
|
||||
if (propList.isEmpty()) {
|
||||
return buildSkuPropInfoVO(prodId, propList, extendDO);
|
||||
}
|
||||
|
||||
// 4. 提取所有属性 ID,用于批量查询属性值
|
||||
List<Long> propIds = propList.stream()
|
||||
.map(ProdPropDO::getId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
// 5. 构建属性值查询条件(批量查询)
|
||||
LambdaQueryWrapper<ProdPropValueDO> valueWrapper = new LambdaQueryWrapper<>();
|
||||
valueWrapper.in(ProdPropValueDO::getPropId, propIds)
|
||||
.eq(ProdPropValueDO::getState, BaseEnum.YES_ONE.getKey()); // 启用状态
|
||||
|
||||
// 根据 isExpire 过滤(注意字段是 getIsExpire)
|
||||
if (BaseEnum.NO_ZERO.getKey().equals(finalIsExpire)) {
|
||||
valueWrapper.eq(ProdPropValueDO::getIsExpire, BaseEnum.NO_ZERO.getKey());
|
||||
} else {
|
||||
valueWrapper.eq(ProdPropValueDO::getIsExpire, BaseEnum.YES_ONE.getKey());
|
||||
}
|
||||
|
||||
// 根据 state 过滤(注意:这里你用的是 getState 字段)
|
||||
if (BaseEnum.NO_ZERO.getKey().equals(finalState)) {
|
||||
valueWrapper.eq(ProdPropValueDO::getState, BaseEnum.NO_ZERO.getKey());
|
||||
} else {
|
||||
valueWrapper.eq(ProdPropValueDO::getState, BaseEnum.YES_ONE.getKey());
|
||||
}
|
||||
|
||||
valueWrapper.orderByDesc(ProdPropValueDO::getSort);
|
||||
|
||||
List<ProdPropValueDO> valueList = prodPropValueService.list(valueWrapper);
|
||||
|
||||
// 6. 按 propId 分组,便于后续关联
|
||||
Map<Long, List<ProdPropValueDO>> valueMap = valueList.stream()
|
||||
.collect(Collectors.groupingBy(ProdPropValueDO::getPropId));
|
||||
|
||||
// 7. 关联属性与属性值
|
||||
propList.forEach(prop ->
|
||||
prop.setProdPropValues(valueMap.getOrDefault(prop.getId(), Collections.emptyList()))
|
||||
);
|
||||
|
||||
// 8. 构建并返回 VO
|
||||
return buildSkuPropInfoVO(prodId, propList, extendDO);
|
||||
}*/
|
||||
|
||||
/* @Override
|
||||
public SkuPropInfoVO getSKuPropList(Long prodId,Integer isExpire,Integer state) {
|
||||
LambdaQueryWrapper<ProdPropDO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(ProdPropDO::getProdId,prodId);
|
||||
wrapper.eq(ProdPropDO::getState, BaseEnum.YES_ONE.getKey())
|
||||
.orderByAsc(ProdPropDO::getSort);
|
||||
ProdExtendDO prodExtendDO = prodExtendService.getOne(new LambdaQueryWrapper<ProdExtendDO>().eq(ProdExtendDO::getProdId, prodId));
|
||||
if(isExpire==null){
|
||||
isExpire = prodExtendDO.getIsExpire();
|
||||
}
|
||||
if(state==null){
|
||||
state = prodExtendDO.getIsDisable();
|
||||
}
|
||||
List<ProdPropDO> list = prodPropService.list(wrapper);
|
||||
list.forEach(prop -> {
|
||||
LambdaQueryWrapper<ProdPropValueDO> wrapper1 = new LambdaQueryWrapper<>();
|
||||
wrapper1.eq(ProdPropValueDO::getPropId,prop.getId());
|
||||
wrapper1.eq(ProdPropValueDO::getState, BaseEnum.YES_ONE.getKey());
|
||||
if (isExpire!= null&& Objects.equals(BaseEnum.NO_ZERO.getKey(),isExpire) ) {
|
||||
wrapper1.eq(ProdPropValueDO::getIsExpire, BaseEnum.NO_ZERO.getKey());
|
||||
}else {
|
||||
wrapper1.eq(ProdPropValueDO::getIsExpire, BaseEnum.YES_ONE.getKey());
|
||||
}
|
||||
if (state!= null&& Objects.equals(BaseEnum.NO_ZERO.getKey(),state) ) {
|
||||
wrapper1.eq(ProdPropValueDO::getState, BaseEnum.NO_ZERO.getKey());
|
||||
}else {
|
||||
wrapper1.eq(ProdPropValueDO::getState, BaseEnum.YES_ONE.getKey());
|
||||
}
|
||||
wrapper1.orderByDesc(ProdPropValueDO::getSort);
|
||||
List<ProdPropValueDO> lists = prodPropValueService.list(wrapper1);
|
||||
prop.setProdPropValues(lists);
|
||||
});
|
||||
SkuPropInfoVO skuPropInfoVO = new SkuPropInfoVO();
|
||||
skuPropInfoVO.setProdId(prodId);
|
||||
skuPropInfoVO.setProdPropSaveReqVO(list);
|
||||
|
||||
skuPropInfoVO.setIsDisable(prodExtendDO.getIsDisable());
|
||||
skuPropInfoVO.setIsExpire(prodExtendDO.getIsExpire());
|
||||
return skuPropInfoVO;
|
||||
}*/
|
||||
|
||||
|
||||
// 封装构建 VO 的逻辑,避免重复代码
|
||||
private SkuPropInfoVO buildSkuPropInfoVO(Long prodId, List<ProdPropDO> propList, ProdExtendDO extendDO) {
|
||||
SkuPropInfoVO vo = new SkuPropInfoVO();
|
||||
vo.setProdId(prodId);
|
||||
vo.setProdPropSaveReqVO(propList);
|
||||
vo.setIsDisable(extendDO.getIsDisable());
|
||||
vo.setIsExpire(extendDO.getIsExpire());
|
||||
return vo;
|
||||
}
|
||||
|
||||
// 空情况处理
|
||||
private SkuPropInfoVO buildEmptySkuPropInfoVO(Long prodId) {
|
||||
SkuPropInfoVO vo = new SkuPropInfoVO();
|
||||
vo.setProdId(prodId);
|
||||
vo.setProdPropSaveReqVO(Collections.emptyList());
|
||||
vo.setIsDisable(BaseEnum.NO_ZERO.getKey()); // 默认值
|
||||
vo.setIsExpire(BaseEnum.NO_ZERO.getKey());
|
||||
return vo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteSku(Long id) {
|
||||
// 校验存在
|
||||
validateSkuExists(id);
|
||||
SkuDO prodSku = skuMapper.selectById(id);
|
||||
// Step 1: 获取该商品下所有未删除的 SKU 的 properties
|
||||
List<String> activeProperties = skuMapper.selectPropertiesByProdIdAndNotDeleted(prodSku.getProdId());
|
||||
|
||||
// Step 2: 提取所有正在被使用的属性值(去重)
|
||||
Set<String> currentlyUsedValues = new HashSet<>();
|
||||
for (String props : activeProperties) {
|
||||
if (props != null && !props.trim().isEmpty()) {
|
||||
String[] values = props.split(",");
|
||||
for (String v : values) {
|
||||
currentlyUsedValues.add(v.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
// 删除
|
||||
skuMapper.deleteBySkuId(id);
|
||||
// Step 3: 查询该商品下所有 rule=1 的属性值(销售属性)
|
||||
List<ProdPropValueDO> allPropValues = prodPropValueMapper.selectSalesValuesByProdId(prodSku.getProdId());
|
||||
// Step 4: 遍历每个属性值,检查是否还在被使用
|
||||
for (ProdPropValueDO pv : allPropValues) {
|
||||
String value = pv.getPropValue().trim();
|
||||
// 如果当前属性值不在“活跃使用”列表中,说明没有未删除的 SKU 使用它
|
||||
if (!currentlyUsedValues.contains(value)) {
|
||||
// 可以安全删除该属性值
|
||||
// 可以安全禁用该属性值
|
||||
ProdPropValueDO prodPropValueDO = new ProdPropValueDO();
|
||||
prodPropValueDO.setId(pv.getId());
|
||||
prodPropValueDO.setIsExpire(BaseEnum.YES_ONE.getKey());
|
||||
prodPropValueDO.setDeleteTime(new Date());
|
||||
prodPropValueMapper.updateById(prodPropValueDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void deleteSkus(List<Long> ids) {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
// Step 1: 查询这些 SKU 的基本信息(主要是 prod_id)
|
||||
List<SkuDO> skuList = skuMapper.selectByIds(ids);
|
||||
if (skuList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
Long prodId = skuList.get(0).getProdId();
|
||||
// 校验是否属于同一个商品(可选)
|
||||
boolean allSameProd = skuList.stream().allMatch(s -> s.getProdId().equals(prodId));
|
||||
if (!allSameProd) {
|
||||
throw new IllegalArgumentException("批量删除的 SKU 必须属于同一个商品");
|
||||
}
|
||||
// Step 3: 获取该商品下【当前仍然未删除】的 SKU 的 properties
|
||||
List<String> activeProperties = skuMapper.selectPropertiesByProdIdAndNotDeleted(prodId);
|
||||
for (Long id : ids) {
|
||||
// 删除
|
||||
skuMapper.deleteBySkuId(id);
|
||||
}
|
||||
// Step 4: 提取所有仍在使用的属性值(去重 + trim)
|
||||
Set<String> currentlyUsedValues = new HashSet<>();
|
||||
for (String props : activeProperties) {
|
||||
if (props != null && !props.trim().isEmpty()) {
|
||||
String[] values = props.split(",");
|
||||
for (String v : values) {
|
||||
currentlyUsedValues.add(v.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
// Step 5: 查询该商品下所有 rule=1 的销售属性值(未删除的)
|
||||
List<ProdPropValueDO> allPropValues = prodPropValueMapper.selectSalesValuesByProdId(prodId);
|
||||
|
||||
// Step 6: 收集需要删除的属性值 ID
|
||||
List<Long> valueIdsToDelete = new ArrayList<>();
|
||||
for (ProdPropValueDO pv : allPropValues) {
|
||||
String value = pv.getPropValue().trim();
|
||||
if (!currentlyUsedValues.contains(value)) {
|
||||
valueIdsToDelete.add(pv.getId());
|
||||
}
|
||||
}
|
||||
// Step 7: 批量删除无用的属性值
|
||||
if (!valueIdsToDelete.isEmpty()) {
|
||||
prodPropValueMapper.batchMarkDeleted(valueIdsToDelete);
|
||||
}
|
||||
}
|
||||
|
||||
//恢复SKU
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void restoreSkuList(List<Long> ids) {
|
||||
List<SkuDO> skuList = skuMapper.getskuListBySkuIds(ids);
|
||||
if (skuList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取商品下所有被删除的SKU(除了当前要恢复的 ids)
|
||||
List<SkuDO> skuAllDeletedList = skuMapper.getskuListByDeleted(skuList.get(0).getProdId(), ids);
|
||||
|
||||
Set<String> allDeletedValues = new HashSet<>();
|
||||
for (SkuDO sku : skuAllDeletedList) {
|
||||
if (sku.getProperties() != null && !sku.getProperties().trim().isEmpty()) {
|
||||
String[] values = sku.getProperties().split(",");
|
||||
for (String v : values) {
|
||||
allDeletedValues.add(v.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> currentlyUsedValues = new HashSet<>();
|
||||
for (SkuDO sku : skuList) {
|
||||
skuMapper.updateSkuDeleted(sku.getSkuId());
|
||||
if (sku.getProperties() != null && !sku.getProperties().trim().isEmpty()) {
|
||||
String[] values = sku.getProperties().split(",");
|
||||
for (String v : values) {
|
||||
currentlyUsedValues.add(v.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// === 核心修改点:提取 currentlyUsedValues 中不在 allDeletedValues 的值(即新增启用的规格值)===
|
||||
Set<String> valuesToRestore = new HashSet<>(currentlyUsedValues);
|
||||
valuesToRestore.removeAll(allDeletedValues); // 只保留“之前被删掉过”的规格值
|
||||
|
||||
// 如果没有需要恢复的规格值,直接返回
|
||||
if (valuesToRestore.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 查询商品下所有属性值
|
||||
Long prodId = skuList.get(0).getProdId();
|
||||
List<ProdPropValueDO> allPropValues = prodPropValueMapper.selectRestoreProp(prodId);
|
||||
|
||||
if (!allPropValues.isEmpty()) {
|
||||
for (ProdPropValueDO pv : allPropValues) {
|
||||
// 仅当该属性值是“当前使用”且“之前被删除”的(即在 valuesToRestore 中),才恢复
|
||||
if (valuesToRestore.contains(pv.getPropValue())) {
|
||||
pv.setIsExpire(BaseEnum.NO_ZERO.getKey()); // 标记为未过期
|
||||
prodPropValueMapper.updateById(pv);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restorePropList(List<Long> ids) {
|
||||
prodPropValueMapper.restorePropValue(ids);
|
||||
List<ProdPropValueDO> prodPropValueDOList = prodPropValueMapper.getskuListByPropValueIds(ids);
|
||||
for (ProdPropValueDO prodPropValueDO : prodPropValueDOList) {
|
||||
int maxPropValue =prodPropValueMapper.getMaxPropValue(prodPropValueDO.getPropId());
|
||||
prodPropValueDO.setSort(maxPropValue+1);
|
||||
prodPropValueService.updateById(prodPropValueDO);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updatSkuIsShelf(Long id, Integer isShelf) {
|
||||
// 校验存在
|
||||
validateSkuExists(id);
|
||||
|
||||
SkuDO prodSku = skuMapper.selectById(id);
|
||||
// Step 1: 获取该商品下所有未禁用的 SKU 的 properties
|
||||
List<String> activeProperties = skuMapper.selectPropertiesByProdIdShelf(prodSku.getProdId());
|
||||
prodSku.setIsShelf(isShelf);
|
||||
skuMapper.updateById(prodSku);
|
||||
// Step 2: 提取所有正在被使用的属性值(去重)
|
||||
Set<String> currentlyUsedValues = new HashSet<>();
|
||||
for (String props : activeProperties) {
|
||||
if (props != null && !props.trim().isEmpty()) {
|
||||
String[] values = props.split(",");
|
||||
for (String v : values) {
|
||||
currentlyUsedValues.add(v.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
// Step 3: 查询该商品下所有 rule=1 的属性值(销售属性)
|
||||
List<ProdPropValueDO> allPropValues = prodPropValueMapper.selectSalesValuesByState(prodSku.getProdId());
|
||||
// Step 4: 遍历每个属性值,检查是否还在被使用
|
||||
for (ProdPropValueDO pv : allPropValues) {
|
||||
String value = pv.getPropValue().trim();
|
||||
// 如果当前属性值不在“活跃使用”列表中,说明没有未删除的 SKU 使用它
|
||||
if (!currentlyUsedValues.contains(value)) {
|
||||
// 可以安全禁用该属性值
|
||||
ProdPropValueDO prodPropValueDO = new ProdPropValueDO();
|
||||
prodPropValueDO.setId(pv.getId());
|
||||
prodPropValueDO.setState(BaseEnum.NO_ZERO.getKey());
|
||||
prodPropValueMapper.updateById(prodPropValueDO);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updatSkuIsShelfs(List<Long> ids, Integer isShelf) {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Step 1: 查询这些 SKU 的基本信息(主要是 prod_id)
|
||||
List<SkuDO> skuList = skuMapper.selectByIds(ids);
|
||||
if (skuList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Long prodId = skuList.get(0).getProdId();
|
||||
// 校验是否属于同一个商品(可选)
|
||||
boolean allSameProd = skuList.stream().allMatch(s -> s.getProdId().equals(prodId));
|
||||
if (!allSameProd) {
|
||||
throw new IllegalArgumentException("批量删除的 SKU 必须属于同一个商品");
|
||||
}
|
||||
for (Long id : ids) {
|
||||
SkuDO sku = new SkuDO();
|
||||
sku.setSkuId(id);
|
||||
sku.setIsShelf(isShelf);
|
||||
skuMapper.updateById(sku);
|
||||
}
|
||||
// ================================
|
||||
//新增逻辑:判断商品整体上下架状态,并更新 tz_prod_prop_value.state
|
||||
// ================================
|
||||
// 查询该商品下所有未删除的 SKU 的 is_shelf 状态
|
||||
List<Integer> allSkuShelfStatus = skuMapper.selectShelfStatusByProdId(prodId);
|
||||
|
||||
if (allSkuShelfStatus.isEmpty()) {
|
||||
return; // 没有 SKU,无需处理
|
||||
}
|
||||
|
||||
boolean allShelf = allSkuShelfStatus.stream().allMatch(status -> status == 1); // 全部上架
|
||||
boolean allOffShelf = allSkuShelfStatus.stream().allMatch(status -> status == 0); // 全部下架
|
||||
|
||||
Integer targetState = null;
|
||||
if (allShelf) {
|
||||
targetState = 1; // 启用
|
||||
} else if (allOffShelf) {
|
||||
targetState = 0; // 禁用
|
||||
}
|
||||
// 混合状态:不修改 state
|
||||
// 如果需要更新状态,则批量更新 tz_prod_prop_value 的 state 字段
|
||||
if (targetState != null) {
|
||||
prodPropValueMapper.updateStateByProdId(prodId, targetState);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void validateSkuExists(Long id) {
|
||||
if (skuMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.SKU_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkuDO getSku(Long id) {
|
||||
return skuMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SkuRecycleBinVO> getSkuRecycleBinPageList(SkuPageReqVO pageReqVO) {
|
||||
IPage<SkuRecycleBinVO> prodPageList = skuMapper.getSkuRecycleBinPageList(MyBatisUtils.buildPage(pageReqVO), pageReqVO.getProdId(), pageReqVO.getProperties());
|
||||
for (SkuRecycleBinVO prodPage : prodPageList.getRecords()) {
|
||||
if (prodPage.getDeleteTime() != null) {
|
||||
prodPage.setRemainingDays(DateUtils.getRemainingDays(prodPage.getDeleteTime()));
|
||||
}
|
||||
}
|
||||
return new PageResult<>(prodPageList.getRecords(), prodPageList.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SkuDO> getSkuPageList(SkuPageReqVO pageReqVO) {
|
||||
IPage<SkuDO> prodPageList = skuMapper.getSkuPageList(MyBatisUtils.buildPage(pageReqVO), pageReqVO.getProdId(), pageReqVO.getSkuId(), pageReqVO.getProperties());
|
||||
|
||||
return new PageResult<>(prodPageList.getRecords(), prodPageList.getTotal());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public PageResult<SkuDO> getSkuPage(SkuPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateServiceDetails(List<SkuServiceDetailsDO> skuServiceDetailsList) {
|
||||
if (ObjectUtils.isNotEmpty(skuServiceDetailsList)) {
|
||||
skuServiceDetailsMapper.delete(SkuServiceDetailsDO::getServiceId, skuServiceDetailsList.get(0).getServiceId());
|
||||
skuServiceDetailsMapper.insertBatch(skuServiceDetailsList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateMaterial(List<SkuServiceMaterialDO> skuServiceMaterialList) {
|
||||
if (ObjectUtils.isNotEmpty(skuServiceMaterialList)) {
|
||||
skuServiceMaterialMapper.delete(SkuServiceMaterialDO::getServiceId, skuServiceMaterialList.get(0).getServiceId());
|
||||
skuServiceMaterialMapper.insertBatch(skuServiceMaterialList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateTransportAdress(List<SkuServiceTransportDO> skuServiceTransportDOList) {
|
||||
if (ObjectUtils.isNotEmpty(skuServiceTransportDOList)) {
|
||||
skuServiceTransportMapper.delete(SkuServiceTransportDO::getServiceId, skuServiceTransportDOList.get(0).getServiceId());
|
||||
skuServiceTransportMapper.insertBatch(skuServiceTransportDOList);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDeliver(List<SkuServiceDeliverDO> skuServiceDeliverList) {
|
||||
if (ObjectUtils.isNotEmpty(skuServiceDeliverList)) {
|
||||
skuServiceDeliverMapper.delete(SkuServiceDeliverDO::getServiceId, skuServiceDeliverList.get(0).getServiceId());
|
||||
skuServiceDeliverMapper.insertBatch(skuServiceDeliverList);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceMaterialDO;
|
||||
import com.tashow.cloud.product.mapper.SkuServiceMaterialMapper;
|
||||
import com.tashow.cloud.product.service.SkuServiceMaterialService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicematerial.SkuServiceMaterialPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicematerial.SkuServiceMaterialSaveReqVO;
|
||||
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 SkuServiceMaterialServiceImpl implements SkuServiceMaterialService {
|
||||
|
||||
@Resource
|
||||
private SkuServiceMaterialMapper skuServiceMaterialMapper;
|
||||
|
||||
@Override
|
||||
public Long createSkuServiceMaterial(SkuServiceMaterialSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SkuServiceMaterialDO skuServiceMaterial = BeanUtils.toBean(createReqVO, SkuServiceMaterialDO.class);
|
||||
skuServiceMaterialMapper.insert(skuServiceMaterial);
|
||||
// 返回
|
||||
return skuServiceMaterial.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSkuServiceMaterial(SkuServiceMaterialSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSkuServiceMaterialExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SkuServiceMaterialDO updateObj = BeanUtils.toBean(updateReqVO, SkuServiceMaterialDO.class);
|
||||
skuServiceMaterialMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSkuServiceMaterial(Long id) {
|
||||
// 校验存在
|
||||
validateSkuServiceMaterialExists(id);
|
||||
// 删除
|
||||
skuServiceMaterialMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateSkuServiceMaterialExists(Long id) {
|
||||
if (skuServiceMaterialMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.SKU_SERVICE_MATERIAL_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkuServiceMaterialDO getSkuServiceMaterial(Long id) {
|
||||
return skuServiceMaterialMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SkuServiceMaterialDO> getSkuServiceMaterialPage(SkuServiceMaterialPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,74 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServiceTransportDO;
|
||||
import com.tashow.cloud.product.mapper.SkuServiceTransportMapper;
|
||||
import com.tashow.cloud.product.service.SkuServiceTransportService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicetransport.SkuServiceTransportPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicetransport.SkuServiceTransportSaveReqVO;
|
||||
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 SkuServiceTransportServiceImpl implements SkuServiceTransportService {
|
||||
|
||||
@Resource
|
||||
private SkuServiceTransportMapper skuServiceTransportMapper;
|
||||
|
||||
@Override
|
||||
public Long createSkuServiceTransport(SkuServiceTransportSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SkuServiceTransportDO skuServiceTransport = BeanUtils.toBean(createReqVO, SkuServiceTransportDO.class);
|
||||
skuServiceTransportMapper.insert(skuServiceTransport);
|
||||
// 返回
|
||||
return skuServiceTransport.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSkuServiceTransport(SkuServiceTransportSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSkuServiceTransportExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SkuServiceTransportDO updateObj = BeanUtils.toBean(updateReqVO, SkuServiceTransportDO.class);
|
||||
skuServiceTransportMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSkuServiceTransport(Long id) {
|
||||
// 校验存在
|
||||
validateSkuServiceTransportExists(id);
|
||||
// 删除
|
||||
skuServiceTransportMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateSkuServiceTransportExists(Long id) {
|
||||
if (skuServiceTransportMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.SKU_SERVICE_TRANSPORT_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkuServiceTransportDO getSkuServiceTransport(Long id) {
|
||||
return skuServiceTransportMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SkuServiceTransportDO> getSkuServiceTransportPage(SkuServiceTransportPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuServicesFormDO;
|
||||
import com.tashow.cloud.product.mapper.SkuServicesFormMapper;
|
||||
import com.tashow.cloud.product.service.SkuServicesFormService;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicesform.SkuServicesFormPageReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.skuservicesform.SkuServicesFormSaveReqVO;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 商品SKU扩展服务表单 Service 实现类
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Service
|
||||
@Validated
|
||||
public class SkuServicesFormServiceImpl implements SkuServicesFormService {
|
||||
|
||||
@Resource
|
||||
private SkuServicesFormMapper skuServicesFormMapper;
|
||||
|
||||
@Override
|
||||
public Long createSkuServicesForm(SkuServicesFormSaveReqVO createReqVO) {
|
||||
// 插入
|
||||
SkuServicesFormDO skuServicesForm = BeanUtils.toBean(createReqVO, SkuServicesFormDO.class);
|
||||
skuServicesFormMapper.insert(skuServicesForm);
|
||||
// 返回
|
||||
return skuServicesForm.getId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateSkuServicesForm(SkuServicesFormSaveReqVO updateReqVO) {
|
||||
// 校验存在
|
||||
validateSkuServicesFormExists(updateReqVO.getId());
|
||||
// 更新
|
||||
SkuServicesFormDO updateObj = BeanUtils.toBean(updateReqVO, SkuServicesFormDO.class);
|
||||
skuServicesFormMapper.updateById(updateObj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteSkuServicesForm(Long id) {
|
||||
// 校验存在
|
||||
validateSkuServicesFormExists(id);
|
||||
// 删除
|
||||
skuServicesFormMapper.deleteById(id);
|
||||
}
|
||||
|
||||
private void validateSkuServicesFormExists(Long id) {
|
||||
if (skuServicesFormMapper.selectById(id) == null) {
|
||||
throw exception(ErrorCodeConstants.SKU_SERVICES_FORM_NOT_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public SkuServicesFormDO getSkuServicesForm(Long id) {
|
||||
return skuServicesFormMapper.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<SkuServicesFormDO> getSkuServicesFormPage(SkuServicesFormPageReqVO pageReqVO) {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
--- #################### 注册中心 + 配置中心相关配置 ####################
|
||||
|
||||
spring:
|
||||
cloud:
|
||||
nacos:
|
||||
server-addr: 43.139.42.137:8848 # Nacos 服务器地址
|
||||
username: nacos # Nacos 账号
|
||||
password: nacos # Nacos 密码
|
||||
discovery: # 【配置中心】配置项
|
||||
namespace: 16bd40df-7cc7-4c2c-82c2-6186ade7bb08 # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
metadata:
|
||||
version: 1.0.0 # 服务实例的版本号,可用于灰度发布
|
||||
config: # 【注册中心】配置项
|
||||
namespace: 16bd40df-7cc7-4c2c-82c2-6186ade7bb08 # 命名空间。这里使用 dev 开发环境
|
||||
group: DEFAULT_GROUP # 使用的 Nacos 配置分组,默认为 DEFAULT_GROUP
|
||||
@@ -0,0 +1,12 @@
|
||||
server:
|
||||
port: 48083
|
||||
spring:
|
||||
application:
|
||||
name: product-server
|
||||
profiles:
|
||||
active: local
|
||||
config:
|
||||
import:
|
||||
- optional:classpath:application-${spring.profiles.active}.yaml # 加载【本地】配置
|
||||
- optional:nacos:application.yaml # 加载【Nacos】的配置
|
||||
- optional:nacos:${spring.application.name}-${spring.profiles.active}.yaml # 加载【Nacos】的配置
|
||||
@@ -0,0 +1,83 @@
|
||||
<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>
|
||||
|
||||
<settings>
|
||||
<!-- 开启自动映射 -->
|
||||
<setting name="autoMappingBehavior" value="FULL"/>
|
||||
<!-- 打印查询的 SQL -->
|
||||
<setting name="logImpl" value="STDOUT_LOGGING"/>
|
||||
</settings>
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,31 @@
|
||||
<?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/
|
||||
-->
|
||||
<select id="selectCategoryList" resultType="com.tashow.cloud.productapi.api.product.dto.CategoryDO">
|
||||
SELECT
|
||||
*
|
||||
FROM tz_category
|
||||
WHERE shop_id = #{shopId}
|
||||
<if test="grade != null">
|
||||
AND grade = #{grade}
|
||||
</if>
|
||||
<if test="categoryId != null">
|
||||
AND category_id = #{categoryId}
|
||||
</if>
|
||||
<if test="categoryName != null">
|
||||
and category_name LIKE CONCAT('%',#{categoryName},'%')
|
||||
</if>
|
||||
|
||||
<if test="status != null">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
ORDER BY sort ASC, create_time DESC
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -0,0 +1,15 @@
|
||||
<?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/
|
||||
-->
|
||||
|
||||
<delete id="deleteAdditionalFeeDates">
|
||||
delete from tz_prod_additional_fee_dates where prod_id = #{prodId} AND type = #{type}
|
||||
</delete>
|
||||
</mapper>
|
||||
@@ -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.ProdAdditionalFeePeriodsMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user