From 6b75391e97aa770e12965ec6e542856df79e6de0 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 27 九月 2019 15:14:02 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/div' into div --- fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandInfoServiceImpl.java | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandInfoServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandInfoServiceImpl.java index 134fb96..4c974af 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandInfoServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/brand/BrandInfoServiceImpl.java @@ -10,6 +10,7 @@ import javax.annotation.Resource; import org.springframework.cache.annotation.Cacheable; +import org.springframework.core.task.TaskExecutor; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import org.yeshi.utils.tencentcloud.COSManager; @@ -68,6 +69,10 @@ @Resource private BrandShopCaheService brandShopCaheService; + @Resource(name = "taskExecutor") + private TaskExecutor executor; + + @Override public void saveObject(MultipartFile file, BrandInfo record) throws BrandInfoException { String name = record.getName(); @@ -118,6 +123,17 @@ record.setUpdateTime(new Date()); brandInfoMapper.updateByPrimaryKey(record); } + + if (state == 1) { + executor.execute(new Runnable() { + @Override + public void run() { + int goodsTotal = brandGoodsCaheService.addBrandGoods(record); + record.setGoodsTotal(goodsTotal); + brandInfoMapper.updateByPrimaryKeySelective(record); + } + }); + } } -- Gitblit v1.8.0