商品服务查询
This commit is contained in:
@@ -58,8 +58,14 @@ public class ProdController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@GetMapping("/get")
|
||||
@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")
|
||||
|
||||
@@ -39,7 +39,7 @@ public class ProdAdditionalFeeDatesDO extends BaseDO {
|
||||
/**
|
||||
* 日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'
|
||||
*/
|
||||
private Boolean dateType;
|
||||
private Integer dateType;
|
||||
/**
|
||||
* 自定义日期时间段(JSON格式存储)
|
||||
*/
|
||||
|
||||
@@ -46,10 +46,10 @@ public class ProdEmergencyResponseDO extends BaseDO {
|
||||
/**
|
||||
* 法定节假日是否开启0:关闭1开启
|
||||
*/
|
||||
private Boolean blackHappy;
|
||||
private Integer blackHappy;
|
||||
/**
|
||||
* 固定休息日周末是否开启0关闭1开启
|
||||
*/
|
||||
private Boolean blackWeekend;
|
||||
private Integer blackWeekend;
|
||||
|
||||
}
|
||||
@@ -44,7 +44,7 @@ public class ProdEmergencyResponseIntervalsDO extends BaseDO {
|
||||
/**
|
||||
* 收费模式0:固定收费 1:浮动收费
|
||||
*/
|
||||
private Boolean chargeMode;
|
||||
private Integer chargeMode;
|
||||
/**
|
||||
* 浮动百分比
|
||||
*/
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ProdPropDO{
|
||||
/**
|
||||
* 是否删除0否1是
|
||||
*/
|
||||
private Boolean isDelete;
|
||||
private Integer isDelete;
|
||||
/**
|
||||
* 属性值
|
||||
*/
|
||||
|
||||
@@ -35,6 +35,6 @@ public class ProdPropValueDO {
|
||||
/**
|
||||
* 是否删除0否1是
|
||||
*/
|
||||
private Boolean isDelete;
|
||||
private Integer isDelete;
|
||||
|
||||
}
|
||||
@@ -35,7 +35,7 @@ public class ProdServiceOverAreaRulesDO extends BaseDO {
|
||||
/**
|
||||
* 超区规则类型(0:拒单、2:接单并收取超区费、3:接单并免超区费)
|
||||
*/
|
||||
private Boolean ruleType;
|
||||
private Integer ruleType;
|
||||
/**
|
||||
* 超区费用(仅在rule_type为accept_with_fee时有效)
|
||||
*/
|
||||
|
||||
@@ -34,7 +34,7 @@ public class ProductOrderLimitDO extends BaseDO {
|
||||
/**
|
||||
* 限制单位'0:按自然天',1:'按自然周',2:'按自然月'
|
||||
*/
|
||||
private Boolean limitUnit;
|
||||
private Integer limitUnit;
|
||||
/**
|
||||
* 上限阈值
|
||||
*/
|
||||
|
||||
@@ -87,7 +87,7 @@ public class SkuDO extends BaseDO {
|
||||
/**
|
||||
* 库存扣款时机0:付款扣1:下单扣
|
||||
*/
|
||||
private Boolean stocksType;
|
||||
private Integer stocksType;
|
||||
/**
|
||||
* sku编码
|
||||
*/
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SkuServiceDeliverDO extends BaseDO {
|
||||
/**
|
||||
* 交互方式0:快递物流 1:到店自提 2:商家自送
|
||||
*/
|
||||
private Boolean type;
|
||||
private Integer type;
|
||||
/**
|
||||
* 价格
|
||||
*/
|
||||
@@ -43,7 +43,7 @@ public class SkuServiceDeliverDO extends BaseDO {
|
||||
/**
|
||||
* 是否收费0:免费1收费
|
||||
*/
|
||||
private Boolean isCharge;
|
||||
private Integer isCharge;
|
||||
/**
|
||||
* 详细地址
|
||||
*/
|
||||
|
||||
@@ -42,7 +42,7 @@ public class SkuServicesFormDO extends BaseDO {
|
||||
/**
|
||||
* 是否启用该服务
|
||||
*/
|
||||
private Boolean isEnabled;
|
||||
private Integer isEnabled;
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
||||
@@ -7,9 +7,14 @@ 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.product.dto.ProdDO;
|
||||
import com.tashow.cloud.product.dto.*;
|
||||
import com.tashow.cloud.product.vo.prod.ProdPageReqVO;
|
||||
import com.tashow.cloud.product.vo.prod.ProdServiceVO;
|
||||
import com.tashow.cloud.product.vo.prodemergencyresponse.ProdEmergencyInfoVO;
|
||||
import com.tashow.cloud.product.vo.prodserviceareas.ProdServiceAreasInfoVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 商品 Mapper
|
||||
@@ -21,4 +26,13 @@ public interface ProdMapper extends BaseMapperX<ProdDO> {
|
||||
|
||||
IPage<ProdDO> getProdPageList(Page<?> page, ProdPageReqVO reqVO);
|
||||
|
||||
ProdServiceVO selectProdService(@Param("prodId") Long prodId
|
||||
,@Param("regionSwitch") Integer regionSwitch
|
||||
,@Param("reservationSwitch") Integer reservationSwitch
|
||||
,@Param("emergencySwitch") Integer emergencySwitch
|
||||
,@Param("orderLimitSwitch") Integer orderLimitSwitch
|
||||
,@Param("additionalSwitch") Integer additionalSwitch
|
||||
,@Param("additionalFeeSwitch") Integer additionalFeeSwitch
|
||||
,@Param("weightSwitch") Integer weightSwitch
|
||||
);
|
||||
}
|
||||
@@ -50,7 +50,7 @@ public interface ProdService {
|
||||
* @param prodId 商品id
|
||||
* @return 编号
|
||||
*/
|
||||
ProdServiceVO getProdService(@Valid Integer prodId);
|
||||
ProdServiceVO getProdService(@Valid Long prodId);
|
||||
|
||||
/**
|
||||
* 更新商品
|
||||
|
||||
@@ -92,7 +92,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
if(Objects.equals(prodServiceVO.getRegionSwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
prodDO.setRegionSwitch(BaseEnum.YES_ONE.getKey());
|
||||
//保存区域设置信息
|
||||
ProdServiceOverAreaRulesDO prodServiceOverAreaRules =prodServiceVO.getProdServiceAreasInfo().getOverAreaRules();
|
||||
ProdServiceOverAreaRulesDO prodServiceOverAreaRules = BeanUtils.toBean(prodServiceVO.getProdServiceAreasInfo(), ProdServiceOverAreaRulesDO.class);
|
||||
prodServiceOverAreaRules.setProdId(prodDO.getProdId());
|
||||
prodServiceOverAreaRulesMapper.insert(prodServiceOverAreaRules);
|
||||
//保存区域
|
||||
@@ -121,7 +121,8 @@ public class ProdServiceImpl implements ProdService {
|
||||
//紧急响应设置
|
||||
if(Objects.equals(prodServiceVO.getEmergencySwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
prodDO.setEmergencySwitch(BaseEnum.YES_ONE.getKey());
|
||||
ProdEmergencyResponseDO prodEmergencyResponse = prodServiceVO.prodEmergencyInfoVO.getProdEmergencyResponse();
|
||||
// 插入
|
||||
ProdEmergencyResponseDO prodEmergencyResponse = BeanUtils.toBean(prodServiceVO.prodEmergencyInfoVO, ProdEmergencyResponseDO.class);
|
||||
prodEmergencyResponse.setProdId(prodDO.getProdId());
|
||||
prodEmergencyResponseMapper.insert(prodEmergencyResponse);
|
||||
for (ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals : prodServiceVO.prodEmergencyInfoVO.getProdEmergencyResponseIntervalsList()){
|
||||
@@ -132,7 +133,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
//接单上线设置
|
||||
if(Objects.equals(prodServiceVO.getOrderLimitSwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
prodDO.setOrderLimitSwitch(BaseEnum.YES_ONE.getKey());
|
||||
ProductOrderLimitDO productOrderLimit = prodServiceVO.ProductOrderLimitVO;
|
||||
ProductOrderLimitDO productOrderLimit = prodServiceVO.productOrderLimitVO;
|
||||
productOrderLimit.setProdId(prodDO.getProdId());
|
||||
productOrderLimitMapper.insert(productOrderLimit);
|
||||
}
|
||||
@@ -171,7 +172,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
if(Objects.equals(prodServiceVO.getRegionSwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
|
||||
//保存区域设置信息
|
||||
ProdServiceOverAreaRulesDO prodServiceOverAreaRules =prodServiceVO.getProdServiceAreasInfo().getOverAreaRules();
|
||||
ProdServiceOverAreaRulesDO prodServiceOverAreaRules = BeanUtils.toBean(prodServiceVO.getProdServiceAreasInfo(), ProdServiceOverAreaRulesDO.class);
|
||||
prodServiceOverAreaRules.setProdId(prodServiceVO.getProdId());
|
||||
prodServiceOverAreaRulesMapper.updateById(prodServiceOverAreaRules);
|
||||
//先批量删除区域关联表
|
||||
@@ -198,7 +199,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
}
|
||||
//紧急响应设置
|
||||
if(Objects.equals(prodServiceVO.getEmergencySwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
ProdEmergencyResponseDO prodEmergencyResponse = prodServiceVO.prodEmergencyInfoVO.getProdEmergencyResponse();
|
||||
ProdEmergencyResponseDO prodEmergencyResponse = BeanUtils.toBean(prodServiceVO.prodEmergencyInfoVO, ProdEmergencyResponseDO.class);
|
||||
if(prodEmergencyResponse!=null){
|
||||
prodEmergencyResponseMapper.updateById(prodEmergencyResponse);
|
||||
prodEmergencyResponseIntervalsMapper.deleteIntervals(prodEmergencyResponse.getId());
|
||||
@@ -211,7 +212,7 @@ public class ProdServiceImpl implements ProdService {
|
||||
}
|
||||
//接单上线设置
|
||||
if(Objects.equals(prodServiceVO.getOrderLimitSwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
productOrderLimitMapper.updateById(prodServiceVO.ProductOrderLimitVO);
|
||||
productOrderLimitMapper.updateById(prodServiceVO.productOrderLimitVO);
|
||||
}
|
||||
//特殊时段设置
|
||||
if(Objects.equals(prodServiceVO.getAdditionalSwitch(),BaseEnum.YES_ONE.getKey())){
|
||||
@@ -233,8 +234,11 @@ public class ProdServiceImpl implements ProdService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProdServiceVO getProdService(Integer prodId) {
|
||||
return null;
|
||||
public ProdServiceVO getProdService(Long prodId) {
|
||||
ProdDO prodDO = prodMapper.selectById(prodId);
|
||||
return prodMapper.selectProdService(prodDO.getProdId(),prodDO.getRegionSwitch(),
|
||||
prodDO.getReservationSwitch(),prodDO.getEmergencySwitch(),prodDO.getOrderLimitSwitch(),
|
||||
prodDO.getAdditionalSwitch(),prodDO.getAdditionalFeeSwitch(),prodDO.getWeightSwitch());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -80,25 +80,25 @@ public class ProdPageReqVO extends PageParam {
|
||||
private String shareContent;
|
||||
|
||||
@Schema(description = "是否开启区域0关1开")
|
||||
private Boolean regionSwitch;
|
||||
private Integer regionSwitch;
|
||||
|
||||
@Schema(description = "是否特殊时段0关1开")
|
||||
private Boolean additionalSwitch;
|
||||
private Integer additionalSwitch;
|
||||
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开")
|
||||
private Boolean additionalFeeSwitch;
|
||||
private Integer additionalFeeSwitch;
|
||||
|
||||
@Schema(description = "是否紧急响应服务0关1开")
|
||||
private Boolean emergencySwitch;
|
||||
private Integer emergencySwitch;
|
||||
|
||||
@Schema(description = "是否预约0关1开")
|
||||
private Boolean reservationSwitch;
|
||||
private Integer reservationSwitch;
|
||||
|
||||
@Schema(description = "是否接单上线0关1开")
|
||||
private Boolean orderLimitSwitch;
|
||||
private Integer orderLimitSwitch;
|
||||
|
||||
@Schema(description = "是否开启体重配置0关1开")
|
||||
private Boolean weightSwitch;
|
||||
private Integer weightSwitch;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
|
||||
@@ -96,31 +96,31 @@ public class ProdRespVO {
|
||||
|
||||
@Schema(description = "是否开启区域0关1开")
|
||||
@ExcelProperty("是否开启区域0关1开")
|
||||
private Boolean regionSwitch;
|
||||
private Integer regionSwitch;
|
||||
|
||||
@Schema(description = "是否特殊时段0关1开")
|
||||
@ExcelProperty("是否特殊时段0关1开")
|
||||
private Boolean additionalSwitch;
|
||||
private Integer additionalSwitch;
|
||||
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开")
|
||||
@ExcelProperty("是否特殊日期(节假日周末什么的)0关1开")
|
||||
private Boolean additionalFeeSwitch;
|
||||
private Integer additionalFeeSwitch;
|
||||
|
||||
@Schema(description = "是否紧急响应服务0关1开")
|
||||
@ExcelProperty("是否紧急响应服务0关1开")
|
||||
private Boolean emergencySwitch;
|
||||
private Integer emergencySwitch;
|
||||
|
||||
@Schema(description = "是否预约0关1开")
|
||||
@ExcelProperty("是否预约0关1开")
|
||||
private Boolean reservationSwitch;
|
||||
private Integer reservationSwitch;
|
||||
|
||||
@Schema(description = "是否接单上线0关1开")
|
||||
@ExcelProperty("是否接单上线0关1开")
|
||||
private Boolean orderLimitSwitch;
|
||||
private Integer orderLimitSwitch;
|
||||
|
||||
@Schema(description = "是否开启体重配置0关1开")
|
||||
@ExcelProperty("是否开启体重配置0关1开")
|
||||
private Boolean weightSwitch;
|
||||
private Integer weightSwitch;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
|
||||
@@ -80,25 +80,25 @@ public class ProdSaveReqVO {
|
||||
private String shareContent;
|
||||
|
||||
@Schema(description = "是否开启区域0关1开")
|
||||
private Boolean regionSwitch;
|
||||
private Integer regionSwitch;
|
||||
|
||||
@Schema(description = "是否特殊时段0关1开")
|
||||
private Boolean additionalSwitch;
|
||||
private Integer additionalSwitch;
|
||||
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开")
|
||||
private Boolean additionalFeeSwitch;
|
||||
private Integer additionalFeeSwitch;
|
||||
|
||||
@Schema(description = "是否紧急响应服务0关1开")
|
||||
private Boolean emergencySwitch;
|
||||
private Integer emergencySwitch;
|
||||
|
||||
@Schema(description = "是否预约0关1开")
|
||||
private Boolean reservationSwitch;
|
||||
private Integer reservationSwitch;
|
||||
|
||||
@Schema(description = "是否接单上线0关1开")
|
||||
private Boolean orderLimitSwitch;
|
||||
private Integer orderLimitSwitch;
|
||||
|
||||
@Schema(description = "是否开启体重配置0关1开")
|
||||
private Boolean weightSwitch;
|
||||
private Integer weightSwitch;
|
||||
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
@@ -13,7 +13,6 @@ import java.util.List;
|
||||
|
||||
@Schema(description = "商品服务配置 VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdServiceVO {
|
||||
|
||||
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6943")
|
||||
@@ -21,46 +20,39 @@ public class ProdServiceVO {
|
||||
|
||||
|
||||
@Schema(description = "是否开启服务区域配置0关1开")
|
||||
@ExcelProperty("是否开启区域0关1开")
|
||||
private Integer regionSwitch;
|
||||
@Schema(description = "服务区域配置")
|
||||
public ProdServiceAreasInfoVO prodServiceAreasInfo;
|
||||
|
||||
|
||||
@Schema(description = "是否预约0关1开")
|
||||
@ExcelProperty("是否预约0关1开")
|
||||
private Integer reservationSwitch;
|
||||
@Schema(description = "预约配置")
|
||||
public ProdReservationConfigDO prodReservationConfig;
|
||||
|
||||
@Schema(description = "是否紧急响应服务0关1开")
|
||||
@ExcelProperty("是否紧急响应服务0关1开")
|
||||
private Integer emergencySwitch;
|
||||
@Schema(description = "急响应服务配置")
|
||||
public ProdEmergencyInfoVO prodEmergencyInfoVO;
|
||||
|
||||
@Schema(description = "是否接单上线0关1开")
|
||||
@ExcelProperty("是否接单上线0关1开")
|
||||
private Integer orderLimitSwitch;
|
||||
@Schema(description = "接单上线配置")
|
||||
public ProductOrderLimitDO ProductOrderLimitVO;
|
||||
public ProductOrderLimitDO productOrderLimitVO;
|
||||
|
||||
|
||||
@Schema(description = "是否特殊时段0关1开")
|
||||
@ExcelProperty("是否特殊时段0关1开")
|
||||
private Integer additionalSwitch;
|
||||
@Schema(description = "特殊时段规则配置")
|
||||
public List<ProdAdditionalFeeDatesDO> ProdAdditionalFeeDatesList;
|
||||
public List<ProdAdditionalFeeDatesDO> prodAdditionalFeeDatesList;
|
||||
|
||||
@Schema(description = "是否特殊日期(节假日周末什么的)0关1开")
|
||||
@ExcelProperty("是否特殊日期(节假日周末什么的)0关1开")
|
||||
private Integer additionalFeeSwitch;
|
||||
@Schema(description = "特殊日期规则配置")
|
||||
public List<ProdAdditionalFeePeriodsDO> prodAdditionalFeePeriodsList;
|
||||
|
||||
|
||||
@Schema(description = "是否开启体重配置0关1开")
|
||||
@ExcelProperty("是否开启体重配置0关1开")
|
||||
private Integer weightSwitch;
|
||||
@Schema(description = "体重配置")
|
||||
public ProdWeightRangePricesDO prodWeightConfig;
|
||||
|
||||
@@ -23,7 +23,7 @@ public class ProdAdditionalFeeDatesPageReqVO extends PageParam {
|
||||
private String name;
|
||||
|
||||
@Schema(description = "日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'", example = "2")
|
||||
private Boolean dateType;
|
||||
private Integer dateType;
|
||||
|
||||
@Schema(description = "自定义日期时间段(JSON格式存储)")
|
||||
private String customTimeSlots;
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ProdAdditionalFeeDatesRespVO {
|
||||
|
||||
@Schema(description = "日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@ExcelProperty("日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'")
|
||||
private Boolean dateType;
|
||||
private Integer dateType;
|
||||
|
||||
@Schema(description = "自定义日期时间段(JSON格式存储)")
|
||||
@ExcelProperty("自定义日期时间段(JSON格式存储)")
|
||||
|
||||
@@ -25,7 +25,7 @@ public class ProdAdditionalFeeDatesSaveReqVO {
|
||||
|
||||
@Schema(description = "日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'", requiredMode = Schema.RequiredMode.REQUIRED, example = "2")
|
||||
@NotNull(message = "日期类型0:'自定义日期范围':1:'指定日期':2:'法定节假日',3:'固定休息日'不能为空")
|
||||
private Boolean dateType;
|
||||
private Integer dateType;
|
||||
|
||||
@Schema(description = "自定义日期时间段(JSON格式存储)")
|
||||
private String customTimeSlots;
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.tashow.cloud.product.vo.prodemergencyresponse;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.tashow.cloud.product.dto.ProdEmergencyResponseDO;
|
||||
import com.tashow.cloud.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
@@ -15,10 +16,39 @@ import java.util.List;
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdEmergencyInfoVO {
|
||||
|
||||
@Schema(description = "紧急响应服务配置")
|
||||
private ProdEmergencyResponseDO prodEmergencyResponse;
|
||||
|
||||
/**
|
||||
* 紧急响应服务配置的唯一标识符
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 可响应时间段(JSON格式存储)
|
||||
*/
|
||||
private String responseTimeSlots;
|
||||
/**
|
||||
* 黑名自定义日期(JSON格式存储)
|
||||
*/
|
||||
private String blacklistedDates;
|
||||
/**
|
||||
* 黑名单指定日期(JSON格式存储)
|
||||
*/
|
||||
private String blackAppointDates;
|
||||
/**
|
||||
* 法定节假日是否开启0:关闭1开启
|
||||
*/
|
||||
private Integer blackHappy;
|
||||
/**
|
||||
* 固定休息日周末是否开启0关闭1开启
|
||||
*/
|
||||
private Integer blackWeekend;
|
||||
|
||||
|
||||
|
||||
@Schema(description = "紧急响应时间区间设置")
|
||||
private List<ProdEmergencyResponseIntervalsDO> prodEmergencyResponseIntervalsList;
|
||||
public List<ProdEmergencyResponseIntervalsDO> prodEmergencyResponseIntervalsList;
|
||||
|
||||
}
|
||||
@@ -28,10 +28,10 @@ public class ProdEmergencyResponsePageReqVO extends PageParam {
|
||||
private String blackAppointDates;
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
private Boolean blackHappy;
|
||||
private Integer blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
private Boolean blackWeekend;
|
||||
private Integer blackWeekend;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@@ -34,11 +34,11 @@ public class ProdEmergencyResponseRespVO {
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
@ExcelProperty("法定节假日是否开启0:关闭1开启")
|
||||
private Boolean blackHappy;
|
||||
private Integer blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
@ExcelProperty("固定休息日周末是否开启0关闭1开启")
|
||||
private Boolean blackWeekend;
|
||||
private Integer blackWeekend;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
|
||||
@@ -28,10 +28,10 @@ public class ProdEmergencyResponseSaveReqVO {
|
||||
private String blackAppointDates;
|
||||
|
||||
@Schema(description = "法定节假日是否开启0:关闭1开启")
|
||||
private Boolean blackHappy;
|
||||
private Integer blackHappy;
|
||||
|
||||
@Schema(description = "固定休息日周末是否开启0关闭1开启")
|
||||
private Boolean blackWeekend;
|
||||
private Integer blackWeekend;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createdAt;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class ProdEmergencyResponseIntervalsPageReqVO extends PageParam {
|
||||
private Integer responseHours;
|
||||
|
||||
@Schema(description = "收费模式0:固定收费 1:浮动收费")
|
||||
private Boolean chargeMode;
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@@ -31,7 +31,7 @@ public class ProdEmergencyResponseIntervalsRespVO {
|
||||
|
||||
@Schema(description = "收费模式0:固定收费 1:浮动收费", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("收费模式0:固定收费 1:浮动收费")
|
||||
private Boolean chargeMode;
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
@ExcelProperty("浮动百分比")
|
||||
|
||||
@@ -29,7 +29,7 @@ public class ProdEmergencyResponseIntervalsSaveReqVO {
|
||||
|
||||
@Schema(description = "收费模式0:固定收费 1:浮动收费", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "收费模式0:固定收费 1:浮动收费不能为空")
|
||||
private Boolean chargeMode;
|
||||
private Integer chargeMode;
|
||||
|
||||
@Schema(description = "浮动百分比")
|
||||
private BigDecimal floatingPercentage;
|
||||
|
||||
@@ -24,6 +24,6 @@ public class ProdPropPageReqVO extends PageParam {
|
||||
private Integer prodId;
|
||||
|
||||
@Schema(description = "是否删除0否1是")
|
||||
private Boolean isDelete;
|
||||
private Integer isDelete;
|
||||
|
||||
}
|
||||
@@ -32,6 +32,6 @@ public class ProdPropRespVO {
|
||||
|
||||
@Schema(description = "是否删除0否1是")
|
||||
@ExcelProperty("是否删除0否1是")
|
||||
private Boolean isDelete;
|
||||
private Integer isDelete;
|
||||
|
||||
}
|
||||
@@ -27,7 +27,7 @@ public class ProdPropSaveReqVO {
|
||||
private Integer prodId;
|
||||
|
||||
@Schema(description = "是否删除0否1是")
|
||||
private Boolean isDelete;
|
||||
private Integer isDelete;
|
||||
|
||||
/**
|
||||
* 属性值
|
||||
|
||||
@@ -18,6 +18,6 @@ public class ProdPropValuePageReqVO extends PageParam {
|
||||
private Long propId;
|
||||
|
||||
@Schema(description = "是否删除0否1是")
|
||||
private Boolean isDelete;
|
||||
private Integer isDelete;
|
||||
|
||||
}
|
||||
@@ -2,11 +2,13 @@ package com.tashow.cloud.product.vo.prodserviceareas;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.tashow.cloud.product.dto.ProdServiceOverAreaRulesDO;
|
||||
import com.tashow.cloud.product.vo.prodserviceoverarearules.ProdServiceOverAreaRulesRespVO;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@@ -15,9 +17,25 @@ import java.util.List;
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ProdServiceAreasInfoVO {
|
||||
|
||||
/**
|
||||
* 超区规则的唯一标识符
|
||||
*/
|
||||
private Long id;
|
||||
/**
|
||||
* 关联的商品ID
|
||||
*/
|
||||
private Long prodId;
|
||||
/**
|
||||
* 超区规则类型(0:拒单、2:接单并收取超区费、3:接单并免超区费)
|
||||
*/
|
||||
private Integer ruleType;
|
||||
/**
|
||||
* 超区费用(仅在rule_type为accept_with_fee时有效)
|
||||
*/
|
||||
private BigDecimal fee;
|
||||
|
||||
|
||||
@Schema(description = "服务区域地址名称")
|
||||
private List<String> areaNameList;
|
||||
|
||||
public ProdServiceOverAreaRulesDO overAreaRules;
|
||||
|
||||
}
|
||||
@@ -8,7 +8,260 @@
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
<!-- 结果映射:将数据库查询结果映射到 ProdServiceVO -->
|
||||
<resultMap id="ProdServiceResultMap" type="com.tashow.cloud.product.vo.prod.ProdServiceVO"> <!-- 确保这是 ProdServiceVO 的正确包名 -->
|
||||
<!-- 商品基本信息映射 -->
|
||||
<id property="prodId" column="prod_id"/>
|
||||
<result property="regionSwitch" column="region_switch"/>
|
||||
<result property="additionalSwitch" column="additional_switch"/>
|
||||
<result property="additionalFeeSwitch" column="additional_fee_switch"/>
|
||||
<result property="emergencySwitch" column="emergency_switch"/>
|
||||
<result property="reservationSwitch" column="reservation_switch"/>
|
||||
<result property="orderLimitSwitch" column="order_limit_switch"/>
|
||||
<result property="weightSwitch" column="weight_switch"/>
|
||||
|
||||
<!-- 关联紧急响应配置 -->
|
||||
<association property="prodEmergencyInfoVO" javaType="com.tashow.cloud.product.vo.prodemergencyresponse.ProdEmergencyInfoVO">
|
||||
<id property="id" column="erc_record_id"/>
|
||||
<result property="prodId" column="erc_prod_id"/>
|
||||
<result property="responseTimeSlots" column="response_time_slots"/>
|
||||
<result property="blacklistedDates" column="blacklisted_dates"/>
|
||||
<result property="blackAppointDates" column="black_appoint_dates"/>
|
||||
<result property="blackHappy" column="black_happy"/>
|
||||
<result property="blackWeekend" column="black_weekend"/>
|
||||
<!-- 嵌套集合:紧急响应时间区间 -->
|
||||
<collection property="prodEmergencyResponseIntervalsList" ofType="com.tashow.cloud.product.dto.ProdEmergencyResponseIntervalsDO">
|
||||
<id property="id" column="eri_record_id"/>
|
||||
<result property="configId" column="eri_config_id"/>
|
||||
<result property="modeName" column="mode_name"/>
|
||||
<result property="responseHours" column="response_hours"/>
|
||||
<result property="chargeMode" column="charge_mode"/>
|
||||
<result property="floatingPercentage" column="floating_percentage"/>
|
||||
<result property="price" column="price"/>
|
||||
</collection>
|
||||
</association>
|
||||
|
||||
<association property="prodReservationConfig" javaType="com.tashow.cloud.product.dto.ProdReservationConfigDO">
|
||||
<id property="id" column="rc_record_id"/>
|
||||
<result property="prodId" column="rc_prod_id"/>
|
||||
<result property="reservationTimeSlots" column="rc_reservation_time_slots"/>
|
||||
<result property="advanceHours" column="rc_advance_hours"/>
|
||||
<result property="reservationDateRange" column="rc_reservation_date_range"/>
|
||||
<result property="allowChange" column="rc_allow_change"/>
|
||||
<result property="changeTimeRule" column="rc_change_time_rule"/>
|
||||
<result property="maxChangeTimes" column="rc_max_change_times"/>
|
||||
<result property="blacklistedDates" column="rc_blacklisted_dates"/>
|
||||
<result property="isBlacklisted" column="rc_is_blacklisted"/>
|
||||
<result property="blackAppointDates" column="rc_black_appoint_dates"/>
|
||||
<result property="isBlackAppoint" column="rc_is_black_appoint"/>
|
||||
<result property="blackHappy" column="rc_black_happy"/>
|
||||
<result property="blackWeekend" column="rc_black_weekend"/>
|
||||
</association>
|
||||
|
||||
<!-- 映射接单上限配置 (productOrderLimitVO) -->
|
||||
<association property="productOrderLimitVO" javaType="com.tashow.cloud.product.dto.ProductOrderLimitDO">
|
||||
<id property="id" column="ol_record_id"/>
|
||||
<result property="prodId" column="ol_prod_id"/>
|
||||
<result property="limitUnit" column="ol_limit_unit"/>
|
||||
<result property="maxOrders" column="ol_max_orders"/>
|
||||
</association>
|
||||
|
||||
<!-- 2. 所有 association 放在前面 -->
|
||||
<!-- 映射服务区域配置 (prodServiceAreasInfo) -->
|
||||
<association property="prodServiceAreasInfo" javaType="com.tashow.cloud.product.vo.prodserviceareas.ProdServiceAreasInfoVO">
|
||||
<id property="id" column="sa_rule_id"/>
|
||||
<result property="prodId" column="sa_prod_id"/>
|
||||
<result property="ruleType" column="sa_rule_type"/>
|
||||
<result property="fee" column="sa_fee"/>
|
||||
</association>
|
||||
|
||||
<!-- 新增:映射体重区间价格配置列表 (prodWeightConfigList) -->
|
||||
<collection property="prodWeightConfig" ofType="com.tashow.cloud.product.dto.ProdWeightRangePricesDO">
|
||||
<id property="id" column="wrp_record_id"/>
|
||||
<result property="prodId" column="wrp_prod_id"/>
|
||||
<result property="weightRange" column="wrp_weight_range"/> <!-- 注意:数据库列是 weight_range -->
|
||||
<result property="price" column="wrp_price"/>
|
||||
<result property="isEnabled" column="wrp_is_enabled"/>
|
||||
<!-- <result property="createTime" column="wrp_create_time"/> -->
|
||||
<!-- <result property="updateTime" column="wrp_update_time"/> -->
|
||||
<!-- <result property="creator" column="wrp_creator"/> -->
|
||||
<!-- <result property="updater" column="wrp_updater"/> -->
|
||||
</collection>
|
||||
|
||||
<!-- 新增:映射特殊日期规则配置列表 (prodAdditionalFeePeriodsList) -->
|
||||
<collection property="prodAdditionalFeePeriodsList" ofType="com.tashow.cloud.product.dto.ProdAdditionalFeePeriodsDO">
|
||||
<id property="id" column="afp_record_id"/>
|
||||
<result property="prodId" column="afp_prod_id"/>
|
||||
<result property="name" column="afp_name"/>
|
||||
<result property="specialTimeSlots" column="afp_special_time_slots"/>
|
||||
<result property="chargeMode" column="afp_charge_mode"/>
|
||||
<result property="price" column="afp_price"/>
|
||||
<result property="floatingPercentage" column="afp_floating_percentage"/>
|
||||
</collection>
|
||||
|
||||
<!-- 新增:映射特殊时段规则配置列表 (ProdAdditionalFeeDatesList) -->
|
||||
<collection property="prodAdditionalFeeDatesList" ofType="com.tashow.cloud.product.dto.ProdAdditionalFeeDatesDO">
|
||||
<id property="id" column="afd_record_id"/>
|
||||
<result property="prodId" column="afd_prod_id"/>
|
||||
<result property="name" column="afd_name"/>
|
||||
<result property="dateType" column="afd_date_type"/>
|
||||
<result property="customTimeSlots" column="afd_custom_time_slots"/>
|
||||
<result property="specificDates" column="afd_specific_dates"/>
|
||||
<result property="chargeMode" column="afd_charge_mode"/>
|
||||
<result property="price" column="afd_price"/>
|
||||
<result property="isEnabled" column="afd_is_enabled"/>
|
||||
</collection>
|
||||
|
||||
<!-- 映射服务区域地址名称 (areaNameList) -->
|
||||
<collection property="prodServiceAreasInfo.areaNameList" ofType="string">
|
||||
<result column="sa_area_name"/>
|
||||
</collection>
|
||||
|
||||
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="getProdPageList" resultType="com.tashow.cloud.product.dto.ProdDO" >
|
||||
select * from tz_prod
|
||||
</select>
|
||||
|
||||
|
||||
<!-- 动态SQL查询商品列表及其服务配置 (返回 List<ProdServiceVO>) -->
|
||||
<!-- 用于列表页,可根据开关动态决定是否关联紧急响应信息以优化性能 -->
|
||||
<select id="selectProdService" parameterType="map" resultMap="ProdServiceResultMap">
|
||||
SELECT
|
||||
p.emergency_switch,
|
||||
p.additional_switch,
|
||||
p.additional_fee_switch,
|
||||
p.reservation_switch,
|
||||
p.order_limit_switch,
|
||||
p.weight_switch,
|
||||
<!-- 只有当 emergencySwitch 开启时,才查询紧急响应相关字段 -->
|
||||
<if test="emergencySwitch != null and emergencySwitch == 1">
|
||||
erc.id AS erc_record_id,
|
||||
erc.prod_id AS erc_prod_id,
|
||||
erc.response_time_slots,
|
||||
erc.blacklisted_dates,
|
||||
erc.black_appoint_dates,
|
||||
erc.black_happy,
|
||||
erc.black_weekend,
|
||||
erc.create_time AS erc_create_time,
|
||||
erc.update_time AS erc_update_time,
|
||||
erc.creator AS erc_creator,
|
||||
erc.updater AS erc_updater,
|
||||
erc.deleted AS erc_deleted,
|
||||
eri.id AS eri_record_id,
|
||||
eri.config_id AS eri_config_id,
|
||||
eri.mode_name,
|
||||
eri.response_hours,
|
||||
eri.charge_mode,
|
||||
eri.floating_percentage,
|
||||
eri.price,
|
||||
eri.create_time AS eri_create_time,
|
||||
eri.update_time AS eri_update_time,
|
||||
eri.creator AS eri_creator,
|
||||
eri.updater AS eri_updater,
|
||||
eri.deleted AS eri_deleted,
|
||||
</if>
|
||||
<!-- 只有当 additionalFeeSwitch 开启时,才查询特殊日期规则相关字段 -->
|
||||
<if test="additionalFeeSwitch != null and additionalFeeSwitch == 1">
|
||||
afp.id AS afp_record_id,
|
||||
afp.prod_id AS afp_prod_id,
|
||||
afp.name AS afp_name,
|
||||
afp.special_time_slots AS afp_special_time_slots,
|
||||
afp.charge_mode AS afp_charge_mode,
|
||||
afp.price AS afp_price,
|
||||
afp.floating_percentage AS afp_floating_percentage,
|
||||
</if>
|
||||
<!-- 只有当 additionalSwitch 开启时,才查询特殊时段规则相关字段 -->
|
||||
<if test="additionalSwitch != null and additionalSwitch == 1">
|
||||
afd.id AS afd_record_id,
|
||||
afd.prod_id AS afd_prod_id,
|
||||
afd.name AS afd_name,
|
||||
afd.date_type AS afd_date_type,
|
||||
afd.custom_time_slots AS afd_custom_time_slots,
|
||||
afd.specific_dates AS afd_specific_dates,
|
||||
afd.charge_mode AS afd_charge_mode,
|
||||
afd.price AS afd_price,
|
||||
afd.is_enabled AS afd_is_enabled,
|
||||
afd.create_time AS afd_create_time,
|
||||
afd.update_time AS afd_update_time,
|
||||
afd.creator AS afd_creator,
|
||||
afd.updater AS afd_updater,
|
||||
afd.deleted AS afd_deleted,
|
||||
</if>
|
||||
<!-- 只有当 reservationSwitch 开启时,才查询预约配置相关字段 -->
|
||||
<if test="reservationSwitch != null and reservationSwitch == 1">
|
||||
rc.id AS rc_record_id,
|
||||
rc.prod_id AS rc_prod_id,
|
||||
rc.reservation_time_slots AS rc_reservation_time_slots,
|
||||
rc.advance_hours AS rc_advance_hours,
|
||||
rc.reservation_date_range AS rc_reservation_date_range,
|
||||
rc.allow_change AS rc_allow_change,
|
||||
rc.change_time_rule AS rc_change_time_rule,
|
||||
rc.max_change_times AS rc_max_change_times,
|
||||
rc.blacklisted_dates AS rc_blacklisted_dates,
|
||||
rc.is_blacklisted AS rc_is_blacklisted,
|
||||
rc.black_appoint_dates AS rc_black_appoint_dates,
|
||||
rc.is_black_appoint AS rc_is_black_appoint,
|
||||
rc.black_happy AS rc_black_happy,
|
||||
rc.black_weekend AS rc_black_weekend,
|
||||
</if>
|
||||
<!-- 只有当 orderLimitSwitch 开启时,才查询接单上限配置相关字段 -->
|
||||
<if test="orderLimitSwitch != null and orderLimitSwitch == 1">
|
||||
ol.id AS ol_record_id,
|
||||
ol.prod_id AS ol_prod_id,
|
||||
ol.limit_unit AS ol_limit_unit,
|
||||
ol.max_orders AS ol_max_orders,
|
||||
</if>
|
||||
<!-- 只有当 weightSwitch 开启时,才查询体重区间价格相关字段 -->
|
||||
<if test="weightSwitch != null and weightSwitch == 1">
|
||||
wrp.id AS wrp_record_id,
|
||||
wrp.prod_id AS wrp_prod_id,
|
||||
wrp.weight_range AS wrp_weight_range,
|
||||
wrp.price AS wrp_price,
|
||||
wrp.is_enabled AS wrp_is_enabled,
|
||||
</if>
|
||||
<!-- 只有当 regionSwitch 开启时,才查询服务区域相关字段 -->
|
||||
<if test="regionSwitch != null and regionSwitch == 1">
|
||||
sa.id AS sa_rule_id,
|
||||
sa.prod_id AS sa_prod_id,
|
||||
sa.rule_type AS sa_rule_type,
|
||||
sa.fee AS sa_fee,
|
||||
saa.area_name AS sa_area_name,
|
||||
</if>
|
||||
p.prod_id
|
||||
FROM
|
||||
tz_prod p
|
||||
<!-- 只有当 emergencySwitch 开启时才进行 LEFT JOIN -->
|
||||
<if test="emergencySwitch != null and emergencySwitch == 1">
|
||||
LEFT JOIN tz_prod_emergency_response erc ON p.prod_id = erc.prod_id AND erc.deleted = 0
|
||||
LEFT JOIN tz_prod_emergency_response_intervals eri ON erc.id = eri.config_id AND eri.deleted = 0
|
||||
</if>
|
||||
<if test="additionalFeeSwitch != null and additionalFeeSwitch == 1">
|
||||
LEFT JOIN tz_prod_additional_fee_periods afp ON p.prod_id = afp.prod_id AND afp.deleted = 0
|
||||
</if>
|
||||
<if test="additionalSwitch != null and additionalSwitch == 1">
|
||||
LEFT JOIN tz_prod_additional_fee_dates afd ON p.prod_id = afd.prod_id AND afd.deleted = 0
|
||||
</if>
|
||||
<if test="reservationSwitch != null and reservationSwitch == 1">
|
||||
LEFT JOIN tz_prod_reservation_config rc ON p.prod_id = rc.prod_id AND rc.deleted = 0
|
||||
</if>
|
||||
<if test="orderLimitSwitch != null and orderLimitSwitch == 1">
|
||||
LEFT JOIN tz_product_order_limit ol ON p.prod_id = ol.prod_id AND ol.deleted = 0
|
||||
</if>
|
||||
<if test="weightSwitch != null and weightSwitch == 1">
|
||||
LEFT JOIN tz_prod_weight_range_prices wrp ON p.prod_id = wrp.prod_id AND wrp.deleted = 0
|
||||
</if>
|
||||
<if test="regionSwitch != null and regionSwitch == 1">
|
||||
LEFT JOIN tz_prod_service_over_area_rules sa ON p.prod_id = sa.prod_id AND sa.deleted = 0
|
||||
LEFT JOIN tz_prod_service_area_relevance sar ON p.prod_id = sar.prod_id
|
||||
LEFT JOIN tz_prod_service_areas saa ON sar.area_id = saa.id AND saa.deleted = 0
|
||||
</if>
|
||||
where p.deleted = 0
|
||||
AND p.prod_id = #{prodId}
|
||||
ORDER BY p.prod_id
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user