考勤报表增加入职日期、哺乳假数据列 20240402-wcf

pull/3/head
fage 1 year ago
parent 2894f6dfbb
commit 0512c0bd61

@ -7,12 +7,12 @@ import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.kq.biz.*;
import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit;
import com.engine.kq.nbjh.KqUtil;
import com.engine.kq.util.ExcelUtil;
import com.engine.kq.util.KQDurationCalculatorUtil;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils;
import weaver.common.DateUtil;
import weaver.common.StringUtil;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.TimeUtil;
@ -27,11 +27,7 @@ import weaver.systeminfo.SystemEnv;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
@ -196,7 +192,7 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
" (select zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayattendancedays," +
" (select zma.workdays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayworkdays," +
" (select zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayattendancedays," +
" a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder," +
" a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder,a.companystartdate," +
" b.kqdate, b.workdays,b.workMins,b.serialid, b.attendancedays,b.attendanceMins,b.beLate," +
" b.beLateMins,b.graveBeLate,b.graveBeLateMins,b.leaveEearly,b.leaveEarlyMins,b.graveLeaveEarly," +
" b.graveLeaveEarlyMins,b.absenteeism,b.signdays,b.signmins, " +
@ -444,6 +440,10 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
//补卡次数
int fillCard = kqReportBiz.getFillCardCountDaily(kqdate, id);
data.add(fillCard);
}else if (fieldName.equals("breastfeedLeave")) {
//哺乳假
double breastfeedLeave = KqUtil.getBreastfeedLeave(kqdate, kqdate, id);
data.add(breastfeedLeave);
} else if (fieldName.equals("businessLeave") || fieldName.equals("officialBusiness")) {
String businessLeaveData = Util.null2s(Util.null2String(flowData.get(id + "|" + kqdate + "|" + fieldName)), "0.0");
String backType = fieldName + "_back";

@ -6,6 +6,7 @@ import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.kq.biz.*;
import com.engine.kq.nbjh.KqUtil;
import com.engine.kq.util.ExcelUtil;
import com.engine.kq.util.KQDurationCalculatorUtil;
import com.engine.kq.util.UtilKQ;
@ -213,7 +214,7 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayattendancedays," +
" (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayworkdays," +
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayattendancedays," +
" a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle," +
" a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle,a.companystartdate," +
" sum(b.workdays) as workdays,sum(b.workMins) as workMins,sum(b.attendancedays) as attendancedays," +
" sum(b.attendanceMins) as attendanceMins,sum(b.beLate) as beLate,sum(b.beLateMins) as beLateMins, " +
" sum(b.graveBeLate) as graveBeLate, sum(b.graveBeLateMins) as graveBeLateMins,sum(b.leaveEearly) as leaveEearly," +
@ -228,7 +229,7 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
"where a.id= b.resourceid and c.id=b.serialid and (c.rest_shift is null or c.rest_shift=0) " +
"and b.kqdate >='" + fromDate + "' and b.kqdate <='" + toDate + "'";
String sqlWhere = rightSql;
String groupBy = " group by a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1,a.departmentid,a.jobtitle ";
String groupBy = " group by a.id,a.lastname,a.workcode,a.dsporder,a.companystartdate,b.resourceid,a.subcompanyid1,a.departmentid,a.jobtitle ";
if (subCompanyId.length() > 0) {
sqlWhere += " and a.subcompanyid1 in(" + subCompanyId + ") ";
}
@ -291,6 +292,10 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
//补卡次数int
if (fieldName.equals("fillCard")) {
fieldValue = KQDurationCalculatorUtil.getDurationRound(String.valueOf(kqReportBiz.getFillCardCount(fromDate, toDate, id)));
}
//哺乳假
else if(fieldName.equals("breastfeedLeave")){
fieldValue = KQDurationCalculatorUtil.getDurationRound(String.valueOf(KqUtil.getBreastfeedLeave(fromDate, toDate, id)));
} else if (fieldName.equals("subcompany")) {
String tmpSubcompanyId = Util.null2String(rs.getString("subcompanyid"));
if (tmpSubcompanyId.length() == 0) {
@ -464,7 +469,7 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
if (Util.null2String(rs.getString(lsCascadekey.get(i))).length() > 0) {
fieldid = KQReportFieldComInfo.field2Id.get(lsCascadekey.get(i));
//迟到早退使用分钟
if (lsCascadekey.get(i).contains("LateMins") || lsCascadekey.get(i).contains("EarlyMins")) {
if (fieldName.contains("LateMins") || fieldName.contains("EarlyMins")) {
fieldValue = rs.getString(lsCascadekey.get(i));
} else {
fieldValue = getFieldValueByUnitType(rs.getString(lsCascadekey.get(i)), kqReportFieldComInfo.getUnittype(fieldid));

@ -9,11 +9,11 @@ import com.engine.kq.biz.*;
import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit;
import com.engine.kq.entity.WorkTimeEntity;
import com.engine.kq.log.KQLog;
import com.engine.kq.nbjh.KqUtil;
import com.engine.kq.util.KQDurationCalculatorUtil;
import com.engine.kq.util.PageUidFactory;
import org.apache.commons.lang3.StringUtils;
import org.springframework.util.CollectionUtils;
import weaver.common.StringUtil;
import weaver.conn.RecordSet;
import weaver.general.BaseBean;
import weaver.general.TimeUtil;
@ -156,7 +156,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
" (select zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayattendancedays," +
" (select zma.workdays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayworkdays," +
" (select zma.attendancedays from kq_format_total zma where zma.resourceid = a.id and zma.kqdate = b.kqdate and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayattendancedays," +
" a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder," +
" a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder,a.companystartdate," +
" b.kqdate, b.workdays,b.workMins,b.serialid, b.attendancedays,b.attendanceMins," +
" b.beLate,b.beLateMins,b.graveBeLate,b.graveBeLateMins,b.leaveEearly,b.leaveEarlyMins," +
" b.signdays,b.signmins, " +
@ -496,6 +496,10 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave));
data.put("overtimeTotal", overtimeTotal);
//哺乳假
String breastfeedLeave = KQDurationCalculatorUtil.getDurationRound(String.valueOf(KqUtil.getBreastfeedLeave(kqdate, kqdate, id)));
data.put("breastfeedLeave", breastfeedLeave);
//夜班补贴次数
String nightSubsidy = KQDurationCalculatorUtil.getDurationRound(String.valueOf(kqReportBiz.getNightSubsidyDaily(kqdate, id)));
data.put("nightSubsidy", nightSubsidy);
@ -647,7 +651,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
sql = " select kqdate,resourceid,serialid,serialnumber,workbegindate,workbegintime, " +
" workenddate,workendtime,workmins,signindate,signintime,signoutdate,signouttime, \n" +
" attendanceMins,belatemins,graveBeLateMins,leaveearlymins,graveLeaveEarlyMins,absenteeismmins,forgotcheckMins,forgotBeginWorkCheckMins," +
" leaveMins,leaveInfo,evectionMins,outMins,signinid,signoutid,flowinfo \n" +
" leaveMins,leaveInfo,evectionMins,outMins,signinid,signoutid \n" +
" from kq_format_detail b \n" +
" where resourceid = " + resourceId + " and kqdate ='" + kqDate + "' \n" +
" order by serialnumber \n";
@ -676,7 +680,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
String signoutid = Util.null2String(rs.getString("signoutid")).trim();
int leaveMins = rs.getInt("leaveMins");
String leaveInfo = Util.null2String(rs.getString("leaveInfo"));
String flowinfo = Util.null2String(rs.getString("flowinfo"));
// String flowinfo = Util.null2String(rs.getString("flowinfo"));
int evectionMins = rs.getInt("evectionMins");
int outMins = rs.getInt("outMins");
@ -684,11 +688,11 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
if (serialid.length() > 0) {
if (workbegintime.length() > 0) {
signStatusInfo = new HashMap();
signStatusInfo.put("resourceId",resourceid);
signStatusInfo.put("kqdate",kqdate);
signStatusInfo.put("flowinfo",flowinfo);
signStatusInfo.put("workbegintime",workbegintime);
signStatusInfo.put("workendtime",workendtime);
// signStatusInfo.put("resourceId",resourceid);
// signStatusInfo.put("kqdate",kqdate);
// signStatusInfo.put("flowinfo",flowinfo);
// signStatusInfo.put("workbegintime",workbegintime);
// signStatusInfo.put("workendtime",workendtime);
signStatusInfo.put("workdate", workbegindate);
signStatusInfo.put("worktime", workbegintime);
signStatusInfo.put("beLateMins", beLateMins);
@ -711,11 +715,11 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
if (workendtime.length() > 0) {
signStatusInfo = new HashMap();
signStatusInfo.put("resourceId",resourceid);
signStatusInfo.put("kqdate",kqdate);
signStatusInfo.put("flowinfo",flowinfo);
signStatusInfo.put("workbegintime",workbegintime);
signStatusInfo.put("workendtime",workendtime);
// signStatusInfo.put("resourceId",resourceid);
// signStatusInfo.put("kqdate",kqdate);
// signStatusInfo.put("flowinfo",flowinfo);
// signStatusInfo.put("workbegintime",workbegintime);
// signStatusInfo.put("workendtime",workendtime);
signStatusInfo.put("workdate", workenddate);
signStatusInfo.put("worktime", kqTimesArrayComInfo.turn48to24Time(workendtime));
signStatusInfo.put("leaveEarlyMins", leaveEarlyMins);
@ -739,15 +743,11 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
//弹性工时打卡时间取自签到签退数据
}
signStatusInfo = new HashMap();
signStatusInfo.put("resourceId",resourceid);
signStatusInfo.put("kqdate",kqdate);
signStatusInfo.put("leaveMins",leaveMins);
signStatusInfo.put("leaveInfo",leaveInfo);
signStatusInfo.put("evectionMins",evectionMins);
signStatusInfo.put("outMins",outMins);
signStatusInfo.put("flowinfo",flowinfo);
signStatusInfo.put("workbegintime",workbegintime);
signStatusInfo.put("workendtime",workendtime);
signStatusInfo.put("leaveMins", leaveMins);
signStatusInfo.put("leaveInfo", leaveInfo);
signStatusInfo.put("evectionMins", evectionMins);
signStatusInfo.put("outMins", outMins);
if (signinid.length() > 0) {
data.put("signintime" + serialnumber, signintime.length() == 0 ? SystemEnv.getHtmlLabelName(25994, user.getLanguage()) : signintime);
data.put("signinstatus" + serialnumber, KQReportBiz.getSignStatus(signStatusInfo, user, "on"));

@ -6,6 +6,7 @@ import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext;
import com.engine.kq.biz.*;
import com.engine.kq.nbjh.KqUtil;
import com.engine.kq.util.KQDurationCalculatorUtil;
import com.engine.kq.util.PageUidFactory;
import org.apache.commons.lang3.StringUtils;
@ -191,7 +192,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayattendancedays," +
" (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayworkdays," +
" (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayattendancedays," +
"a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle," +
"a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle,a.companystartdate," +
" sum(b.workdays) as workdays,sum(b.workMins) as workMins,sum(b.attendancedays) as attendancedays," +
" sum(b.attendanceMins) as attendanceMins,sum(b.beLate) as beLate,sum(b.beLateMins) as beLateMins, " +
" sum(b.graveBeLate) as graveBeLate, sum(b.graveBeLateMins) as graveBeLateMins,sum(b.leaveEearly) as leaveEearly," +
@ -207,7 +208,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
"where a.id= b.resourceid and c.id=b.serialid and (c.rest_shift is null or c.rest_shift=0) " +
"and b.kqdate >='" + fromDate + "' and b.kqdate <='" + toDate + "'";
String sqlWhere = rightSql;
String groupBy = " group by a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1,a.departmentid,a.jobtitle ";
String groupBy = " group by a.id,a.lastname,a.workcode,a.dsporder,a.companystartdate,b.resourceid,a.subcompanyid1,a.departmentid,a.jobtitle ";
if (subCompanyId.length() > 0) {
sqlWhere += " and a.subcompanyid1 in(" + subCompanyId + ") ";
}
@ -593,6 +594,10 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave));
data.put("overtimeTotal", overtimeTotal);
//哺乳假
String breastfeedLeave = KQDurationCalculatorUtil.getDurationRound(String.valueOf(KqUtil.getBreastfeedLeave(fromDate, toDate, id)));
data.put("breastfeedLeave", breastfeedLeave);
//夜班补贴次数
String nightSubsidy = KQDurationCalculatorUtil.getDurationRound(String.valueOf(kqReportBiz.getNightSubsidyTotal(fromDate, toDate, id)));
data.put("nightSubsidy", nightSubsidy);

@ -0,0 +1,35 @@
package com.engine.kq.nbjh;
import weaver.conn.RecordSet;
import weaver.general.Util;
/**
* @Title
* @Author wangchaofa
* @CreateDate 2024/4/2
* @Version 1.0
* @Description
*/
public class KqUtil {
/**
*
* @param fromDate
* @param toDate
* @param userid
* @return
*/
public static double getBreastfeedLeave(String fromDate,String toDate,String userid){
double result = 0.00;
RecordSet rs = new RecordSet();
String breastfeedLeave_table = rs.getPropValue("nbjh_ygdjblc","breastfeedLeave_table");
rs.executeQuery(" select sum(a.mtgjxs) as result from "+ breastfeedLeave_table +" a,workflow_requestbase b " +
" where a.requestid=b.requestid and b.currentnodetype=3 " +
" and a.ksrq >= ? and a.jsrq <= ? and a.xm = ?",fromDate,toDate,userid);
while(rs.next()){
result = Util.getDoubleValue(rs.getString("result"),0.00);
}
return result;
}
}
Loading…
Cancel
Save