admin
2019-11-23 51a4ff5d777028d52a19c314a99f796334cb7b51
fanli/src/main/java/com/yeshi/fanli/util/taobao/DaTaoKeUtil.java
@@ -388,7 +388,7 @@
            ScriptEngineManager manager = new ScriptEngineManager();
            ScriptEngine engine = manager.getEngineByName("javascript");
            try {
               String js = "function getData(){return  JSON.stringify(dataDef);}" + content;
               String js = "function getData(){return  JSON.stringify(dataDef);} var test1='--';function test2(res){};" + content.replace("$(window).load", "test2").replace("window.location.search.", "test1.");
               engine.eval(js);
               if (engine instanceof Invocable) {
                  Invocable in = (Invocable) engine;
@@ -580,7 +580,7 @@
      return detail;
   }
   public static List<String> getDingDongQiangTime(Calendar nowDate) {
   public static List<DingDongTime> getDingDongQiangTime(Calendar nowDate) {
      // 获取当前的小时数
      DingDongTime[] times = new DingDongTime[] { new DingDongTime("0", "00:00"), new DingDongTime("8", "08:00"),
@@ -614,36 +614,35 @@
      //获取当前时间之前的5个数据
      for (int i = 5; i >= 0; i--) {
         int p = pos - i < 0 ? (times.length + pos - i) : pos - i;
         DingDongTime itemData = new DingDongTime(times[p].getKey(), times[p].getValue());
         DingDongTime itemData = new DingDongTime(times[p].getKey(), times[p].getValue(),-1);
         if (pos - i < 0)
            itemData.setTime(
                  preDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
         else
            itemData.setTime(
                  nowDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
         if(pos==p)
            itemData.setState(0);
         list.add(itemData);
      }
      //向后添加剩下的
      if (pos + 1 < times.length)
         for (int i = pos + 1; i < times.length; i++) {
            DingDongTime itemData = new DingDongTime(times[i].getKey(), times[i].getValue());
            DingDongTime itemData = new DingDongTime(times[i].getKey(), times[i].getValue(),1);
            itemData.setTime(
                  nowDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
            list.add(itemData);
         }
      if (times.length - (pos + 1) < 2) {
         DingDongTime itemData = new DingDongTime(times[0].getKey(), times[0].getValue());
         DingDongTime itemData = new DingDongTime(times[0].getKey(), times[0].getValue(),1);
         itemData.setTime(
               nextDay + "" + (itemData.getKey().length() < 2 ? ("0" + itemData.getKey()) : itemData.getKey()));
         list.add(itemData);
      }
      List<String> finalTimeList = new ArrayList<>();
      for (DingDongTime time : list)
         finalTimeList.add(time.getTime());
      return finalTimeList;
      return list;
   }
}