admin
2020-06-09 28fafb67d05ea8398f3f5968f37dec86f0e37e67
fanli/src/main/java/com/yeshi/fanli/controller/CallBackController.java
@@ -94,7 +94,7 @@
   @Resource
   private HongBaoManageService hongBaoManageService;
   @Resource
   private OrderHongBaoMoneyComputeService orderHongBaoMoneyComputeService;
@@ -194,8 +194,6 @@
   public void VIP(PrintWriter out) {
      out.print("success");
   }
   /**
    * 支付宝支付回调
@@ -260,37 +258,19 @@
      // return;
      // }
      String contentDecode = "";
      if (request instanceof MultipartHttpServletRequest) {
         MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
         List<MultipartFile> files = multipartRequest.getFiles("file");
         try {
            InputStream input = files.get(0).getInputStream();
            InputStreamReader reader = new InputStreamReader(input, "UTF-16LE");
            int d = -1;
            String st = "";
            while ((d = reader.read()) != -1) {
               st += ((char) d);
            }
            System.out.println(st);
            contentDecode = st;
            contentDecode = contentDecode.substring(contentDecode.indexOf("(") +1,
                  contentDecode.length()).trim();
            if (contentDecode.endsWith(")"))
               contentDecode = contentDecode.substring(0, contentDecode.length() - 1);
      contentDecode = content.substring(content.indexOf("(") + 1, content.length()).trim();
      if (contentDecode.endsWith(")"))
         contentDecode = contentDecode.substring(0, contentDecode.length() - 1);
            System.out.println(contentDecode);
            reader.close();
         } catch (IOException e) {
            e.printStackTrace();
         }
      }
      System.out.println(contentDecode);
      JSONObject data = JSONObject.fromObject(contentDecode).optJSONObject("data");
      JSONArray array = data.optJSONObject("recommend").optJSONArray("resultList");
      long startTime=System.currentTimeMillis();
      for (int i = array.size() - 1; i >= 0; i--) {
         JSONObject item = array.optJSONObject(i);
         String title = item.optString("itemName");
@@ -337,7 +317,7 @@
            } else {
               imgInfo.setType(ImgEnum.goods);
               SimpleGoods simpleGoods = new SimpleGoods();
               simpleGoods.setGoodsId(itemId+"");
               simpleGoods.setGoodsId(itemId + "");
               simpleGoods.setGoodsType(Constant.SOURCE_TYPE_TAOBAO);
               simpleGoods.setState(CommonGoods.STATE_NORMAL);
               CouponInfoVO couponInfo = goodsVO.getCouponInfo();
@@ -357,7 +337,7 @@
         ActivityUser user = ruleList.get((int) (ruleList.size() * Math.random())).getActivityUser();
         try {
            goodsEvaluateService.addGoodsEvaluate(itemId+"", imageList, user, doc, null, null);
            goodsEvaluateService.addGoodsEvaluate(itemId + "", imageList, user, doc, null, new Date(startTime-1000*60*20L*i));
         } catch (GoodsEvaluateException e) {
            e.printStackTrace();
         }