| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public void saveComment(String pid, CommentInfo commentInfo) throws GoodsEvaluateException { |
| | | GoodsEvaluate goodsEvaluate = goodsEvaluateDao.getById(pid); |
| | |
| | | |
| | | @Override |
| | | public List<GoodsEvaluate> query(int start, int count, String key, Integer state, int dynamicType, |
| | | String typeEnum) { |
| | | return goodsEvaluateDao.query(start, count, key, state, dynamicType, typeEnum); |
| | | String typeEnum, SystemEnum system) { |
| | | return goodsEvaluateDao.query(start, count, key, state, dynamicType, typeEnum, system); |
| | | } |
| | | |
| | | @Override |
| | | public long count(String key, Integer state, int dynamicType, String typeEnum) { |
| | | return goodsEvaluateDao.count(key, state, dynamicType, typeEnum); |
| | | public long count(String key, Integer state, int dynamicType, String typeEnum, SystemEnum system) { |
| | | return goodsEvaluateDao.count(key, state, dynamicType, typeEnum, system); |
| | | } |
| | | |
| | | @Override |
| | | public void addRanDomShareCount() { |
| | | public void addRanDomShareCount(SystemEnum system) { |
| | | // 发圈 |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(0, Integer.MAX_VALUE, 1); |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(0, Integer.MAX_VALUE, 1, system); |
| | | if (list != null) { |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | Integer shareNum = goodsEvaluate.getShareNum(); |
| | |
| | | |
| | | // 素材 |
| | | try { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(0, Integer.MAX_VALUE, 2); |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(0, Integer.MAX_VALUE, 2, system); |
| | | if (list != null) { |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | Integer shareNum = goodsEvaluate.getShareNum(); |
| | |
| | | |
| | | @Override |
| | | @Cacheable(value = "dynamicCache", key = "'queryValidEvaluateCache-'+#start") |
| | | public List<GoodsEvaluate> queryValidEvaluateCache(int start, int count) { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(start, count, 1); |
| | | public List<GoodsEvaluate> queryValidEvaluateCache(int start, int count, SystemEnum system) { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(start, count, 1, system); |
| | | |
| | | // 更新商品信息 |
| | | executor.execute(new Runnable() { |
| | |
| | | } |
| | | |
| | | @Override |
| | | public long countValid() { |
| | | return goodsEvaluateDao.countValid(1); |
| | | public long countValid(SystemEnum system) { |
| | | return goodsEvaluateDao.countValid(1, system); |
| | | } |
| | | |
| | | @Override |
| | | @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); |
| | | public List<GoodsEvaluate> queryMaterialsCache(int start, int count, int type, SystemEnum system) throws Exception { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryValid(start, count, type, system); |
| | | if (list == null) { |
| | | list = new ArrayList<>(); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public long countValidMaterials(int type) { |
| | | return goodsEvaluateDao.countValid(type); |
| | | public long countValidMaterials(int type, SystemEnum system) { |
| | | return goodsEvaluateDao.countValid(type, system); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int addGoodsEvaluate(TaoBaoGoodsBrief goodsBrief, List<String> imgs, ActivityUser user, String title,SystemEnum system) throws GoodsEvaluateException { |
| | | if (goodsBrief == null || user == null || StringUtil.isNullOrEmpty(title)) { |
| | |
| | | @Override |
| | | public void addGoodsEvaluateByDaTaoKe(SystemEnum system) { |
| | | List<Long> listId = null; |
| | | List<GoodsEvaluate> listExist = goodsEvaluateDao.querySingleExist(); |
| | | List<GoodsEvaluate> listExist = goodsEvaluateDao.querySingleExist(system); |
| | | if (listExist != null && listExist.size() > 0) { |
| | | listId = new ArrayList<Long>(); |
| | | for (GoodsEvaluate goodsEvaluate : listExist) { |
| | |
| | | |
| | | /** |
| | | * 发圈标题 加入表情 |
| | | * |
| | | * @param desc |
| | | * @return |
| | | */ |
| | |
| | | if (goods == null) { |
| | | return; |
| | | } |
| | | for (SystemEnum system : SystemEnum.values()) { |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_TAOBAO, |
| | | goods.getAuctionId()+""); |
| | | goods.getAuctionId() + "", system); |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | if (jdGoods == null) { |
| | | return; |
| | | } |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_JD, jdGoods.getSkuId()+""); |
| | | for (SystemEnum system : SystemEnum.values()) { |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_JD, jdGoods.getSkuId() + "", system); |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | |
| | | |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updatePDDGoods(PDDGoodsDetail pddGoods) { |
| | | if (pddGoods == null) { |
| | | return; |
| | | } |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_PDD, pddGoods.getGoodsId()+""); |
| | | for (SystemEnum system : SystemEnum.values()) { |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_PDD, pddGoods.getGoodsId() + "", system); |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateVIPGoods(VIPGoodsInfo goods) { |
| | | if (goods == null) { |
| | | return; |
| | | } |
| | | for (SystemEnum system : SystemEnum.values()) { |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_VIP, |
| | | goods.getGoodsId()); |
| | | goods.getGoodsId(), system); |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertVIPGoods(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void updateSuningGoods(SuningGoodsInfo goods) { |
| | | if (goods == null) { |
| | | return; |
| | | } |
| | | for (SystemEnum system : SystemEnum.values()) { |
| | | List<GoodsEvaluate> queryExist = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_SUNING, |
| | | goods.getCommodityInfo().getCommodityCode()); |
| | | goods.getCommodityInfo().getCommodityCode(), system); |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | return; |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertSuningGoods(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | } |
| | | |
| | | private void updateGoods(List<GoodsEvaluate> listExist, GoodsDetailVO goodsNew) { |
| | |
| | | if (goodsId == null) { |
| | | return; |
| | | } |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_TAOBAO,goodsId); |
| | | if (list == null || list.size() == 0) { |
| | | return; |
| | | } |
| | | |
| | | for (SystemEnum system : SystemEnum.values()) { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryExist(Constant.SOURCE_TYPE_TAOBAO, goodsId, system); |
| | | if (list == null || list.size() == 0) { |
| | | continue; |
| | | } |
| | | // 下架商品 |
| | | offlineGoods(list, Constant.SOURCE_TYPE_TAOBAO, goodsId); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | |
| | | |
| | | @Override |
| | | public GoodsEvaluate queryExistSingle(String goodsId, int goodsType) { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryExistSingle(goodsType, goodsId); |
| | | public GoodsEvaluate queryExistSingle(String goodsId, int goodsType,SystemEnum system) { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryExistSingle(goodsType, goodsId,system); |
| | | if (list != null && list.size() > 0) |
| | | return list.get(0); |
| | | return null; |