fix: 优化更新促销状态流程,增加促销检查

This commit is contained in:
misworga831 2023-04-12 16:13:29 +08:00
parent b2fb415ab5
commit 38ad5bb394
3 changed files with 9 additions and 0 deletions

View File

@ -102,6 +102,9 @@ public class CartSkuVO extends CartBase implements Serializable {
*/
public CartSkuVO(GoodsSku goodsSku) {
this.goodsSku = goodsSku;
if (goodsSku.getUpdateTime() == null) {
this.goodsSku.setUpdateTime(goodsSku.getCreateTime());
}
this.checked = true;
this.invalid = false;
//默认时间为0让系统为此商品更新缓存

View File

@ -112,6 +112,7 @@ public abstract class AbstractPromotionsServiceImpl<M extends BaseMapper<T>, T e
List<T> promotionsList = this.list(new QueryWrapper<T>().in("id", ids));
for (T t : promotionsList) {
if (startTime != null && endTime != null) {
this.checkPromotions(t);
t.setStartTime(new Date(startTime));
t.setEndTime(new Date(endTime));
} else {

View File

@ -350,6 +350,11 @@ public class EsGoodsIndex implements Serializable {
}
}
public EsGoodsIndex(GoodsSku sku, Date createDate) {
this(sku);
this.releaseTime = createDate.getTime();
}
public void setGoodsSku(GoodsSku sku) {
if (sku != null) {
this.id = sku.getId();