日报,月报,大夜班天数,小夜班天数

dev-chenwnj
howec 1 year ago
parent 4d015e61e8
commit ccb43ae87e

@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
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.biz.KQReportBiz;
import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit;
import com.engine.kq.util.ExcelUtil;
import com.engine.kq.util.KQDurationCalculatorUtil;
@ -176,12 +176,20 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
titleList.add(title);
}
//刘浩 导出新增列[夜班天数]-begin
//刘浩 导出新增列[夜班天数]-begin
title = new HashMap<>();
title.put("title","夜班天数");
title.put("title","夜班天数");
title.put("width",30*256);
title.put("rowSpan", 3);
titleList.add(title);
//刘浩 导出新增列[小夜班天数]-begin
title = new HashMap<>();
title.put("title","小夜班天数");
title.put("width",30*256);
title.put("rowSpan", 3);
titleList.add(title);
//刘浩 导出新增列[夜班天数]-end
sheet.put("titleList", titleList);
@ -476,11 +484,22 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
}
}
//刘浩 夜班天数 -- begin
//刘浩 夜班天数 -- begin
writeLog("howec-serialidx:::::::::"+serialidx);
writeLog("howec-signintime1x:::::::::"+signintime1x);
writeLog("howec-signouttime1x:::::::::"+signouttime1x);
if(serialidx.contains("夜班")) {
if(serialidx.contains("值夜班")) {
if((!"未打卡".equals(signintime1x)) && (!"未打卡".equals(signouttime1x))) {
data.add("1");
}else {
data.add("0");
}
}else {
data.add("0");
}
// 刘浩 小夜班天数 --
if(serialidx.contains("两班夜班")) {
if((!"未打卡".equals(signintime1x)) && (!"未打卡".equals(signouttime1x))) {
data.add("1");
}else {
@ -489,7 +508,8 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
}else {
data.add("0");
}
//刘浩 夜班天数 -- end
//刘浩 大小夜班天数 -- end
dataList.add(data);
}

@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
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.biz.KQReportBiz;
import com.engine.kq.util.ExcelUtil;
import com.engine.kq.util.KQDurationCalculatorUtil;
import com.engine.kq.util.UtilKQ;
@ -188,12 +188,19 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
}
titleList.add(title);
}
//刘浩 新增一列[夜班天数]
//刘浩 新增一列[夜班天数]
title = new HashMap();
title.put("title","夜班天数");
title.put("title","夜班天数");
title.put("width", 30 * 256);
title.put("rowSpan",3);
titleList.add(title);
//刘浩 新增一列[小夜班天数]
title = new HashMap();
title.put("title","小夜班天数");
title.put("width", 30 * 256);
title.put("rowSpan",3);
titleList.add(title);
sheet.put("titleList", titleList);
String forgotBeginWorkCheck_field = " sum(b.forgotBeginWorkCheck) ";
@ -469,12 +476,13 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
}
s1 = s1.substring(0,s1.length()-1);
String sql88 = "select b.resourceid,b.signintime,b.signouttime,b.serialid from kq_format_detail b where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
//刘浩--大夜班天数统计
String sql88 = "select b.resourceid,b.signintime,b.signouttime,b.serialid from kq_format_detail b inner join kq_ShiftManagement c on c.id = b.serialid where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
" and b.signintime !='' and b.signouttime !='' " +
" and b.kqdate in("+s1+") and b.serialid in (3,5,6)";
String sql99 = "select count(b.resourceid) as sums from kq_format_detail b where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
" and b.kqdate in("+s1+") and c.serial like '%值夜班%'";
String sql99 = "select count(b.resourceid) as sums from kq_format_detail b inner join kq_ShiftManagement c on c.id = b.serialid where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
" and b.signintime !='' and b.signouttime !='' " +
" and b.kqdate in("+s1+") and b.serialid in (3,5,6)";
" and b.kqdate in("+s1+") and c.serial like '%值夜班%'";
writeLog("howec:::::sql2:"+sql88);
RecordSet rs99 = new RecordSet();
rs99.execute(sql99);
@ -483,8 +491,26 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
counts99 = String.valueOf(rs99.getInt("sums"));
}
data.add(counts99);
//刘浩--小夜班天数统计
sql88 = "select b.resourceid,b.signintime,b.signouttime,b.serialid from kq_format_detail b inner join kq_ShiftManagement c on c.id = b.serialid where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
" and b.signintime !='' and b.signouttime !='' " +
" and b.kqdate in("+s1+") and c.serial like '%两班夜班%'";
sql99 = "select count(b.resourceid) as sums from kq_format_detail b inner join kq_ShiftManagement c on c.id = b.serialid where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
" and b.signintime !='' and b.signouttime !='' " +
" and b.kqdate in("+s1+") and c.serial like '%两班夜班%'";
writeLog("howec:::::sql2-1:"+sql88);
rs99 = new RecordSet();
rs99.execute(sql99);
counts99 = "0";
if (rs99.next()){
counts99 = String.valueOf(rs99.getInt("sums"));
}
data.add(counts99);
}else {
data.add("0");
data.add("0");
}
dataList.add(data);
}

