sh_loaddata.java 1.7 KB
package com.servlet.bksh.DMC;

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.service.bksh.SHExecuteService;

public class sh_loaddata extends HttpServlet {
	private static final long serialVersionUID = 1L;

	protected void doGet(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		doPost(request, response);
	}

	protected void doPost(HttpServletRequest request,
			HttpServletResponse response) throws ServletException, IOException {

		request.setCharacterEncoding("utf-8");
		response.setCharacterEncoding("utf-8");
		String datetime = request.getParameter("date");
		SHExecuteService shservice = new SHExecuteService();
		String result = shservice.getDataForDB(datetime);
//		System.out.println(result);
//		String  result="{totalProperty:'1',root:[{a_id:1815,a_datetime:'2018-11-08 10:00:00',cxwsjh_incod_eq:'3',a_incod_note:' ',cxwsjh_innh4n_eq:'3',a_innh4n_note:' ',cxwsjh_inph_eq:'3',a_inph_note:' ',cxwsjh_outcod_eq:'33',a_outcod_note:'工作人员正在排查超标原因',cxwsjh_outzl_eq:'3',a_outzl_note:'工作人员正在排查超标原因',cxwsjh_outzd_eq:'3',a_outzd_note:'数据达标,显示正常',cxwsjh_outnh4n_eq:'33',a_outnh4n_note:'工作人员正在排查超标原因',cxwsjh_outph_eq:'33',a_outph_note:'工作人员正在排查超标原因',cxwsjh_intp_eq:'3',a_intp_note:'数据达标,显示正常'}]}";
		PrintWriter out = response.getWriter();
		out.write(result);
		out.close();
	}

}