Commit 934e63d0 by shenjinzhu

详细数据的时间部分修改

parent e4aea5cf
...@@ -37,7 +37,7 @@ import com.zhiwei.manage.bean.Weibo; ...@@ -37,7 +37,7 @@ import com.zhiwei.manage.bean.Weibo;
import com.zhiwei.manage.handle.DbDepot; import com.zhiwei.manage.handle.DbDepot;
import com.zhiwei.manage.util.Change; import com.zhiwei.manage.util.Change;
import com.zhiwei.manage.util.MongoConnect; import com.zhiwei.manage.util.MongoConnect;
@SuppressWarnings({ "all" })
@Component @Component
public class DataDaoImpl implements DataDao { public class DataDaoImpl implements DataDao {
...@@ -112,7 +112,6 @@ public class DataDaoImpl implements DataDao { ...@@ -112,7 +112,6 @@ public class DataDaoImpl implements DataDao {
} }
@Override @Override
@SuppressWarnings("resource")
public long finCountByDayData(Date startTime, Date endTime, String pt, String id) { public long finCountByDayData(Date startTime, Date endTime, String pt, String id) {
String end = ""; String end = "";
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
......
...@@ -45,12 +45,7 @@ public class MessageDaoImpl implements MessageDao { ...@@ -45,12 +45,7 @@ public class MessageDaoImpl implements MessageDao {
@Override @Override
public String update(Message message, String pt) { public String update(Message message, String pt) {
DBCollection con = null; DBCollection con = getConnection(pt);
if (DbDepot.dbCons.get(pt + "msg") != null) {
con = (DBCollection) DbDepot.dbCons.get(pt + "msg");
} else {
con = dbDepot.getDBCollection("msg", pt);
}
if (con == null) { if (con == null) {
return null; return null;
} }
...@@ -73,12 +68,7 @@ public class MessageDaoImpl implements MessageDao { ...@@ -73,12 +68,7 @@ public class MessageDaoImpl implements MessageDao {
@Override @Override
public List<Message> findAll(int pageNo, int pageSize, String pt) { public List<Message> findAll(int pageNo, int pageSize, String pt) {
List<Message> msgList = new ArrayList<Message>(); List<Message> msgList = new ArrayList<Message>();
DBCollection con = null; DBCollection con = getConnection(pt);
if (DbDepot.dbCons.get(pt + "msg") != null) {
con = (DBCollection) DbDepot.dbCons.get(pt + "msg");
} else {
con = dbDepot.getDBCollection("msg", pt);
}
if (con == null) { if (con == null) {
return null; return null;
} }
...@@ -94,15 +84,20 @@ public class MessageDaoImpl implements MessageDao { ...@@ -94,15 +84,20 @@ public class MessageDaoImpl implements MessageDao {
return msgList; return msgList;
} }
@Override public DBCollection getConnection(String pt) {
public List<Message> findByTmpName(String templateName, int pageNo, int pageSize, String pt) {
List<Message> msgList = new ArrayList<Message>();
DBCollection con = null; DBCollection con = null;
if (DbDepot.dbCons.get(pt + "msg") != null) { if (DbDepot.dbCons.get(pt + "msg") != null) {
con = (DBCollection) DbDepot.dbCons.get(pt + "msg"); con = (DBCollection) DbDepot.dbCons.get(pt + "msg");
} else { } else {
con = dbDepot.getDBCollection("msg", pt); con = dbDepot.getDBCollection("msg", pt);
} }
return con;
}
@Override
public List<Message> findByTmpName(String templateName, int pageNo, int pageSize, String pt) {
List<Message> msgList = new ArrayList<Message>();
DBCollection con = getConnection(pt);
if (con == null) { if (con == null) {
return null; return null;
} }
...@@ -121,12 +116,7 @@ public class MessageDaoImpl implements MessageDao { ...@@ -121,12 +116,7 @@ public class MessageDaoImpl implements MessageDao {
@Override @Override
public boolean delete(List<String> messageId, String pt) { public boolean delete(List<String> messageId, String pt) {
DBCollection con = null; DBCollection con = getConnection(pt);
if (DbDepot.dbCons.get(pt + "msg") != null) {
con = (DBCollection) DbDepot.dbCons.get(pt + "msg");
} else {
con = dbDepot.getDBCollection("msg", pt);
}
if (con == null) { if (con == null) {
return false; return false;
} }
...@@ -142,12 +132,7 @@ public class MessageDaoImpl implements MessageDao { ...@@ -142,12 +132,7 @@ public class MessageDaoImpl implements MessageDao {
@Override @Override
public int allCount(String pt) { public int allCount(String pt) {
DBCollection con = null; DBCollection con = getConnection(pt);
if (DbDepot.dbCons.get(pt + "msg") != null) {
con = (DBCollection) DbDepot.dbCons.get(pt + "msg");
} else {
con = dbDepot.getDBCollection("msg", pt);
}
if (con == null) { if (con == null) {
return 0; return 0;
} }
...@@ -156,12 +141,7 @@ public class MessageDaoImpl implements MessageDao { ...@@ -156,12 +141,7 @@ public class MessageDaoImpl implements MessageDao {
@Override @Override
public int findByTmpCount(String templateName, String pt) { public int findByTmpCount(String templateName, String pt) {
DBCollection con = null; DBCollection con = getConnection(pt);
if (DbDepot.dbCons.get(pt + "msg") != null) {
con = (DBCollection) DbDepot.dbCons.get(pt + "msg");
} else {
con = dbDepot.getDBCollection("msg", pt);
}
if (con == null) { if (con == null) {
return 0; return 0;
} }
...@@ -171,12 +151,7 @@ public class MessageDaoImpl implements MessageDao { ...@@ -171,12 +151,7 @@ public class MessageDaoImpl implements MessageDao {
@Override @Override
public List<Message> findByHandle(int pageNo, int pageSize, boolean handle, String tempName, String pt) { public List<Message> findByHandle(int pageNo, int pageSize, boolean handle, String tempName, String pt) {
DBCollection con = null; DBCollection con = getConnection(pt);
if (DbDepot.dbCons.get(pt + "msg") != null) {
con = (DBCollection) DbDepot.dbCons.get(pt + "msg");
} else {
con = dbDepot.getDBCollection("msg", pt);
}
if (con == null) { if (con == null) {
return null; return null;
} }
...@@ -209,12 +184,7 @@ public class MessageDaoImpl implements MessageDao { ...@@ -209,12 +184,7 @@ public class MessageDaoImpl implements MessageDao {
@Override @Override
public int findByHandleCount(int pageNo, int pageSize, boolean handle, String tempName, String pt) { public int findByHandleCount(int pageNo, int pageSize, boolean handle, String tempName, String pt) {
DBCollection con = null; DBCollection con = getConnection(pt);
if (DbDepot.dbCons.get(pt + "msg") != null) {
con = (DBCollection) DbDepot.dbCons.get(pt + "msg");
} else {
con = dbDepot.getDBCollection("msg", pt);
}
if (con == null) { if (con == null) {
return 0; return 0;
} }
......
...@@ -71,6 +71,9 @@ public class DataController { ...@@ -71,6 +71,9 @@ public class DataController {
@ResponseBody @ResponseBody
public String getDataByTempName(HttpServletRequest request, HttpServletResponse response,@RequestBody Map<String, Object> map) public String getDataByTempName(HttpServletRequest request, HttpServletResponse response,@RequestBody Map<String, Object> map)
throws UnsupportedEncodingException { throws UnsupportedEncodingException {
// Calendar c=Calendar.getInstance();
// c.setTimeInMillis((long) map.get("end"));
// System.out.println(new SimpleDateFormat("yyyy-MM-dd HH:mm:mm").format(c.getTime()));
long start=(long) map.get("start"); long start=(long) map.get("start");
long end=(long) map.get("end"); long end=(long) map.get("end");
String timeType=(String) map.get("timeType"); String timeType=(String) map.get("timeType");
...@@ -84,13 +87,14 @@ public class DataController { ...@@ -84,13 +87,14 @@ public class DataController {
} else if (timeType.equals("hour")) { } else if (timeType.equals("hour")) {
// 小时数据 // 小时数据
if (start == 0) { if (start == 0) {
startd.set(Calendar.HOUR, -7); startd.set(Calendar.HOUR, -10);
} else { } else {
startd.setTimeInMillis(start); startd.setTimeInMillis(start);
endTime.setTimeInMillis(start); endTime.setTimeInMillis(start);
} }
String source = ""; String source = "";
List<Data> list = new ArrayList<Data>(); List<Data> list = new ArrayList<Data>();
startd.add(Calendar.HOUR, -8);
while (endTime.getTimeInMillis() < end) { while (endTime.getTimeInMillis() < end) {
endTime.add(Calendar.HOUR, 1); endTime.add(Calendar.HOUR, 1);
List<EasyNews> newsList = new ArrayList<>(); List<EasyNews> newsList = new ArrayList<>();
...@@ -165,7 +169,6 @@ public class DataController { ...@@ -165,7 +169,6 @@ public class DataController {
startTime.setTimeInMillis(start); startTime.setTimeInMillis(start);
Calendar endTime = Calendar.getInstance(); Calendar endTime = Calendar.getInstance();
endTime.setTimeInMillis(end); endTime.setTimeInMillis(end);
List<Channel> channel = serverService.findDisChannel(); List<Channel> channel = serverService.findDisChannel();
List<Channel> list = new ArrayList<>(); List<Channel> list = new ArrayList<>();
for(Channel chan:channel){ for(Channel chan:channel){
......
...@@ -60,7 +60,6 @@ public class MessageConteoller { ...@@ -60,7 +60,6 @@ public class MessageConteoller {
@ResponseBody @ResponseBody
public String delete(@RequestBody Map<String, Object> map) { public String delete(@RequestBody Map<String, Object> map) {
List<String> messageId=(List<String>) map.get("messageId"); List<String> messageId=(List<String>) map.get("messageId");
System.out.println(messageId);
String pt=(String) map.get("pt"); String pt=(String) map.get("pt");
msgService.delete(messageId, pt); msgService.delete(messageId, pt);
JsonResult result = new JsonResult(true, 200, "删除成功", ""); JsonResult result = new JsonResult(true, 200, "删除成功", "");
......
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>数据管理系统</title><link rel=stylesheet href=./static/css/style.ini.css><link rel=stylesheet href=./static/datepicker/css/datepicker.css><link rel=stylesheet href=./static/datepicker/css/layout.css><link href=./static/css/app.92bad3cc55dab6eb58d4f6d580131955.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.1f643cf06e5671b25020.js></script><script type=text/javascript src=./static/js/vendor.c00def797876150978d2.js></script><script type=text/javascript src=./static/js/app.508ffe1db26d2a077b87.js></script></body><script src=./static/js/jquery-1.12.4.min.js></script><script src=./static/js/jquery.easing-master/jquery.easing.min.js></script><script src=./static/js/jquery.transit.js></script><script src=./static/datepicker/js/datepicker.js></script><script src=./static/datepicker/js/eye.js></script><script src=./static/datepicker/js/utils.js></script></html> <!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>数据管理系统</title><link rel=stylesheet href=./static/css/style.ini.css><link rel=stylesheet href=./static/datepicker/css/datepicker.css><link rel=stylesheet href=./static/datepicker/css/layout.css><link href=./static/css/app.6f47627e9efa16c11dbedd718e637bc9.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.831f4c0acbad15a40c03.js></script><script type=text/javascript src=./static/js/vendor.c00def797876150978d2.js></script><script type=text/javascript src=./static/js/app.716319d99e004baea6ee.js></script></body><script src=./static/js/jquery-1.12.4.min.js></script><script src=./static/js/jquery.easing-master/jquery.easing.min.js></script><script src=./static/js/jquery.transit.js></script><script src=./static/datepicker/js/datepicker.js></script><script src=./static/datepicker/js/eye.js></script><script src=./static/datepicker/js/utils.js></script></html>
\ No newline at end of file \ No newline at end of file
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.
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,a){for(var i,u,f,s=0,l=[];s<t.length;s++)u=t[s],o[u]&&l.push(o[u][0]),o[u]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(r&&r(t,c,a);l.length;)l.shift()();if(a)for(s=0;s<a.length;s++)f=n(n.s=a[s]);return f};var t={},o={2:0};n.e=function(e){function r(){i.onerror=i.onload=null,clearTimeout(u);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 a=document.getElementsByTagName("head")[0],i=document.createElement("script");i.type="text/javascript",i.charset="utf-8",i.async=!0,i.timeout=12e4,n.nc&&i.setAttribute("nonce",n.nc),i.src=n.p+"static/js/"+e+"."+{0:"c00def797876150978d2",1:"508ffe1db26d2a077b87"}[e]+".js";var u=setTimeout(r,12e4);return i.onerror=i.onload=r,a.appendChild(i),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}}([]); !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,a){for(var i,u,f,s=0,l=[];s<t.length;s++)u=t[s],o[u]&&l.push(o[u][0]),o[u]=0;for(i in c)Object.prototype.hasOwnProperty.call(c,i)&&(e[i]=c[i]);for(r&&r(t,c,a);l.length;)l.shift()();if(a)for(s=0;s<a.length;s++)f=n(n.s=a[s]);return f};var t={},o={2:0};n.e=function(e){function r(){i.onerror=i.onload=null,clearTimeout(u);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 a=document.getElementsByTagName("head")[0],i=document.createElement("script");i.type="text/javascript",i.charset="utf-8",i.async=!0,i.timeout=12e4,n.nc&&i.setAttribute("nonce",n.nc),i.src=n.p+"static/js/"+e+"."+{0:"c00def797876150978d2",1:"716319d99e004baea6ee"}[e]+".js";var u=setTimeout(r,12e4);return i.onerror=i.onload=r,a.appendChild(i),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.1f643cf06e5671b25020.js.map //# sourceMappingURL=manifest.831f4c0acbad15a40c03.js.map
\ No newline at end of file \ No newline at end of file
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div id="myECharts"></div> <div id="myECharts"></div>
<div class="select"> <div class="select">
单位: 单位:
<select class="" name="" v-model="timeType" @change="echartsUpdate()"> <select class="" name="" v-model="timeType" @change="timeToggle(), echartsUpdate()">
<option value="day">天</option> <option value="day">天</option>
<option value="hour">小时</option> <option value="hour">小时</option>
</select> </select>
...@@ -52,14 +52,19 @@ export default { ...@@ -52,14 +52,19 @@ export default {
return { return {
myChart: null, myChart: null,
option: {}, option: {},
startTime: (new Date(moment().format('YYYY-MM-DD'))).getTime() - 1000 * 60 * 60 * 24 * 7, // startTime: (new Date(moment().format('YYYY-MM-DD'))).getTime() - 1000 * 60 * 60 * 24 * 7,
// endTime: (new Date(moment().format('YYYY-MM-DD'))).getTime(),
// startHours: 0,
// endHours: 0,
startTime: (new Date(moment(Date.now() - 18 * 60 * 60 * 1000).format('YYYY-MM-DD'))).getTime(),
endTime: (new Date(moment().format('YYYY-MM-DD'))).getTime(), endTime: (new Date(moment().format('YYYY-MM-DD'))).getTime(),
startHours: 0, startHours: moment(Date.now() - 18 * 60 * 60 * 1000).format('HH'),
endHours: 0, endHours: moment().format('HH'),
colorList: ['#4FCF94', '#F8656B', '#ffbb22', '#4CB1F5', '', '', '', '', '', ''], colorList: ['#4FCF94', '#F8656B', '#ffbb22', '#4CB1F5', '', '', '', '', '', ''],
data: [], data: [],
timeType: 'day', // timeType: 'day',
methodValue: 'IT时报', timeType: 'hour',
methodValue: 'IT之家',
method: 'tempName', method: 'tempName',
matchingWord: [], matchingWord: [],
toggle: { toggle: {
...@@ -202,6 +207,23 @@ export default { ...@@ -202,6 +207,23 @@ export default {
this.echartsUpdate() this.echartsUpdate()
}, },
methods: { methods: {
timeToggle () {
if (this.timeType === 'day') {
this.startTime = (new Date(moment().format('YYYY-MM-DD'))).getTime() - 1000 * 60 * 60 * 24 * 7
this.endTime = (new Date(moment().format('YYYY-MM-DD'))).getTime()
this.startHours = 0
this.endHours = 0
window.$('#detailedDataStartTime').val(moment(Date.now() - 1000 * 60 * 60 * 24 * 7).format('YYYY-MM-DD'))
window.$('#detailedDataEndTime').val(moment().format('YYYY-MM-DD'))
} else if (this.timeType === 'hour') {
this.startTime = (new Date(moment(Date.now() - 18 * 60 * 60 * 1000).format('YYYY-MM-DD'))).getTime()
this.endTime = (new Date(moment().format('YYYY-MM-DD'))).getTime()
this.startHours = moment(Date.now() - 18 * 60 * 60 * 1000).format('HH')
this.endHours = moment().format('HH')
window.$('#detailedDataStartTime').val(moment(Date.now() - 18 * 60 * 60 * 1000).format('YYYY-MM-DD'))
window.$('#detailedDataEndTime').val(moment().format('YYYY-MM-DD'))
}
},
inputToSearch (str) { inputToSearch (str) {
this.methodValue = str this.methodValue = str
this.matchingWord = [] this.matchingWord = []
......
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