admin
2020-02-23 b59fef5c00b15fdfdfa9d4be26e5bf6b41c75458
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -516,10 +516,11 @@
      data.put("words", configService.get(ConfigKeyEnum.articleHotWords.getKey()));
      out.print(JsonUtil.loadTrueResult(data));
   }
   //发圈测试
   @RequestMapping(value = "evaluate", method = RequestMethod.POST)
   public void evaluate(AcceptData acceptData, PrintWriter out) {
      out.print(configService.get("test"));
   // //发圈测试
   public void evaluateTest(AcceptData acceptData, PrintWriter out) {
      JSONObject data = JSONObject.fromObject(configService.get("test"));
      out.print(data.toString());
   }
   /**
@@ -531,6 +532,11 @@
    */
   @RequestMapping(value = "evaluate", method = RequestMethod.POST)
   public void evaluate(AcceptData acceptData, Integer page, PrintWriter out) {
      if ("1".equalsIgnoreCase(configService.get("test-open"))) {
         evaluateTest(acceptData, out);
         return;
      }
      long cid = 1;
      long subId = 1;
      List<DynamicInfo> listd = dynamicInfoService.queryV2(2, 74, (page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
@@ -541,7 +547,10 @@
      List<GoodsEvaluate> list = new ArrayList<>();
      int p = 0;
      for (DynamicInfo info : listd) {
         p++;
         GoodsEvaluate goodsEvaluate = new GoodsEvaluate();
         goodsEvaluate.setId(info.getId());
         ActivityUser user = info.getUser();
@@ -555,6 +564,7 @@
         List<ImgInfo> imgList = new ArrayList<>();
         int i = 0;
         for (GoodsPicture goodsPicture : imgs) {
            ImgInfo imgInfo = new ImgInfo();
            GoodsDetailVO goodsVO = goodsPicture.getGoodsVO();
@@ -578,22 +588,45 @@
            imgInfo.setLarge(false);
            imgInfo.setUrl(goodsPicture.getUrl());
             imgInfo.setUrlHD(goodsPicture.getUrl());
            imgInfo.setUrlHD(goodsPicture.getUrl());
//            if (i == 0) {
//               imgInfo.setUrl(goodsPicture.getUrl());
//               imgInfo.setType(ImgEnum.video);
//               imgInfo.setLarge(true);
//               imgInfo.setVideoUrl(
//                     "http://pgcvideo.cdn.xiaodutv.com/754825344_367171606_2020010816001720200108174342.mp4?Cache-Control=max-age%3D8640000&responseExpires=Fri%2C+17+Apr+2020+18%3A11%3A55+GMT&xcode=0b0f3962eddaf66837d4af61a22c57bae3a5055540c75232&time=1579077845&_=1578992502888");
//            } else {
//               imgInfo.setType(ImgEnum.img);
//               imgInfo.setLarge(true);
//               imgInfo.setUrl(goodsPicture.getUrl());
//            }
//            i++;
            // if (i == 0) {
            // imgInfo.setUrl(goodsPicture.getUrl());
            // imgInfo.setType(ImgEnum.video);
            // imgInfo.setLarge(true);
            // imgInfo.setVideoUrl(
            // "http://pgcvideo.cdn.xiaodutv.com/754825344_367171606_2020010816001720200108174342.mp4?Cache-Control=max-age%3D8640000&responseExpires=Fri%2C+17+Apr+2020+18%3A11%3A55+GMT&xcode=0b0f3962eddaf66837d4af61a22c57bae3a5055540c75232&time=1579077845&_=1578992502888");
            // } else {
            // imgInfo.setType(ImgEnum.img);
            // imgInfo.setLarge(true);
            // imgInfo.setUrl(goodsPicture.getUrl());
            // }
            // i++;
            imgList.add(imgInfo);
         }
         if (p == 1) {
            ImgInfo imgInfo = new ImgInfo();
            imgInfo.setLarge(true);
            imgInfo.setType(ImgEnum.img);
            imgInfo.setUrl(
                  "http://ec-1255749512.file.myqcloud.com/img/invite/new/10ea86eb8db94f7cbb5e68864480d5fe.jpg");
            imgInfo.setH(1334);
            imgInfo.setW(750);
            imgList.add(0, imgInfo);
            imgInfo = new ImgInfo();
            imgInfo.setType(ImgEnum.video);
            imgInfo.setLarge(true);
            imgInfo.setUrl(
                  "http://ec-1255749512.file.myqcloud.com/img/invite/new/10ea86eb8db94f7cbb5e68864480d5fe.jpg");
            imgInfo.setH(315);
            imgInfo.setW(560);
            imgInfo.setUrl("https://zzya.beva.cn/img/Fr56bczo_F8NvroeG54jLH5ey0aC.jpg");
            imgInfo.setVideoUrl("http://img.flqapp.com/resource/video.mp4");
            imgList.add(0, imgInfo);
         }
         goodsEvaluate.setImgList(imgList);
@@ -603,18 +636,18 @@
         commentInfo.setContent("😆7.9元🉐1只儿童牙刷!!安妮贝拉卡通版儿童牙⭕PBT材质,毛刷细腻柔⭕外观卡通人物造型设计");
         commentInfo.setType(CommentInfoEnum.goodsCoupon);
//         ClientTextStyleVO text1 = new ClientTextStyleVO();
//         text1.setContent("猫超");
//         text1.setColor("#1D9B31");
//
//         ClientTextStyleVO text2 = new ClientTextStyleVO();
//         text2.setContent("满150减15");
//         text2.setColor("#E5005C");
//         List<ClientTextStyleVO> tagList = new ArrayList<>();
//         tagList.add(text1);
//         tagList.add(text2);
//         commentInfo.setTagList(tagList);
//         commentInfo.setTagDesc("除生鲜及部分酒水除生鲜及除生鲜及");
         // ClientTextStyleVO text1 = new ClientTextStyleVO();
         // text1.setContent("猫超");
         // text1.setColor("#1D9B31");
         //
         // ClientTextStyleVO text2 = new ClientTextStyleVO();
         // text2.setContent("满150减15");
         // text2.setColor("#E5005C");
         // List<ClientTextStyleVO> tagList = new ArrayList<>();
         // tagList.add(text1);
         // tagList.add(text2);
         // commentInfo.setTagList(tagList);
         // commentInfo.setTagDesc("除生鲜及部分酒水除生鲜及除生鲜及");
         CommentInfo commentInfo2 = new CommentInfo();
         commentInfo2.setContent("😆7.9元🉐1只儿童牙刷!!安妮贝拉卡通版儿童牙⭕PBT材质,毛刷细腻柔⭕外观卡通人物造型设计");
@@ -642,10 +675,12 @@
         list.add(goodsEvaluate);
      }
//      List<GoodsEvaluate> list = goodsEvaluateService.queryValidEvaluateCache((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE);
//      if (list == null) {
//         list = new ArrayList<>();
//      }
      // List<GoodsEvaluate> list =
      // goodsEvaluateService.queryValidEvaluateCache((page - 1) *
      // Constant.PAGE_SIZE, Constant.PAGE_SIZE);
      // if (list == null) {
      // list = new ArrayList<>();
      // }
      GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
      gsonBuilder.registerTypeAdapter(CommentInfoEnum.class, new JsonSerializer<CommentInfoEnum>() {
@@ -729,17 +764,18 @@
   }
   @RequestMapping(value = "evaluateShare", method = RequestMethod.POST)
   public void evaluateShare(AcceptData acceptData, Long uid, String id, Integer type, Long goodsId, Integer goodsType, PrintWriter out) {
   public void evaluateShare(AcceptData acceptData, Long uid, String id, Integer type, Long goodsId, Integer goodsType,
         PrintWriter out) {
      if (uid == null) {
         out.print(JsonUtil.loadFalseResult("用户未登录"));
         return;
      }
      if (StringUtil.isNullOrEmpty(id) || type == null) {
         out.print(JsonUtil.loadFalseResult("传递参数不能为空"));
         return;
      }
      if (type == 1 && (goodsId == null || goodsType == null)) {
         out.print(JsonUtil.loadFalseResult("商品参数不能为空"));
         return;
@@ -778,12 +814,12 @@
         out.print(JsonUtil.loadFalseResult("该图片内容已不存在"));
         return;
      }
      int total = 0;
      for (GoodsPicture goodsPicture : imgs) {
         GoodsDetailVO goodsVO = goodsPicture.getGoodsVO();
         if (goodsVO != null) {
            total ++;
            total++;
         }
      }
@@ -794,9 +830,10 @@
            list.add(goodsPicture.getUrl());
            continue;
         }
         if (type == 1) {
            if (goodsVO.getGoodsId().longValue() == goodsId.longValue() && goodsVO.getGoodsType() == goodsType.intValue()) {
            if (goodsVO.getGoodsId().longValue() == goodsId.longValue()
                  && goodsVO.getGoodsType() == goodsType.intValue()) {
               String jumpLink = getJumpLink(goodsVO, user);
               if (!StringUtil.isNullOrEmpty(jumpLink)) {
                  list.add(jumpLink);
@@ -824,7 +861,7 @@
         out.print(JsonUtil.loadFalseResult("该信息已下架"));
         return;
      }
      JSONObject data = new JSONObject();
      data.put("count", shareCount);
      data.put("list", list);
@@ -843,10 +880,10 @@
         }
      } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_JD) {
         JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsVO.getGoodsId());
         if (jdGoods == null ) {
         if (jdGoods == null) {
            return null;
         }
         String couponUrl = null;
         JDCouponInfo couponInfo = JDUtil.getShowCouponInfo(jdGoods);
         if (couponInfo != null) {
@@ -856,7 +893,8 @@
         jumpLink = JDApiUtil.convertLinkWithSubUnionId(materialId, couponUrl, JDApiUtil.POSITION_SHARE + "",
               user.getId() + "");
      } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_PDD) {
         jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsVO.getGoodsId(), PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + "");
         jumpLink = PinDuoDuoApiUtil.getPromotionUrl(goodsVO.getGoodsId(), PinDuoDuoApiUtil.PID_SHARE + "",
               user.getId() + "");
      }
      FileUploadResult uploadResult = qrCodeService.drawGoodsPoster(jumpLink, user.getPortrait(), goodsVO);
      if (uploadResult != null) {
@@ -864,13 +902,14 @@
      }
      return null;
   }
   /**
    *  评论复制
    * 评论复制
    *
    * @param acceptData
    * @param id
    * @param cid 评论id
    * @param cid
    *            评论id
    * @param out
    */
   @RequestMapping(value = "evaluateComment", method = RequestMethod.POST)
@@ -879,7 +918,7 @@
         out.print(JsonUtil.loadFalseResult("id不能为空"));
         return;
      }
      DynamicInfo dynamicInfo = dynamicInfoService.getById(id);
      if (dynamicInfo == null) {
         out.print(JsonUtil.loadFalseResult("该内容已不存在"));
@@ -896,7 +935,7 @@
         out.print(JsonUtil.loadFalseResult(Constant.CODE_FORBIDDEN_USER, Constant.FORBIDDEN_USER_REASON_DESC));
         return;
      }
      UserExtraTaoBaoInfo taoBaoInfo = userExtraTaoBaoInfoService.getByUid(uid);
      String relationId = null;
      if (taoBaoInfo != null && taoBaoInfo.getRelationId() != null && taoBaoInfo.getRelationValid() != null
@@ -907,7 +946,7 @@
         out.print(JsonUtil.loadFalseResult(2, "淘宝未授权,请前往\"我的\"绑定淘宝账号"));
         return;
      }
      JSONObject data = new JSONObject();
      data.put("text", "安妮贝拉卡通版儿拉卡通版拉卡通版拉卡通版拉卡通版拉卡通版拉卡通版拉卡通版");
      out.print(JsonUtil.loadTrueResult(data));