yj
2020-03-03 8ebf78f9d9a2663f53f09346abdd14c5964fdfeb
fanli/src/main/java/com/yeshi/fanli/controller/client/v2/DynamicControllerV2.java
@@ -70,6 +70,7 @@
import com.yeshi.fanli.vo.goods.GoodsDetailVO;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
/**
@@ -239,7 +240,7 @@
         // 2.0.7返回发圈+活动+学院+素材
         list.add(map.get(TYPE_FAQUAN));
         list.add(map.get(TYPE_HUODONG));
         // list.add(map.get(TYPE_XUEYUAN));
//         list.add(map.get(TYPE_XUEYUAN));
         list.add(map.get(TYPE_SUCAI));
      } else if (VersionUtil.greaterThan_2_0_6(acceptData.getPlatform(), acceptData.getVersion())) {
@@ -669,12 +670,31 @@
         });
         Gson gson = gsonBuilder.create();
         long count = goodsEvaluateService.countValidMaterials(type);
         String listStr = gson.toJson(list);
         JSONArray array = JSONArray.fromObject(listStr);
         for (int i = 0; i< array.size() ; i++) {
            Object object = array.get(i);
            JSONObject json = JSONObject.fromObject(object);
            Object shareNum = json.get("shareNum");
            if (shareNum != null) {
               int num = Integer.parseInt(shareNum.toString());
               if (num >= 10000) {
                  double sales = num;
                  String salesCountMidea = String.format("%.1f", sales / 10000);
                  json.put("shareNum", salesCountMidea + "万");
               }
            }
//            array.add(json);
         }
         JSONObject data = new JSONObject();
         data.put("count", count);
         data.put("list", gson.toJson(list));
         data.put("list", array);
         out.print(JsonUtil.loadTrueResult(data));
      } catch (Exception e) {
         e.printStackTrace();
         out.print(JsonUtil.loadFalseResult(1, "查询信息失败"));
         LogHelper.errorDetailInfo(e);
      }