简介

日程系统,繁琐的月日期开始结束计算、当前页面开始的天数(跨月)。。。等等,麻烦的事情都交给FullCalendar,世界安静了。

日程日历系统,顶级插件FullCalendar使用说明_第1张图片


官网

https://fullcalendar.io/


使用

1、页面引用






2、页面代码

Large modal

3、后台代码

/**
     * 机构符合率
     */
    @SuppressWarnings("unchecked")
    @RequestMapping(value = "/fhl_json")
    @ResponseBody
    public List>  fhlJson(HttpServletRequest request, HttpServletResponse response){
        String sql = "select t1.d \"start\", nvl(t2.\"title\", '数据未上传' ) \"title\", nvl (t2.\"color\", '#CCCCCC') \"color\" from ( select to_char ( to_date (#{startDate}, 'yyyy-MM-dd') + rownum - 1, 'yyyy-mm-dd' ) d from user_objects where to_date (#{startDate}, 'yyyy-MM-dd') + rownum - 1 <= to_date (#{endDate}, 'yyyy-MM-dd')) t1 left join ( select to_char (ERRORDATE, 'yyyy-MM-dd') \"start\", '符合率:' || trunc (sum(total) / count(total), 2) || '%' \"title\", case when trunc (sum(total) / count(total), 2) < 95 then '#FF3333' when trunc (sum(total) / count(total), 2) between 95 and 100 then '#FFCC66' when trunc (sum(total) / count(total), 2) = 100 then '#FFCC66' end as \"color\" from SYS_TONG_QUOTA_ERROR t where t .ERRORDATE >= to_date (#{startDate}, 'yyyy-MM-dd') and t .ERRORDATE <= to_date (#{endDate}, 'yyyy-MM-dd')";
        HashMap prm = new HashMap();
        //设置当前日历起止时间
        prm.put("startDate", request.getParameter("start"));
        prm.put("endDate", request.getParameter("end"));
        //获取当前用户
        HashMap user = (HashMap) request.getSession().getAttribute(SessionUtils.SESSION_USER_KEY);
        //非管理只看本院
        if(null!=user&&user.get("ISADMIN").equals("yiyuan")){
            sql+=" and JGDM=#{jgdm}";
            prm.put("jgdm", user.get("YLJGDM"));
        }
        sql+=" group by to_char (ERRORDATE, 'yyyy-MM-dd')) t2 on t1. d = t2.\"start\" where to_date(t1.d,'yyyy-mm-dd') 
  

FullCalendar默认提交日期开始结束:“start”“end”

返回的格式如上Sql展示


以上,Ok!


使用ajax全程不用处理,扔给FullCalendar全程自动化

日程日历系统,顶级插件FullCalendar使用说明_第2张图片