    /**
     * 返回指定日志范围内的工作日天数
     * @param beginDate 开始日期
     * @param endDate   结束日期
     * @param userid    人员ID
     * @return
     */
    public String getWorkDays(String beginDate, String endDate, int userid) {
        BaseBean bean = new BaseBean();
        //设置日期格式
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");

        //起始日期
        if (beginDate == null || beginDate.length() == 0) {
            beginDate = bean.getPropValue("scheduleWorkDayForFormula", "fromDate");
            beginDate = beginDate == null ? "" : beginDate.trim();
            if (beginDate.length() == 0) {
                beginDate = df.format(new Date());
            }
        }

        //截止日期
        if (endDate == null || endDate.length() == 0) {
            endDate = bean.getPropValue("scheduleWorkDayForFormula", "endDate");
            endDate = endDate == null ? "" : endDate.trim();
            if (endDate.length() == 0) {
                endDate = df.format(new Date());
            }
        }

        boolean isBig = false;
        try {
            SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
            Date begin = sdf.parse(beginDate);
            Date end = sdf.parse(endDate);
            if (begin.compareTo(end) > 0) {
                String temp = beginDate;
                beginDate = endDate;
                endDate = temp;
                isBig = true;
            }
        } catch (Exception e) {
            bean.writeLog("ExcelFormulaWorkday解析日期报错", e);
        }

        int workDayCount = 0;
        User user = new User(userid);
        HrmScheduleManager manager = new HrmScheduleManager(user);
        Map<String, Boolean> mapWorkday = manager.isWorkday(beginDate, endDate, manager.getSubCompanyId());
        if (mapWorkday != null && mapWorkday.size() > 0) {
            Iterator<String> itr = mapWorkday.keySet().iterator();
            while (itr.hasNext()) {
                String tempDate = itr.next();
                Boolean isWorkDay = mapWorkday.get(tempDate);
                if (isWorkDay) {
                    if (isBig) {
                        workDayCount--;
                    } else {
                        workDayCount++;
                    }
                }
            }
        }
        return workDayCount+"";
    }