admin
2020-07-03 651a15c78f668bef3859d9ed1bb7ad0b669d3600
fanli/src/main/java/com/yeshi/fanli/controller/wxmp/v1/DynamicController.java
@@ -26,6 +26,7 @@
import com.yeshi.fanli.util.Constant;
import com.yeshi.fanli.util.JumpDetailUtil;
import com.yeshi.fanli.util.jd.JDApiUtil;
import com.yeshi.fanli.vo.homemodule.SpecialVO;
import com.yeshi.fanli.vo.msg.ClientTextStyleVO;
import net.sf.json.JSONObject;
@@ -73,6 +74,7 @@
         JSONObject data = new JSONObject();
         data.put("list", gson.toJson(infoList));
         data.put("count", count);
         data.put("page",page);
         out.print(JsonUtil.loadTrueResult(data));
      } catch (Exception e) {
         out.print(JsonUtil.loadFalseResult(1, "获取数据失败"));
@@ -114,14 +116,14 @@
      listKey.add("special_channel_jd");
      listKey.add("special_channel_pdd");
      List<Special> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
            listKey, platformCode, Integer.parseInt(acceptData.getVersion()));
      List<SpecialVO> list = specialService.listByPlaceKeyHasLabel((page - 1) * Constant.PAGE_SIZE, Constant.PAGE_SIZE,
            listKey, platformCode, Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
      long time = System.currentTimeMillis();
      // 删除尚未启用的过期的
      for (int i = 0; i < list.size(); i++) {
         Special special = list.get(i);
         SpecialVO special = list.get(i);
         if (special.getJumpDetail() != null) {
            special.setJumpDetail(JumpDetailUtil.getWXMPJumDetail(special.getJumpDetail()));
         }
@@ -129,12 +131,7 @@
         if (special.getState() == 1L) {
            list.remove(i--);
         } else {
            if (special.getStartTime() != null && special.getEndTime() != null)
               special.setTimeTask(true);
            else
               special.setTimeTask(false);
            if (special.isTimeTask()) {
            if (special.getStartTime() != null && special.getEndTime() != null) {
               if (time < special.getStartTime().getTime() || time > special.getEndTime().getTime()) {
                  list.remove(i--);
               } else// 设置倒计时
@@ -155,12 +152,13 @@
      }
      long count = specialService.countByPlaceKeyList(listKey, platformCode,
            Integer.parseInt(acceptData.getVersion()));
            Integer.parseInt(acceptData.getVersion()),acceptData.getSystem());
      GsonBuilder gsonBuilder = new GsonBuilder().excludeFieldsWithoutExposeAnnotation();
      Gson gson = gsonBuilder.create();
      JSONObject data = new JSONObject();
      data.put("count", count);
      data.put("page", page);
      data.put("list", gson.toJson(list));
      out.print(JsonUtil.loadTrueResult(data));
   }