@ -6,7 +6,7 @@ import com.alibaba.fastjson.JSONObject;
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.biz.KQReportBiz;
import com.engine.kq.cmd.shiftmanagement.toolkit.ShiftManagementToolKit;
import com.engine.kq.entity.WorkTimeEntity;
import com.engine.kq.log.KQLog;
@ -44,8 +44,8 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
RecordSet rs = new RecordSet();
String sql = "";
try{
writeLog("howeccccccccccccggggggg1"+ new Date());
String pageUid = PageUidFactory.getHrmPageUid("KQDailyReport");
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
ResourceComInfo resourceComInfo = new ResourceComInfo();
@ -54,7 +54,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
ShiftManagementToolKit shiftManagementToolKit = new ShiftManagementToolKit();
KQReportBiz kqReportBiz = new KQReportBiz();
KQLeaveRulesBiz kqLeaveRulesBiz = new KQLeaveRulesBiz();
writeLog("howeccccccccccccggggggg2"+ new Date());
String rightSql = new KQReportBiz().getReportRight("2",""+user.getUID(),"a");
JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data")));
@ -71,6 +71,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
toDate = TimeUtil.getDateByOption(typeselect,"1");
}
}
writeLog("howeccccccccccccggggggg3"+ new Date());
//人员状态
String status = Util.null2String(jsonObj.get("status"));
String subCompanyId = Util.null2String(jsonObj.get("subCompanyId"));
@ -86,7 +87,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
int pageCount = 0;
int isHavePre = 0;
int isHaveNext = 0;
writeLog("howeccccccccccccggggggg4"+ new Date());
List<Map<String, Object>> leaveRules = kqLeaveRulesBiz.getAllLeaveRules();
List<Object> columns = new ArrayList();
Map<String,Object> column = null;
@ -95,6 +96,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
Map<String,Object> mapChildColumnInfo = null;
List<Object> childColumns = null;
KQReportFieldComInfo kqReportFieldComInfo = new KQReportFieldComInfo();
writeLog("howeccccccccccccggggggg5"+ new Date());
while (kqReportFieldComInfo.next()){
if(Util.null2String(kqReportFieldComInfo.getParentid()).length()>0)continue;
boolean isDaily = kqReportFieldComInfo.getReportType().equals("daily");
@ -117,6 +119,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
column.put("rowSpan", 3);
column.put("width", Util.getIntValue(kqReportFieldComInfo.getWidth()));
}
writeLog("howeccccccccccccggggggg6"+ new Date());
if(kqReportFieldComInfo.getReportType1().equals("daily")){
column.put("isdaily", "1");
}
@ -132,6 +135,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
// fromDate = today;
// }
// }
writeLog("howeccccccccccccggggggg7"+ new Date());
String forgotBeginWorkCheck_field = " b.forgotbeginworkcheck ";
if(rs.getDBType().equalsIgnoreCase("oracle")&&!Util.null2String(rs.getOrgindbtype()).equals("dm")&&!Util.null2String(rs.getOrgindbtype()).equals("st")&&!Util.null2String(rs.getOrgindbtype()).equals("jc")) {
@ -152,7 +156,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
if(subCompanyId.length()>0){
sqlWhere +=" and a.subcompanyid1 in("+subCompanyId+") ";
}
writeLog("howeccccccccccccggggggg8"+ new Date());
if(departmentId.length()>0){
sqlWhere +=" and a.departmentid in("+departmentId+") ";
}
@ -198,7 +202,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
String orderBy = " order by a.dsporder asc, a.lastname asc, b.kqdate asc ";
String descOrderBy = " order by a.dsporder desc, a.lastname desc, b.kqdate desc ";
sql = backFields + sqlFrom + sqlWhere + orderBy;
writeLog("howeccccccccccccggggggg9"+ new Date());
if (pageIndex > 0 && pageSize > 0) {
if (rs.getDBType().equals("oracle")) {
sql = " select " + sql;
@ -236,7 +240,6 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
String isShowFullPath = Util.null2String(kqSettingsComInfo.getMain_val(fullPathMainKey),"0");
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
rs.execute(sql);
writeLog("howec::::::::::::::::sql:"+sql);
while (rs.next()) {
@ -288,6 +291,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
}
data.put(fieldName + "Id", fieldValueID);
data.put(fieldName, fieldValue);
} else if (fieldName.equals("jobtitle")) {
String fieldValueID = rs.getString("jobtitle");
fieldValue = jobTitlesComInfo.getJobTitlesname(rs.getString("jobtitle"));
@ -297,6 +301,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
}
data.put(fieldName + "Id", fieldValueID);
data.put(fieldName, fieldValue);
} else if (kqReportFieldComInfo.getParentid().equals("overtime") || kqReportFieldComInfo.getParentid().equals("overtime_nonleave")
|| kqReportFieldComInfo.getParentid().equals("overtime_4leave") || fieldName.equals("businessLeave") || fieldName.equals("officialBusiness")) {
if (fieldName.equals("overtimeTotal")) {
@ -319,9 +324,11 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
} else {
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id + "|" + kqdate + "|" + fieldName)));
}
data.put(fieldName, fieldValue);
} else if (fieldName.equals("serialid")) {
fieldValue = Util.null2String(rs.getString(fieldName));
if (fieldValue.length()>0) {//弹性工作制没有班次
// data.put("serialid", shiftManagementToolKit.getShiftOnOffWorkSections(fieldValue, user.getLanguage()));
@ -354,6 +361,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
data.put(fieldName, fieldValue);
}
}
data.putAll(this.getSignDetailInfo(id, kqdate));
//请假
@ -402,7 +410,6 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
data.put("kqdate", kqdate);
datas.add(data);
}
List<Object> lsHolidays = KQHolidaySetBiz.getHolidaySetListByScope(""+user.getUID(),fromDate,toDate);
retmap.put("holidays", lsHolidays);
retmap.put("columns",columns);

