⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 utilfunction.java

📁 OA系统实现以下功能: a、个人办公,我的办公桌 b、公文管理 c、工作流程 d、组织管理 e. 权限管理
💻 JAVA
字号:
package com.bjsxt.oa.web;

import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;

import com.bjsxt.oa.model.MeetingRoomApply;
import com.bjsxt.oa.model.MeetingRoomApplyVO;

public class UtilFunction {
	public static boolean isHoliday(int year,int month,int date){
		Calendar now = Calendar.getInstance();
		now.set(year, month - 1, date);
		int current = now.get(Calendar.DAY_OF_WEEK);
		if(current == Calendar.SUNDAY || current == Calendar.SATURDAY){
			return true;
		}
		return false;
	}
	
	public static List splitApply(MeetingRoomApply apply){
		Date begin = apply.getBeginDate();
		Date end = apply.getEndDate();
		
		Calendar beginCal = Calendar.getInstance();
		beginCal.setTime(begin);
		
		Calendar endCal = Calendar.getInstance();
		endCal.setTime(end);
		
		List applyVO = new ArrayList();
		
		do{
			
			if(beginCal.get(Calendar.HOUR_OF_DAY) < 8 || beginCal.get(Calendar.HOUR_OF_DAY) > 18){
				beginCal.add(Calendar.HOUR_OF_DAY, 1);
				continue;
			}
			
			MeetingRoomApplyVO vo = new MeetingRoomApplyVO();
			vo.setId(
					apply.getRoom().getSn() + "_" +
					beginCal.get(Calendar.YEAR) + "-" +
					(beginCal.get(Calendar.MONTH)+1) + "-" +
					beginCal.get(Calendar.DAY_OF_MONTH) + "-" +
					beginCal.get(Calendar.HOUR_OF_DAY)
					);
			vo.setOid(apply.getId());
			vo.setApplyReason(apply.getApplyReason());
			vo.setStatus(apply.getStatus());
			applyVO.add(vo);
			
			beginCal.add(Calendar.HOUR_OF_DAY, 1);
		}while(endCal.after(beginCal));
		
		return applyVO;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -