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

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

@ -5,7 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.engine.common.biz.AbstractCommonCommand; import com.engine.common.biz.AbstractCommonCommand;
import com.engine.common.entity.BizLogContext; import com.engine.common.entity.BizLogContext;
import com.engine.core.interceptor.CommandContext; 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.ExcelUtil;
import com.engine.kq.util.KQDurationCalculatorUtil; import com.engine.kq.util.KQDurationCalculatorUtil;
import com.engine.kq.util.UtilKQ; import com.engine.kq.util.UtilKQ;
@ -188,12 +188,19 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
} }
titleList.add(title); titleList.add(title);
} }
//刘浩 新增一列[夜班天数] //刘浩 新增一列[夜班天数]
title = new HashMap(); title = new HashMap();
title.put("title","夜班天数"); title.put("title","夜班天数");
title.put("width", 30 * 256); title.put("width", 30 * 256);
title.put("rowSpan",3); title.put("rowSpan",3);
titleList.add(title); 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); sheet.put("titleList", titleList);
String forgotBeginWorkCheck_field = " sum(b.forgotBeginWorkCheck) "; 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); 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.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 '%值夜班%'";
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 " + 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.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); writeLog("howec:::::sql2:"+sql88);
RecordSet rs99 = new RecordSet(); RecordSet rs99 = new RecordSet();
rs99.execute(sql99); rs99.execute(sql99);
@ -483,8 +491,26 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
counts99 = String.valueOf(rs99.getInt("sums")); counts99 = String.valueOf(rs99.getInt("sums"));
} }
data.add(counts99); 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 { }else {
data.add("0"); data.add("0");
data.add("0");
} }
dataList.add(data); dataList.add(data);
} }

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

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

Loading…
Cancel
Save