@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
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.biz.KQReportBiz;
import com.engine.kq.util.KQDurationCalculatorUtil;
import com.engine.kq.util.PageUidFactory;
import weaver.common.DateUtil;
@ -23,7 +23,6 @@ import weaver.systeminfo.SystemEnv;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.util.*;
public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
@ -44,12 +43,11 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
String pageUid = PageUidFactory.getHrmPageUid("KQReport");
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
ResourceComInfo resourceComInfo = new ResourceComInfo();
JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo();
KQLeaveRulesBiz kqLeaveRulesBiz = new KQLeaveRulesBiz();
KQReportBiz kqReportBiz = new KQReportBiz();
JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data")));
String attendanceSerial = Util.null2String(jsonObj.get("attendanceSerial"));
String fromDate = Util.null2String(jsonObj.get("fromDate"));
@ -101,7 +99,6 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
if(KQReportFieldComInfo.cascadekey2fieldname.keySet().contains(kqReportFieldComInfo.getFieldname()))continue;
if(!kqReportFieldComInfo.getReportType().equals("all") && !kqReportFieldComInfo.getReportType().equals("month"))continue;
if("leave".equalsIgnoreCase(kqReportFieldComInfo.getFieldname())&&leaveRules.size()==0)continue;
column = new HashMap();
column.put("title", SystemEnv.getHtmlLabelNames(kqReportFieldComInfo.getFieldlabel(), user.getLanguage()));
column.put("unit", KQReportBiz.getUnitType(kqReportFieldComInfo, user));
@ -124,20 +121,19 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
columns.addAll(this.getCascadeKeyColumnsInfo(kqReportFieldComInfo.getCascadekey(),user));
}
//Liuhao 新增列[夜班天数] --begin
//Liuhao 新增列[夜班天数] --begin
column = new HashMap();
column.put("title","夜班天数");
column.put("title","夜班天数");
column.put("unit","天");
column.put("dataIndex","nightdays");
column.put("dataIndex","nightdaysd");
column.put("type","businessLeave");
column.put("key","nightdays");
column.put("key","nightdaysd");
column.put("isSystem","1");
column.put("rowSpan","3");
column.put("width",65);
column.put("showDetial","1");
columns.add(column);
//Liuhao 新增列[夜班天数] --end
boolean isEnd = false;
Calendar cal = DateUtil.getCalendar();
String today = DateUtil.getCurrentDate();
@ -176,26 +172,25 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
columns.add(column);
String forgotBeginWorkCheck_field = " sum(b.forgotBeginWorkCheck) ";
if(rs.getDBType().equalsIgnoreCase("oracle")) {
forgotBeginWorkCheck_field = " sum(nvl(b.forgotBeginWorkCheck,0)) ";
}else if((rs.getDBType()).equalsIgnoreCase("mysql")){
forgotBeginWorkCheck_field = " sum(ifnull(b.forgotBeginWorkCheck,0)) ";
}else {
forgotBeginWorkCheck_field = " sum(isnull(b.forgotBeginWorkCheck,0)) ";
}
if(rs.getDBType().equalsIgnoreCase("oracle")) {
forgotBeginWorkCheck_field = " sum(nvl(b.forgotBeginWorkCheck,0)) ";
}else if((rs.getDBType()).equalsIgnoreCase("mysql")){
forgotBeginWorkCheck_field = " sum(ifnull(b.forgotBeginWorkCheck,0)) ";
}else {
forgotBeginWorkCheck_field = " sum(isnull(b.forgotBeginWorkCheck,0)) ";
}
Map<String,Object> definedFieldInfo = new KQFormatBiz().getDefinedField();
String definedFieldSum = Util.null2String(definedFieldInfo.get("definedFieldSum"));
String backFields = " a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle," +
" 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," +
" sum(b.leaveEarlyMins) as leaveEarlyMins, sum(b.graveLeaveEarly) as graveLeaveEarly, " +
" sum(b.graveLeaveEarlyMins) as graveLeaveEarlyMins,sum(b.absenteeism) as absenteeism, " +
" sum(b.signdays) as signdays,sum(b.signmins) as signmins, "+
" sum(b.absenteeismMins) as absenteeismMins, sum(b.forgotCheck)+"+forgotBeginWorkCheck_field+" as forgotCheck "+(definedFieldSum.length()>0?","+definedFieldSum+"":"");
" 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," +
" sum(b.leaveEarlyMins) as leaveEarlyMins, sum(b.graveLeaveEarly) as graveLeaveEarly, " +
" sum(b.graveLeaveEarlyMins) as graveLeaveEarlyMins,sum(b.absenteeism) as absenteeism, " +
" sum(b.signdays) as signdays,sum(b.signmins) as signmins, "+
" sum(b.absenteeismMins) as absenteeismMins, sum(b.forgotCheck)+"+forgotBeginWorkCheck_field+" as forgotCheck "+(definedFieldSum.length()>0?","+definedFieldSum+"":"");
if(rs.getDBType().equals("oracle")){
backFields = "/*+ index(kq_format_total IDX_KQ_FORMAT_TOTAL_KQDATE) */ "+backFields;
@ -206,7 +201,6 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
if(subCompanyId.length()>0){
sqlWhere +=" and a.subcompanyid1 in("+subCompanyId+") ";
}
if(departmentId.length()>0){
sqlWhere +=" and a.departmentid in("+departmentId+") ";
}
@ -226,14 +220,13 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' ");
}
if(status.length()>0){
if (!status.equals("8") && !status.equals("9")) {
sqlWhere += " and a.status = "+status+ "";
}else if (status.equals("8")) {
sqlWhere += " and (a.status = 0 or a.status = 1 or a.status = 2 or a.status = 3) ";
}
}
if(status.length()>0){
if (!status.equals("8") && !status.equals("9")) {
sqlWhere += " and a.status = "+status+ "";
}else if (status.equals("8")) {
sqlWhere += " and (a.status = 0 or a.status = 1 or a.status = 2 or a.status = 3) ";
}
}
sql = " select count(*) as c from ( select 1 as c "+sqlFrom+sqlWhere+groupBy+") t";
rs.execute(sql);
if (rs.next()){
@ -286,12 +279,11 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
// orderBy = "order by "+orderBy;
sql = backFields + sqlFrom + sqlWhere + groupBy;
if (pageIndex > 0 && pageSize > 0) {
if (rs.getDBType().equals("oracle")) {
sql = " select * from (select " + sql+") t "+orderBy;
sql = "select * from ( select row_.*, rownum rownum_ from ( " + sql + " ) row_ where rownum <= "
+ (pageIndex * pageSize) + ") where rownum_ > " + ((pageIndex - 1) * pageSize);
+ (pageIndex * pageSize) + ") where rownum_ > " + ((pageIndex - 1) * pageSize);
} else if (rs.getDBType().equals("mysql")) {
sql = " select * from (select " + sql+") t "+orderBy;
sql = "select t1.* from (" + sql + ") t1 limit " + ((pageIndex - 1) * pageSize) + "," + pageSize;
@ -309,7 +301,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
topSize = count - (pageSize * (pageIndex - 1));
}
sql = " select top " + topSize + " * from ( select top " + topSize + " * from ( select top "
+ (pageIndex * pageSize) + sql + orderBy+ " ) tbltemp1 " + descOrderBy + ") tbltemp2 " + orderBy;
+ (pageIndex * pageSize) + sql + orderBy+ " ) tbltemp1 " + descOrderBy + ") tbltemp2 " + orderBy;
} else {
sql = " select top " + pageSize + sql+orderBy;
}
@ -318,7 +310,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
sql = " select " + sql;
}
writeLog("howeccccccccccccggggggg10"+ System.currentTimeMillis());
// #1475814-概述:满足考勤报分部部门显示及导出时显示全路径
String fullPathMainKey = "show_full_path";
KQSettingsComInfo kqSettingsComInfo = new KQSettingsComInfo();
@ -335,6 +327,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
rs.execute(sql);
writeLog("howeccccccccccccggggggg11"+ System.currentTimeMillis());
while (rs.next()) {
data = new HashMap<>();
kqReportFieldComInfo.setTofirstRow();
@ -388,8 +381,9 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
data.put(serialIds.get(i), kqReportBiz.getSerialCount(id,fromDate,toDate,serialIds.get(i)));
}
}else if(kqReportFieldComInfo.getParentid().equals("overtime")||kqReportFieldComInfo.getParentid().equals("overtime_nonleave")
||kqReportFieldComInfo.getParentid().equals("overtime_4leave")||fieldName.equals("businessLeave") || fieldName.equals("officialBusiness")){
||kqReportFieldComInfo.getParentid().equals("overtime_4leave")||fieldName.equals("businessLeave") || fieldName.equals("officialBusiness")){
if(fieldName.equals("overtimeTotal")){
writeLog("howeccccccccccccggggggg12"+ System.currentTimeMillis());
double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|workingDayOvertime_4leave")));
workingDayOvertime_4leave = workingDayOvertime_4leave<0?0:workingDayOvertime_4leave;
double restDayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|restDayOvertime_4leave")));
@ -397,37 +391,37 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
double holidayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|holidayOvertime_4leave")));
holidayOvertime_4leave = holidayOvertime_4leave<0?0:holidayOvertime_4leave;
double workingDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|workingDayOvertime_nonleave")));
workingDayOvertime_nonleave = workingDayOvertime_nonleave<0?0:workingDayOvertime_nonleave;
double restDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|restDayOvertime_nonleave")));
restDayOvertime_nonleave = restDayOvertime_nonleave<0?0:restDayOvertime_nonleave;
double holidayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|holidayOvertime_nonleave")));
holidayOvertime_nonleave = holidayOvertime_nonleave<0?0:holidayOvertime_nonleave;
double workingDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|workingDayOvertime_nonleave")));
workingDayOvertime_nonleave = workingDayOvertime_nonleave<0?0:workingDayOvertime_nonleave;
double restDayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|restDayOvertime_nonleave")));
restDayOvertime_nonleave = restDayOvertime_nonleave<0?0:restDayOvertime_nonleave;
double holidayOvertime_nonleave = Util.getDoubleValue(Util.null2String(flowData.get(id+"|holidayOvertime_nonleave")));
holidayOvertime_nonleave = holidayOvertime_nonleave<0?0:holidayOvertime_nonleave;
fieldValue = KQDurationCalculatorUtil.getDurationRound(String.valueOf(workingDayOvertime_4leave+restDayOvertime_4leave+holidayOvertime_4leave+
workingDayOvertime_nonleave+restDayOvertime_nonleave+holidayOvertime_nonleave));
}else if(fieldName.equals("businessLeave") || fieldName.equals("officialBusiness")){
String businessLeaveData = Util.null2s(Util.null2String(flowData.get(id+"|"+fieldName)),"0.0");
String backType = fieldName+"_back";
String businessLeavebackData = Util.null2s(Util.null2String(flowData.get(id+"|"+backType)),"0.0");
String businessLeave = "";
try{
//以防止出现精度问题
if(businessLeaveData.length() == 0){
businessLeaveData = "0.0";
}
if(businessLeavebackData.length() == 0){
businessLeavebackData = "0.0";
}
BigDecimal b_businessLeaveData = new BigDecimal(businessLeaveData);
BigDecimal b_businessLeavebackData = new BigDecimal(businessLeavebackData);
businessLeave = b_businessLeaveData.subtract(b_businessLeavebackData).toString();
if(Util.getDoubleValue(businessLeave, -1) < 0){
businessLeave = "0.0";
String businessLeaveData = Util.null2s(Util.null2String(flowData.get(id+"|"+fieldName)),"0.0");
String backType = fieldName+"_back";
String businessLeavebackData = Util.null2s(Util.null2String(flowData.get(id+"|"+backType)),"0.0");
String businessLeave = "";
try{
//以防止出现精度问题
if(businessLeaveData.length() == 0){
businessLeaveData = "0.0";
}
if(businessLeavebackData.length() == 0){
businessLeavebackData = "0.0";
}
BigDecimal b_businessLeaveData = new BigDecimal(businessLeaveData);
BigDecimal b_businessLeavebackData = new BigDecimal(businessLeavebackData);
businessLeave = b_businessLeaveData.subtract(b_businessLeavebackData).toString();
if(Util.getDoubleValue(businessLeave, -1) < 0){
businessLeave = "0.0";
}
}catch (Exception e){
}
}catch (Exception e){
}
fieldValue = KQDurationCalculatorUtil.getDurationRound(businessLeave);
fieldValue = KQDurationCalculatorUtil.getDurationRound(businessLeave);
}else{
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id+"|"+fieldName)));
}
@ -445,7 +439,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
}
data.put(fieldName,fieldValue);
}
writeLog("howeccccccccccccggggggg13"+ System.currentTimeMillis());
//请假
List<Map<String, Object>> allLeaveRules = kqLeaveRulesBiz.getAllLeaveRules();
Map<String, Object> leaveRule = null;
@ -456,31 +450,31 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
String flowLeaveBackType = Util.null2String("leavebackType_"+leaveRule.get("id"));
String leavebackData = Util.null2s(Util.null2String(flowData.get(id+"|"+flowLeaveBackType)),"0.0");
String b_flowLeaveData = "";
String flowLeaveData = "";
String flowLeaveData = "";
try{
//以防止出现精度问题
if(leaveData.length() == 0){
leaveData = "0.0";
}
if(leavebackData.length() == 0){
leavebackData = "0.0";
}
BigDecimal b_leaveData = new BigDecimal(leaveData);
BigDecimal b_leavebackData = new BigDecimal(leavebackData);
b_flowLeaveData = b_leaveData.subtract(b_leavebackData).toString();
if(Util.getDoubleValue(b_flowLeaveData, -1) < 0){
b_flowLeaveData = "0.0";
}
}catch (Exception e){
writeLog("GetKQReportCmd:leaveData"+leaveData+":leavebackData:"+leavebackData+":"+e);
}
//考虑下冻结的数据
if(b_flowLeaveData.length() > 0){
flowLeaveData = KQDurationCalculatorUtil.getDurationRound(b_flowLeaveData);
}else{
flowLeaveData = KQDurationCalculatorUtil.getDurationRound(Util.null2String(Util.getDoubleValue(leaveData,0.0)-Util.getDoubleValue(leavebackData,0.0)));
}
//以防止出现精度问题
if(leaveData.length() == 0){
leaveData = "0.0";
}
if(leavebackData.length() == 0){
leavebackData = "0.0";
}
BigDecimal b_leaveData = new BigDecimal(leaveData);
BigDecimal b_leavebackData = new BigDecimal(leavebackData);
b_flowLeaveData = b_leaveData.subtract(b_leavebackData).toString();
if(Util.getDoubleValue(b_flowLeaveData, -1) < 0){
b_flowLeaveData = "0.0";
}
}catch (Exception e){
writeLog("GetKQReportCmd:leaveData"+leaveData+":leavebackData:"+leavebackData+":"+e);
}
writeLog("howeccccccccccccggggggg14"+ System.currentTimeMillis());
//考虑下冻结的数据
if(b_flowLeaveData.length() > 0){
flowLeaveData = KQDurationCalculatorUtil.getDurationRound(b_flowLeaveData);
}else{
flowLeaveData = KQDurationCalculatorUtil.getDurationRound(Util.null2String(Util.getDoubleValue(leaveData,0.0)-Util.getDoubleValue(leavebackData,0.0)));
}
data.put(flowType,flowLeaveData);
}
@ -519,13 +513,13 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
s1 = s1+"'"+strdate+"',";
}
s1 = s1.substring(0,s1.length()-1);
String sql88 = "select b.resourceid,b.signintime,b.signouttime,b.serialid from kq_format_detail b where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
//刘浩 大夜班天数
String sql88 = "select b.resourceid,b.signintime,b.signouttime,b.serialid from kq_format_detail b inner join kq_ShiftManagement c on c.id = b.serialid where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
" and b.signintime !='' and b.signouttime !='' " +
" and b.kqdate in("+s1+") and b.serialid in (3,5,6)";
String sql99 = "select count(b.resourceid) as sums from kq_format_detail b where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
" and b.kqdate in("+s1+") and c.serial like '%值夜班%'";
String sql99 = "select count(b.resourceid) as sums from kq_format_detail b inner join kq_ShiftManagement c on c.id = b.serialid where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
" and b.signintime !='' and b.signouttime !='' " +
" and b.kqdate in("+s1+") and b.serialid in (3,5,6)";
" and b.kqdate in("+s1+") and c.serial like '%值夜班%'";
writeLog("howec:::::sql1:"+sql88);
RecordSet rs99 = new RecordSet();
rs99.execute(sql99);
@ -533,16 +527,30 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
if (rs99.next()){
counts99 = String.valueOf(rs99.getInt("sums"));
}
data.put("nightdays",counts99);
data.put("nightdaysd",counts99);
//刘浩 小夜班天数
sql88 = "select b.resourceid,b.signintime,b.signouttime,b.serialid from kq_format_detail b inner join kq_ShiftManagement c on c.id = b.serialid where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
" and b.signintime !='' and b.signouttime !='' " +
" and b.kqdate in("+s1+") and c.serial like '%两班夜班%'";
sql99 = "select count(b.resourceid) as sums from kq_format_detail b inner join kq_ShiftManagement c on c.id = b.serialid where b.resourceid = "+resourceid+" and b.signintime is not null and b.signouttime is not null " +
" and b.signintime !='' and b.signouttime !='' " +
" and b.kqdate in("+s1+") and c.serial like '%两班夜班%'";
writeLog("howec:::::sql1-1:"+sql88);
rs99 = new RecordSet();
rs99.execute(sql99);
counts99 = "0";
if (rs99.next()){
counts99 = String.valueOf(rs99.getInt("sums"));
}
data.put("nightdaysx",counts99);
}else {
data.put("nightdays","0");
data.put("nightdaysd","0");
data.put("nightdaysx","0");
}
datas.add(data);
}
List<Object> lsHolidays = KQHolidaySetBiz.getHolidaySetListByScope(""+user.getUID(),fromDate,toDate);
retmap.put("holidays", lsHolidays);
retmap.put("columns",columns);
retmap.put("datas",datas);
retmap.put("pagesize", pageSize);
@ -576,7 +584,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
column.put("width", 65);
column.put("dataIndex", serialIds.get(i));
column.put("key", serialIds.get(i));
column.put("rowSpan", 2);
column.put("rowSpan", 2);
column.put("colSpan", 1);
sumChildColumnWidth+=65;
lsChildColumns.add(column);
@ -602,48 +610,48 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
lsChildColumns.add(column);
}
}else if(parentid.equals("overtime")){
String[] overtimeChild = {"overtime_nonleave","overtime_4leave","overtimeTotal"};
for(int i=0;i<overtimeChild.length;i++){
String id = overtimeChild[i];
column = new HashMap();
String fieldlabel = "";
column.put("unit", "");
if("overtime_nonleave".equalsIgnoreCase(id)){
fieldlabel = "125805";
}else if("overtime_4leave".equalsIgnoreCase(id)){
fieldlabel = "125804";
}else{
fieldlabel = "523";
column.put("showDetial","1");
String unitType = (KQOvertimeRulesBiz.getMinimumUnit()==3 || KQOvertimeRulesBiz.getMinimumUnit()==5 ||KQOvertimeRulesBiz.getMinimumUnit()==6)?"2":"1";
String unitTypeName = "";
if(Util.null2String(unitType).length()>0){
if(unitType.equals("1")){
unitTypeName=SystemEnv.getHtmlLabelName(1925, user.getLanguage());
}else if(unitType.equals("2")){
unitTypeName=SystemEnv.getHtmlLabelName(391, user.getLanguage());
}else if(unitType.equals("3")){
unitTypeName=SystemEnv.getHtmlLabelName(18083, user.getLanguage());
}
}
column.put("unit", unitTypeName);
}
column.put("title", SystemEnv.getHtmlLabelNames(fieldlabel, user.getLanguage()));
column.put("dataIndex", id);
column.put("key", id);
column.put("rowSpan", 1);
Map<String,Object> mapChildColumnInfo = getChildColumnsInfo(id, user);
int childWidth = 65;
List<Object> childColumns = (List<Object>)mapChildColumnInfo.get("childColumns");
if(childColumns.size()>0) {//跨列width取子列的width
column.put("children", childColumns);
childWidth = Util.getIntValue(Util.null2String(mapChildColumnInfo.get("sumChildColumnWidth")),65);
}
column.put("width", childWidth+"");
sumChildColumnWidth+=childWidth;
lsChildColumns.add(column);
}
}else{
String[] overtimeChild = {"overtime_nonleave","overtime_4leave","overtimeTotal"};
for(int i=0;i<overtimeChild.length;i++){
String id = overtimeChild[i];
column = new HashMap();
String fieldlabel = "";
column.put("unit", "");
if("overtime_nonleave".equalsIgnoreCase(id)){
fieldlabel = "125805";
}else if("overtime_4leave".equalsIgnoreCase(id)){
fieldlabel = "125804";
}else{
fieldlabel = "523";
column.put("showDetial","1");
String unitType = (KQOvertimeRulesBiz.getMinimumUnit()==3 || KQOvertimeRulesBiz.getMinimumUnit()==5 ||KQOvertimeRulesBiz.getMinimumUnit()==6)?"2":"1";
String unitTypeName = "";
if(Util.null2String(unitType).length()>0){
if(unitType.equals("1")){
unitTypeName=SystemEnv.getHtmlLabelName(1925, user.getLanguage());
}else if(unitType.equals("2")){
unitTypeName=SystemEnv.getHtmlLabelName(391, user.getLanguage());
}else if(unitType.equals("3")){
unitTypeName=SystemEnv.getHtmlLabelName(18083, user.getLanguage());
}
}
column.put("unit", unitTypeName);
}
column.put("title", SystemEnv.getHtmlLabelNames(fieldlabel, user.getLanguage()));
column.put("dataIndex", id);
column.put("key", id);
column.put("rowSpan", 1);
Map<String,Object> mapChildColumnInfo = getChildColumnsInfo(id, user);
int childWidth = 65;
List<Object> childColumns = (List<Object>)mapChildColumnInfo.get("childColumns");
if(childColumns.size()>0) {//跨列width取子列的width
column.put("children", childColumns);
childWidth = Util.getIntValue(Util.null2String(mapChildColumnInfo.get("sumChildColumnWidth")),65);
}
column.put("width", childWidth+"");
sumChildColumnWidth+=childWidth;
lsChildColumns.add(column);
}
}else{
KQReportFieldComInfo kqReportFieldComInfo = new KQReportFieldComInfo();
while (kqReportFieldComInfo.next()){
if(kqReportFieldComInfo.getParentid().equals(parentid)) {

Loading…
Cancel
Save