获取服务配置2

This commit is contained in:
xuelijun
2025-08-19 18:27:27 +08:00
parent a99402c6b0
commit a5f992c090
17 changed files with 353 additions and 48 deletions

View File

@@ -71,5 +71,7 @@ public class ProdAdditionalFeeDatesDO extends BaseDO {
* 是否启用该规则是否启用该规则0关1开
*/
private Integer isEnabled;
public boolean isEmpty() {
return id == null ;
}
}

View File

@@ -56,5 +56,7 @@ public class ProdAdditionalFeePeriodsDO extends BaseDO {
* 浮动百分比
*/
private BigDecimal floatingPercentage;
public boolean isEmpty() {
return id == null ;
}
}

View File

@@ -58,4 +58,8 @@ public class ProdEmergencyResponseIntervalsDO extends BaseDO {
*/
private BigDecimal price;
public boolean isEmpty() {
return id == null;
}
}

View File

@@ -41,4 +41,9 @@ public class ProdExtendDO {
*/
private Integer isDisable;
/**
* 体重是否收费0否1是
*/
private Integer isWeightCharge;
}

View File

@@ -0,0 +1,80 @@
package com.tashow.cloud.productapi.api.product.vo.prod;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeeDatesDO;
import com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeePeriodsDO;
import com.tashow.cloud.productapi.api.product.dto.ProdWeightRangePricesDO;
import com.tashow.cloud.productapi.api.product.dto.ProductOrderLimitDO;
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyInfoVO;
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationInfoVO;
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasInfoVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@Schema(description = "商品服务配置 VO")
@Data
public class ProdServiceInfoVO {
@Schema(description = "产品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "6943")
private Long prodId;
@Schema(description = "创建时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date createTime;
@Schema(description = "修改时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
private Date updateTime;
@Schema(description = "新建人")
private String creator;
@Schema(description = "修改人")
private String updater;
@Schema(description = "分类名称")
private String categoryName;
@Schema(description = "是否开启服务区域配置0关1开")
private Integer regionSwitch;
@Schema(description = "服务区域配置")
public ProdServiceAreasInfoVO prodServiceAreasInfo;
@Schema(description = "是否预约0关1开")
private Integer reservationSwitch;
@Schema(description = "预约配置")
public ProdReservationInfoVO prodReservationConfig;
@Schema(description = "是否紧急响应服务0关1开")
private Integer emergencySwitch;
@Schema(description = "急响应服务配置")
public ProdEmergencyInfoVO prodEmergencyInfoVO;
@Schema(description = "是否接单上线0关1开")
private Integer orderLimitSwitch;
@Schema(description = "接单上线配置")
public ProductOrderLimitDO productOrderLimitVO;
@Schema(description = "是否特殊时段0关1开")
private Integer additionalSwitch;
@Schema(description = "特殊时段规则配置")
public List<ProdAdditionalFeeDatesDO> prodAdditionalFeeDatesList;
@Schema(description = "是否特殊日期节假日周末什么的0关1开")
private Integer additionalFeeSwitch;
@Schema(description = "特殊日期规则配置")
public List<ProdAdditionalFeePeriodsDO> prodAdditionalFeePeriodsList;
@Schema(description = "是否开启体重配置0关1开")
private Integer weightSwitch;
@Schema(description = "体重配置")
public List<ProdWeightRangePricesDO> prodWeightConfig;
}

View File

@@ -5,11 +5,13 @@ import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmer
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationInfoVO;
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasInfoVO;
import com.tashow.cloud.productapi.api.product.dto.*;
import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesSaveInfoVO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@Schema(description = "商品服务配置 VO")
@Data
@@ -71,6 +73,31 @@ public class ProdServiceVO {
@Schema(description = "是否开启体重配置0关1开")
private Integer weightSwitch;
@Schema(description = "体重配置")
public ProdWeightRangePricesDO prodWeightConfig;
public ProdWeightRangePricesSaveInfoVO prodWeightConfig;
public List<ProdAdditionalFeeDatesDO> getProdAdditionalFeeDatesList() {
if (prodAdditionalFeeDatesList == null) {
return null; // 或者 return Collections.emptyList(); 根据你希望 null 还是 []d
}
return prodAdditionalFeeDatesList.stream()
.filter(black -> black != null && !black.isEmpty())
.collect(Collectors.toList());
}
public void setProdAdditionalFeeDatesList(List<ProdAdditionalFeeDatesDO> prodAdditionalFeeDatesList) {
this.prodAdditionalFeeDatesList = prodAdditionalFeeDatesList;
}
public List<ProdAdditionalFeePeriodsDO> getProdAdditionalFeePeriodsList() {
if (prodAdditionalFeePeriodsList == null) {
return null; // 或者 return Collections.emptyList(); 根据你希望 null 还是 []d
}
return prodAdditionalFeePeriodsList.stream()
.filter(black -> black != null && !black.isEmpty())
.collect(Collectors.toList());
}
public void setProdAdditionalFeePeriodsList(List<ProdAdditionalFeePeriodsDO> prodAdditionalFeePeriodsList) {
this.prodAdditionalFeePeriodsList = prodAdditionalFeePeriodsList;
}
}

View File

@@ -36,6 +36,7 @@ public class ProdAdditionalFeeBlackVO {
@Schema(description = "是否启用该规则是否启用该规则0关1开", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("是否启用该规则是否启用该规则0关1开")
private Integer isEnabled;
public boolean isEmpty() {
return id == null ;
}
}

View File

@@ -9,6 +9,7 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
import java.util.stream.Collectors;
@Schema(description = "管理后台 - 商品紧急响应服务设置 Response VO")
@Data
@@ -35,4 +36,31 @@ public class ProdEmergencyInfoVO {
@Schema(description = "紧急响应黑名单日期设置")
public List<ProdAdditionalFeeBlackVO> prodEmergencyResponseBlackList;
public List<ProdEmergencyResponseIntervalsDO> getProdEmergencyResponseIntervalsList() {
if (prodEmergencyResponseIntervalsList == null) {
return null; // 或者 return Collections.emptyList(); 根据你希望 null 还是 []
}
return prodEmergencyResponseIntervalsList.stream()
.filter(black -> black != null && !black.isEmpty())
.collect(Collectors.toList());
}
public void setProdEmergencyResponseIntervalsList(List<ProdEmergencyResponseIntervalsDO> prodEmergencyResponseIntervalsList) {
this.prodEmergencyResponseIntervalsList = prodEmergencyResponseIntervalsList;
}
// getter 中做转换
public List<ProdAdditionalFeeBlackVO> getProdEmergencyResponseBlackList() {
if (prodEmergencyResponseBlackList == null) {
return null; // 或者 return Collections.emptyList(); 根据你希望 null 还是 []
}
return prodEmergencyResponseBlackList.stream()
.filter(black -> black != null && !black.isEmpty())
.collect(Collectors.toList());
}
public void setProdEmergencyResponseBlackList(List<ProdAdditionalFeeBlackVO> prodEmergencyResponseBlackList) {
this.prodEmergencyResponseBlackList = prodEmergencyResponseBlackList;
}
}

View File

@@ -0,0 +1,84 @@
package com.tashow.cloud.productapi.api.product.vo.prodreservationconfig;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO;
import com.tashow.cloud.productapi.general.StringListTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Schema(description = "管理后台 - 商品紧急响应服务设置 Response VO")
@Data
@ExcelIgnoreUnannotated
public class ProdReservationInfoReqVO {
/**
* 预约配置的唯一标识符
*/
@TableId
private Long id;
/**
* 关联的商品ID
*/
private Long prodId;
/**
* 预约时段设置
*/
@TableField(typeHandler = StringListTypeHandler.class)
private List<String> reservationTimeSlots;
/**
* 需提前多少小时预约
*/
private Integer advanceHours;
/**
* 预约日期范围 7天 10天 15天 30天
*/
private Integer reservationDateRange;
/**
* 是否允许更改预约时间 1可以 0不可以
*/
private Integer allowChange;
/**
* 时间段
*/
private Integer timeSlot;
/**
* 更改预约时间的时间规则如服务开始前1小时可更改
*/
private Integer changeTimeRule;
/**
* 允许更改预约时间的最大次数
*/
private Integer maxChangeTimes;
/**
* 预约时间区间设置
*/
@TableField(exist=false)
private TimeBookVO timeBook;
public TimeBookVO getTimeBook() {
if (this.timeBook == null) {
this.timeBook = new TimeBookVO();
this.timeBook.setTimeSlot(this.timeSlot);
this.timeBook.setReservationTimeSlots(this.reservationTimeSlots);
}
return this.timeBook;
}
public void setTimeBook(TimeBookVO timeBook) {
this.timeBook = timeBook;
}
@Schema(description = "预约黑名单日期设置")
public List<ProdAdditionalFeeBlackVO> prodReservationBlackList = new ArrayList<>();
}

View File

@@ -10,6 +10,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
@Schema(description = "管理后台 - 商品紧急响应服务设置 Response VO")
@Data
@@ -78,4 +80,19 @@ public class ProdReservationInfoVO {
@Schema(description = "预约黑名单日期设置")
public List<ProdAdditionalFeeBlackVO> prodReservationBlackList;
public List<ProdAdditionalFeeBlackVO> getProdReservationBlackList() {
if (prodReservationBlackList == null || prodReservationBlackList.isEmpty()) {
return prodReservationBlackList;
}
return prodReservationBlackList.stream()
.filter(Objects::nonNull)
.filter(black -> !black.isEmpty())
.collect(Collectors.toList());
}
public void setProdReservationBlackList(List<ProdAdditionalFeeBlackVO> prodReservationBlackList) {
this.prodReservationBlackList = prodReservationBlackList;
}
}

View File

@@ -0,0 +1,23 @@
package com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices;
import com.tashow.cloud.productapi.api.product.dto.ProdWeightRangePricesDO;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotEmpty;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
@Schema(description = "管理后台 - 体重区间价格新增/修改 Request VO")
@Data
public class ProdWeightRangePricesSaveInfoVO {
@Schema(description = "体重是否收费0否1是")
private Integer isWeightCharge;
@Schema(description = "体重配置")
public List<ProdWeightRangePricesDO> prodWeightConfigList;
}

View File

@@ -7,6 +7,7 @@ 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
@@ -17,4 +18,8 @@ import org.apache.ibatis.annotations.Mapper;
public interface ProdWeightRangePricesMapper extends BaseMapperX<ProdWeightRangePricesDO> {
/**
* 删除关联
*/
public int deleteWeightRangePrices(@Param("prodId")Long prodId);
}

View File

@@ -167,12 +167,12 @@ public class ProdServiceImpl implements ProdService {
}
}
//体重设置
if (Objects.equals(prodServiceVO.getWeightSwitch(), BaseEnum.YES_ONE.getKey())) {
/* 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);
}
@@ -243,7 +243,7 @@ public class ProdServiceImpl implements ProdService {
prodReservationConfigDO.setTimeBook(prodServiceVO.getProdReservationConfig().getTimeBook());
prodReservationConfigDO.setReservationTimeSlots(prodServiceVO.getProdReservationConfig().getReservationTimeSlots());
prodReservationConfigMapper.insert(prodReservationConfigDO);
if(prodServiceVO.getProdReservationConfig().getProdReservationBlackList()!=null){
if (prodServiceVO.getProdReservationConfig().getProdReservationBlackList() != null) {
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdReservationConfig().getProdReservationBlackList()) {
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
prodAdditionalFeeDatesDO.setProdId(prod.getProdId());
@@ -257,8 +257,8 @@ public class ProdServiceImpl implements ProdService {
prodReservationConfigDO.setReservationTimeSlots(prodServiceVO.getProdReservationConfig().getReservationTimeSlots());
prodReservationConfigMapper.updateById(prodReservationConfigDO);
//先删除在新增
prodAdditionalFeeDatesMapper.deleteAdditionalFeeDates(prod.getProdId(),2);
if(prodServiceVO.getProdReservationConfig().getProdReservationBlackList()!=null){
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());
@@ -278,14 +278,14 @@ public class ProdServiceImpl implements ProdService {
ProdEmergencyResponseDO prodEmergencyResponse = BeanUtils.toBean(prodServiceVO.getProdEmergencyInfoVO(), ProdEmergencyResponseDO.class);
prodEmergencyResponse.setProdId(prod.getProdId());
prodEmergencyResponseMapper.insert(prodEmergencyResponse);
if(prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList()!=null){
if (prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList() != null) {
for (ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals : prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList()) {
prodEmergencyResponseIntervals.setConfigId(prodEmergencyResponse.getId());
prodEmergencyResponseIntervals.setProdId(prod.getProdId());
prodEmergencyResponseIntervalsMapper.insert(prodEmergencyResponseIntervals);
}
}
if(prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList()!=null){
if (prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList() != null) {
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList()) {
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
prodAdditionalFeeDatesDO.setProdId(prod.getProdId());
@@ -298,7 +298,7 @@ public class ProdServiceImpl implements ProdService {
if (prodEmergencyResponse != null) {
prodEmergencyResponseMapper.updateById(prodEmergencyResponse);
prodEmergencyResponseIntervalsMapper.deleteIntervals(prodEmergencyResponse.getId());
if(prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList()!=null) {
if (prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList() != null) {
for (ProdEmergencyResponseIntervalsDO prodEmergencyResponseIntervals : prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList()) {
prodEmergencyResponseIntervals.setConfigId(prodEmergencyResponse.getId());
prodEmergencyResponseIntervals.setProdId(prod.getProdId());
@@ -306,8 +306,8 @@ public class ProdServiceImpl implements ProdService {
}
}
//先删除在新增
prodAdditionalFeeDatesMapper.deleteAdditionalFeeDates(prod.getProdId(),3);
if(prodServiceVO.getProdReservationConfig().getProdReservationBlackList()!=null){
prodAdditionalFeeDatesMapper.deleteAdditionalFeeDates(prod.getProdId(), 3);
if (prodServiceVO.getProdReservationConfig().getProdReservationBlackList() != null) {
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdReservationConfig().getProdReservationBlackList()) {
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
prodAdditionalFeeDatesDO.setProdId(prod.getProdId());
@@ -356,14 +356,25 @@ public class ProdServiceImpl implements ProdService {
}
//体重设置
if (Objects.equals(prodServiceVO.getWeightSwitch(), BaseEnum.YES_ONE.getKey())) {
if (prodServiceVO.getProdWeightConfig().getId() == null) {
prod.setWeightSwitch(BaseEnum.YES_ONE.getKey());
ProdWeightRangePricesDO prodWeightRangePrices = prodServiceVO.getProdWeightConfig();
prodWeightRangePrices.setProdId(prod.getProdId());
prodWeightRangePricesMapper.insert(prodWeightRangePrices);
} else {
prodWeightRangePricesMapper.updateById(prodServiceVO.getProdWeightConfig());
prod.setWeightSwitch(BaseEnum.YES_ONE.getKey());
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);
}

View File

@@ -10,6 +10,6 @@
-->
<delete id="deleteAdditionalFeeDates">
delete from tz_prod_additional_fee_dates where prod_id = #{configId} AND type = #{type}
delete from tz_prod_additional_fee_dates where prod_id = #{prodId} AND type = #{type}
</delete>
</mapper>

View File

@@ -89,17 +89,21 @@
<!-- 新增:映射体重区间价格配置列表 (prodWeightConfigList) -->
<collection property="prodWeightConfig" ofType="com.tashow.cloud.productapi.api.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>
<association property="prodWeightConfig" javaType="com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesSaveInfoVO">
<result property="isWeightCharge" column="tpe_is_weight_charge"/>
<!-- 新增:映射体重区间价格配置列表 (prodWeightConfigList) -->
<collection property="prodWeightConfigList" ofType="com.tashow.cloud.productapi.api.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>
</association>
<!-- 新增:映射特殊日期规则配置列表 (prodAdditionalFeePeriodsList) -->
<collection property="prodAdditionalFeePeriodsList" ofType="com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeePeriodsDO">
@@ -204,19 +208,23 @@
<result property="maxOrders" column="ol_max_orders"/>
</association>
<association property="prodWeightConfig" javaType="com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesSaveInfoVO">
<result property="isWeightCharge" column="tpe_is_weight_charge"/>
<!-- 新增:映射体重区间价格配置列表 (prodWeightConfigList) -->
<collection property="prodWeightConfigList" ofType="com.tashow.cloud.productapi.api.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>
</association>
<!-- 新增:映射体重区间价格配置列表 (prodWeightConfigList) -->
<collection property="prodWeightConfig" ofType="com.tashow.cloud.productapi.api.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.productapi.api.product.dto.ProdAdditionalFeePeriodsDO">
@@ -268,6 +276,7 @@
p.category_name,
<!-- 只有当 emergencySwitch 开启时,才查询紧急响应相关字段 -->
<if test="emergencySwitch != null and emergencySwitch == 1">
erc.id AS erc_record_id,
erc.response_time_slots as erc_response_time_slots,
epafd.id AS erc_record_id,
epafd.date_type as erc_date_type,
@@ -340,6 +349,7 @@
</if>
<!-- 只有当 weightSwitch 开启时,才查询体重区间价格相关字段 -->
<if test="weightSwitch != null and weightSwitch == 1">
tpe.is_weight_charge as tpe_is_weight_charge,
wrp.id AS wrp_record_id,
wrp.prod_id AS wrp_prod_id,
wrp.weight_range AS wrp_weight_range,
@@ -377,6 +387,7 @@
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_extend tpe ON p.prod_id = tpe.prod_id
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">
@@ -405,6 +416,7 @@
p.region_switch,
<!-- 只有当 emergencySwitch 开启时,才查询紧急响应相关字段 -->
<if test="emergencySwitch != null and emergencySwitch == 1">
erc.id AS erc_record_id,
erc.response_time_slots as erc_response_time_slots,
epafd.id AS erc_record_id,
epafd.date_type as erc_date_type,
@@ -477,6 +489,7 @@
</if>
<!-- 只有当 weightSwitch 开启时,才查询体重区间价格相关字段 -->
<if test="weightSwitch != null and weightSwitch == 1">
tpe.is_weight_charge as tpe_is_weight_charge,
wrp.id AS wrp_record_id,
wrp.prod_id AS wrp_prod_id,
wrp.weight_range AS wrp_weight_range,
@@ -506,6 +519,7 @@
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_extend tpe ON p.prod_id = tpe.prod_id
LEFT JOIN tz_prod_weight_range_prices wrp ON p.prod_id = wrp.prod_id AND wrp.deleted = 0
</if>
where p.deleted = 0

View File

@@ -9,6 +9,6 @@
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<delete id="deleteReservationConfig">
delete from tz_prod_reservation_config where prod_id = #{configId}
delete from tz_prod_reservation_config where prod_id = #{prodId}
</delete>
</mapper>

View File

@@ -8,5 +8,7 @@
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
文档可见https://www.iocoder.cn/MyBatis/x-plugins/
-->
<delete id="deleteWeightRangePrices">
delete from tz_prod_weight_range_prices where prod_id = #{prodId}
</delete>
</mapper>