AccountDetailInfoAjax.jsp 2.03 KB
<%@ page import="java.text.DecimalFormat"%>
<%@ page import="weaver.general.BaseBean"%>
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.hrm.company.SubCompanyComInfo"%>
<%@ page import="weaver.hrm.company.CompanyComInfo"%>
<%@ page language="java" contentType="text/html; charset=utf-8" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs2" class="weaver.conn.RecordSet" scope="page" />
<%@ page import="weaver.hrm.*" %>
<%@ page import="weaver.conn.RecordSet" %>
<%@ page import="java.util.*" %>
<%@ page import="org.json.JSONArray" %>
<%@ page import="org.json.JSONObject" %>

<%
User user = HrmUserVarify.getUser (request , response) ;
String id = Util.null2String(request.getParameter("id"));

SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
CompanyComInfo companyComInfo = new CompanyComInfo();

JSONArray jsonArray = new JSONArray();
JSONArray ajaxData = new JSONArray();
JSONObject jsonObject=new JSONObject();
DecimalFormat df = new DecimalFormat("#####################0.00");
if(!"".equals(id) && !"0".equals(id)) {
    rs.executeQuery(" select * from FnaAccountRangeSet where accountId = ? ", id);
    while(rs.next()){ 
        String orgId = Util.null2String(rs.getString("orgId"));
        String subCompanyName = subCompanyComInfo.getSubCompanyname(orgId);
        
        jsonArray = new JSONArray();
        
        jsonObject = new JSONObject();
        jsonObject.put("name", "subId");
        jsonObject.put("iseditable", "true");
        jsonObject.put("value", orgId);
        jsonObject.put("label", orgId);
        jsonObject.put("type", "input");
        jsonArray.put(jsonObject);
        
        jsonObject = new JSONObject();
        jsonObject.put("name", "subCompanyName");
        jsonObject.put("iseditable", "true");
        jsonObject.put("value", subCompanyName);
        jsonObject.put("label", subCompanyName);
        jsonObject.put("type", "input");
        jsonArray.put(jsonObject);
        
        ajaxData.put(jsonArray);
    }
}
out.println(ajaxData.toString());
%>