From 4cb15e222cd7d099d533ccbeb7f9a8cd99bf180c Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 25 十二月 2018 16:35:18 +0800 Subject: [PATCH] 替换原来老的资金详情 --- fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityFactoryServiceImpl.java | 37 ++++++++++++++++++++++++++----------- 1 files changed, 26 insertions(+), 11 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityFactoryServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityFactoryServiceImpl.java index 2f5e525..8e51262 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityFactoryServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/lable/QualityFactoryServiceImpl.java @@ -28,6 +28,7 @@ import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief; import com.yeshi.fanli.exception.QualityFactoryException; import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException; +import com.yeshi.fanli.exception.taobao.TaobaoGoodsUpdateException; import com.yeshi.fanli.log.LogHelper; import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService; import com.yeshi.fanli.service.inter.lable.LabelService; @@ -252,11 +253,7 @@ } } - List<String> strList = new ArrayList<String>(); - for (Long id : auctionIdList) { - strList.add(id + ""); - } - List<TaoBaoGoodsBrief> existList = taoBaoGoodsBriefRecordMapper.queryGoodsByAuctionId(strList); + List<TaoBaoGoodsBrief> existList = taoBaoGoodsBriefRecordMapper.queryByAuctionIdList(auctionIdList); List<QualityFactory> addList = new ArrayList<QualityFactory>(); List<LabelGoods> addLabelList = new ArrayList<LabelGoods>(); @@ -461,8 +458,11 @@ return; } - + // 鍒犻櫎绮鹃�夊簱 List<Long> listDeleteQuality = new ArrayList<Long>(); + // 鍒犻櫎鏍囩 + List<Long> listDeleteLabel = new ArrayList<Long>(); + List<QualityFactory> listUpdateQuality = new ArrayList<QualityFactory>(); @@ -540,6 +540,8 @@ /* 鏃犲埜淇℃伅 绉婚櫎绮鹃�夊簱 */ listDeleteQuality.add(quality.getId()); + // 绉婚櫎鏍囩 + listDeleteLabel.add(goods.getId()); } else { /* 鏃犲埜淇℃伅 绉婚櫎绮鹃�夊簱 */ @@ -548,13 +550,16 @@ // 绉婚櫎绮鹃�夊簱 listDeleteQuality.add(quality.getId()); + // 绉婚櫎鏍囩 + listDeleteLabel.add(goods.getId()); } else { /* 鏇存柊鍟嗗搧淇℃伅 */ - TaoBaoGoodsBrief updateGoods = taoBaoGoodsUpdateService - .getUpdateTaoBaoGoodsBrief(newGoodsBrief); + TaoBaoGoodsBrief updateGoods = taoBaoGoodsUpdateService.getUpdateTaoBaoGoodsBrief(newGoodsBrief); + updateGoods.setId(id); taoBaoGoodsBriefService.setGoodsBriefDefault(updateGoods); + listUpdateGoodsBrief.add(updateGoods); /* 鏇存柊绮鹃�夊簱 淇℃伅鏃堕棿 */ @@ -592,7 +597,7 @@ // 鏇存柊鍟嗗搧淇℃伅 if (listUpdateGoodsBrief.size() > 0) { - taoBaoGoodsBriefService.updateBatchSelective(listUpdateGoodsBrief); + taoBaoGoodsUpdateService.updateTaoBaoGoods(listUpdateGoodsBrief); } // 鏇存柊绮鹃�夊簱 @@ -603,8 +608,15 @@ // 鎵归噺鍒犻櫎绮鹃�夊簱 if (listDeleteQuality.size() > 0) { qualityFactoryMapper.deleteBatchByPrimaryKey(listDeleteQuality); + // 鎵归噺鍒犻櫎闄愭椂鎶㈣喘 + qualityFlashSaleMapper.deleteBatchByQualityID(listDeleteQuality); } + // 鍒犻櫎瀵瑰簲鏍囩 + if (listDeleteLabel.size() > 0) { + labelGoodsMapper.deleteBatchByGoodsId(listDeleteLabel); + } + // 娣诲姞鏍囩 if (listLabelAdd.size() > 0) { labelGoodsMapper.insertBatch(listLabelAdd); @@ -944,8 +956,11 @@ } } - - taoBaoGoodsBriefService.updateBatchSelective(listGoodsUpdate); + try { + taoBaoGoodsUpdateService.updateTaoBaoGoods(listGoodsUpdate); + } catch (TaobaoGoodsUpdateException e) { + System.out.println(e.getMsg()); + } } // 娣樺疂鍟嗗搧鎻掑叆鏁版嵁搴� -- Gitblit v1.8.0