admin
2020-03-04 0444d8204d16a378a38ab29d2fe7b644fb68f0ca
fanli/src/main/java/com/yeshi/fanli/controller/admin/GoodsEvaluateAdminController.java
@@ -29,6 +29,7 @@
import com.yeshi.fanli.entity.taobao.TaoBaoGoodsBrief;
import com.yeshi.fanli.exception.dynamic.GoodsEvaluateException;
import com.yeshi.fanli.exception.taobao.TaobaoGoodsDownException;
import com.yeshi.fanli.log.LogHelper;
import com.yeshi.fanli.service.inter.dynamic.GoodsEvaluateService;
import com.yeshi.fanli.service.inter.order.config.HongBaoManageService;
import com.yeshi.fanli.service.manger.ClipboardAnalysisManager;
@@ -84,13 +85,14 @@
   @RequestMapping(value = "saveHead")
   public void saveHead(String callback, GoodsEvaluate evaluate, HttpServletRequest request, PrintWriter out) {
      try {
         String id = null;
         if (request instanceof MultipartHttpServletRequest) {
            MultipartHttpServletRequest fileRequest = (MultipartHttpServletRequest) request;
            goodsEvaluateService.saveHead(fileRequest.getFile("portraitFile"), evaluate);
            id = goodsEvaluateService.saveHead(fileRequest.getFile("portraitFile"), evaluate);
         } else {
            goodsEvaluateService.saveHead(null, evaluate);
            id = goodsEvaluateService.saveHead(null, evaluate);
         }
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(id));
      } catch (GoodsEvaluateException e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
      } catch (Exception e) {
@@ -134,9 +136,9 @@
    * @param out
    */
   @RequestMapping(value = "saveGoodsCoupon")
   public void saveGoodsCoupon(String callback, String pid, String tags, String tagDesc, PrintWriter out) {
   public void saveGoodsCoupon(String callback, String pid, String content, PrintWriter out) {
      try {
         goodsEvaluateService.saveGoodsCoupon(pid, tags, tagDesc);
         goodsEvaluateService.saveGoodsCoupon(pid, content);
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("保存成功"));
      } catch (GoodsEvaluateException e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
@@ -237,9 +239,10 @@
            if (goodsEvaluate != null && goodsEvaluate.getComments() != null
                  && goodsEvaluate.getComments().size() > 0) {
               for (CommentInfo info : goodsEvaluate.getComments()) {
                  if (CommentInfoEnum.currencyCoupon == info.getType()) {
                     commentInfo = info;
                  }
                  if (info != null)
                     if (CommentInfoEnum.currencyCoupon == info.getTypeEnum()) {
                        commentInfo = info;
                     }
               }
            }
         }
@@ -267,9 +270,10 @@
            if (goodsEvaluate != null && goodsEvaluate.getComments() != null
                  && goodsEvaluate.getComments().size() > 0) {
               for (CommentInfo info : goodsEvaluate.getComments()) {
                  if (CommentInfoEnum.goodsCoupon == info.getType()) {
                     commentInfo = info;
                  }
                  if (info != null)
                     if (CommentInfoEnum.goodsCoupon == info.getTypeEnum()) {
                        commentInfo = info;
                     }
               }
            }
         }
@@ -437,9 +441,57 @@
      } catch (Exception e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("保存失败"));
         e.printStackTrace();
         LogHelper.errorDetailInfo(e);
      }
   }
   /**
    * 获取信息
    *
    * @param callback
    * @param special
    *            0a39676f138c4dcba722e321d43c4284
    * @param out
    */
   @RequestMapping(value = "getSuCaiPic")
   public void getSuCaiPic(String callback, String pid, PrintWriter out) {
      try {
         String videoUrl = "";
         String videoPic = "";
         String activityUrl = "";
         List<String> list = new ArrayList<String>();
         if (!StringUtil.isNullOrEmpty(pid)) {
            GoodsEvaluate goodsEvaluate = goodsEvaluateService.getById(pid);
            if (goodsEvaluate != null && goodsEvaluate.getImgList() != null
                  && goodsEvaluate.getImgList().size() > 0) {
               List<ImgInfo> imgList = goodsEvaluate.getImgList();
               for (ImgInfo imgInfo : imgList) {
                  ImgEnum type = imgInfo.getType();
                  if (type == ImgEnum.video) {
                     videoPic = imgInfo.getUrl();
                     videoUrl = imgInfo.getVideoUrl();
                  } else if (type == ImgEnum.activity) {
                     activityUrl = imgInfo.getActivityPic();
                  } else if (type == ImgEnum.img) {
                     list.add(imgInfo.getUrl());
                  }
               }
            }
         }
         JSONObject data = new JSONObject();
         data.put("activityUrl", activityUrl);
         data.put("videoUrl", videoUrl);
         data.put("videoPic", videoPic);
         data.put("list", list);
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
      } catch (Exception e) {
         JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("查询失败"));
         e.printStackTrace();
      }
   }
   /**
    * 保存信息
    * 
@@ -634,8 +686,7 @@
         BigDecimal fanLiRate = hongBaoManageService.getFanLiRate();
         BigDecimal shareRate = hongBaoManageService.getShareRate();
         BigDecimal vipFanLiRate = hongBaoManageService.getVIPFanLiRate();
         ConfigParamsDTO params = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE,
               vipFanLiRate);
         ConfigParamsDTO params = new ConfigParamsDTO(fanLiRate, shareRate, Constant.MAX_REWARD_RATE, vipFanLiRate);
         if (commonGoods.getGoodsType() == Constant.SOURCE_TYPE_TAOBAO) {
            try {
@@ -661,7 +712,7 @@
         JSONObject object = new JSONObject();
         object.put("goodsId", goodsDetail.getGoodsId());
         object.put("goodsType", goodsDetail.getGoodsType());
         object.put("picUrl",goodsDetail.getPicUrl());
         object.put("picUrl", goodsDetail.getPicUrl());
         object.put("imgList", goodsDetail.getImgList());
         JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(object));
      } catch (Exception e) {