<%@ page import="weaver.general.*" %>
<%@ page import="org.apache.commons.lang.StringUtils" %>
<%@ page import="com.alibaba.fastjson.JSONObject" %>
<%@ page import="java.util.*" %>
<%@ page import="com.engine.kq.service.impl.KQMyAttendanceServiceImpl" %>
<%@ page import="weaver.hrm.User" %>
<%@ page import="weaver.hrm.HrmUserVarify" %>
<%@ page import="com.alibaba.fastjson.JSONArray" %>
<%@ page import="com.engine.common.util.ParamUtil" %>
<%@ page import="com.engine.kq.service.KQMyAttendanceService" %>
<%@ page import="com.engine.common.util.ServiceUtil" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>

<%
    User user = HrmUserVarify.getUser(request , response);

    Map<String,Object> apiDatas = getService(user).getHrmKQReportInfo(ParamUtil.request2Map(request), user);
    JSONObject dataJson = new JSONObject(apiDatas);

    String zjkqnj = "0.0";
    String lnkqnj = "0.0";
    String jnkqnj = "0.0";

    if(StringUtils.isNotEmpty(dataJson.toJSONString())){
        if(dataJson.containsKey("status")){
            if("1".equals(dataJson.getString("status"))){
                if(dataJson.containsKey("groupitem4")){
                    JSONObject groupitem4 = dataJson.getJSONObject("groupitem4");
                    out.print("groupitem4:"+groupitem4+"<br>");
                    if(groupitem4.containsKey("items")){
                        JSONArray items = groupitem4.getJSONArray("items");

                        JSONObject itemJson = items.getJSONObject(1);
                        JSONArray itemArray = itemJson.getJSONArray("item");
                        JSONObject itemData = itemArray.getJSONObject(0);
                        lnkqnj = itemData.getString("value");
                        itemData = itemArray.getJSONObject(1);
                        jnkqnj = itemData.getString("value");
                        itemData = itemArray.getJSONObject(2);
                        zjkqnj = itemData.getString("value");

                    }
                }
            }
        }
    }

    out.print("zjkqnj:"+zjkqnj+"lnkqnj:"+lnkqnj+"jnkqnj:"+jnkqnj);

    JSONObject jsonObject = new JSONObject();

    jsonObject.put("zjkqnj",zjkqnj);
    jsonObject.put("lnkqnj",lnkqnj);
    jsonObject.put("jnkqnj",jnkqnj);

%>
<%=jsonObject.toString()  %>

<%!

    private KQMyAttendanceService getService(User user){
        return (KQMyAttendanceService) ServiceUtil.getService(KQMyAttendanceServiceImpl.class, user);
    }

%>



