private void query() throws IOException {
        UserEntity user = Scheduler.getUsers().get(username);
        URL url2 = new URL("https://kyfw.12306.cn/otn/queryOrder/queryMyOrderNoComplete");
        HttpsURLConnection con = (HttpsURLConnection) url2.openConnection();
        con.setSSLSocketFactory(Utils.getSsf());
        ConnectionUtil.setSessionId(con, user.getSessionId());
        BufferedReader reader = new BufferedReader(new InputStreamReader(con.getInputStream(), "UTF-8"));
        try {
            String line = null;
            StringBuffer res = new StringBuffer();
            String[] tmp = null;
            while ((line = reader.readLine()) != null) {
                if (line.indexOf("用户未登录") != -1) {
                    user.setStatus(Constant.USER_STATUS_NO_LOGIN);
                    tmp = ConnectionUtil.getRandCode();
                    user.setRandCode(tmp[0]);
                    user.setSessionId(tmp[1]);
                    res.append(line);
                    stop();
                } else {
                    res.append(line);
                }
            }
            if (user.getStatus() != Constant.USER_STATUS_NO_LOGIN) {
                Integer times = sendMailTimesMap.get(username);
                if(times==null)times=0;
                int limit = PropertiesUtil.getIntegerValue(SEND_MAIL_TIMES);
                if (times <= limit) {
                    String title = "您的帐号：" + user.getUsername() + ",购票状态变更。";
//                    MailUtil.sendMail(title, parseRes(res.toString()), StringUtil.isBlank(user.getEmail()) ? user
//                            .getUsername() : user.getEmail());
                    System.out.println(title+ parseRes(res.toString()));
                    times++;
                    sendMailTimesMap.put(username, times);
                }
                if (!res.toString().equals(user.getQueryRes())) {
                    sendMailTimesMap.put(user.getUsername(), 0);
                    user.setQueryRes(res.toString());
                }
            }
            if (user.getStatus() == Constant.USER_STATUS_NO_LOGIN && res.toString().indexOf("用户未登录") == -1) {
                user.setStatus(Constant.USER_STATUS_TICKETIMG);
            }
            Scheduler.getUsers().put(username, user);
        } finally {
            reader.close();
            con.disconnect();
        }
    }