From f301c983314494841e54aa0cd87d01a4bdc72d16 Mon Sep 17 00:00:00 2001
From: yujian <yujian@163.com>
Date: 星期三, 15 四月 2020 11:32:00 +0800
Subject: [PATCH] 消息调整
---
fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushGoodsServiceImpl.java | 31 ++++++++++++++++++-------------
1 files changed, 18 insertions(+), 13 deletions(-)
diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushGoodsServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushGoodsServiceImpl.java
index 76cdaab..936229c 100644
--- a/fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushGoodsServiceImpl.java
+++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/push/PushGoodsServiceImpl.java
@@ -15,6 +15,7 @@
import com.yeshi.fanli.entity.goods.CommonGoods;
import com.yeshi.fanli.entity.push.PushGoods;
import com.yeshi.fanli.entity.push.PushGoodsGroup;
+import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.push.PushException;
import com.yeshi.fanli.exception.push.PushGoodsException;
@@ -78,7 +79,7 @@
}
@Override
- @Transactional
+ @Transactional(rollbackFor=Exception.class)
public void save(PushGoods record, List<Long> goodsIds) throws PushGoodsException, Exception {
// 瀹氭椂鏃堕棿
@@ -127,7 +128,7 @@
saveGoodsInfo(isAdd, pushId, goodsIds);
}
- @Transactional
+ @Transactional(rollbackFor=Exception.class)
public void saveGoodsInfo(boolean isAdd, Long pushId, List<Long> goodsIds) throws Exception {
if (goodsIds == null || goodsIds.size() == 0) {
@@ -141,17 +142,21 @@
List<Long> listCommonId = new ArrayList<Long>();
for (Long auctionId : goodsIds) {
// 鑾峰彇鍟嗗搧璇︽儏
- TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(auctionId);
-
- // 杞崲绠�鐗堝晢鍝佷俊鎭�
- CommonGoods commonGoods = CommonGoodsFactory.create(goodsBrief);
- if (commonGoods != null) {
- commonGoodsService.addOrUpdateCommonGoods(commonGoods);
- Long cid = commonGoods.getId();
- if (cid != null) {
- listCommonId.add(cid);
+ try {
+ TaoBaoGoodsBrief goodsBrief = TaoKeApiUtil.searchGoodsDetail(auctionId);
+ // 杞崲绠�鐗堝晢鍝佷俊鎭�
+ CommonGoods commonGoods = CommonGoodsFactory.create(goodsBrief);
+ if (commonGoods != null) {
+ commonGoodsService.addOrUpdateCommonGoods(commonGoods);
+ Long cid = commonGoods.getId();
+ if (cid != null) {
+ listCommonId.add(cid);
+ }
}
+ } catch (Exception e) {
+ e.printStackTrace();
}
+
}
/* 淇敼鏃跺垹闄� 閮ㄥ垎 */
@@ -201,7 +206,7 @@
}
@Override
- @Transactional
+ @Transactional(rollbackFor=Exception.class)
public int deleteBatchByPrimaryKey(List<Long> list) throws Exception {
/*List<PushGoods> lisState = pushGoodsMapper.listByPushState(list);
@@ -342,7 +347,7 @@
} else {
/* 澶氫釜鍟嗗搧鎺ㄩ�� */
- String url = configService.get("push_goods_details");
+ String url = configService.get(ConfigKeyEnum.pushGoodsDetails.getKey());
if (StringUtil.isNullOrEmpty(url)) {
throw new PushGoodsException(1, "鎺ㄩ�侀〉闈㈤摼鎺ヤ笉瀛樺湪");
}
--
Gitblit v1.8.0