diff --git a/interface/sskj/getWeekendLeaveTime.jsp b/interface/sskj/getWeekendLeaveTime.jsp new file mode 100644 index 0000000..73584d1 --- /dev/null +++ b/interface/sskj/getWeekendLeaveTime.jsp @@ -0,0 +1,64 @@ +<%@ page import="weaver.general.*" %> +<%@ page import="com.alibaba.fastjson.JSONObject" %> +<%@ page import="java.util.*" %> +<%@ page import="org.apache.commons.lang3.StringUtils" %> +<%@ page import="java.time.format.DateTimeFormatter" %> +<%@ page import="java.time.LocalDate" %> +<%@ page import="java.time.Period" %> +<%@ page import="weaver.hrm.User" %> +<%@ page import="weaver.hrm.HrmUserVarify" %> +<%@ page import="com.engine.kq.biz.KQWorkTime" %> +<%@ page import="com.engine.kq.biz.KQHolidaySetBiz" %> +<%@ page language="java" contentType="text/html; charset=UTF-8" %> + +<% + + List> list = new ArrayList>(); + Map dataMap = null; + JSONObject jsonObject = new JSONObject(); + int count = 0; + int weekendHour = 8 ; + User user = HrmUserVarify.getUser(request , response) ; + KQWorkTime kqWorkTime = new KQWorkTime(); + + KQHolidaySetBiz kqHolidaySetBiz = new KQHolidaySetBiz(); + + String currentuserid = Util.null2String(request.getParameter("userid")); + if(StringUtils.isBlank(currentuserid)){ + currentuserid = user.getUID() +""; + } + String startdate = Util.null2String(request.getParameter("startdate")); + String enddate = Util.null2String(request.getParameter("enddate")); + if(StringUtils.isNotBlank(startdate) && StringUtils.isNotBlank(enddate)){ + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + LocalDate localstartdate = LocalDate.parse(startdate, formatter); + LocalDate localenddate = LocalDate.parse(enddate, formatter); + + Period period = Period.between(localstartdate, localenddate); + int days = period.getDays(); + for(int i=0;i<=days;i++){ + LocalDate localCurrentDate = localstartdate.plusDays(i); + String currentDate= localCurrentDate.toString(); +// out.println("currentDate:"+currentDate); +// out.println("isworkday:"+kqHolidaySetBiz.isHoliday(currentuserid,currentDate,true)+"
"); + + if(kqHolidaySetBiz.isHoliday(currentuserid,currentDate,true)){//非工作日 + dataMap = new HashMap(); + dataMap.put("currentDate",currentDate); + dataMap.put("hour",weekendHour+""); + list.add(dataMap); + count = count+ weekendHour ; + } + } + + } + jsonObject.put("code","200"); + jsonObject.put("data",list); + jsonObject.put("count",count); + +%> +<%=jsonObject.toString() %> + + + +