admin
2020-06-28 eda623f37c3260f4b4657e34a8a39798c72432b1
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -55,7 +55,6 @@
import com.yeshi.fanli.entity.taobao.TaoBaoLink;
import com.yeshi.fanli.exception.goods.ConvertLinkExceptionException;
import com.yeshi.fanli.exception.share.ShareGoodsException;
import com.yeshi.fanli.exception.user.cloud.UserCloudException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.ConfigService;
@@ -626,7 +625,7 @@
    * @param out
    */
   @RequestMapping(value = "getDynamicList", method = RequestMethod.POST)
   public void getDynamicListNew(AcceptData acceptData, Integer page, Long cid, String subId, PrintWriter out) {
   public void getDynamicListNew(AcceptData acceptData, Integer page, Long cid, String subId, Long uid, PrintWriter out) {
      try {
         int type = 1;
         if (cid == TYPE_FAQUAN) {
@@ -642,12 +641,17 @@
         if (!VersionUtil.greaterThan_2_1_1(acceptData.getPlatform(), acceptData.getVersion())) {
            listNew.addAll(list);
         } else if (list.size() > 0) { // 活动图片不允许跳转
            for (GoodsEvaluate goodsEvaluate : list) {
               if (goodsEvaluate.getType() != EvaluateEnum.activity) {
                  listNew.add(goodsEvaluate);
                  continue;
            // 云发单是否开启
            boolean cloudOpen = configService.isRobotCloudOpen(ConfigKeyEnum.robotCloudOpenCircle.getKey());
            if (!cloudOpen && uid != null) {
               List<String> testUsers = configService.getTestUsers();
               if (testUsers != null && testUsers.contains(uid+"")) {
                  cloudOpen = true;
               }
            }
            for (GoodsEvaluate goodsEvaluate : list) {
               GoodsEvaluate evaluateNew = new GoodsEvaluate();
               try {
                  PropertyUtils.copyProperties(evaluateNew, goodsEvaluate);
@@ -655,6 +659,19 @@
                  e.printStackTrace();
                  continue;
               }
               EvaluateEnum evaluateEnum = evaluateNew.getType();
               // 单品 活动可以一键云发单
               if (evaluateEnum == EvaluateEnum.activity || evaluateEnum == EvaluateEnum.single) {
                  evaluateNew.setCloud(cloudOpen);
               }
               if (evaluateEnum != EvaluateEnum.activity) {
                  listNew.add(evaluateNew);
                  continue;
               }
               // 跳转过渡页
               // String jumpLink =
               // configService.get(ConfigKeyEnum.activityDetailLink.getKey())
@@ -818,8 +835,8 @@
    * @param out
    */
   @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, String goodsId,
         Integer goodsType, PrintWriter out) {
      try {
         if (uid == null) {
            out.print(JsonUtil.loadFalseResult("用户未登录"));
@@ -831,7 +848,7 @@
            return;
         }
         if (type == 1 && (goodsId == null || goodsType == null)) {
         if (type == 1 && (StringUtil.isNullOrEmpty(goodsId) || goodsType == null)) {
            out.print(JsonUtil.loadFalseResult("商品参数不能为空"));
            return;
         }
@@ -913,7 +930,7 @@
               if (type == 1) {
                  for (ImgInfo imgInfo : imgs) {
                     if (imgInfo.getGoodsVO() != null)
                        if (imgInfo.getGoodsVO().getGoodsId().longValue() == goodsId.longValue()
                        if (imgInfo.getGoodsVO().getGoodsId().equalsIgnoreCase(goodsId)
                              && imgInfo.getGoodsVO().getGoodsType() == goodsType.intValue()) {
                           String jumpLink = getJumpLink(imgInfo.getGoodsVO(), user, relationId, inviteCode,
                                 imgInfo.getUrl());
@@ -990,7 +1007,8 @@
      if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
         TaoBaoLink taoBaoLink = null;
         try {
            taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(user.getId(), goodsVO.getGoodsId(), relationId);
            taoBaoLink = shareGoodsService.getTaoBaoLinkForShare(user.getId(), Long.parseLong(goodsVO.getGoodsId()),
                  relationId);
         } catch (ShareGoodsException e) {
            e.printStackTrace();
         }
@@ -998,7 +1016,7 @@
               configService.get(ConfigKeyEnum.taobaoShareQrcodeText.getKey()), taoBaoLink.getGoods(),
               TaoBaoUtil.filterTaoToken(taoBaoLink.getTaoToken()));
      } else if (goodsVO.getGoodsType() == Constant.SOURCE_TYPE_JD) {
         JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(goodsVO.getGoodsId());
         JDGoods jdGoods = jdGoodsCacheUtil.getGoodsInfo(Long.parseLong(goodsVO.getGoodsId()));
         if (jdGoods == null) {
            return null;
         }
@@ -1012,8 +1030,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(Long.parseLong(goodsVO.getGoodsId()),
               PinDuoDuoApiUtil.PID_SHARE + "", user.getId() + "");
      }
      FileUploadResult uploadResult = qrCodeService.drawDynamicGoodsPoster(jumpLink, user.getPortrait(), inviteCode,