8 changed files with 153 additions and 0 deletions
@ -0,0 +1,20 @@ |
|||||
|
package com.qs.serve.modules.goods.entity.dto; |
||||
|
|
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/12/20 |
||||
|
*/ |
||||
|
@Data |
||||
|
public class GoodSpuSkuNum { |
||||
|
|
||||
|
private Long spuId; |
||||
|
|
||||
|
private Long countOrder; |
||||
|
|
||||
|
private Long countSpec; |
||||
|
|
||||
|
private Long countSku; |
||||
|
|
||||
|
} |
@ -0,0 +1,27 @@ |
|||||
|
package com.qs.serve.task; |
||||
|
|
||||
|
import com.qs.serve.modules.goods.service.GoodsSpuService; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import lombok.extern.slf4j.Slf4j; |
||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
||||
|
import org.springframework.scheduling.annotation.Scheduled; |
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @author YenHex |
||||
|
* @since 2023/12/20 |
||||
|
*/ |
||||
|
@Slf4j |
||||
|
@Component |
||||
|
@AllArgsConstructor |
||||
|
@ConditionalOnProperty(value = "project.task", havingValue = "true") |
||||
|
public class GoodsTask { |
||||
|
|
||||
|
private GoodsSpuService goodsSpuService; |
||||
|
|
||||
|
@Scheduled(cron="0 0 1 * * ?") |
||||
|
public void buildTempTable(){ |
||||
|
goodsSpuService.initSkuNum(); |
||||
|
} |
||||
|
|
||||
|
} |
Loading…
Reference in new issue