yujian
2020-04-02 0ec22dcf4fd9c4496e6f681e7fab89f56c6e4e8a
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -12,6 +12,7 @@
import javax.annotation.Resource;
import org.springframework.core.task.TaskExecutor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@@ -42,13 +43,13 @@
import com.yeshi.fanli.entity.dynamic.ImgInfo.ImgEnum;
import com.yeshi.fanli.entity.jd.JDGoods;
import com.yeshi.fanli.entity.system.ConfigKeyEnum;
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
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.log.LogHelper;
import com.yeshi.fanli.service.inter.common.JumpDetailV2Service;
import com.yeshi.fanli.service.inter.config.ConfigService;
import com.yeshi.fanli.service.inter.count.DailyCountMomentsService;
import com.yeshi.fanli.service.inter.dynamic.ArticleOfficialService;
import com.yeshi.fanli.service.inter.dynamic.DynamicInfoService;
import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
@@ -135,6 +136,13 @@
   @Resource
   private ShareGoodsService shareGoodsService;
   @Resource
   private DailyCountMomentsService dailyCountMomentsService;
   @Resource(name = "taskExecutor")
   private TaskExecutor executor;
   private final static long TYPE_REXIAO = 1;// 热销
   private final static long TYPE_TUIJIAN = 2;// 推荐
@@ -877,6 +885,13 @@
         if (type == 3) {
            shareCount++;
            goodsEvaluateService.addShareNum(id);
            executor.execute(new Runnable() {
               @Override
               public void run() { // 添加每日统计
                  dailyCountMomentsService.addShareClick();
               }
            });
         }
         if (list.size() == 0) {
@@ -991,7 +1006,8 @@
      }
      String newText = text; // 非通用券需要验证
      if (comment != null && comment.getTypeEnum() != CommentInfoEnum.currencyCoupon) {
      if ((comment != null && comment.getTypeEnum() != CommentInfoEnum.currencyCoupon)
            || goodsEvaluate.getType() == EvaluateEnum.activity) {
         try {
            newText = convertLinkManager.convertLinkFromText(text, uid, true);
         } catch (ConvertLinkExceptionException e) {
@@ -1000,7 +1016,7 @@
               return;
            }
         } catch (Exception e) {
            e.printStackTrace();
            LogHelper.errorDetailInfo(e);
            out.print(JsonUtil.loadFalseResult("评论生成失败"));
            return;
         }
@@ -1024,6 +1040,13 @@
      JSONObject data = new JSONObject();
      data.put("text", newText);
      out.print(JsonUtil.loadTrueResult(data));
      executor.execute(new Runnable() {
         @Override
         public void run() { // 添加每日统计
            dailyCountMomentsService.addCopyComment();
         }
      });
   }
}