/* Automatically generated.
 * Copyright (c) 2000-2006 by SAP AG, Walldorf.,
 * http://www.sap.com
 * All rights reserved.
 *
 * This software is the confidential and proprietary information
 * of SAP AG, Walldorf. You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms
 * of the license agreement you entered into with SAP.
 * Do not edit.
 */

import ro.emid.common.utils.RequestUtils;
import ro.emid.common.types.Instalatie;
import ro.emid.lpod.db.InstalatieDB;
import ro.emid.common.types.LFInfo;
import ro.emid.common.db.LFInfoAccessDB;
import ro.emid.common.utils.InstalatieUtils;
import ro.emid.common.constants.GlobalAppConstants;
import ro.emid.common.constants.AppConstants;

import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;

public class JEE_jsp_WEB_2d_INF_pagelet_getInstalatieInfoJSON_1471595258429 extends com.sap.engine.services.servlets_jsp.lib.jspruntime.JspBase{

	public void _jspService(HttpServletRequest request, HttpServletResponse response) throws ServletException, java.io.IOException
	{
		//isXml=false
		JspFactory  _jspFactory     = JspFactory.getDefaultFactory();
		PageContext pageContext = _jspFactory.getPageContext(this,request,response,null,true,32768,true);
		ServletConfig config = pageContext.getServletConfig();
		ServletContext application = pageContext.getServletContext();
		com.sap.engine.services.servlets_jsp.lib.jspruntime.PageContextImpl _jspx_pageContext = (com.sap.engine.services.servlets_jsp.lib.jspruntime.PageContextImpl) pageContext;
		com.sap.engine.services.servlets_jsp.server.application.InjectionWrapper _jspx_resourceInjector = ((com.sap.engine.services.servlets_jsp.server.application.ServletContextImpl)_jspx_pageContext.getServletContext()).getApplicationContext().getInjectionWrapper();
		HttpSession session = pageContext.getSession();
		if (!response.isCommitted()) {
		response.setContentType("text/html;charset=UTF-8");
		}
		JspWriter   out     = pageContext.getOut();
		java.lang.Object page = this;
		try {
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(1,54);to=(2,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(2,52);to=(3,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(3,49);to=(4,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(4,48);to=(5,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(5,53);to=(6,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(6,57);to=(7,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(7,64);to=(8,0)]
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(8,58);to=(12,4)]
			out.print("\r\n\r\n<respmesg>\r\n\r\n    ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(12,4);to=(28,2)]
			
    try{

        final long idInstalatie = RequestUtils.getLong( request, "idInstalatie", -1);

        final Instalatie instalatie = InstalatieDB.getById( idInstalatie, true);


        LFInfo info = null;

        if( instalatie != null){

            info = LFInfoAccessDB.getLastEntryByCodSapLF( instalatie.getCod());

        }


// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(28,2);to=(31,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(31,0);to=(31,24)]
			 if( info != null){ 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(31,24);to=(33,13)]
			out.print("\r\n    {\r\n        id : ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(33,13);to=(33,36)]
			out.print(instalatie.getId());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(33,36);to=(34,15)]
			out.print(",\r\n        cod : \"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(34,15);to=(34,39)]
			out.print(instalatie.getCod());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(34,39);to=(35,17)]
			out.print("\",\r\n        putere : ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(35,17);to=(35,78)]
			out.print(AppConstants.format3(InstalatieUtils.calculPutere(info)));
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(35,78);to=(36,27)]
			out.print(",\r\n        totalConsumatori : ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(36,27);to=(36,122)]
			out.print(info.getNumarConsumatoriIT() + info.getNumarConsumatoriMT() + info.getNumarConsumatoriJT());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(36,122);to=(37,25)]
			out.print(",\r\n        consumatori_IT : ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(37,25);to=(37,58)]
			out.print(info.getNumarConsumatoriIT());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(37,58);to=(38,25)]
			out.print(",\r\n        consumatori_MT : ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(38,25);to=(38,58)]
			out.print(info.getNumarConsumatoriMT());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(38,58);to=(39,25)]
			out.print(",\r\n        consumatori_JT : ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(39,25);to=(39,58)]
			out.print(info.getNumarConsumatoriJT());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(39,58);to=(40,30)]
			out.print(",\r\n        consumatori_casnici : ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(40,30);to=(40,68)]
			out.print(info.getNumarConsumatoriCasnici());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(40,68);to=(41,27)]
			out.print(",\r\n        consumatori_mici : ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(41,27);to=(41,62)]
			out.print(info.getNumarConsumatoriMici());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(41,62);to=(42,27)]
			out.print(",\r\n        consumatori_mari : ");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(42,27);to=(42,62)]
			out.print(info.getNumarConsumatoriMari());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(42,62);to=(44,0)]
			out.print("\r\n    }\r\n");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(44,0);to=(44,7)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(44,7);to=(46,0)]
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(46,0);to=(46,27)]
			 } catch( Exception t){
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(46,27);to=(47,13)]
			out.print("\r\n    {error: \"");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(47,13);to=(47,32)]
			out.print(t.getMessage());
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(47,32);to=(48,0)]
			out.print("\"}\r\n");
// end
// begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(48,0);to=(48,7)]
			 } 
// end
// HTML // begin [file="D:/usr/sap/POR/J00/j2ee/cluster/apps/JavaEE/emid-lpod/servlet_jsp/emid-lpod/root/WEB-INF/pagelet/getInstalatieInfoJSON.jsp";from=(48,7);to=(50,0)]
			out.print("\r\n</respmesg>\r\n");
// end
		} catch (ThreadDeath tde) { throw tde;
		} catch (OutOfMemoryError ome) { throw ome;
		} catch (Throwable t) {
			if (!(t instanceof SkipPageException)) {
				try {
					out.clear();
				} catch(java.io.IOException _jspioex) {}
				_jspx_pageContext.handlePageException(t);
			}
		}finally{
			_jspFactory.releasePageContext(pageContext);
		}
	}

}
