| | |
| | | package com.yeshi.fanli.service.impl.lable; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | |
| | |
| | | |
| | | |
| | | @Override |
| | | public void deleteByTaoBaoGoodsId(Long auctionId) { |
| | | public void deleteByTaoBaoGoodsId(String auctionId) { |
| | | if (auctionId == null) { |
| | | return; |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | public void deleteBatchByTaoBaoGoodsId(List<Long> listGid) { |
| | | public void deleteBatchByTaoBaoGoodsId(List<String> listGid) { |
| | | |
| | | if (listGid == null || listGid.size() == 0) { |
| | | return; |
| | |
| | | |
| | | if (ids != null && ids.size() > 0) { |
| | | for (String goodsId : ids) { |
| | | qualityFactoryMapper.deleteByGoodsId(Long.parseLong(goodsId)); |
| | | qualityFactoryMapper.deleteByGoodsId(goodsId); |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<Long> getAuctionIdbyClassId(Long systemCid, Integer goodsSource, String dateTime){ |
| | | public List<String> getAuctionIdbyClassId(Long systemCid, Integer goodsSource, String dateTime){ |
| | | return qualityFactoryMapper.getAuctionIdbyClassId(systemCid, goodsSource, dateTime); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Long queryCountByGoodsId(Long goodsId) { |
| | | public Long queryCountByGoodsId(String goodsId) { |
| | | return qualityFactoryMapper.queryCountByGoodsId(goodsId); |
| | | } |
| | | |
| | | @Override |
| | | public List<QualityFactory> listQueryByAuctionId(List<Long> list) { |
| | | public List<QualityFactory> listQueryByAuctionId(List<String> list) { |
| | | return qualityFactoryMapper.listQueryByAuctionId(list); |
| | | } |
| | | |
| | |
| | | |
| | | |
| | | // 插入商品淘宝ID集合 |
| | | List<Long> listAuctionId = new ArrayList<Long>(); |
| | | List<String> listAuctionId = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goodsBrief : listTaoBaoGoods) { |
| | | listAuctionId.add(goodsBrief.getAuctionId()); |
| | | } |
| | |
| | | |
| | | // 遍历商品 |
| | | for (TaoBaoGoodsBrief newGoodsBrief : listTaoBaoGoods) { |
| | | Long auctionId = newGoodsBrief.getAuctionId(); |
| | | String auctionId = newGoodsBrief.getAuctionId(); |
| | | // 设置成主键 |
| | | newGoodsBrief.setId(auctionId); |
| | | newGoodsBrief.setAuctionId(auctionId); |
| | | newGoodsBrief.setState(0); // 状态启用 |
| | | newGoodsBrief.setCreatetime(new Date()); |
| | | newGoodsBrief.setUpdatetime(new Date()); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void updateQualityGoods(Long goodsId) { |
| | | public void updateQualityGoods(String goodsId) { |
| | | if (goodsId == null) { |
| | | return; |
| | | } |
| | |
| | | // 移除精选库 |
| | | if (isDelete) { |
| | | deleteByTaoBaoGoodsId(goodsId); |
| | | taoBaoGoodsBriefService.deleteByPrimaryKey(goodsId); |
| | | taoBaoGoodsBriefService.deleteBatchByGoodsId(Arrays.asList(new String[]{ goodsId})); |
| | | return; |
| | | } |
| | | |
| | | goods.setId(goodsId); |
| | | goods.setAuctionId(goodsId); |
| | | goods.setCreatetime(new Date()); |
| | | goods.setUpdatetime(new Date()); |
| | | try { |
| | |
| | | List<QualityFactory> listUpdateQuality = new ArrayList<QualityFactory>(); |
| | | |
| | | // 插入商品淘宝ID集合 |
| | | List<Long> listAuctionId = new ArrayList<Long>(); |
| | | List<String> listAuctionId = new ArrayList<>(); |
| | | for (TaoBaoGoodsBrief goodsBrief : goodsList) { |
| | | listAuctionId.add(goodsBrief.getAuctionId()); |
| | | } |
| | |
| | | |
| | | // 遍历商品 |
| | | for (TaoBaoGoodsBrief newGoodsBrief : goodsList) { |
| | | Long auctionId = newGoodsBrief.getAuctionId(); |
| | | String auctionId = newGoodsBrief.getAuctionId(); |
| | | // 设置成主键 |
| | | newGoodsBrief.setId(auctionId); |
| | | newGoodsBrief.setAuctionId(auctionId); |
| | | newGoodsBrief.setState(0); // 状态启用 |
| | | newGoodsBrief.setCreatetime(new Date()); |
| | | newGoodsBrief.setUpdatetime(new Date()); |
| | |
| | | |
| | | /** |
| | | * 限时秒杀 |
| | | * @param listinsert |
| | | * @param listUpdate |
| | | * @param listGoods |
| | | * @param autoRule |
| | | */ |
| | | public void updateQualityFlashSale(List<TaoBaoGoodsBrief> listGoods, BoutiqueAutoRule autoRule) { |
| | |
| | | |
| | | /** |
| | | * 创建新对象QualityFlashSale |
| | | * |
| | | * @param qfId |
| | | * @param i |
| | | * |
| | | * @return |
| | | */ |
| | | public QualityFlashSale getNewQualityFlashSale(TaoBaoGoodsBrief taoBaoGoodsBrief, int startWeight, |
| | |
| | | * 商品加入精选库-new QualityFactory() |
| | | * |
| | | * @param goodsBrief |
| | | * @param admin |
| | | * @param autoRule |
| | | * @return |
| | | */ |
| | | public QualityFactory getNewQualityFactory(TaoBaoGoodsBrief goodsBrief, BoutiqueAutoRule autoRule) { |
| | |
| | | */ |
| | | @Override |
| | | public void deleteNotUpdateGoods(Long systemCid, String formatDate, int source) { |
| | | List<Long> list = qualityFactoryMapper.getAuctionIdbyClassId(systemCid, source, formatDate); |
| | | List<String> list = qualityFactoryMapper.getAuctionIdbyClassId(systemCid, source, formatDate); |
| | | if (list == null || list.size() == 0) { |
| | | return; |
| | | } |
| | |
| | | } |
| | | |
| | | for (int i = 0; i < count; i++) { |
| | | List<Long> sublist = new ArrayList<Long>(); |
| | | List<String> sublist = new ArrayList<>(); |
| | | if (i == count - 1) { |
| | | sublist = list.subList(start, list.size()); |
| | | deleteBatchByTaoBaoGoodsId(sublist); |