Commit 1bb4dd78 by admin

提交前端文件

parent aacb3ce7
package com.zhiwei.manage.util;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import javax.annotation.Resource;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.zhiwei.manage.bean.Channel;
import com.zhiwei.manage.bean.Data;
import com.zhiwei.manage.dao.DataDaoImpl;
import com.zhiwei.manage.service.ServerServiceImpl;
@RunWith(SpringJUnit4ClassRunner.class) // 使用junit4进行测试
@ContextConfiguration(locations = { "classpath:applicationContext.xml" })
public class Tests {
@Resource
private DataDaoImpl dd;
@Resource
private ServerServiceImpl sd;
@Test
public void test1() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH");
Calendar cal = Calendar.getInstance();
cal.add(Calendar.DATE, -5);
List<Channel> list = sd.findDisChannel();
long count = 0;
Map<String, Long> map = new HashMap<>();
for (; cal.getTime().before(new Date()); cal.add(Calendar.HOUR_OF_DAY, 1)) {
for (Channel ch : list) {
if (cal.get(Calendar.HOUR_OF_DAY) == 0) {
count = 0;
map.put(ch.getPt(), count);
}
if (map.get(ch.getPt()) == null) {
map.put(ch.getPt(), (long) (Math.random() * 3000));
} else
map.put(ch.getPt(), map.get(ch.getPt()) + (int) (Math.random() * 3000));
Data d = new Data();
d.setCount(map.get(ch.getPt()));
d.setPt(ch.getPt());
try {
d.setTime(sdf.parse(sdf.format(cal.getTime())));
} catch (ParseException e) {
e.printStackTrace();
}
System.out.println(ch.getPt() + ":" + map.get(ch.getPt()));
dd.insertTest(d);
}
}
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}var r=window.webpackJsonp;window.webpackJsonp=function(t,c,i){for(var u,a,f,s=0,l=[];s<t.length;s++)a=t[s],o[a]&&l.push(o[a][0]),o[a]=0;for(u in c)Object.prototype.hasOwnProperty.call(c,u)&&(e[u]=c[u]);for(r&&r(t,c,i);l.length;)l.shift()();if(i)for(s=0;s<i.length;s++)f=n(n.s=i[s]);return f};var t={},o={2:0};n.e=function(e){function r(){u.onerror=u.onload=null,clearTimeout(a);var n=o[e];0!==n&&(n&&n[1](new Error("Loading chunk "+e+" failed.")),o[e]=void 0)}var t=o[e];if(0===t)return new Promise(function(e){e()});if(t)return t[2];var c=new Promise(function(n,r){t=o[e]=[n,r]});t[2]=c;var i=document.getElementsByTagName("head")[0],u=document.createElement("script");u.type="text/javascript",u.charset="utf-8",u.async=!0,u.timeout=12e4,n.nc&&u.setAttribute("nonce",n.nc),u.src=n.p+"static/js/"+e+"."+{0:"c00def797876150978d2",1:"2eb11249cf067d55eb92"}[e]+".js";var a=setTimeout(r,12e4);return u.onerror=u.onload=r,i.appendChild(u),c},n.m=e,n.c=t,n.d=function(e,r,t){n.o(e,r)||Object.defineProperty(e,r,{configurable:!1,enumerable:!0,get:t})},n.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(r,"a",r),r},n.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},n.p="./",n.oe=function(e){throw console.error(e),e}}([]);
//# sourceMappingURL=manifest.924ae89cf33ce54f2bd0.js.map
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment