Merge remote-tracking branch 'origin/dev' into dev
commit
4d015e61e8
@ -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<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() %>
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue