| | |
| | | return goodsEvaluateDao.count(key, state, dynamicType); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public void addRanDomShareCount() { |
| | | // 发圈 |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(0, Integer.MAX_VALUE, 1); |
| | | if (list != null) { |
| | | for (GoodsEvaluate goodsEvaluate: list) { |
| | | Integer shareNum = goodsEvaluate.getShareNum(); |
| | | if (shareNum == null) { |
| | | shareNum = 0; |
| | | } |
| | | goodsEvaluate.setShareNum(shareNum + (int) (Math.random() * 100) + 10); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | |
| | | // 素材 |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(0, Integer.MAX_VALUE, 2); |
| | | if (list != null) { |
| | | for (GoodsEvaluate goodsEvaluate: list) { |
| | | Integer shareNum = goodsEvaluate.getShareNum(); |
| | | if (shareNum == null) { |
| | | shareNum = 0; |
| | | } |
| | | goodsEvaluate.setShareNum(shareNum + (int) (Math.random() * 100) + 10); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | | } |
| | | } catch (Exception e) { |
| | | LogHelper.errorDetailInfo(e); |
| | | } |
| | | } |
| | | |
| | | |
| | | @Override |
| | | @Cacheable(value = "dynamicCache", key = "'queryValidEvaluateCache-'+#start") |
| | | public List<GoodsEvaluate> queryValidEvaluateCache(int start, int count) { |
| | |
| | | } |
| | | |
| | | @Override |
| | | // @Cacheable(value = "dynamicCache", key = "'queryMaterialsCache-'+#start+'-'+#type") |
| | | @Cacheable(value = "dynamicCache", key = "'queryMaterialsCache-'+#start+'-'+#type") |
| | | public List<GoodsEvaluate> queryMaterialsCache(int start, int count, int type) throws Exception { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(start, count, type); |
| | | if (list == null) { |
| | |
| | | ConfigParamsDTO paramsDTO = hongBaoManageService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO); |
| | | |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | |
| | |
| | | GoodsDetailVO goodsDetailVO = goodsEvaluate.getGoods(); |
| | | if (goodsDetailVO != null && goodsDetailVO.getGoodsId() != null |
| | | && goodsDetailVO.getGoodsId() == goodsId && goodsDetailVO.getGoodsType() == goodsType ) { |
| | | if (goodsDetailVO.getTitle().equalsIgnoreCase(goodsNew.getTitle())) { |
| | | goodsEvaluate.setGoods(goodsNew); |
| | | } else { |
| | | goodsEvaluate.setState(1); |
| | | goodsEvaluate.setRemarks("商品标题发生变化下架:" + goodsDetailVO.getTitle() +" / 新:" + goodsNew.getTitle()); |
| | | } |
| | | } |
| | | |
| | | // 更新商品信息 |
| | |
| | | |
| | | for (ImgInfo imgInfo : imgList) { |
| | | SimpleGoods simpleGoods = imgInfo.getGoods(); |
| | | if (simpleGoods == null) { |
| | | if (simpleGoods == null || simpleGoods.getGoodsId() != goodsId |
| | | || goodsType != simpleGoods.getGoodsType()) { |
| | | continue; |
| | | } |
| | | |
| | | GoodsDetailVO goodsVO = imgInfo.getGoodsVO(); |
| | | if (goodsVO != null) { |
| | | if (goodsVO.getTitle().equalsIgnoreCase(goodsNew.getTitle())) { |
| | | simpleGoods.setState(0); |
| | | } else { |
| | | simpleGoods.setState(1); |
| | | simpleGoods.setRemarks("商品标题发生变化下架:" + goodsVO.getTitle() +" / 新:" + goodsNew.getTitle()); |
| | | } |
| | | } |
| | | |
| | | simpleGoods.setPrice(goodsDetailVO.getCouponPrice()); |
| | | CouponInfoVO couponInfo = goodsDetailVO.getCouponInfo(); |
| | | if (couponInfo == null) { |