|
@@ -0,0 +1,518 @@
|
|
|
|
|
+package com.happy.action;
|
|
|
|
|
+
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.google.gson.Gson;
|
|
|
|
|
+import com.google.gson.reflect.TypeToken;
|
|
|
|
|
+import com.happy.Model.*;
|
|
|
|
|
+import com.happy.Until.GetHttpParam;
|
|
|
|
|
+import com.happy.Until.ResUtil;
|
|
|
|
|
+import com.happy.Until.ResponseUtil;
|
|
|
|
|
+import com.happy.service.SecondBuffertService;
|
|
|
|
|
+import com.opensymphony.xwork2.ActionSupport;
|
|
|
|
|
+import org.apache.struts2.ServletActionContext;
|
|
|
|
|
+import org.apache.struts2.interceptor.ServletRequestAware;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.text.ParseException;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
+import com.google.gson.Gson;
|
|
|
|
|
+import com.google.gson.reflect.TypeToken;
|
|
|
|
|
+import com.happy.Model.*;
|
|
|
|
|
+import com.happy.Until.GetHttpParam;
|
|
|
|
|
+import com.happy.Until.ResUtil;
|
|
|
|
|
+import com.happy.Until.ResponseUtil;
|
|
|
|
|
+import com.happy.service.SecondBuffertService;
|
|
|
|
|
+import com.opensymphony.xwork2.ActionSupport;
|
|
|
|
|
+import org.apache.struts2.ServletActionContext;
|
|
|
|
|
+import org.apache.struts2.interceptor.ServletRequestAware;
|
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
+
|
|
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
|
|
+import javax.servlet.http.HttpServletResponse;
|
|
|
|
|
+import java.util.List;
|
|
|
|
|
+
|
|
|
|
|
+public class SecondBuffertAction extends ActionSupport implements ServletRequestAware {
|
|
|
|
|
+
|
|
|
|
|
+ private HttpServletRequest request;
|
|
|
|
|
+ public HttpServletResponse response;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ public SecondBuffertService secondBuffertService;
|
|
|
|
|
+
|
|
|
|
|
+ public String startDate;
|
|
|
|
|
+ public String endDate;
|
|
|
|
|
+ public int page; // 当前页
|
|
|
|
|
+ public int rows;// 每页显示的行数rows
|
|
|
|
|
+ public String sm_color;
|
|
|
|
|
+ public String ishot;
|
|
|
|
|
+ public String sm_place;
|
|
|
|
|
+ public String place_type;
|
|
|
|
|
+ public Integer m;
|
|
|
|
|
+
|
|
|
|
|
+ public HttpServletRequest getRequest() {
|
|
|
|
|
+ return request;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setRequest(HttpServletRequest request) {
|
|
|
|
|
+ this.request = request;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setServletRequest(HttpServletRequest request) {
|
|
|
|
|
+ this.request = request;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public HttpServletResponse getResponse() {
|
|
|
|
|
+ return response;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setResponse(HttpServletResponse response) {
|
|
|
|
|
+ this.response = response;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getStartDate() {
|
|
|
|
|
+ return startDate;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setStartDate(String startDate) {
|
|
|
|
|
+ this.startDate = startDate;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getEndDate() {
|
|
|
|
|
+ return endDate;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setEndDate(String endDate) {
|
|
|
|
|
+ this.endDate = endDate;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public int getPage() {
|
|
|
|
|
+ return page;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setPage(int page) {
|
|
|
|
|
+ this.page = page;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public int getRows() {
|
|
|
|
|
+ return rows;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setRows(int rows) {
|
|
|
|
|
+ this.rows = rows;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getSm_color() {
|
|
|
|
|
+ return sm_color;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setSm_color(String sm_color) {
|
|
|
|
|
+ this.sm_color = sm_color;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getIshot() {
|
|
|
|
|
+ return ishot;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setIshot(String ishot) {
|
|
|
|
|
+ this.ishot = ishot;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getSm_place() {
|
|
|
|
|
+ return sm_place;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setSm_place(String sm_place) {
|
|
|
|
|
+ this.sm_place = sm_place;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String getPlace_type() {
|
|
|
|
|
+ return place_type;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setPlace_type(String place_type) {
|
|
|
|
|
+ this.place_type = place_type;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public Integer getM() {
|
|
|
|
|
+ return m;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public void setM(Integer m) {
|
|
|
|
|
+ this.m = m;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第二道防护汇总
|
|
|
|
|
+ public String InSecondBufferT(){
|
|
|
|
|
+ System.out.println("第二道防护汇总");
|
|
|
|
|
+ JSONObject resultjson = new JSONObject();
|
|
|
|
|
+ Gson gson=new Gson();
|
|
|
|
|
+ JSONObject json = GetHttpParam.getHttpParam(request);
|
|
|
|
|
+ if (json == null){
|
|
|
|
|
+ resultjson.put("msg", "请传入参数");
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ SecondBufferT secondBufferT = null;
|
|
|
|
|
+ try{
|
|
|
|
|
+ secondBufferT = gson.fromJson(json.toString(), new TypeToken<SecondBufferT>(){}.getType());
|
|
|
|
|
+ if (secondBufferT == null){
|
|
|
|
|
+ resultjson.put("msg", "数据为空");
|
|
|
|
|
+ resultjson.put("code", "500");
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ int m = secondBuffertService.insertSecondBufferT(secondBufferT);
|
|
|
|
|
+ if (m > 0){
|
|
|
|
|
+ resultjson.put("msg", "上传成功");
|
|
|
|
|
+ resultjson.put("code", "200");
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ resultjson.put("msg", "解析参数失败");
|
|
|
|
|
+ resultjson.put("code", "502");
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ resultjson.put("msg", "参数格式有误!");
|
|
|
|
|
+ resultjson.put("code", "502");
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第二道防护汇总--人数
|
|
|
|
|
+ public String InSecondBufferC(){
|
|
|
|
|
+ System.out.println("第二道防护汇总---人数");
|
|
|
|
|
+ JSONObject resultjson = new JSONObject();
|
|
|
|
|
+ Gson gson=new Gson();
|
|
|
|
|
+ JSONObject json = GetHttpParam.getHttpParam(request);
|
|
|
|
|
+ if (json == null){
|
|
|
|
|
+ resultjson.put("msg", "请传入参数");
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ SecondBufferC secondBufferC = null;
|
|
|
|
|
+ try{
|
|
|
|
|
+ secondBufferC = gson.fromJson(json.toString(), new TypeToken<SecondBufferC>(){}.getType());
|
|
|
|
|
+ if (secondBufferC == null){
|
|
|
|
|
+ resultjson.put("msg", "数据为空");
|
|
|
|
|
+ resultjson.put("code", "500");
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ int m = secondBuffertService.insertSecondBufferC(secondBufferC);
|
|
|
|
|
+ if (m > 0){
|
|
|
|
|
+ resultjson.put("msg", "上传成功");
|
|
|
|
|
+ resultjson.put("code", "200");
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ resultjson.put("msg", "解析参数失败");
|
|
|
|
|
+ resultjson.put("code", "502");
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ resultjson.put("msg", "参数格式有误!");
|
|
|
|
|
+ resultjson.put("code", "502");
|
|
|
|
|
+ ResUtil.writeJson(ServletActionContext.getResponse(), resultjson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第二道防线扫描汇总
|
|
|
|
|
+ public String querySecondBufferT() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ List<SecondBufferT> list = secondBuffertService.querySecondBufferT();
|
|
|
|
|
+ if (list!=null){
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ resultJson.put("code", 205);
|
|
|
|
|
+ resultJson.put("msg", "数据为空");
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 最近7天人员分布
|
|
|
|
|
+ public String querySecondBufferTLastSeven() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ List<SecondBufferT> list = secondBuffertService.querySecondBufferTLastSeven();
|
|
|
|
|
+ if (list!=null){
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ resultJson.put("code", 205);
|
|
|
|
|
+ resultJson.put("msg", "数据为空");
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第二道防线扫描人数汇总
|
|
|
|
|
+ public String querySecondBufferC() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ List<SecondBufferC> list = secondBuffertService.querySecondBufferC();
|
|
|
|
|
+ if (list!=null){
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ resultJson.put("code", 205);
|
|
|
|
|
+ resultJson.put("msg", "数据为空");
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第二道防线处置情况
|
|
|
|
|
+ public String queryHandler() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ List<Handlde> list = secondBuffertService.queryHandler();
|
|
|
|
|
+ if (list!=null){
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ resultJson.put("code", 205);
|
|
|
|
|
+ resultJson.put("msg", "数据为空");
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第二道防线发热人员统计
|
|
|
|
|
+ public String queryHot() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ int num = secondBuffertService.queryHot();
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ resultJson.put("number", num);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第二道防线红码人员详情
|
|
|
|
|
+ public String queryRed() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ List<User> list = secondBuffertService.queryRed(startDate,endDate);
|
|
|
|
|
+ if (list!=null){
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ resultJson.put("code", 205);
|
|
|
|
|
+ resultJson.put("msg", "数据为空");
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 第二道防线黄码人员详情
|
|
|
|
|
+ public String queryYellow() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ int total = secondBuffertService.queryYellowTotal(startDate,endDate); // 查询表中的总记录数
|
|
|
|
|
+ List<User> listPage = secondBuffertService.queryYellow(startDate,endDate,page,rows);
|
|
|
|
|
+ if (listPage == null) {
|
|
|
|
|
+ resultJson.put("rows", "");
|
|
|
|
|
+ resultJson.put("total", 0);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ resultJson.put("rows", listPage);
|
|
|
|
|
+ // int total = listAll.size();
|
|
|
|
|
+ resultJson.put("total", total);// 总记录数
|
|
|
|
|
+ int totalPage = total % rows == 0 ? (total / rows)
|
|
|
|
|
+ : (total / rows) + 1;// 总页数
|
|
|
|
|
+ resultJson.put("totalPage", totalPage);
|
|
|
|
|
+ resultJson.put("currentPage", page);// 当前页
|
|
|
|
|
+ resultJson.put("numPerPage", rows);// 每页数
|
|
|
|
|
+ resultJson.put("nextPage", totalPage - page == 0 ? page : page + 1);// 下一页
|
|
|
|
|
+ resultJson.put("previousPage", page - 0 == 1 ? page : page - 1);// 上一页
|
|
|
|
|
+ resultJson.put("hasPreviousPage", true);// 有上一页
|
|
|
|
|
+ resultJson.put("hasNextPage", true);// 有下一页
|
|
|
|
|
+ resultJson.put("firstPage", true);// 首页
|
|
|
|
|
+ resultJson.put("lastPage", true);// 尾页
|
|
|
|
|
+ }
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(),
|
|
|
|
|
+ resultJson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ // 各类型详情
|
|
|
|
|
+ public String querySpjc() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ List<SecondPlaceJc> list = secondBuffertService.querySpjc();
|
|
|
|
|
+ SecondPlaceJc list2 = secondBuffertService.querySpjd();
|
|
|
|
|
+ SecondPlaceJc list3 = secondBuffertService.querySl();
|
|
|
|
|
+ if (list!=null){
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
|
|
+ resultJson.put("data_jd", list2);
|
|
|
|
|
+ resultJson.put("data_lm", list3);
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ resultJson.put("code", 205);
|
|
|
|
|
+ resultJson.put("msg", "数据为空");
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 各门店详情
|
|
|
|
|
+ public String queryCommon() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ List<SecondPlaceJc> list = secondBuffertService.queryCommon(place_type);
|
|
|
|
|
+ if (list!=null){
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ resultJson.put("code", 205);
|
|
|
|
|
+ resultJson.put("msg", "数据为空");
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第二道防线红黄码加时间搜索
|
|
|
|
|
+ public String queryHotByTime(){
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ StringBuilder sb = new StringBuilder("");
|
|
|
|
|
+ if (startDate!=null && endDate!=null){
|
|
|
|
|
+ sb.append(" and sm_time between '").append(this.startDate)
|
|
|
|
|
+ .append("' and '").append(this.endDate).append(" 24:60:60' ");
|
|
|
|
|
+ }
|
|
|
|
|
+ int total = secondBuffertService.findUsersTotal(sb.toString()); // 查询表中的总记录数
|
|
|
|
|
+ List<User> listPage = this.secondBuffertService.queryByTime(page,rows,sb.toString());
|
|
|
|
|
+ if (listPage == null) {
|
|
|
|
|
+ resultJson.put("rows", "");
|
|
|
|
|
+ resultJson.put("total", 0);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ resultJson.put("rows", listPage);
|
|
|
|
|
+ // int total = listAll.size();
|
|
|
|
|
+ resultJson.put("total", total);// 总记录数
|
|
|
|
|
+ int totalPage = total % rows == 0 ? (total / rows)
|
|
|
|
|
+ : (total / rows) + 1;// 总页数
|
|
|
|
|
+ resultJson.put("totalPage", totalPage);
|
|
|
|
|
+ resultJson.put("currentPage", page);// 当前页
|
|
|
|
|
+ resultJson.put("numPerPage", rows);// 每页数
|
|
|
|
|
+ resultJson.put("nextPage", totalPage - page == 0 ? page : page + 1);// 下一页
|
|
|
|
|
+ resultJson.put("previousPage", page - 0 == 1 ? page : page - 1);// 上一页
|
|
|
|
|
+ resultJson.put("hasPreviousPage", true);// 有上一页
|
|
|
|
|
+ resultJson.put("hasNextPage", true);// 有下一页
|
|
|
|
|
+ resultJson.put("firstPage", true);// 首页
|
|
|
|
|
+ resultJson.put("lastPage", true);// 尾页
|
|
|
|
|
+ }
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(),
|
|
|
|
|
+ resultJson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第二道防线红黄码加时间搜索
|
|
|
|
|
+ public String queryLj(){
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ StringBuilder sb = new StringBuilder("");
|
|
|
|
|
+ if (startDate!=null && endDate!=null){
|
|
|
|
|
+ sb.append(" and sm_time between '").append(this.startDate)
|
|
|
|
|
+ .append("' and '").append(this.endDate).append(" 24:60:60' ");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (sm_color!=null){
|
|
|
|
|
+ sb.append(" and sm_color='").append(this.sm_color).append("' ");
|
|
|
|
|
+ }
|
|
|
|
|
+ if (ishot!=null){
|
|
|
|
|
+ sb.append(" and ishot='").append(this.ishot).append("' ");
|
|
|
|
|
+ }
|
|
|
|
|
+ int total = secondBuffertService.findLjUsersTotal(sb.toString()); // 查询表中的总记录数
|
|
|
|
|
+ List<User> listPage = this.secondBuffertService.queryLjByTime(page,rows,sb.toString());
|
|
|
|
|
+ if (listPage == null) {
|
|
|
|
|
+ resultJson.put("rows", "");
|
|
|
|
|
+ resultJson.put("total", 0);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ resultJson.put("rows", listPage);
|
|
|
|
|
+ // int total = listAll.size();
|
|
|
|
|
+ resultJson.put("total", total);// 总记录数
|
|
|
|
|
+ int totalPage = total % rows == 0 ? (total / rows)
|
|
|
|
|
+ : (total / rows) + 1;// 总页数
|
|
|
|
|
+ resultJson.put("totalPage", totalPage);
|
|
|
|
|
+ resultJson.put("currentPage", page);// 当前页
|
|
|
|
|
+ resultJson.put("numPerPage", rows);// 每页数
|
|
|
|
|
+ resultJson.put("nextPage", totalPage - page == 0 ? page : page + 1);// 下一页
|
|
|
|
|
+ resultJson.put("previousPage", page - 0 == 1 ? page : page - 1);// 上一页
|
|
|
|
|
+ resultJson.put("hasPreviousPage", true);// 有上一页
|
|
|
|
|
+ resultJson.put("hasNextPage", true);// 有下一页
|
|
|
|
|
+ resultJson.put("firstPage", true);// 首页
|
|
|
|
|
+ resultJson.put("lastPage", true);// 尾页
|
|
|
|
|
+ }
|
|
|
|
|
+ ResponseUtil.writeJson(ServletActionContext.getResponse(),
|
|
|
|
|
+ resultJson.toString());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 第二道防线红黄绿累积统计
|
|
|
|
|
+ public String queryLjRyg() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ SecondPlaceJc list = secondBuffertService.queryLjRyg();
|
|
|
|
|
+ if (list!=null){
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ resultJson.put("code", 205);
|
|
|
|
|
+ resultJson.put("msg", "数据为空");
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public String queryView() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ Tz list = secondBuffertService.queryView(sm_place);
|
|
|
|
|
+ if (list!=null){
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ resultJson.put("code", 205);
|
|
|
|
|
+ resultJson.put("msg", "数据为空");
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ /** =================昨日累积缓存 =============================**/
|
|
|
|
|
+ // 前7天活动人数
|
|
|
|
|
+ public String queryEgihtTour() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ List<SecondBufferT> list = secondBuffertService.queryEgihtSbLj(m);
|
|
|
|
|
+ if (list!=null){
|
|
|
|
|
+ resultJson.put("data", list);
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ resultJson.put("code", 205);
|
|
|
|
|
+ resultJson.put("msg", "数据为空");
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 插入缓存
|
|
|
|
|
+ public String insertSbT() throws Exception {
|
|
|
|
|
+ JSONObject resultJson = new JSONObject();
|
|
|
|
|
+ if (m==null){
|
|
|
|
|
+ m=-3;
|
|
|
|
|
+ }
|
|
|
|
|
+ for (int i=m;i<0;i++){
|
|
|
|
|
+ int n = secondBuffertService.insertSbT(i);
|
|
|
|
|
+ }
|
|
|
|
|
+ resultJson.put("msg", "插入成功!");
|
|
|
|
|
+ resultJson.put("code", 200);
|
|
|
|
|
+ ResUtil.write(resultJson, ServletActionContext.getResponse());
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+}
|