规格回收站
This commit is contained in:
@@ -63,7 +63,8 @@ public class ProdListVO {
|
|||||||
/**
|
/**
|
||||||
* 服务时段
|
* 服务时段
|
||||||
*/
|
*/
|
||||||
private BigDecimal reservationTimeSlots;
|
@TableField(typeHandler = StringListTypeHandler.class)
|
||||||
|
private List<String> reservationTimeSlots;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 还剩多少天
|
* 还剩多少天
|
||||||
|
|||||||
@@ -1,7 +1,9 @@
|
|||||||
package com.tashow.cloud.productapi.api.product.vo.prod;
|
package com.tashow.cloud.productapi.api.product.vo.prod;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import com.tashow.cloud.productapi.general.StringListTypeHandler;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -49,7 +51,8 @@ public class ProdRestoreListVO {
|
|||||||
/**
|
/**
|
||||||
* 服务时段
|
* 服务时段
|
||||||
*/
|
*/
|
||||||
private BigDecimal reservationTimeSlots;
|
@TableField(typeHandler = StringListTypeHandler.class)
|
||||||
|
private List<String> reservationTimeSlots;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 还剩多少天
|
* 还剩多少天
|
||||||
|
|||||||
@@ -5,9 +5,12 @@ 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.ProdAdditionalFeePeriodsDO;
|
||||||
import com.tashow.cloud.productapi.api.product.dto.ProdWeightRangePricesDO;
|
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.dto.ProductOrderLimitDO;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyInfoReqVO;
|
||||||
import com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse.ProdEmergencyInfoVO;
|
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.prodreservationconfig.ProdReservationInfoVO;
|
||||||
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasInfoVO;
|
import com.tashow.cloud.productapi.api.product.vo.prodserviceareas.ProdServiceAreasInfoVO;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prodweightrangeprices.ProdWeightRangePricesSaveInfoVO;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
@@ -48,12 +51,12 @@ public class ProdServiceInfoVO {
|
|||||||
@Schema(description = "是否预约0关1开")
|
@Schema(description = "是否预约0关1开")
|
||||||
private Integer reservationSwitch;
|
private Integer reservationSwitch;
|
||||||
@Schema(description = "预约配置")
|
@Schema(description = "预约配置")
|
||||||
public ProdReservationInfoVO prodReservationConfig;
|
public ProdReservationInfoReqVO prodReservationConfig;
|
||||||
|
|
||||||
@Schema(description = "是否紧急响应服务0关1开")
|
@Schema(description = "是否紧急响应服务0关1开")
|
||||||
private Integer emergencySwitch;
|
private Integer emergencySwitch;
|
||||||
@Schema(description = "急响应服务配置")
|
@Schema(description = "急响应服务配置")
|
||||||
public ProdEmergencyInfoVO prodEmergencyInfoVO;
|
public ProdEmergencyInfoReqVO prodEmergencyInfoVO;
|
||||||
|
|
||||||
@Schema(description = "是否接单上线0关1开")
|
@Schema(description = "是否接单上线0关1开")
|
||||||
private Integer orderLimitSwitch;
|
private Integer orderLimitSwitch;
|
||||||
@@ -75,6 +78,7 @@ public class ProdServiceInfoVO {
|
|||||||
@Schema(description = "是否开启体重配置0关1开")
|
@Schema(description = "是否开启体重配置0关1开")
|
||||||
private Integer weightSwitch;
|
private Integer weightSwitch;
|
||||||
@Schema(description = "体重配置")
|
@Schema(description = "体重配置")
|
||||||
public List<ProdWeightRangePricesDO> prodWeightConfig;
|
public ProdWeightRangePricesSaveInfoVO prodWeightConfig;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
package com.tashow.cloud.productapi.api.product.vo.prodemergencyresponse;
|
||||||
|
|
||||||
|
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
|
import com.tashow.cloud.productapi.api.product.dto.ProdEmergencyResponseIntervalsDO;
|
||||||
|
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.List;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
@Schema(description = "管理后台 - 商品紧急响应服务设置 Response VO")
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class ProdEmergencyInfoReqVO {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 紧急响应服务配置的唯一标识符
|
||||||
|
*/
|
||||||
|
private Long id;
|
||||||
|
/**
|
||||||
|
* 关联的商品ID
|
||||||
|
*/
|
||||||
|
private Long prodId;
|
||||||
|
/**
|
||||||
|
* 可响应时间段
|
||||||
|
*/
|
||||||
|
@TableField(typeHandler = StringListTypeHandler.class)
|
||||||
|
private List<String> responseTimeSlots;
|
||||||
|
|
||||||
|
@Schema(description = "紧急响应时间区间设置")
|
||||||
|
public List<ProdEmergencyResponseIntervalsDO> prodEmergencyResponseIntervalsList;
|
||||||
|
|
||||||
|
@Schema(description = "紧急响应黑名单日期设置")
|
||||||
|
public List<ProdAdditionalFeeBlackVO> prodEmergencyResponseBlackList;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
package com.tashow.cloud.productapi.api.product.vo.prodpropvalue;
|
||||||
|
|
||||||
|
import com.tashow.cloud.common.pojo.PageParam;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.ToString;
|
||||||
|
|
||||||
|
@Schema(description = "")
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@ToString(callSuper = true)
|
||||||
|
public class ProPageReqVO extends PageParam {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 属性规格名称
|
||||||
|
*/
|
||||||
|
private String propValue;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 商品id
|
||||||
|
*/
|
||||||
|
private Long prodId;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package com.tashow.cloud.productapi.api.product.vo.prodpropvalue;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ProPropRecycleBinVO {
|
||||||
|
@Schema(description = "规格值id")
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 属性规格名称
|
||||||
|
*/
|
||||||
|
private String propValue;
|
||||||
|
/**
|
||||||
|
* 关联规格属性id
|
||||||
|
*/
|
||||||
|
private Long propId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 还剩多少天
|
||||||
|
*/
|
||||||
|
private Long remainingDays;
|
||||||
|
/**
|
||||||
|
* 删除时间
|
||||||
|
*/
|
||||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
private Date deleteTime;
|
||||||
|
}
|
||||||
@@ -12,9 +12,13 @@ public class SkuRecycleBinVO {
|
|||||||
private Long skuId;
|
private Long skuId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 是否显示失效规格值 0否1是
|
* 属性规格名称
|
||||||
*/
|
*/
|
||||||
private String properties;
|
private String properties;
|
||||||
|
/**
|
||||||
|
* 是否显示失效规格值 0否1是
|
||||||
|
*/
|
||||||
|
private String skuName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 还剩多少天
|
* 还剩多少天
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ public class ProdController {
|
|||||||
@PostMapping("/uptateProdService")
|
@PostMapping("/uptateProdService")
|
||||||
@Operation(summary = "修改商品服务配置")
|
@Operation(summary = "修改商品服务配置")
|
||||||
@PermitAll
|
@PermitAll
|
||||||
public CommonResult<Boolean> uptateProdService(@Valid @RequestBody ProdServiceVO prodServiceVO) {
|
public CommonResult<Boolean> uptateProdService(@Valid @RequestBody ProdServiceInfoVO prodServiceInfoVO) {
|
||||||
prodService.uptateProdService(prodServiceVO);
|
prodService.uptateProdService(prodServiceInfoVO);
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ public class ProdController {
|
|||||||
ProdDO prod = new ProdDO();
|
ProdDO prod = new ProdDO();
|
||||||
prod.setProdId(id);
|
prod.setProdId(id);
|
||||||
prod.setStatus(status);
|
prod.setStatus(status);
|
||||||
prodMapper.updateBatch(prod);
|
prodMapper.updateById(prod);
|
||||||
}
|
}
|
||||||
return success(true);
|
return success(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import com.tashow.cloud.product.service.ProdExtendService;
|
|||||||
import com.tashow.cloud.product.service.ProdPropService;
|
import com.tashow.cloud.product.service.ProdPropService;
|
||||||
import com.tashow.cloud.product.service.ProdPropValueService;
|
import com.tashow.cloud.product.service.ProdPropValueService;
|
||||||
import com.tashow.cloud.product.service.SkuService;
|
import com.tashow.cloud.product.service.SkuService;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPageReqVO;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPropRecycleBinVO;
|
||||||
import com.tashow.cloud.productapi.api.product.vo.sku.*;
|
import com.tashow.cloud.productapi.api.product.vo.sku.*;
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
import io.swagger.v3.oas.annotations.Operation;
|
||||||
import io.swagger.v3.oas.annotations.Parameter;
|
import io.swagger.v3.oas.annotations.Parameter;
|
||||||
@@ -76,6 +78,18 @@ public class SkuController {
|
|||||||
return success(skuService.getSKuPropList(prodId));
|
return success(skuService.getSKuPropList(prodId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@PermitAll
|
||||||
|
@GetMapping("/getPropRecycleBinList")
|
||||||
|
@Operation(summary = "获取规格回收站")
|
||||||
|
public CommonResult<PageResult<ProPropRecycleBinVO>> getSKuPropRecycleBinList(ProPageReqVO proPageReqVO) {
|
||||||
|
PageResult<ProPropRecycleBinVO> pageResult = skuService.getSKuPropRecycleBinList(proPageReqVO);
|
||||||
|
return success(pageResult);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@PutMapping("/deleteProp")
|
@PutMapping("/deleteProp")
|
||||||
@Operation(summary = "删除规格值")
|
@Operation(summary = "删除规格值")
|
||||||
@PermitAll
|
@PermitAll
|
||||||
|
|||||||
@@ -2,10 +2,14 @@ package com.tashow.cloud.product.mapper;
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.tashow.cloud.common.pojo.PageResult;
|
import com.tashow.cloud.common.pojo.PageResult;
|
||||||
import com.tashow.cloud.mybatis.mybatis.core.query.LambdaQueryWrapperX;
|
import com.tashow.cloud.mybatis.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
import com.tashow.cloud.mybatis.mybatis.core.mapper.BaseMapperX;
|
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.ProdPropValueDO;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPropRecycleBinVO;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
import org.apache.ibatis.annotations.Param;
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
@@ -34,4 +38,6 @@ public interface ProdPropValueMapper extends BaseMapperX<ProdPropValueDO> {
|
|||||||
|
|
||||||
List<ProdPropValueDO> selectRestoreProp(@Param("prodId") Long prodId);
|
List<ProdPropValueDO> selectRestoreProp(@Param("prodId") Long prodId);
|
||||||
|
|
||||||
|
IPage<ProPropRecycleBinVO> getSKuPropRecycleBinList(Page<?> page, @Param("prodId") Long prodId,@Param("propValue")String propValue);
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -31,4 +31,9 @@ public interface SkuMapper extends BaseMapperX<SkuDO> {
|
|||||||
int deleteBySkuId( @Param("skuId")Long skuId);
|
int deleteBySkuId( @Param("skuId")Long skuId);
|
||||||
|
|
||||||
void batchSkuDeleted(@Param("ids") List<Long> ids);
|
void batchSkuDeleted(@Param("ids") List<Long> ids);
|
||||||
|
|
||||||
|
void updateSkuDeleted(@Param("skuId") Long skuId);
|
||||||
|
|
||||||
|
|
||||||
|
List<SkuDO> getskuListBySkuIds( @Param("ids")List<Long> ids);
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ public interface ProdService {
|
|||||||
* @param prodServiceVO 创建信息
|
* @param prodServiceVO 创建信息
|
||||||
* @return 编号
|
* @return 编号
|
||||||
*/
|
*/
|
||||||
void uptateProdService(@Valid ProdServiceVO prodServiceVO);
|
void uptateProdService(@Valid ProdServiceInfoVO prodServiceInfoVO);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,8 @@ package com.tashow.cloud.product.service;
|
|||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import com.tashow.cloud.productapi.api.product.dto.*;
|
import com.tashow.cloud.productapi.api.product.dto.*;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPageReqVO;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPropRecycleBinVO;
|
||||||
import com.tashow.cloud.productapi.api.product.vo.sku.*;
|
import com.tashow.cloud.productapi.api.product.vo.sku.*;
|
||||||
import jakarta.validation.*;
|
import jakarta.validation.*;
|
||||||
import com.tashow.cloud.common.pojo.PageResult;
|
import com.tashow.cloud.common.pojo.PageResult;
|
||||||
@@ -74,6 +76,7 @@ public interface SkuService {
|
|||||||
|
|
||||||
SkuPropInfoVO getSKuPropList(Long prodId);
|
SkuPropInfoVO getSKuPropList(Long prodId);
|
||||||
|
|
||||||
|
PageResult<ProPropRecycleBinVO> getSKuPropRecycleBinList(ProPageReqVO proPageReqVO);
|
||||||
/**
|
/**
|
||||||
* 删除单品SKU
|
* 删除单品SKU
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -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.prod.*;
|
||||||
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO;
|
import com.tashow.cloud.productapi.api.product.vo.prodadditionalfeedates.ProdAdditionalFeeBlackVO;
|
||||||
|
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.prodreservationconfig.ProdReservationInfoVO;
|
||||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuPageReqVO;
|
import com.tashow.cloud.productapi.api.product.vo.sku.SkuPageReqVO;
|
||||||
import com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO;
|
import com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO;
|
||||||
@@ -178,7 +179,7 @@ public class ProdServiceImpl implements ProdService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Transactional
|
@Transactional
|
||||||
public void uptateProdService(ProdServiceVO prodServiceVO) {
|
public void uptateProdService(ProdServiceInfoVO prodServiceVO) {
|
||||||
|
|
||||||
ProdDO prod = BeanUtils.toBean(prodServiceVO, ProdDO.class);
|
ProdDO prod = BeanUtils.toBean(prodServiceVO, ProdDO.class);
|
||||||
//服务区域设置
|
//服务区域设置
|
||||||
@@ -237,7 +238,7 @@ public class ProdServiceImpl implements ProdService {
|
|||||||
.eq(ProdReservationConfigDO::getProdId, prodServiceVO.getProdId()));
|
.eq(ProdReservationConfigDO::getProdId, prodServiceVO.getProdId()));
|
||||||
if (reservationConfig == null) {
|
if (reservationConfig == null) {
|
||||||
prod.setReservationSwitch(BaseEnum.YES_ONE.getKey());
|
prod.setReservationSwitch(BaseEnum.YES_ONE.getKey());
|
||||||
ProdReservationInfoVO prodReservationInfoVO = prodServiceVO.getProdReservationConfig();
|
ProdReservationInfoReqVO prodReservationInfoVO = prodServiceVO.getProdReservationConfig();
|
||||||
ProdReservationConfigDO prodReservationConfigDO = BeanUtils.toBean(prodReservationInfoVO, ProdReservationConfigDO.class);
|
ProdReservationConfigDO prodReservationConfigDO = BeanUtils.toBean(prodReservationInfoVO, ProdReservationConfigDO.class);
|
||||||
prodReservationConfigDO.setProdId(prod.getProdId());
|
prodReservationConfigDO.setProdId(prod.getProdId());
|
||||||
prodReservationConfigDO.setTimeBook(prodServiceVO.getProdReservationConfig().getTimeBook());
|
prodReservationConfigDO.setTimeBook(prodServiceVO.getProdReservationConfig().getTimeBook());
|
||||||
@@ -311,6 +312,7 @@ public class ProdServiceImpl implements ProdService {
|
|||||||
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdReservationConfig().getProdReservationBlackList()) {
|
for (ProdAdditionalFeeBlackVO prodAdditionalFeeBlackVO : prodServiceVO.getProdReservationConfig().getProdReservationBlackList()) {
|
||||||
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
|
ProdAdditionalFeeDatesDO prodAdditionalFeeDatesDO = BeanUtils.toBean(prodAdditionalFeeBlackVO, ProdAdditionalFeeDatesDO.class);
|
||||||
prodAdditionalFeeDatesDO.setProdId(prod.getProdId());
|
prodAdditionalFeeDatesDO.setProdId(prod.getProdId());
|
||||||
|
prodAdditionalFeeDatesDO.setType(3);
|
||||||
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDatesDO);
|
prodAdditionalFeeDatesMapper.insert(prodAdditionalFeeDatesDO);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ import com.tashow.cloud.product.service.ProdExtendService;
|
|||||||
import com.tashow.cloud.product.service.ProdPropService;
|
import com.tashow.cloud.product.service.ProdPropService;
|
||||||
import com.tashow.cloud.product.service.ProdPropValueService;
|
import com.tashow.cloud.product.service.ProdPropValueService;
|
||||||
import com.tashow.cloud.product.service.SkuService;
|
import com.tashow.cloud.product.service.SkuService;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPageReqVO;
|
||||||
|
import com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPropRecycleBinVO;
|
||||||
import com.tashow.cloud.productapi.api.product.vo.sku.*;
|
import com.tashow.cloud.productapi.api.product.vo.sku.*;
|
||||||
import com.tashow.cloud.productapi.enums.BaseEnum;
|
import com.tashow.cloud.productapi.enums.BaseEnum;
|
||||||
import com.tashow.cloud.productapi.enums.ErrorCodeConstants;
|
import com.tashow.cloud.productapi.enums.ErrorCodeConstants;
|
||||||
@@ -483,6 +485,17 @@ public class SkuServiceImpl implements SkuService {
|
|||||||
return skuPropInfoVO;
|
return skuPropInfoVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PageResult<ProPropRecycleBinVO> getSKuPropRecycleBinList(ProPageReqVO proPageReqVO) {
|
||||||
|
IPage<ProPropRecycleBinVO> prodPageList = prodPropValueMapper.getSKuPropRecycleBinList(MyBatisUtils.buildPage(proPageReqVO),proPageReqVO.getProdId(), proPageReqVO.getPropValue());
|
||||||
|
for (ProPropRecycleBinVO prodPage : prodPageList.getRecords()) {
|
||||||
|
if (prodPage.getDeleteTime() != null) {
|
||||||
|
prodPage.setRemainingDays(DateUtils.getRemainingDays(prodPage.getDeleteTime()));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new PageResult<>(prodPageList.getRecords(), prodPageList.getTotal());
|
||||||
|
}
|
||||||
|
|
||||||
/* @Override
|
/* @Override
|
||||||
public SkuPropInfoVO getSKuPropList(Long prodId, Integer isExpire, Integer state) {
|
public SkuPropInfoVO getSKuPropList(Long prodId, Integer isExpire, Integer state) {
|
||||||
if (prodId == null) {
|
if (prodId == null) {
|
||||||
@@ -710,14 +723,13 @@ public class SkuServiceImpl implements SkuService {
|
|||||||
@Override
|
@Override
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public void restoreSkuList(List<Long> ids) {
|
public void restoreSkuList(List<Long> ids) {
|
||||||
List<SkuDO> skuList = skuMapper.selectByIds(ids);
|
List<SkuDO> skuList = skuMapper.getskuListBySkuIds(ids);
|
||||||
if (skuList.isEmpty()) {
|
if (skuList.isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Set<String> currentlyUsedValues = new HashSet<>();
|
Set<String> currentlyUsedValues = new HashSet<>();
|
||||||
for (SkuDO sku : skuList) {
|
for (SkuDO sku : skuList) {
|
||||||
sku.setDeleted(BaseEnum.NO_ZERO.getKey());
|
skuMapper.updateSkuDeleted(sku.getSkuId());
|
||||||
skuMapper.updateById(sku);
|
|
||||||
if (sku.getProperties() != null && !sku.getProperties().trim().isEmpty()) {
|
if (sku.getProperties() != null && !sku.getProperties().trim().isEmpty()) {
|
||||||
String[] values = sku.getProperties().split(",");
|
String[] values = sku.getProperties().split(",");
|
||||||
for (String v : values) {
|
for (String v : values) {
|
||||||
|
|||||||
@@ -588,7 +588,7 @@
|
|||||||
) min_eri ON tp.prod_id = min_eri.prod_id
|
) min_eri ON tp.prod_id = min_eri.prod_id
|
||||||
where tp.deleted = 1
|
where tp.deleted = 1
|
||||||
<if test="prodName != null and prodName != ''">
|
<if test="prodName != null and prodName != ''">
|
||||||
and tp.prod_ame like concat('%', #{prodName}, '%')
|
and tp.prod_name like concat('%', #{prodName}, '%')
|
||||||
</if>
|
</if>
|
||||||
<if test="deleteTime != null and deleteTime.length == 2">
|
<if test="deleteTime != null and deleteTime.length == 2">
|
||||||
AND tp.delete_time BETWEEN #{deleteTime[0]} AND #{deleteTime[1]}
|
AND tp.delete_time BETWEEN #{deleteTime[0]} AND #{deleteTime[1]}
|
||||||
@@ -641,4 +641,7 @@
|
|||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -11,4 +11,7 @@
|
|||||||
<select id="getProdPropByPropNameAndShopId" resultType="com.tashow.cloud.productapi.api.product.dto.ProdPropDO">
|
<select id="getProdPropByPropNameAndShopId" resultType="com.tashow.cloud.productapi.api.product.dto.ProdPropDO">
|
||||||
select * from tz_prod_prop where prop_name = #{propName} and prod_id = #{prodId} and rule = #{rule}
|
select * from tz_prod_prop where prop_name = #{propName} and prod_id = #{prodId} and rule = #{rule}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -78,6 +78,19 @@
|
|||||||
|
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="getSKuPropRecycleBinList" resultType="com.tashow.cloud.productapi.api.product.vo.prodpropvalue.ProPropRecycleBinVO" >
|
||||||
|
SELECT
|
||||||
|
ppv.id,
|
||||||
|
ppv.prop_value,
|
||||||
|
ppv.prop_id,
|
||||||
|
ppv.delete_time
|
||||||
|
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
|
||||||
|
<if test="propValue != null and propValue != ''">
|
||||||
|
and prop_value like concat('%', #{propValue}, '%')
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
-->
|
-->
|
||||||
|
|
||||||
<select id="getSkuRecycleBinPageList" resultType="com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO" >
|
<select id="getSkuRecycleBinPageList" resultType="com.tashow.cloud.productapi.api.product.vo.sku.SkuRecycleBinVO" >
|
||||||
select sku_id, properties, delete_time from tz_sku where prod_id = #{prodId} and deleted = 1
|
select sku_id, properties,sku_name, delete_time from tz_sku where prod_id = #{prodId} and deleted = 1
|
||||||
<if test="properties != null and properties != ''">
|
<if test="properties != null and properties != ''">
|
||||||
and properties like concat('%', #{properties}, '%')
|
and properties like concat('%', #{properties}, '%')
|
||||||
</if>
|
</if>
|
||||||
@@ -73,4 +73,21 @@
|
|||||||
#{id}
|
#{id}
|
||||||
</foreach>
|
</foreach>
|
||||||
</update>
|
</update>
|
||||||
|
|
||||||
|
|
||||||
|
<select id="getskuListBySkuIds" resultType="com.tashow.cloud.productapi.api.product.dto.SkuDO">
|
||||||
|
SELECT *
|
||||||
|
FROM tz_sku
|
||||||
|
WHERE sku_id 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>
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user