bug fix --商品是否可售控制
This commit is contained in:
@@ -407,12 +407,9 @@ public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> impl
|
||||
}
|
||||
super.updateById(entity);
|
||||
// 清除商品分类列表缓存
|
||||
Long categoryId = ObjUtil.defaultIfNull(dto.getCategoryId(), old.getCategoryId());
|
||||
if (!old.getCategoryId().equals(categoryId)) {
|
||||
// 清除旧分类缓存&新分类缓存
|
||||
clearProductCache(old.getCategoryId(), entity.getCategoryId());
|
||||
} else {
|
||||
clearProductCache(old.getCategoryId());
|
||||
clearProductCache(old.getCategoryId());
|
||||
if (!old.getCategoryId().equals(dto.getCategoryId())) {
|
||||
clearProductCache(entity.getCategoryId());
|
||||
}
|
||||
if (ObjUtil.defaultIfNull(dto.getIsStock(), old.getIsStock()) == YesNoEnum.NO.value()) {
|
||||
redisService.del(StrUtil.format(CacheConstant.SHOP_PRODUCT_STOCK, shopId, dto.getId()));
|
||||
|
||||
@@ -233,9 +233,9 @@ public class UProductServiceImpl extends ServiceImpl<ProductMapper, Product> imp
|
||||
* @return 是否可售时间 1-是,0-否
|
||||
*/
|
||||
@Override
|
||||
public Integer calcIsSaleTime(Integer useTime, LocalTime startTime, LocalTime endTime) {
|
||||
public Integer calcIsSaleTime(int prodIsSaleTime, Integer useTime, LocalTime startTime, LocalTime endTime) {
|
||||
if (NumberUtil.nullToZero(useTime) == 0) {
|
||||
return YesNoEnum.YES.value();
|
||||
return prodIsSaleTime;
|
||||
}
|
||||
if (ObjUtil.isNull(startTime) || ObjUtil.isNull(endTime)) {
|
||||
return YesNoEnum.NO.value();
|
||||
|
||||
Reference in New Issue
Block a user