| | |
| | | GoodsDetailVO goodsDetailVO = null; |
| | | JDGoods jdGoods = null; |
| | | PDDGoodsDetail pddGoods = null; |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | try { |
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(Long.parseLong(goodsId)); |
| | |
| | | return commentText.replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n").replace("\r\n\r\n", "\r\n"); |
| | | } |
| | | |
| | | public GoodsDetailVO getGoodsDetailVO(Long goodsId, Integer goodsType) throws GoodsEvaluateException { |
| | | public GoodsDetailVO getGoodsDetailVO(Long goodsId, Integer goodsType, SystemEnum system) throws GoodsEvaluateException { |
| | | GoodsDetailVO goodsDetail = null; |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | if (goodsType == Constant.SOURCE_TYPE_TAOBAO) { |
| | | try { |
| | | TaoBaoGoodsBrief goodsBrief = redisManager.getTaoBaoGoodsBrief(goodsId); |
| | |
| | | for (int i = 0; i < goodsArray.length && i < 9; i++) { |
| | | String goodsids = goodsArray[i]; |
| | | String[] g = goodsids.split("-"); |
| | | GoodsDetailVO goodsDetailVO = getGoodsDetailVO(Long.parseLong(g[0]), Integer.parseInt(g[1])); |
| | | GoodsDetailVO goodsDetailVO = getGoodsDetailVO(Long.parseLong(g[0]), Integer.parseInt(g[1]), resultObj.getSystem()); |
| | | if (goodsDetailVO == null) { |
| | | continue; |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Cacheable(value = "dynamicCache", key = "'queryMaterialsCache-'+#start+'-'+#type") |
| | | @Cacheable(value = "dynamicCache", key = "'queryMaterialsCache-'+#start+'-'+#type+'-'+#system") |
| | | 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) { |
| | |
| | | try { |
| | | Date now = new Date(); |
| | | SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | |
| | | for (GoodsEvaluate goodsEvaluate : list) { |
| | | ConfigParamsDTO params = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", goodsEvaluate.getSystem()); |
| | | params.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(goodsEvaluate.getSystem())); |
| | | // 是否2个小时之内已更新 |
| | | Date updateTime = goodsEvaluate.getUpdateTime(); |
| | | if (updateTime != null) { |
| | |
| | | imgs.addAll(goodsBrief.getImgList()); |
| | | |
| | | // 商品VO |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, paramsDTO); |
| | | |
| | | // 商品图片信息 |
| | |
| | | goodsEvaluate.setLineNum(lineNum); |
| | | goodsEvaluate.setImgList(imgList); |
| | | goodsEvaluate.setComments(commentsNew); |
| | | goodsEvaluate.setSystem(system); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | // 商品VO |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, paramsDTO); |
| | | |
| | | // 商品图片信息 |
| | |
| | | goodsEvaluate.setLineNum(lineNum); |
| | | goodsEvaluate.setImgList(imgList); |
| | | goodsEvaluate.setComments(commentsNew); |
| | | goodsEvaluate.setSystem(system); |
| | | goodsEvaluateDao.save(goodsEvaluate); |
| | | return result; |
| | | } |
| | |
| | | return false; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsVO = GoodsDetailVOFactory.convertTaoBao(goodsBrief, paramsDTO); |
| | | |
| | | ActivityUser user = null; |
| | |
| | | goodsEvaluate.setPublishTime(new Date()); |
| | | goodsEvaluate.setCreateTime(new Date()); |
| | | goodsEvaluate.setUpdateTime(new Date()); |
| | | goodsEvaluate.setSystem(system); |
| | | |
| | | List<String> goodsimgs = goodsBrief.getImgList(); |
| | | |
| | |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | continue; |
| | | } |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertTaoBao(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertJDGoods(jdGoods, paramsDTO); |
| | | |
| | | updateGoods(queryExist, goodsNew); |
| | |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertPDDGoods(pddGoods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertVIPGoods(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | |
| | | if (queryExist == null || queryExist.size() == 0) { |
| | | continue; |
| | | } |
| | | |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55"); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate()); |
| | | ConfigParamsDTO paramsDTO = orderHongBaoMoneyComputeService.getShowComputeRate("android", "55", system); |
| | | paramsDTO.setBaseFanliRate(hongBaoManageService.getBaseFanliRate(system)); |
| | | GoodsDetailVO goodsNew = GoodsDetailVOFactory.convertSuningGoods(goods, paramsDTO); |
| | | updateGoods(queryExist, goodsNew); |
| | | } |
| | | } |
| | | |
| | | private void updateGoods(List<GoodsEvaluate> listExist, GoodsDetailVO goodsNew) { |
| | | String goodsId = goodsNew.getGoodsId(); |
| | | int goodsType = goodsNew.getGoodsType(); |
| | | for (GoodsEvaluate goodsEvaluate : listExist) { |
| | | String goodsId = goodsNew.getGoodsId(); |
| | | int goodsType = goodsNew.getGoodsType(); |
| | | |
| | | GoodsDetailVO goodsDetailVO = goodsEvaluate.getGoods(); |
| | | if (goodsDetailVO != null && goodsDetailVO.getGoodsId() != null && goodsDetailVO.getGoodsId().equalsIgnoreCase(goodsId) |
| | | && goodsDetailVO.getGoodsType() == goodsType) { |
| | |
| | | |
| | | |
| | | @Override |
| | | public GoodsEvaluate queryExistSingle(String goodsId, int goodsType,SystemEnum system) { |
| | | List<GoodsEvaluate> list = goodsEvaluateDao.queryExistSingle(goodsType, goodsId,system); |
| | | 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; |