You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
65 lines
2.5 KiB
Plaintext
65 lines
2.5 KiB
Plaintext
1 year ago
|
<%@ 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<Map<String,String>> list = new ArrayList<Map<String,String>>();
|
||
|
Map<String,String> 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)+"</br>");
|
||
|
|
||
|
if(kqHolidaySetBiz.isHoliday(currentuserid,currentDate,true)){//非工作日
|
||
|
dataMap = new HashMap<String, String>();
|
||
|
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() %>
|
||
|
|
||
|
|
||
|
|
||
|
|