| | |
| | | import com.yeshi.fanli.entity.bus.lable.QualityFlashSale;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
|
| | | import com.yeshi.fanli.exception.QualityFactoryException;
|
| | | import com.yeshi.fanli.exception.goods.quality.QualityFactoryException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
|
| | | import com.yeshi.fanli.exception.taobao.TaobaoGoodsUpdateException;
|
| | | import com.yeshi.fanli.service.inter.goods.TaoBaoGoodsBriefService;
|
| | |
| | | import com.yeshi.fanli.service.inter.lable.QualityFlashSaleService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoGoodsUpdateService;
|
| | | import com.yeshi.fanli.service.inter.taobao.TaoBaoUnionConfigService;
|
| | | import com.yeshi.fanli.util.RedisKeyEnum;
|
| | | import com.yeshi.fanli.util.RedisManager;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoBaoUtil;
|
| | | import com.yeshi.fanli.util.taobao.TaoKeApiUtil;
|
| | | import com.yeshi.fanli.vo.quality.QualityFactoryVO;
|
| | |
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void deleteByGoodsId(List<String> ids) throws QualityFactoryException {
|
| | |
|
| | | if (ids != null && ids.size() > 0) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void addBatchTaoBaoGoods(List<TaoBaoGoodsBrief> listTaoBaoGoods, String lableNames, AdminUser admin)
|
| | | throws Exception {
|
| | |
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void setWeightBatch(List<Long> idList, AdminUser admin, Integer weight, Integer weightSmall,
|
| | | Integer weightLarge) throws Exception {
|
| | |
|
| | |
| | | qualityFactoryMapper.updateWeight(weight, time);
|
| | | }
|
| | |
|
| | | @Override
|
| | | public long queryNeedUpdateCount() {
|
| | | return qualityFactoryMapper.countQueryNeedUpdate();
|
| | | }
|
| | |
|
| | | @Override
|
| | | public List<Long> queryNeedUpdate(long start, int count, int hour) {
|
| | | return qualityFactoryMapper.queryNeedUpdate(start, count, hour);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 获取缓存
|
| | |
| | | * @return
|
| | | */
|
| | | public String getLabelIdByRedis(String key, String title) throws Exception {
|
| | |
|
| | | key = RedisKeyEnum.getRedisKey(RedisKeyEnum.emptyKey, key);
|
| | | String value = redisManager.getCommonString(key);
|
| | |
|
| | | if (StringUtil.isNullOrEmpty(value)) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | public void autoInsertOrUpadateStorage(BoutiqueAutoRule autoRule, List<TaoBaoGoodsBrief> goodsList, List<Label> listLabs) {
|
| | |
|
| | | if (goodsList == null || goodsList.size() == 0) {
|
| | |
| | | for (TaoBaoGoodsBrief goodsBrief : goodsList) {
|
| | | listAuctionId.add(goodsBrief.getAuctionId());
|
| | | }
|
| | | List<Long> listHas = taoBaoGoodsBriefService.listExistById(listAuctionId);
|
| | |
|
| | | |
| | | List<Long> listHas = new ArrayList<Long>();
|
| | | if (listAuctionId.size() > 0) {
|
| | | listHas = taoBaoGoodsBriefService.listExistById(listAuctionId);
|
| | | }
|
| | |
|
| | |
|
| | | // 遍历商品
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | |
| | | // 大于100需要分段删除
|
| | | int start = 0;
|
| | | int end = 100;
|
| | |
| | | }
|
| | |
|
| | |
|
| | | /**
|
| | | * 查询精选商品数据应用前端
|
| | | * |
| | | * @param start
|
| | | * @param count
|
| | | * @param key
|
| | | * @param classId
|
| | | * 分类id
|
| | | * @param labId
|
| | | * 标签id
|
| | | * @return
|
| | | */
|
| | |
|
| | | @Override
|
| | | public List<QualityFactory> listQuery(long start, int count, String key, Long classId, Long labId) {
|
| | | return qualityFactoryMapper.listQuery(start, count, key, classId, labId, null, null);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 对应查询精选商品数据应用前端统计
|
| | | */
|
| | | |
| | | @Override
|
| | | public long countQuery(String key, Integer goodsSource, Long classId, Long labId) {
|
| | | return qualityFactoryMapper.countQuery(key, classId, labId, null, null);
|
| | | }
|
| | |
|
| | | public LabelGoods screen9K9(TaoBaoGoodsBrief goodsBrief, Map<String, Label> map) {
|
| | | // 贴上新标签
|
| | | LabelGoods lg = null;
|
| | |
|
| | | /* 9k9 */
|
| | | BigDecimal price9k9 = new BigDecimal(10);
|
| | | /* 19k9 */
|
| | | BigDecimal price19k9 = new BigDecimal(20);
|
| | | /* 29.9 */
|
| | | BigDecimal price29K9 = new BigDecimal(30);
|
| | | /* 49.9 */
|
| | | BigDecimal price49K9 = new BigDecimal(50);
|
| | | /* 券后价--计算 */
|
| | | BigDecimal couponPrice = TaoBaoUtil.getAfterUseCouplePrice(goodsBrief);
|
| | |
|
| | | if (couponPrice.compareTo(price9k9) < 0) {
|
| | | Label label = map.get("9.9");
|
| | | if (label == null) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | lg = new LabelGoods();
|
| | | lg.setLabel(label);
|
| | |
|
| | | } else if (couponPrice.compareTo(price19k9) < 0) {
|
| | | Label label = map.get("19.9");
|
| | | if (label == null) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | lg = new LabelGoods();
|
| | | lg.setLabel(label);
|
| | | } else if (couponPrice.compareTo(price29K9) < 0) {
|
| | | Label label = map.get("29.9");
|
| | | if (label == null) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | lg = new LabelGoods();
|
| | | lg.setLabel(label);
|
| | | } else if (couponPrice.compareTo(price49K9) < 0) {
|
| | | Label label = map.get("49.9");
|
| | | if (label == null) {
|
| | | return null;
|
| | | }
|
| | |
|
| | | lg = new LabelGoods();
|
| | | lg.setLabel(label);
|
| | | } else {
|
| | | return null;
|
| | | }
|
| | |
|
| | | lg.setCreateUser(new AdminUser(2L));
|
| | | lg.setCreatetime(new Date());
|
| | | lg.setTaoBaoGoodsBrief(goodsBrief);
|
| | |
|
| | | return lg;
|
| | | }
|
| | |
|
| | | @Override
|