| | |
| | |
|
| | | import com.google.gson.Gson;
|
| | | import com.yeshi.fanli.dao.mybatis.taobao.TaoBaoGoodsBriefMapper;
|
| | | import com.yeshi.fanli.entity.goods.CommonGoods;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.goods.CommonGoodsException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | |
| | | }
|
| | |
|
| | | } catch (TaobaoGoodsDownException e) {
|
| | | downTaoBaoGoods(goods.getAuctionId());
|
| | | offlineTaoBaoGoods(goods.getAuctionId());
|
| | | } catch (Exception e) {
|
| | |
|
| | | }
|
| | |
| | |
|
| | | @Transactional
|
| | | @Override
|
| | | public void downTaoBaoGoods(Long auctionId) {
|
| | | public void offlineTaoBaoGoods(Long auctionId) {
|
| | | // 删除首页推荐数据
|
| | | recommendSectionGoodsService.deleteRecommendSectionGoodsByTbAuctionId(auctionId);
|
| | | // 更新动态数据
|
| | |
| | |
|
| | | // 删除商品本身数据
|
| | | taoBaoGoodsBriefMapper.deleteByAuctionId(auctionId);
|
| | |
|
| | | // 更新简版商品状态为下架
|
| | | commonGoodsService.offlineCommonGoods(auctionId, CommonGoods.GOODS_TYPE_TB);
|
| | | }
|
| | |
|
| | | @Transactional
|
| | |
| | | taoBaoGoodsBriefMapper.updateByPrimaryKeySelective(updateGoods);
|
| | |
|
| | | }
|
| | |
|
| | | // 更新动态商品
|
| | | activityService.updateRecommendActivityGoods(goods);
|
| | | }
|
| | |
|
| | | @Override
|
| | |
| | |
|
| | | @Override
|
| | | public void updateTaoBaoGoods(List<TaoBaoGoodsBrief> goodsList) throws TaobaoGoodsUpdateException {
|
| | | if (goodsList == null)
|
| | | return;
|
| | | if (goodsList == null || goodsList.size() == 0)
|
| | | throw new TaobaoGoodsUpdateException(1, "商品列表为空");
|
| | |
|
| | | List<TaoBaoGoodsBrief> updateList = new ArrayList<>();
|
| | |
|
| | | for (TaoBaoGoodsBrief goods : goodsList) {
|
| | | if (goods.getId() == null || goods.getId() == 0L)
|
| | |
|
| | | if (goods.getId() == null || goods.getId() == 0L) {
|
| | | throw new TaobaoGoodsUpdateException(1, "商品主键ID为空");
|
| | | updateList.add(goods);
|
| | | }
|
| | |
|
| | | TaoBaoGoodsBrief updateGoods = getUpdateTaoBaoGoodsBrief(goods);
|
| | | updateGoods.setCreatetime(goods.getCreatetime());
|
| | |
|
| | | updateList.add(updateGoods);
|
| | | }
|
| | |
|
| | | taoBaoGoodsBriefMapper.updateBatchSelective(updateList);
|
| | | }
|
| | |
|