规格回收站bug
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,7 @@
|
||||
package com.tashow.cloud.productapi.api.product.vo.prod;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasInfoVO;
|
||||
@@ -9,8 +10,10 @@ import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeig
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Schema(description = "商品服务配置 VO")
|
||||
@@ -48,6 +51,22 @@ public class ProdServiceVO {
|
||||
@Schema(description = "预约配置")
|
||||
public ProdReservationInfoVO prodReservationConfig;
|
||||
|
||||
/* public List<ProdAdditionalFeeBlackVO> getProdReservationBlackList() {
|
||||
if (prodReservationBlackList == null || prodReservationBlackList.isEmpty()) {
|
||||
return prodReservationBlackList;
|
||||
}
|
||||
return prodReservationBlackList.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public void setProdReservationBlackList(List<ProdAdditionalFeeBlackVO> prodReservationBlackList) {
|
||||
this.prodReservationBlackList = prodReservationBlackList;
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
@Schema(description = "是否紧急响应服务0关1开")
|
||||
private Integer emergencySwitch;
|
||||
@Schema(description = "急响应服务配置")
|
||||
@@ -75,29 +94,26 @@ public class ProdServiceVO {
|
||||
@Schema(description = "体重配置")
|
||||
public ProdWeightRangePricesSaveInfoVO prodWeightConfig;
|
||||
|
||||
public List<ProdAdditionalFeeDatesDO> getProdAdditionalFeeDatesList() {
|
||||
if (prodAdditionalFeeDatesList == null) {
|
||||
return null; // 或者 return Collections.emptyList(); 根据你希望 null 还是 []d
|
||||
|
||||
public ProdReservationInfoVO getProdReservationConfig() {
|
||||
|
||||
if (this.prodReservationConfig == null) {
|
||||
return null;
|
||||
}
|
||||
return prodAdditionalFeeDatesList.stream()
|
||||
.filter(black -> black != null && !black.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
// 判断是否“逻辑上为空”
|
||||
if (isProdReservationInfoEmpty(this.prodReservationConfig)) {
|
||||
return null;
|
||||
}
|
||||
return this.prodReservationConfig;
|
||||
}
|
||||
|
||||
public void setProdAdditionalFeeDatesList(List<ProdAdditionalFeeDatesDO> prodAdditionalFeeDatesList) {
|
||||
this.prodAdditionalFeeDatesList = prodAdditionalFeeDatesList;
|
||||
public void setProdReservationConfig(ProdReservationInfoVO prodReservationConfig) {
|
||||
this.prodReservationConfig = prodReservationConfig;
|
||||
}
|
||||
|
||||
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;
|
||||
private boolean isProdReservationInfoEmpty(ProdReservationInfoVO config) {
|
||||
if (config == null) return true;
|
||||
// 判断所有字段是否都为 null 或空
|
||||
return config.getId() == null;
|
||||
}
|
||||
}
|
||||
@@ -36,31 +36,4 @@ 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;
|
||||
}
|
||||
}
|
||||
@@ -9,6 +9,7 @@ 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;
|
||||
@@ -81,18 +82,22 @@ public class ProdReservationInfoVO {
|
||||
@Schema(description = "预约黑名单日期设置")
|
||||
public List<ProdAdditionalFeeBlackVO> prodReservationBlackList;
|
||||
|
||||
public List<ProdAdditionalFeeBlackVO> getProdReservationBlackList() {
|
||||
|
||||
/* public List<ProdAdditionalFeeBlackVO> getProdReservationBlackList() {
|
||||
if (prodReservationBlackList == null || prodReservationBlackList.isEmpty()) {
|
||||
return prodReservationBlackList;
|
||||
}
|
||||
return prodReservationBlackList.stream()
|
||||
.filter(Objects::nonNull)
|
||||
.filter(black -> !black.isEmpty())
|
||||
.filter(black -> black != null && !black.isEmpty())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public void setProdReservationBlackList(List<ProdAdditionalFeeBlackVO> prodReservationBlackList) {
|
||||
this.prodReservationBlackList = prodReservationBlackList;
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -15,7 +15,6 @@ public class SkuSaveReqVO {
|
||||
private Long skuId;
|
||||
|
||||
@Schema(description = "商品ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "18784")
|
||||
@NotNull(message = "商品ID不能为空")
|
||||
private Long prodId;
|
||||
|
||||
@Schema(description = "销售属性组合字符串 格式是p1:v1;p2:v2")
|
||||
@@ -86,7 +85,6 @@ public class SkuSaveReqVO {
|
||||
private String prodName;
|
||||
|
||||
@Schema(description = "版本号", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@NotNull(message = "版本号不能为空")
|
||||
private Integer version;
|
||||
|
||||
@Schema(description = "商品重量")
|
||||
@@ -103,6 +101,11 @@ public class SkuSaveReqVO {
|
||||
|
||||
@Schema(description = "最小购买数量")
|
||||
private Integer moq;
|
||||
/**
|
||||
* 是否默认规则0否1是
|
||||
*/
|
||||
private Integer isSpecs;
|
||||
|
||||
/**
|
||||
* 扩展服务表单id
|
||||
*/
|
||||
|
||||
@@ -3,6 +3,8 @@ package com.tashow.cloud.product.controller.admin;
|
||||
import com.tashow.cloud.common.pojo.CommonResult;
|
||||
import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.common.util.object.BeanUtils;
|
||||
import com.tashow.cloud.product.mapper.ProdPropMapper;
|
||||
import com.tashow.cloud.product.mapper.ProdPropValueMapper;
|
||||
import com.tashow.cloud.productapi.api.product.dto.*;
|
||||
import com.tashow.cloud.product.mapper.SkuMapper;
|
||||
import com.tashow.cloud.product.service.ProdExtendService;
|
||||
@@ -43,6 +45,12 @@ public class SkuController {
|
||||
@Resource
|
||||
private ProdExtendService prodExtendService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ProdPropValueMapper prodPropValueMapper;
|
||||
@Resource
|
||||
private ProdPropMapper prodPropMapper;
|
||||
|
||||
@Resource
|
||||
private SkuMapper skuMapper;
|
||||
|
||||
@@ -56,20 +64,43 @@ public class SkuController {
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新单品SKU")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateSku(@Valid @RequestBody SkuSaveReqVO updateReqVO) {
|
||||
public CommonResult<Boolean> updateSku(@RequestBody SkuSaveReqVO updateReqVO) {
|
||||
skuService.updateSku(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/updateProp")
|
||||
@Operation(summary = "更新sku规格")
|
||||
@Operation(summary = "新增统一保存sku规格")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateProp(@Valid @RequestBody SkuPropVO skuPropVO) {
|
||||
skuService.updateProp(skuPropVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/updatePropValue")
|
||||
@Operation(summary = "修改属性下面规格值")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updatePropValue(@RequestParam("id") Long id,@RequestParam("propValue") String propValue) {
|
||||
ProdPropValueDO propValueDO = new ProdPropValueDO();
|
||||
propValueDO.setId(id);
|
||||
propValueDO.setPropValue(propValue);
|
||||
prodPropValueMapper.updateById(propValueDO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PutMapping("/updateProdProp")
|
||||
@Operation(summary = "修改属性规格值")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> updateProdProp(@RequestParam("id") Long id,@RequestParam("propName") String propName) {
|
||||
ProdPropDO prodPropDO = new ProdPropDO();
|
||||
prodPropDO.setId( id);
|
||||
prodPropDO.setPropName(propName);
|
||||
prodPropMapper.updateById(prodPropDO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@GetMapping("/getSKuPropList")
|
||||
@Operation(summary = "获取sku规格")
|
||||
@PermitAll
|
||||
@@ -87,7 +118,14 @@ public class SkuController {
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/restorePropList")
|
||||
@Operation(summary = "恢复规格")
|
||||
@Parameter(name = "ids", description = "skuids", required = true)
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> restorePropList(@RequestParam("ids") List<Long> ids) {
|
||||
skuService.restorePropList(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@PutMapping("/deleteProp")
|
||||
@@ -100,10 +138,12 @@ public class SkuController {
|
||||
|
||||
|
||||
@PutMapping("/disableProp")
|
||||
@Operation(summary = "禁用规格值")
|
||||
@Operation(summary = "禁用或者启用规格值")
|
||||
@Parameter(name = "id", description = "规格id")
|
||||
@Parameter(name = "state", description = "状态0禁用1启用")
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> disableProp(@RequestParam("id") Long id) {
|
||||
skuService.disableProp(id);
|
||||
public CommonResult<Boolean> disableProp(@RequestParam("id") Long id,@RequestParam("state") Integer state) {
|
||||
skuService.disableProp(id,state);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@@ -122,19 +162,12 @@ public class SkuController {
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@PermitAll
|
||||
public CommonResult<Boolean> deleteSkuList(@RequestParam("ids") List<Long> ids) {
|
||||
/*for(Long id:ids){
|
||||
SkuDO sku = new SkuDO();
|
||||
sku.setSkuId(id);
|
||||
sku.setDeleteTime(new Date());
|
||||
// 删除
|
||||
skuMapper.deleteById(sku);
|
||||
}*/
|
||||
skuService.deleteSkus(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/updateSkuShelf")
|
||||
@PutMapping("/updateSkuShelf")
|
||||
@Operation(summary = "修改单品上下架")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@Parameter(name = "isShelf", description = "是否上下架(0下架 1上架)", required = true)
|
||||
@@ -144,7 +177,7 @@ public class SkuController {
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@PostMapping("/updateSkuShelfList")
|
||||
@PutMapping("/updateSkuShelfList")
|
||||
@Operation(summary = "批量上下架")
|
||||
@Parameter(name = "ids", description = "编号", required = true)
|
||||
@Parameter(name = "isShelf", description = "是否上下架(0下架 1上架)", required = true)
|
||||
@@ -154,7 +187,7 @@ public class SkuController {
|
||||
SkuDO sku = new SkuDO();
|
||||
sku.setSkuId(id);
|
||||
sku.setIsShelf(isShelf);
|
||||
skuMapper.updateBatch(sku);
|
||||
skuMapper.updateById(sku);
|
||||
}
|
||||
skuService.updatSkuIsShelfs(ids,isShelf);
|
||||
return success(true);
|
||||
|
||||
@@ -8,6 +8,7 @@ import com.tashow.cloud.common.pojo.PageResult;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.tashow.cloud.mybatis.mybatis.core.mapper.BaseMapperX;
|
||||
import com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO;
|
||||
import com.tashow.cloud.productapi.api.product.dto.SkuDO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPropRecycleBinVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -40,4 +41,5 @@ public interface ProdPropValueMapper extends BaseMapperX<ProdPropValueDO> {
|
||||
|
||||
IPage<ProPropRecycleBinVO> getSKuPropRecycleBinList(Page<?> page, @Param("prodId") Long prodId,@Param("propValue")String propValue);
|
||||
|
||||
List<ProdPropValueDO> getskuListByPropValueIds(@Param("ids")List<Long> ids);
|
||||
}
|
||||
@@ -36,4 +36,8 @@ public interface SkuMapper extends BaseMapperX<SkuDO> {
|
||||
|
||||
|
||||
List<SkuDO> getskuListBySkuIds( @Param("ids")List<Long> ids);
|
||||
|
||||
List<SkuDO> getskuListByDeleted( @Param("prodId")Long prodId,@Param("ids")List<Long> ids);
|
||||
|
||||
void batchSkuRecover(@Param("ids") List<Long> ids);
|
||||
}
|
||||
@@ -70,7 +70,7 @@ public interface SkuService {
|
||||
*
|
||||
* @param id 删除规格值
|
||||
*/
|
||||
void disableProp(Long id);
|
||||
void disableProp(Long id,Integer state);
|
||||
|
||||
|
||||
|
||||
@@ -97,6 +97,12 @@ public interface SkuService {
|
||||
* @param ids
|
||||
*/
|
||||
void restoreSkuList(List<Long> ids);
|
||||
/**
|
||||
* 恢复规格
|
||||
*
|
||||
* @param ids
|
||||
*/
|
||||
void restorePropList(List<Long> ids);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,6 +13,7 @@ import com.tashow.cloud.product.service.ProdService;
|
||||
|
||||
import com.tashow.cloud.productapi.api.product.vo.prod.*;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationInfoReqVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.prodreservationconfig.ProdReservationInfoVO;
|
||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuPageReqVO;
|
||||
@@ -236,13 +237,13 @@ public class ProdServiceImpl implements ProdService {
|
||||
if (Objects.equals(prodServiceVO.getReservationSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
ProdReservationConfigDO reservationConfig = prodReservationConfigMapper.selectOne(new LambdaQueryWrapper<ProdReservationConfigDO>()
|
||||
.eq(ProdReservationConfigDO::getProdId, prodServiceVO.getProdId()));
|
||||
ProdReservationInfoReqVO prodReservationInfoVO = prodServiceVO.getProdReservationConfig();
|
||||
if (reservationConfig == null) {
|
||||
prod.setReservationSwitch(BaseEnum.YES_ONE.getKey());
|
||||
ProdReservationInfoReqVO prodReservationInfoVO = prodServiceVO.getProdReservationConfig();
|
||||
ProdReservationConfigDO prodReservationConfigDO = BeanUtils.toBean(prodReservationInfoVO, ProdReservationConfigDO.class);
|
||||
prodReservationConfigDO.setProdId(prod.getProdId());
|
||||
prodReservationConfigDO.setTimeBook(prodServiceVO.getProdReservationConfig().getTimeBook());
|
||||
prodReservationConfigDO.setReservationTimeSlots(prodServiceVO.getProdReservationConfig().getReservationTimeSlots());
|
||||
prodReservationConfigDO.setTimeSlot(prodReservationInfoVO.getTimeBook().getTimeSlot());
|
||||
prodReservationConfigDO.setReservationTimeSlots(prodReservationInfoVO.getTimeBook().getReservationTimeSlots());
|
||||
prodReservationConfigMapper.insert(prodReservationConfigDO);
|
||||
if (prodServiceVO.getProdReservationConfig().getProdReservationBlackList() != null) {
|
||||
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdReservationConfig().getProdReservationBlackList()) {
|
||||
@@ -254,8 +255,8 @@ public class ProdServiceImpl implements ProdService {
|
||||
}
|
||||
} else {
|
||||
ProdReservationConfigDO prodReservationConfigDO = BeanUtils.toBean(prodServiceVO.getProdReservationConfig(), ProdReservationConfigDO.class);
|
||||
prodReservationConfigDO.setTimeBook(prodServiceVO.getProdReservationConfig().getTimeBook());
|
||||
prodReservationConfigDO.setReservationTimeSlots(prodServiceVO.getProdReservationConfig().getReservationTimeSlots());
|
||||
prodReservationConfigDO.setTimeSlot(prodReservationInfoVO.getTimeBook().getTimeSlot());
|
||||
prodReservationConfigDO.setReservationTimeSlots(prodReservationInfoVO.getTimeBook().getReservationTimeSlots());
|
||||
prodReservationConfigMapper.updateById(prodReservationConfigDO);
|
||||
//先删除在新增
|
||||
prodAdditionalFeeDatesMapper.deleteAdditionalFeeDates(prod.getProdId(), 2);
|
||||
@@ -359,18 +360,18 @@ public class ProdServiceImpl implements ProdService {
|
||||
//体重设置
|
||||
if (Objects.equals(prodServiceVO.getWeightSwitch(), BaseEnum.YES_ONE.getKey())) {
|
||||
prod.setWeightSwitch(BaseEnum.YES_ONE.getKey());
|
||||
ProdExtendDO prodExtendDO =prodExtendMapper.selectOne(ProdExtendDO::getProdId, prod.getProdId());
|
||||
if(prodExtendDO!= null){
|
||||
ProdExtendDO prodExtendDO = prodExtendMapper.selectOne(ProdExtendDO::getProdId, prod.getProdId());
|
||||
if (prodExtendDO != null) {
|
||||
prodExtendDO.setIsWeightCharge(prodServiceVO.getProdWeightConfig().getIsWeightCharge());
|
||||
prodExtendMapper.updateById(prodExtendDO);
|
||||
}else {
|
||||
} 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){
|
||||
if (prodServiceVO.getProdWeightConfig().getProdWeightConfigList() != null) {
|
||||
for (ProdWeightRangePricesDO prodWeightRangePricesDO : prodServiceVO.getProdWeightConfig().getProdWeightConfigList()) {
|
||||
prodWeightRangePricesDO.setProdId(prod.getProdId());
|
||||
prodWeightRangePricesMapper.insert(prodWeightRangePricesDO);
|
||||
@@ -385,13 +386,47 @@ public class ProdServiceImpl implements ProdService {
|
||||
public ProdServiceVO getProdService(Long prodId) {
|
||||
ProdDO prodDO = prodMapper.selectById(prodId);
|
||||
if (prodDO != null && prodDO.getRegionSwitch() == BaseEnum.YES_ONE.getKey()) {
|
||||
return prodMapper.selectProdService(prodDO.getProdId(), prodDO.getRegionSwitch(),
|
||||
ProdServiceVO prodServiceVO = prodMapper.selectProdService(prodDO.getProdId(), prodDO.getRegionSwitch(),
|
||||
prodDO.getReservationSwitch(), prodDO.getEmergencySwitch(), prodDO.getOrderLimitSwitch(),
|
||||
prodDO.getAdditionalSwitch(), prodDO.getAdditionalFeeSwitch(), prodDO.getWeightSwitch());
|
||||
if (Objects.equals(prodDO.getReservationSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdReservationConfig().getProdReservationBlackList().get(0).isEmpty()) {
|
||||
ProdReservationInfoVO prodReservationInfoVO = prodServiceVO.getProdReservationConfig();
|
||||
prodReservationInfoVO.setProdReservationBlackList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList().get(0).isEmpty()) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseIntervalsList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getAdditionalSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeeDatesList().get(0).isEmpty()) {
|
||||
prodServiceVO.setProdAdditionalFeeDatesList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getAdditionalFeeSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeePeriodsList().get(0).isEmpty()) {
|
||||
prodServiceVO.setProdAdditionalFeePeriodsList(new ArrayList<>());
|
||||
}
|
||||
return prodServiceVO;
|
||||
} else {
|
||||
return prodMapper.selectProdServiceInfo(prodDO.getProdId(),
|
||||
ProdServiceVO prodServiceVO = prodMapper.selectProdServiceInfo(prodDO.getProdId(),
|
||||
prodDO.getReservationSwitch(), prodDO.getEmergencySwitch(), prodDO.getOrderLimitSwitch(),
|
||||
prodDO.getAdditionalSwitch(), prodDO.getAdditionalFeeSwitch(), prodDO.getWeightSwitch());
|
||||
if (Objects.equals(prodDO.getReservationSwitch(), BaseEnum.YES_ONE.getKey())&prodServiceVO.getProdReservationConfig().getProdReservationBlackList().get(0).isEmpty()) {
|
||||
ProdReservationInfoVO prodReservationInfoVO = prodServiceVO.getProdReservationConfig();
|
||||
prodReservationInfoVO.setProdReservationBlackList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseIntervalsList().get(0).isEmpty()) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseIntervalsList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getEmergencySwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdEmergencyInfoVO().getProdEmergencyResponseBlackList().get(0).isEmpty()) {
|
||||
ProdEmergencyInfoVO prodEmergencyInfoVO = prodServiceVO.getProdEmergencyInfoVO();
|
||||
prodEmergencyInfoVO.setProdEmergencyResponseBlackList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getAdditionalSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeeDatesList().get(0).isEmpty()) {
|
||||
prodServiceVO.setProdAdditionalFeeDatesList(new ArrayList<>());
|
||||
}
|
||||
if (Objects.equals(prodDO.getAdditionalFeeSwitch(), BaseEnum.YES_ONE.getKey())&&prodServiceVO.getProdAdditionalFeePeriodsList().get(0).isEmpty()) {
|
||||
prodServiceVO.setProdAdditionalFeePeriodsList(new ArrayList<>());
|
||||
}
|
||||
return prodServiceVO;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -395,21 +395,15 @@ public class SkuServiceImpl implements SkuService {
|
||||
if (CollectionUtil.isNotEmpty(skuPropVO.getSkuList())) {
|
||||
List<SkuDO> skuList = skuPropVO.getSkuList();
|
||||
List<SkuDO> skuListNew = new ArrayList<>();
|
||||
List<SkuDO> skuListUpdate = new ArrayList<>();
|
||||
for (SkuDO sku : skuList) {
|
||||
if (Objects.equals(BaseEnum.YES_ONE.getKey(), sku.getIsExist())) {
|
||||
sku.setProdId(skuPropVO.getProdId());
|
||||
skuListNew.add(sku);
|
||||
} else {
|
||||
skuListUpdate.add(sku);
|
||||
}
|
||||
}
|
||||
if (CollUtil.isNotEmpty(skuListNew)) {
|
||||
skuMapper.insertBatch(skuListNew);
|
||||
}
|
||||
if (CollUtil.isNotEmpty(skuListUpdate)) {
|
||||
skuMapper.updateBatch(skuListUpdate);
|
||||
}
|
||||
}
|
||||
prodExtendMapper.updateByProdId(skuPropVO.getProdId(), skuPropVO.getIsDisable(), skuPropVO.getIsExpire());
|
||||
//保存规格
|
||||
@@ -438,10 +432,11 @@ public class SkuServiceImpl implements SkuService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableProp(Long id) {
|
||||
public void disableProp(Long id, Integer state) {
|
||||
ProdPropValueDO prodPropValueDO = prodPropValueService.getById(id);
|
||||
prodPropValueDO.setState(BaseEnum.YES_ONE.getKey());
|
||||
prodPropValueDO.setState(state);
|
||||
prodPropValueService.updateById(prodPropValueDO);
|
||||
if (Objects.equals(BaseEnum.NO_ZERO.getKey(), state)) {
|
||||
List<SkuDO> skuDOList = skuMapper.getSkuListByName(prodPropValueDO.getPropValue());
|
||||
List<SkuDO> skuDOList1 = new ArrayList<>();
|
||||
for (SkuDO skuDO : skuDOList) {
|
||||
@@ -459,6 +454,7 @@ public class SkuServiceImpl implements SkuService {
|
||||
skuMapper.updateBatch(skuDOList1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@@ -472,6 +468,7 @@ public class SkuServiceImpl implements SkuService {
|
||||
List<ProdPropValueDO> values = prodPropValueService.list(
|
||||
new LambdaQueryWrapper<ProdPropValueDO>()
|
||||
.eq(ProdPropValueDO::getPropId, prop.getId())
|
||||
.eq(ProdPropValueDO::getDeleted, BaseEnum.NO_ZERO.getKey())
|
||||
.orderByAsc(ProdPropValueDO::getSort)
|
||||
);
|
||||
prop.setProdPropValues(values);
|
||||
@@ -487,7 +484,7 @@ public class SkuServiceImpl implements SkuService {
|
||||
|
||||
@Override
|
||||
public PageResult<ProPropRecycleBinVO> getSKuPropRecycleBinList(ProPageReqVO proPageReqVO) {
|
||||
IPage<ProPropRecycleBinVO> prodPageList = prodPropValueMapper.getSKuPropRecycleBinList(MyBatisUtils.buildPage(proPageReqVO),proPageReqVO.getProdId(), proPageReqVO.getPropValue());
|
||||
IPage<ProPropRecycleBinVO> prodPageList = prodPropValueMapper.getSKuPropRecycleBinList(MyBatisUtils.buildPage(proPageReqVO), proPageReqVO.getProdId(), proPageReqVO.getPropValue());
|
||||
for (ProPropRecycleBinVO prodPage : prodPageList.getRecords()) {
|
||||
if (prodPage.getDeleteTime() != null) {
|
||||
prodPage.setRemainingDays(DateUtils.getRemainingDays(prodPage.getDeleteTime()));
|
||||
@@ -727,6 +724,20 @@ public class SkuServiceImpl implements SkuService {
|
||||
if (skuList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取商品下所有被删除的SKU(除了当前要恢复的 ids)
|
||||
List<SkuDO> skuAllDeletedList = skuMapper.getskuListByDeleted(skuList.get(0).getProdId(), ids);
|
||||
|
||||
Set<String> allDeletedValues = new HashSet<>();
|
||||
for (SkuDO sku : skuAllDeletedList) {
|
||||
if (sku.getProperties() != null && !sku.getProperties().trim().isEmpty()) {
|
||||
String[] values = sku.getProperties().split(",");
|
||||
for (String v : values) {
|
||||
allDeletedValues.add(v.trim());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Set<String> currentlyUsedValues = new HashSet<>();
|
||||
for (SkuDO sku : skuList) {
|
||||
skuMapper.updateSkuDeleted(sku.getSkuId());
|
||||
@@ -737,19 +748,39 @@ public class SkuServiceImpl implements SkuService {
|
||||
}
|
||||
}
|
||||
}
|
||||
//恢复被删除的属性值
|
||||
if(!currentlyUsedValues.isEmpty()){
|
||||
|
||||
// === 核心修改点:提取 currentlyUsedValues 中不在 allDeletedValues 的值(即新增启用的规格值)===
|
||||
Set<String> valuesToRestore = new HashSet<>(currentlyUsedValues);
|
||||
valuesToRestore.removeAll(allDeletedValues); // 只保留“之前被删掉过”的规格值
|
||||
|
||||
// 如果没有需要恢复的规格值,直接返回
|
||||
if (valuesToRestore.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 查询商品下所有属性值
|
||||
Long prodId = skuList.get(0).getProdId();
|
||||
List<ProdPropValueDO> allPropValues =prodPropValueMapper.selectRestoreProp(prodId);
|
||||
if(!allPropValues.isEmpty()){
|
||||
for (ProdPropValueDO pv : allPropValues){
|
||||
if (currentlyUsedValues.contains(pv.getPropValue())) {
|
||||
pv.setIsExpire(BaseEnum.NO_ZERO.getKey());
|
||||
List<ProdPropValueDO> allPropValues = prodPropValueMapper.selectRestoreProp(prodId);
|
||||
|
||||
if (!allPropValues.isEmpty()) {
|
||||
for (ProdPropValueDO pv : allPropValues) {
|
||||
// 仅当该属性值是“当前使用”且“之前被删除”的(即在 valuesToRestore 中),才恢复
|
||||
if (valuesToRestore.contains(pv.getPropValue())) {
|
||||
pv.setIsExpire(BaseEnum.NO_ZERO.getKey()); // 标记为未过期
|
||||
prodPropValueMapper.updateById(pv);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restorePropList(List<Long> ids) {
|
||||
List<ProdPropValueDO> prodPropValueDOList = prodPropValueMapper.getskuListByPropValueIds(ids);
|
||||
for(ProdPropValueDO prodPropValueDO: prodPropValueDOList){
|
||||
prodPropValueDO.setState(BaseEnum.YES_ONE.getKey());
|
||||
prodPropValueService.updateById(prodPropValueDO);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -761,10 +792,8 @@ public class SkuServiceImpl implements SkuService {
|
||||
SkuDO prodSku = skuMapper.selectById(id);
|
||||
// Step 1: 获取该商品下所有未禁用的 SKU 的 properties
|
||||
List<String> activeProperties = skuMapper.selectPropertiesByProdIdShelf(prodSku.getProdId());
|
||||
SkuDO sku = new SkuDO();
|
||||
sku.setSkuId(id);
|
||||
sku.setIsShelf(isShelf);
|
||||
skuMapper.updateById(sku);
|
||||
prodSku.setIsShelf(isShelf);
|
||||
skuMapper.updateById(prodSku);
|
||||
// Step 2: 提取所有正在被使用的属性值(去重)
|
||||
Set<String> currentlyUsedValues = new HashSet<>();
|
||||
for (String props : activeProperties) {
|
||||
@@ -818,7 +847,7 @@ public class SkuServiceImpl implements SkuService {
|
||||
SkuDO sku = new SkuDO();
|
||||
sku.setSkuId(id);
|
||||
sku.setIsShelf(isShelf);
|
||||
skuMapper.updateBatch(sku);
|
||||
skuMapper.updateById(sku);
|
||||
}
|
||||
// Step 4: 提取所有仍在使用的属性值(去重 + trim)
|
||||
Set<String> currentlyUsedValues = new HashSet<>();
|
||||
|
||||
@@ -28,11 +28,11 @@
|
||||
<result property="responseTimeSlots" column="erc_response_time_slots"/>
|
||||
<!-- 嵌套集合:紧急响应时间区间 -->
|
||||
<collection property="prodEmergencyResponseBlackList" ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO">
|
||||
<id property="id" column="erc_record_id"/>
|
||||
<result property="dateType" column="erc_date_type"/>
|
||||
<result property="customTimeSlots" column="erc_custom_time_slots"/>
|
||||
<result property="type" column="erc_type"/>
|
||||
<result property="isEnabled" column="erc_is_enabled"/>
|
||||
<id property="id" column="eblack_record_id"/>
|
||||
<result property="dateType" column="eblack_date_type"/>
|
||||
<result property="customTimeSlots" column="eblack_custom_time_slots"/>
|
||||
<result property="type" column="eblack_type"/>
|
||||
<result property="isEnabled" column="eblack_is_enabled"/>
|
||||
</collection>
|
||||
<!-- 嵌套集合:紧急响应时间区间 -->
|
||||
<collection property="prodEmergencyResponseIntervalsList" ofType="com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO">
|
||||
@@ -56,13 +56,14 @@
|
||||
<result property="changeTimeRule" column="rc_change_time_rule"/>
|
||||
<result property="timeSlot" column="rc_time_slot"/>
|
||||
<result property="maxChangeTimes" column="rc_max_change_times"/>
|
||||
<!-- 嵌套集合:紧急响应时间区间 -->
|
||||
<collection property="prodReservationBlackList" ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO">
|
||||
<id property="id" column="rcp_record_id"/>
|
||||
<result property="dateType" column="rcp_date_type"/>
|
||||
<result property="customTimeSlots" column="rcp_custom_time_slots"/>
|
||||
<result property="type" column="rcp_type"/>
|
||||
<result property="isEnabled" column="rcp_is_enabled"/>
|
||||
|
||||
<collection property="prodReservationBlackList"
|
||||
ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO"> <!-- 所有 blacklist 字段加 black_ 前缀 -->
|
||||
<id property="id" column="black_id"/>
|
||||
<result property="dateType" column="black_date_type"/>
|
||||
<result property="customTimeSlots" column="black_custom_time_slots"/>
|
||||
<result property="type" column="black_type"/>
|
||||
<result property="isEnabled" column="black_is_enabled"/>
|
||||
</collection>
|
||||
</association>
|
||||
|
||||
@@ -105,6 +106,7 @@
|
||||
</collection>
|
||||
</association>
|
||||
|
||||
|
||||
<!-- 新增:映射特殊日期规则配置列表 (prodAdditionalFeePeriodsList) -->
|
||||
<collection property="prodAdditionalFeePeriodsList" ofType="com.tashow.cloud.productapi.api.product.dto.ProdAdditionalFeePeriodsDO">
|
||||
<id property="id" column="afp_record_id"/>
|
||||
@@ -128,16 +130,10 @@
|
||||
<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>
|
||||
|
||||
|
||||
@@ -162,11 +158,11 @@
|
||||
<result property="responseTimeSlots" column="erc_response_time_slots"/>
|
||||
<!-- 嵌套集合:紧急响应时间区间 -->
|
||||
<collection property="prodEmergencyResponseBlackList" ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO">
|
||||
<id property="id" column="erc_record_id"/>
|
||||
<result property="dateType" column="erc_date_type"/>
|
||||
<result property="customTimeSlots" column="erc_custom_time_slots"/>
|
||||
<result property="type" column="erc_type"/>
|
||||
<result property="isEnabled" column="erc_is_enabled"/>
|
||||
<id property="id" column="eblack_record_id"/>
|
||||
<result property="dateType" column="eblack_date_type"/>
|
||||
<result property="customTimeSlots" column="eblack_custom_time_slots"/>
|
||||
<result property="type" column="eblack_type"/>
|
||||
<result property="isEnabled" column="eblack_is_enabled"/>
|
||||
</collection>
|
||||
<!-- 嵌套集合:紧急响应时间区间 -->
|
||||
<collection property="prodEmergencyResponseIntervalsList" ofType="com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO">
|
||||
@@ -190,13 +186,13 @@
|
||||
<result property="changeTimeRule" column="rc_change_time_rule"/>
|
||||
<result property="timeSlot" column="rc_time_slot"/>
|
||||
<result property="maxChangeTimes" column="rc_max_change_times"/>
|
||||
<!-- 嵌套集合:紧急响应时间区间 -->
|
||||
<collection property="prodReservationBlackList" ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO">
|
||||
<id property="id" column="rcp_record_id"/>
|
||||
<result property="dateType" column="rcp_date_type"/>
|
||||
<result property="customTimeSlots" column="rcp_custom_time_slots"/>
|
||||
<result property="type" column="rcp_type"/>
|
||||
<result property="isEnabled" column="rcp_is_enabled"/>
|
||||
<collection property="prodReservationBlackList"
|
||||
ofType="com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO"> <!-- 所有 blacklist 字段加 black_ 前缀 -->
|
||||
<id property="id" column="black_id"/>
|
||||
<result property="dateType" column="black_date_type"/>
|
||||
<result property="customTimeSlots" column="black_custom_time_slots"/>
|
||||
<result property="type" column="black_type"/>
|
||||
<result property="isEnabled" column="black_is_enabled"/>
|
||||
</collection>
|
||||
</association>
|
||||
|
||||
@@ -262,6 +258,7 @@
|
||||
<!-- 用于列表页,可根据开关动态决定是否关联紧急响应信息以优化性能 -->
|
||||
<select id="selectProdService" parameterType="map" resultMap="ProdServiceResultMap">
|
||||
SELECT
|
||||
p.prod_id,
|
||||
p.emergency_switch,
|
||||
p.additional_switch,
|
||||
p.additional_fee_switch,
|
||||
@@ -278,11 +275,13 @@
|
||||
<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,
|
||||
epafd.custom_time_slots as erc_custom_time_slots,
|
||||
epafd.type as erc_type,
|
||||
epafd.is_enabled as erc_is_enabled,
|
||||
|
||||
epafd.id AS eblack_record_id,
|
||||
epafd.date_type as eblack_date_type,
|
||||
epafd.custom_time_slots as eblack_custom_time_slots,
|
||||
epafd.type as eblack_type,
|
||||
epafd.is_enabled as eblack_is_enabled,
|
||||
|
||||
eri.id AS eri_record_id,
|
||||
eri.config_id AS eri_config_id,
|
||||
eri.mode_name,
|
||||
@@ -334,11 +333,13 @@
|
||||
rc.change_time_rule AS rc_change_time_rule,
|
||||
rc.time_slot AS rc_time_slot,
|
||||
rc.max_change_times AS rc_max_change_times,
|
||||
rpafd.id AS rcp_record_id,
|
||||
rpafd.date_type as rcp_date_type,
|
||||
rpafd.custom_time_slots as rcp_custom_time_slots,
|
||||
rpafd.type as rcp_type,
|
||||
rpafd.is_enabled as rcp_is_enabled,
|
||||
|
||||
rpafd.id AS black_id,
|
||||
rpafd.date_type as black_date_type,
|
||||
rpafd.custom_time_slots as black_custom_time_slots,
|
||||
rpafd.type as black_type,
|
||||
rpafd.is_enabled as black_is_enabled,
|
||||
|
||||
</if>
|
||||
<!-- 只有当 orderLimitSwitch 开启时,才查询接单上限配置相关字段 -->
|
||||
<if test="orderLimitSwitch != null and orderLimitSwitch == 1">
|
||||
@@ -364,13 +365,13 @@
|
||||
sa.fee AS sa_fee,
|
||||
saa.area_name AS sa_area_name,
|
||||
</if>
|
||||
p.prod_id
|
||||
p.prod_name
|
||||
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_additional_fee_dates epafd ON erc.prod_id = epafd.prod_id AND epafd.deleted = 0 AND epafd.type = 3
|
||||
LEFT JOIN tz_prod_additional_fee_dates epafd ON p.prod_id = epafd.prod_id AND epafd.deleted = 0 AND epafd.type = 3
|
||||
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">
|
||||
@@ -381,7 +382,7 @@
|
||||
</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
|
||||
LEFT JOIN tz_prod_additional_fee_dates rpafd ON rc.id = rpafd.prod_id AND rpafd.deleted = 0 AND rpafd.type = 2
|
||||
LEFT JOIN tz_prod_additional_fee_dates rpafd ON p.prod_id = rpafd.prod_id AND rpafd.deleted = 0 AND rpafd.type = 2
|
||||
</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
|
||||
@@ -407,6 +408,7 @@
|
||||
<!-- 用于列表页,可根据开关动态决定是否关联紧急响应信息以优化性能 -->
|
||||
<select id="selectProdServiceInfo" parameterType="map" resultMap="ProdServiceResultInfoMap">
|
||||
SELECT
|
||||
p.prod_id,
|
||||
p.emergency_switch,
|
||||
p.additional_switch,
|
||||
p.additional_fee_switch,
|
||||
@@ -418,11 +420,13 @@
|
||||
<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,
|
||||
epafd.custom_time_slots as erc_custom_time_slots,
|
||||
epafd.type as erc_type,
|
||||
epafd.is_enabled as erc_is_enabled,
|
||||
|
||||
epafd.id AS eblack_record_id,
|
||||
epafd.date_type as eblack_date_type,
|
||||
epafd.custom_time_slots as eblack_custom_time_slots,
|
||||
epafd.type as eblack_type,
|
||||
epafd.is_enabled as eblack_is_enabled,
|
||||
|
||||
eri.id AS eri_record_id,
|
||||
eri.config_id AS eri_config_id,
|
||||
eri.mode_name,
|
||||
@@ -474,11 +478,12 @@
|
||||
rc.change_time_rule AS rc_change_time_rule,
|
||||
rc.time_slot AS rc_time_slot,
|
||||
rc.max_change_times AS rc_max_change_times,
|
||||
rpafd.id AS rcp_record_id,
|
||||
rpafd.date_type as rcp_date_type,
|
||||
rpafd.custom_time_slots as rcp_custom_time_slots,
|
||||
rpafd.type as rcp_type,
|
||||
rpafd.is_enabled as rcp_is_enabled,
|
||||
|
||||
rpafd.id AS black_id,
|
||||
rpafd.date_type as black_date_type,
|
||||
rpafd.custom_time_slots as black_custom_time_slots,
|
||||
rpafd.type as black_type,
|
||||
rpafd.is_enabled as black_is_enabled,
|
||||
</if>
|
||||
<!-- 只有当 orderLimitSwitch 开启时,才查询接单上限配置相关字段 -->
|
||||
<if test="orderLimitSwitch != null and orderLimitSwitch == 1">
|
||||
@@ -496,13 +501,13 @@
|
||||
wrp.price AS wrp_price,
|
||||
wrp.is_enabled AS wrp_is_enabled,
|
||||
</if>
|
||||
p.prod_id
|
||||
p.prod_name
|
||||
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_additional_fee_dates epafd ON erc.prod_id = epafd.prod_id AND epafd.deleted = 0 AND epafd.type = 3
|
||||
LEFT JOIN tz_prod_additional_fee_dates epafd ON p.prod_id = epafd.prod_id AND epafd.deleted = 0 AND epafd.type = 3
|
||||
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">
|
||||
@@ -513,7 +518,7 @@
|
||||
</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
|
||||
LEFT JOIN tz_prod_additional_fee_dates rpafd ON rc.id = rpafd.prod_id AND rpafd.deleted = 0 AND rpafd.type = 2
|
||||
LEFT JOIN tz_prod_additional_fee_dates rpafd ON p.prod_id = rpafd.prod_id AND rpafd.deleted = 0 AND rpafd.type = 2
|
||||
</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
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
<update id="deleteProdPropValueById">
|
||||
UPDATE tz_prod_prop_value
|
||||
SET
|
||||
is_expire = 1, delete_time = NOW()
|
||||
deleted = 1, delete_time = NOW()
|
||||
WHERE id = #{id}
|
||||
</update>
|
||||
|
||||
@@ -87,10 +87,20 @@
|
||||
FROM tz_prod_prop pp
|
||||
JOIN tz_prod_prop_value ppv ON pp.id = ppv.prop_id
|
||||
WHERE pp.prod_id = #{prodId}
|
||||
AND ppv.is_expire = 1
|
||||
AND (ppv.is_expire = 1 or ppv.deleted = 1)
|
||||
<if test="propValue != null and propValue != ''">
|
||||
and prop_value like concat('%', #{propValue}, '%')
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getskuListByPropValueIds" resultType="com.tashow.cloud.productapi.api.product.dto.ProdPropValueDO">
|
||||
SELECT *
|
||||
FROM tz_prod_prop_value
|
||||
WHERE id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@@ -84,10 +84,31 @@
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getskuListByDeleted" resultType="com.tashow.cloud.productapi.api.product.dto.SkuDO">
|
||||
SELECT *
|
||||
FROM tz_sku
|
||||
WHERE prod_id = #{prodId} AND deleted = 1 and sku_id not IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
<update id="updateSkuDeleted">
|
||||
UPDATE tz_sku
|
||||
SET deleted = 0
|
||||
WHERE sku_id = #{skuId}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="batchSkuRecover">
|
||||
UPDATE tz_sku
|
||||
SET deleted = 0
|
||||
WHERE sku_id IN
|
||||
<foreach item="id" collection="ids" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user