|
@@ -5,6 +5,7 @@
|
|
|
*/
|
|
|
package com.hboxs.control.admin;
|
|
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
import com.hboxs.common.Filter;
|
|
|
import com.hboxs.common.Message;
|
|
|
import com.hboxs.common.Pageable;
|
|
@@ -15,6 +16,7 @@ import com.hboxs.entity.BaseEntity.Save;
|
|
|
import com.hboxs.service.*;
|
|
|
import org.apache.commons.codec.digest.DigestUtils;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.json.JSONObject;
|
|
|
import org.springframework.stereotype.Controller;
|
|
|
import org.springframework.ui.Model;
|
|
|
import org.springframework.ui.ModelMap;
|
|
@@ -62,7 +64,8 @@ public class IndexController extends BaseController {
|
|
|
*今日人流量
|
|
|
*/
|
|
|
@RequestMapping(value = "/peopleCounting", method = RequestMethod.GET)
|
|
|
- public Integer peopleCounting(ModelMap model , RedirectAttributes redirectAttributes) {
|
|
|
+ @ResponseBody
|
|
|
+ public int peopleCounting(ModelMap model , RedirectAttributes redirectAttributes) {
|
|
|
int number = 0;
|
|
|
Admin admin = adminService.getCurrent();
|
|
|
List<Equipment> equipmentList = equipmentService.findByAdminId(admin.getId());
|
|
@@ -162,7 +165,7 @@ public class IndexController extends BaseController {
|
|
|
*/
|
|
|
@RequestMapping(value = "/alarmRecordList", method = RequestMethod.GET)
|
|
|
@ResponseBody
|
|
|
- public List<AlarmRecord> alarmRecordList(ModelMap model , RedirectAttributes redirectAttributes) {
|
|
|
+ public String alarmRecordList() {
|
|
|
List<AlarmRecord> alarmRecordList = new ArrayList<>();
|
|
|
Admin admin = adminService.getCurrent();
|
|
|
List<Filter> fs = new ArrayList<>();
|
|
@@ -189,7 +192,10 @@ public class IndexController extends BaseController {
|
|
|
fs.add(Filter.geDate("createDate", begin));
|
|
|
fs.add(Filter.leDate("createDate", end));
|
|
|
alarmRecordList = alarmRecordService.findList(999, fs, null);
|
|
|
- return alarmRecordList;
|
|
|
+ JSONObject jsonObject = new JSONObject();
|
|
|
+ jsonObject.put("alarmRecordList",alarmRecordList);
|
|
|
+ String js = jsonObject.toString();
|
|
|
+ return js;
|
|
|
}
|
|
|
/**
|
|
|
*机器全年的使用统计
|