产品模块5
This commit is contained in:
@@ -14,4 +14,6 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode PROD_NOT_EXISTS = new ErrorCode(10002, "商品不存在");
|
||||
ErrorCode PROD_ADDITIONAL_FEE_DATES_NOT_EXISTS = new ErrorCode(10003, "特殊日期附加费用规则不存在");
|
||||
ErrorCode PROD_ADDITIONAL_FEE_PERIODS_NOT_EXISTS = new ErrorCode(10004, "特殊时段附加费用规则不存在");
|
||||
ErrorCode PROD_EMERGENCY_RESPONSE_NOT_EXISTS = new ErrorCode(10005, "商品紧急响应服务设置不存在");
|
||||
ErrorCode PROD_EMERGENCY_RESPONSE_INTERVALS_NOT_EXISTS = new ErrorCode(10006, "紧急响应时间区间设置不存在");
|
||||
}
|
||||
|
||||
@@ -0,0 +1,96 @@
|
||||
package com.tashow.cloud.product.controller;
|
||||
|
||||
import com.tashow.cloud.product.dto.ProdAdditionalFeePeriodsDO;
|
||||
import com.tashow.cloud.product.service.ProdAdditionalFeePeriodsService;
|
||||
import com.tashow.cloud.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsPageReqVO;
|
||||
import com.tashow.cloud.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsRespVO;
|
||||
import com.tashow.cloud.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 特殊时段附加费用规则")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-additional-fee-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,97 @@
|
||||
package com.tashow.cloud.product.controller;
|
||||
|
||||
import com.tashow.cloud.product.dto.ProdEmergencyResponseDO;
|
||||
import com.tashow.cloud.product.service.ProdEmergencyResponseService;
|
||||
import com.tashow.cloud.product.vo.prodemergencyresponse.ProdEmergencyResponsePageReqVO;
|
||||
import com.tashow.cloud.product.vo.prodemergencyresponse.ProdEmergencyResponseRespVO;
|
||||
import com.tashow.cloud.product.vo.prodemergencyresponse.ProdEmergencyResponseSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
|
||||
@Tag(name = "管理后台 - 商品紧急响应服务设置")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-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,96 @@
|
||||
package com.tashow.cloud.product.controller;
|
||||
|
||||
import com.tashow.cloud.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import com.tashow.cloud.product.service.ProdEmergencyResponseIntervalsService;
|
||||
import com.tashow.cloud.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsPageReqVO;
|
||||
import com.tashow.cloud.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsRespVO;
|
||||
import com.tashow.cloud.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsSaveReqVO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import jakarta.validation.constraints.*;
|
||||
import jakarta.validation.*;
|
||||
import jakarta.servlet.http.*;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import static com.tashow.cloud.common.pojo.CommonResult.success;
|
||||
|
||||
import com.tashow.cloud.excel.excel.core.util.ExcelUtils;
|
||||
|
||||
import com.tashow.cloud.web.apilog.core.annotation.ApiAccessLog;
|
||||
import static com.tashow.cloud.web.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
@Tag(name = "管理后台 - 紧急响应时间区间设置")
|
||||
@RestController
|
||||
@RequestMapping("/tz/prod-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,65 @@
|
||||
package com.tashow.cloud.product.dto;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 特殊时段附加费用规则 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_additional_fee_periods")
|
||||
@KeySequence("tz_prod_additional_fee_periods_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdAdditionalFeePeriodsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 特殊时段规则的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 特殊时段设置(JSON格式存储)
|
||||
*/
|
||||
private String specialTimeSlots;
|
||||
/**
|
||||
* 收费方式0:'固定金额',1:'基准价上浮'
|
||||
*/
|
||||
private Integer chargeMode;
|
||||
/**
|
||||
* 价格或上浮百分比
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 浮动百分比
|
||||
*/
|
||||
private BigDecimal floatingPercentage;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.tashow.cloud.product.dto;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 商品紧急响应服务设置 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_emergency_response")
|
||||
@KeySequence("tz_prod_emergency_response_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdEmergencyResponseDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 紧急响应服务配置的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 可响应时间段(JSON格式存储)
|
||||
*/
|
||||
private String responseTimeSlots;
|
||||
/**
|
||||
* 黑名自定义日期(JSON格式存储)
|
||||
*/
|
||||
private String blacklistedDates;
|
||||
/**
|
||||
* 黑名单指定日期(JSON格式存储)
|
||||
*/
|
||||
private String blackAppointDates;
|
||||
/**
|
||||
* 法定节假日是否开启0:关闭1开启
|
||||
*/
|
||||
private Boolean blackHappy;
|
||||
/**
|
||||
* 固定休息日周末是否开启0关闭1开启
|
||||
*/
|
||||
private Boolean blackWeekend;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
package com.tashow.cloud.product.dto;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 紧急响应时间区间设置 DO
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@TableName("tz_prod_emergency_response_intervals")
|
||||
@KeySequence("tz_prod_emergency_response_intervals_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class ProdEmergencyResponseIntervalsDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* 响应时间区间的唯一标识符
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的紧急响应服务配置ID
|
||||
*/
|
||||
private Long configId;
|
||||
/**
|
||||
* 响应模式名称
|
||||
*/
|
||||
private String modeName;
|
||||
/**
|
||||
* 响应时间(小时)
|
||||
*/
|
||||
private Integer responseHours;
|
||||
/**
|
||||
* 收费模式0:固定收费 1:浮动收费
|
||||
*/
|
||||
private Boolean chargeMode;
|
||||
/**
|
||||
* 浮动百分比
|
||||
*/
|
||||
private BigDecimal floatingPercentage;
|
||||
/**
|
||||
* 价格或上浮百分比
|
||||
*/
|
||||
private BigDecimal price;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private LocalDateTime createdAt;
|
||||
/**
|
||||
* 最后更新时间
|
||||
*/
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.tashow.cloud.product.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.mapper.BaseMapperX;
|
||||
import com.tashow.cloud.product.dto.ProdAdditionalFeePeriodsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 特殊时段附加费用规则 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdAdditionalFeePeriodsMapper extends BaseMapperX<ProdAdditionalFeePeriodsDO> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.tashow.cloud.product.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.mapper.BaseMapperX;
|
||||
import com.tashow.cloud.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 紧急响应时间区间设置 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdEmergencyResponseIntervalsMapper extends BaseMapperX<ProdEmergencyResponseIntervalsDO> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.tashow.cloud.product.mapper;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.mapper.BaseMapperX;
|
||||
import com.tashow.cloud.product.dto.ProdEmergencyResponseDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 商品紧急响应服务设置 Mapper
|
||||
*
|
||||
* @author 芋道源码
|
||||
*/
|
||||
@Mapper
|
||||
public interface ProdEmergencyResponseMapper extends BaseMapperX<ProdEmergencyResponseDO> {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.tashow.cloud.product.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.tashow.cloud.product.dto.ProdAdditionalFeePeriodsDO;
|
||||
import com.tashow.cloud.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsPageReqVO;
|
||||
import com.tashow.cloud.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.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import com.tashow.cloud.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsPageReqVO;
|
||||
import com.tashow.cloud.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.product.dto.ProdEmergencyResponseDO;
|
||||
import com.tashow.cloud.product.vo.prodemergencyresponse.ProdEmergencyResponsePageReqVO;
|
||||
import com.tashow.cloud.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,76 @@
|
||||
package com.tashow.cloud.product.service.impl;
|
||||
|
||||
import com.tashow.cloud.product.dto.ProdAdditionalFeePeriodsDO;
|
||||
import com.tashow.cloud.product.mapper.ProdAdditionalFeePeriodsMapper;
|
||||
import com.tashow.cloud.product.service.ProdAdditionalFeePeriodsService;
|
||||
import com.tashow.cloud.product.vo.prodadditionalfeeperiods.ProdAdditionalFeePeriodsPageReqVO;
|
||||
import com.tashow.cloud.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.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import com.tashow.cloud.product.mapper.ProdEmergencyResponseIntervalsMapper;
|
||||
import com.tashow.cloud.product.service.ProdEmergencyResponseIntervalsService;
|
||||
import com.tashow.cloud.product.vo.prodemergencyresponseintervals.ProdEmergencyResponseIntervalsPageReqVO;
|
||||
import com.tashow.cloud.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.product.dto.ProdEmergencyResponseDO;
|
||||
import com.tashow.cloud.product.mapper.ProdEmergencyResponseMapper;
|
||||
import com.tashow.cloud.product.service.ProdEmergencyResponseService;
|
||||
import com.tashow.cloud.product.vo.prodemergencyresponse.ProdEmergencyResponsePageReqVO;
|
||||
import com.tashow.cloud.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,43 @@
|
||||
package com.tashow.cloud.product.vo.prodadditionalfeeperiods;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 特殊时段附加费用规则分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdAdditionalFeePeriodsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "商品ID", example = "11100")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "名称", example = "张三")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "特殊时段设置(JSON格式存储)")
|
||||
private String specialTimeSlots;
|
||||
|
||||
@Schema(description = "收费方式0:'固定金额',1:'基准价上浮'")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "20834")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.tashow.cloud.product.vo.prodadditionalfeeperiods;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 特殊时段附加费用规则 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdAdditionalFeePeriodsRespVO {
|
||||
|
||||
@Schema(description = "特殊时段规则的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "24746")
|
||||
@ExcelProperty("特殊时段规则的唯一标识符")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11100")
|
||||
@ExcelProperty("商品ID")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "特殊时段设置(JSON格式存储)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("特殊时段设置(JSON格式存储)")
|
||||
private String specialTimeSlots;
|
||||
|
||||
@Schema(description = "收费方式0:'固定金额',1:'基准价上浮'", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收费方式0:'固定金额',1:'基准价上浮'")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "20834")
|
||||
@ExcelProperty("价格或上浮百分比")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
@ExcelProperty("浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.tashow.cloud.product.vo.prodadditionalfeeperiods;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 特殊时段附加费用规则新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdAdditionalFeePeriodsSaveReqVO {
|
||||
|
||||
@Schema(description = "特殊时段规则的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "24746")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "11100")
|
||||
@NotNull(message = "商品ID不能为空")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "张三")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "特殊时段设置(JSON格式存储)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotEmpty(message = "特殊时段设置(JSON格式存储)不能为空")
|
||||
private String specialTimeSlots;
|
||||
|
||||
@Schema(description = "收费方式0:'固定金额',1:'基准价上浮'", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "收费方式0:'固定金额',1:'基准价上浮'不能为空")
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "20834")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tashow.cloud.product.vo.prodemergencyresponse;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 商品紧急响应服务设置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdEmergencyResponsePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "关联的商品ID", example = "29152")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "可响应时间段(JSON格式存储)")
|
||||
private String responseTimeSlots;
|
||||
|
||||
@Schema(description = "黑名自定义日期(JSON格式存储)")
|
||||
private String blacklistedDates;
|
||||
|
||||
@Schema(description = "黑名单指定日期(JSON格式存储)")
|
||||
private String blackAppointDates;
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
private Boolean blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
private Boolean blackWeekend;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.tashow.cloud.product.vo.prodemergencyresponse;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 商品紧急响应服务设置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdEmergencyResponseRespVO {
|
||||
|
||||
@Schema(description = "紧急响应服务配置的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "7448")
|
||||
@ExcelProperty("紧急响应服务配置的唯一标识符")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29152")
|
||||
@ExcelProperty("关联的商品ID")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "可响应时间段(JSON格式存储)")
|
||||
@ExcelProperty("可响应时间段(JSON格式存储)")
|
||||
private String responseTimeSlots;
|
||||
|
||||
@Schema(description = "黑名自定义日期(JSON格式存储)")
|
||||
@ExcelProperty("黑名自定义日期(JSON格式存储)")
|
||||
private String blacklistedDates;
|
||||
|
||||
@Schema(description = "黑名单指定日期(JSON格式存储)")
|
||||
@ExcelProperty("黑名单指定日期(JSON格式存储)")
|
||||
private String blackAppointDates;
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
@ExcelProperty("法定节假日是否开启0:关闭1开启")
|
||||
private Boolean blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
@ExcelProperty("固定休息日周末是否开启0关闭1开启")
|
||||
private Boolean blackWeekend;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
@ExcelProperty("更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package com.tashow.cloud.product.vo.prodemergencyresponse;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 商品紧急响应服务设置新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdEmergencyResponseSaveReqVO {
|
||||
|
||||
@Schema(description = "紧急响应服务配置的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "7448")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "29152")
|
||||
@NotNull(message = "关联的商品ID不能为空")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "可响应时间段(JSON格式存储)")
|
||||
private String responseTimeSlots;
|
||||
|
||||
@Schema(description = "黑名自定义日期(JSON格式存储)")
|
||||
private String blacklistedDates;
|
||||
|
||||
@Schema(description = "黑名单指定日期(JSON格式存储)")
|
||||
private String blackAppointDates;
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
private Boolean blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
private Boolean blackWeekend;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
package com.tashow.cloud.product.vo.prodemergencyresponseintervals;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.tashow.cloud.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.tashow.cloud.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 紧急响应时间区间设置分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ProdEmergencyResponseIntervalsPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "关联的紧急响应服务配置ID", example = "5737")
|
||||
private Long configId;
|
||||
|
||||
@Schema(description = "响应模式名称", example = "王五")
|
||||
private String modeName;
|
||||
|
||||
@Schema(description = "响应时间(小时)")
|
||||
private Integer responseHours;
|
||||
|
||||
@Schema(description = "收费模式0:固定收费 1:浮动收费")
|
||||
private Boolean chargeMode;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17810")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
package com.tashow.cloud.product.vo.prodemergencyresponseintervals;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 紧急响应时间区间设置 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdEmergencyResponseIntervalsRespVO {
|
||||
|
||||
@Schema(description = "响应时间区间的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "29650")
|
||||
@ExcelProperty("响应时间区间的唯一标识符")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的紧急响应服务配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5737")
|
||||
@ExcelProperty("关联的紧急响应服务配置ID")
|
||||
private Long configId;
|
||||
|
||||
@Schema(description = "响应模式名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@ExcelProperty("响应模式名称")
|
||||
private String modeName;
|
||||
|
||||
@Schema(description = "响应时间(小时)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("响应时间(小时)")
|
||||
private Integer responseHours;
|
||||
|
||||
@Schema(description = "收费模式0:固定收费 1:浮动收费", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收费模式0:固定收费 1:浮动收费")
|
||||
private Boolean chargeMode;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
@ExcelProperty("浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17810")
|
||||
@ExcelProperty("价格或上浮百分比")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "最后更新时间")
|
||||
@ExcelProperty("最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.tashow.cloud.product.vo.prodemergencyresponseintervals;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import jakarta.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Schema(description = "管理后台 - 紧急响应时间区间设置新增/修改 Request VO")
|
||||
@Data
|
||||
public class ProdEmergencyResponseIntervalsSaveReqVO {
|
||||
|
||||
@Schema(description = "响应时间区间的唯一标识符", requiredMode = Schema.RequiredMode.REQUIRED, example = "29650")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "关联的紧急响应服务配置ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "5737")
|
||||
@NotNull(message = "关联的紧急响应服务配置ID不能为空")
|
||||
private Long configId;
|
||||
|
||||
@Schema(description = "响应模式名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "王五")
|
||||
@NotEmpty(message = "响应模式名称不能为空")
|
||||
private String modeName;
|
||||
|
||||
@Schema(description = "响应时间(小时)", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "响应时间(小时)不能为空")
|
||||
private Integer responseHours;
|
||||
|
||||
@Schema(description = "收费模式0:固定收费 1:浮动收费", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "收费模式0:固定收费 1:浮动收费不能为空")
|
||||
private Boolean chargeMode;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@Schema(description = "价格或上浮百分比", example = "17810")
|
||||
private BigDecimal price;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@Schema(description = "最后更新时间")
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
}
|
||||
@@ -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>
|
||||
@@ -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.ProdEmergencyResponseMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user