|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.engine.kq.cmd.report;
|
|
|
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
|
|
import com.engine.common.biz.AbstractCommonCommand;
|
|
|
|
@ -12,6 +13,7 @@ import com.engine.kq.log.KQLog;
|
|
|
|
|
import com.engine.kq.util.KQDurationCalculatorUtil;
|
|
|
|
|
import com.engine.kq.util.PageUidFactory;
|
|
|
|
|
import weaver.conn.RecordSet;
|
|
|
|
|
import weaver.general.BaseBean;
|
|
|
|
|
import weaver.general.TimeUtil;
|
|
|
|
|
import weaver.general.Util;
|
|
|
|
|
import weaver.hrm.User;
|
|
|
|
@ -26,7 +28,8 @@ import java.util.*;
|
|
|
|
|
|
|
|
|
|
public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Object>> {
|
|
|
|
|
|
|
|
|
|
private KQLog kqLog = new KQLog();
|
|
|
|
|
private KQLog kqLog = new KQLog();
|
|
|
|
|
BaseBean bb = new BaseBean();
|
|
|
|
|
|
|
|
|
|
public GetKQDailyReportCmd(Map<String, Object> params, User user) {
|
|
|
|
|
this.user = user;
|
|
|
|
@ -42,7 +45,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
String pageUid = PageUidFactory.getHrmPageUid("KQDailyReport");
|
|
|
|
|
|
|
|
|
|
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
|
|
|
|
|
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
|
|
|
|
|
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
|
|
|
|
|
ResourceComInfo resourceComInfo = new ResourceComInfo();
|
|
|
|
|
JobTitlesComInfo jobTitlesComInfo = new JobTitlesComInfo();
|
|
|
|
|
KQWorkTime kqWorkTime = new KQWorkTime();
|
|
|
|
@ -66,8 +69,8 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
toDate = TimeUtil.getDateByOption(typeselect,"1");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//人员状态
|
|
|
|
|
String status = Util.null2String(jsonObj.get("status"));
|
|
|
|
|
//人员状态
|
|
|
|
|
String status = Util.null2String(jsonObj.get("status"));
|
|
|
|
|
String subCompanyId = Util.null2String(jsonObj.get("subCompanyId"));
|
|
|
|
|
String departmentId = Util.null2String(jsonObj.get("departmentId"));
|
|
|
|
|
String resourceId = Util.null2String(jsonObj.get("resourceId"));
|
|
|
|
@ -113,8 +116,8 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
column.put("width", Util.getIntValue(kqReportFieldComInfo.getWidth()));
|
|
|
|
|
}
|
|
|
|
|
if(kqReportFieldComInfo.getReportType1().equals("daily")){
|
|
|
|
|
column.put("isdaily", "1");
|
|
|
|
|
}
|
|
|
|
|
column.put("isdaily", "1");
|
|
|
|
|
}
|
|
|
|
|
column.put("showDetial",kqReportFieldComInfo.getShowDetial());
|
|
|
|
|
columns.add(column);
|
|
|
|
|
}
|
|
|
|
@ -127,21 +130,21 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
// fromDate = today;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
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")) {
|
|
|
|
|
forgotBeginWorkCheck_field = " nvl(b.forgotBeginWorkCheck,0) ";
|
|
|
|
|
}else if((rs.getDBType()).equalsIgnoreCase("mysql")){
|
|
|
|
|
forgotBeginWorkCheck_field = " ifnull(b.forgotBeginWorkCheck,0) ";
|
|
|
|
|
}else {
|
|
|
|
|
forgotBeginWorkCheck_field = " isnull(b.forgotBeginWorkCheck,0) ";
|
|
|
|
|
}
|
|
|
|
|
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")) {
|
|
|
|
|
forgotBeginWorkCheck_field = " nvl(b.forgotBeginWorkCheck,0) ";
|
|
|
|
|
}else if((rs.getDBType()).equalsIgnoreCase("mysql")){
|
|
|
|
|
forgotBeginWorkCheck_field = " ifnull(b.forgotBeginWorkCheck,0) ";
|
|
|
|
|
}else {
|
|
|
|
|
forgotBeginWorkCheck_field = " isnull(b.forgotBeginWorkCheck,0) ";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String backFields = " a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder," +
|
|
|
|
|
" 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, "+
|
|
|
|
|
" b.graveLeaveEarly,b.graveLeaveEarlyMins,b.absenteeism ,b.absenteeismMins ,(b.forgotCheck+"+forgotBeginWorkCheck_field+") forgotCheck ";
|
|
|
|
|
" 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, "+
|
|
|
|
|
" b.graveLeaveEarly,b.graveLeaveEarlyMins,b.absenteeism ,b.absenteeismMins ,(b.forgotCheck+"+forgotBeginWorkCheck_field+") forgotCheck ";
|
|
|
|
|
String sqlFrom = " from hrmresource a, kq_format_total b where a.id= b.resourceid and b.kqdate >='"+fromDate+"' and b.kqdate <='"+toDate+"'";
|
|
|
|
|
String sqlWhere = rightSql;
|
|
|
|
|
if(subCompanyId.length()>0){
|
|
|
|
@ -166,13 +169,13 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
if (!"1".equals(isNoAccount)) {
|
|
|
|
|
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+") t";
|
|
|
|
|
rs.execute(sql);
|
|
|
|
@ -198,16 +201,14 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
if (rs.getDBType().equals("oracle")) {
|
|
|
|
|
sql = " select " + sql;
|
|
|
|
|
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 " + sql;
|
|
|
|
|
sql = "select t1.* from (" + sql + ") t1 limit " + ((pageIndex - 1) * pageSize) + "," + pageSize;
|
|
|
|
|
}
|
|
|
|
|
else if (rs.getDBType().equals("postgresql")) {
|
|
|
|
|
} else if (rs.getDBType().equals("postgresql")) {
|
|
|
|
|
sql = " select " + sql;
|
|
|
|
|
sql = "select t1.* from (" + sql + ") t1 limit " + pageSize+ " offset " + ((pageIndex - 1) * pageSize);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
} else {
|
|
|
|
|
orderBy = " order by dsporder asc, lastname asc, kqdate asc ";
|
|
|
|
|
descOrderBy = " order by dsporder desc, lastname desc, kqdate desc ";
|
|
|
|
|
if (pageIndex > 1) {
|
|
|
|
@ -216,7 +217,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
topSize = count - (pageSize * (pageIndex - 1));
|
|
|
|
|
}
|
|
|
|
|
sql = " select top " + topSize + " * from ( select top " + topSize + " * from ( select top "
|
|
|
|
|
+ (pageIndex * pageSize) + sql+" ) tbltemp1 " + descOrderBy + ") tbltemp2 " + orderBy;
|
|
|
|
|
+ (pageIndex * pageSize) + sql+" ) tbltemp1 " + descOrderBy + ") tbltemp2 " + orderBy;
|
|
|
|
|
} else {
|
|
|
|
|
sql = " select top " + pageSize + sql;
|
|
|
|
|
}
|
|
|
|
@ -224,7 +225,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
} else {
|
|
|
|
|
sql = " select " + sql;
|
|
|
|
|
}
|
|
|
|
|
Map<String,Object> flowData = kqReportBiz.getDailyFlowData(params,user);
|
|
|
|
|
Map<String,Object> flowData = kqReportBiz.getDailyFlowData(params,user);
|
|
|
|
|
Map<String,String> serialdata = new HashMap<>();
|
|
|
|
|
|
|
|
|
|
// #1475814-概述:满足考勤报分部部门显示及导出时显示全路径
|
|
|
|
@ -293,7 +294,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")) {
|
|
|
|
|
|| kqReportFieldComInfo.getParentid().equals("overtime_4leave") || fieldName.equals("businessLeave") || fieldName.equals("officialBusiness")) {
|
|
|
|
|
if (fieldName.equals("overtimeTotal")) {
|
|
|
|
|
double workingDayOvertime_4leave = Util.getDoubleValue(Util.null2String(flowData.get(id + "|" + kqdate + "|workingDayOvertime_4leave")));
|
|
|
|
|
workingDayOvertime_4leave = workingDayOvertime_4leave < 0 ? 0 : workingDayOvertime_4leave;
|
|
|
|
@ -310,7 +311,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
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));
|
|
|
|
|
workingDayOvertime_nonleave + restDayOvertime_nonleave + holidayOvertime_nonleave));
|
|
|
|
|
} else {
|
|
|
|
|
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id + "|" + kqdate + "|" + fieldName)));
|
|
|
|
|
}
|
|
|
|
@ -336,7 +337,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
data.put(fieldName, fieldValue);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
data.putAll(this.getSignDetailInfo(id, kqdate));
|
|
|
|
|
data.putAll(this.getSignDetailInfo(id, kqdate));
|
|
|
|
|
|
|
|
|
|
//请假
|
|
|
|
|
List<Map<String, Object>> allLeaveRules = KQLeaveRulesBiz.getAllLeaveRules();
|
|
|
|
@ -360,10 +361,10 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
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";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(Util.getDoubleValue(b_flowLeaveData, -1) < 0){
|
|
|
|
|
b_flowLeaveData = "0.0";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} catch (Exception e) {
|
|
|
|
|
kqLog.info("GetKQReportCmd:leaveData" + leaveData + ":leavebackData:" + leavebackData + ":" + e);
|
|
|
|
|
}
|
|
|
|
@ -419,86 +420,86 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
Map column = null;
|
|
|
|
|
int sumChildColumnWidth = 0;
|
|
|
|
|
if(parentid.equals("leave")){
|
|
|
|
|
KQLeaveRulesBiz kqLeaveRulesBiz = new KQLeaveRulesBiz();
|
|
|
|
|
List<Map<String, Object>> leaveRules = kqLeaveRulesBiz.getAllLeaveRules();
|
|
|
|
|
for(int i=0;leaveRules!=null&&i<leaveRules.size();i++){
|
|
|
|
|
Map<String, Object> leaveRule = leaveRules.get(i);
|
|
|
|
|
String id = "leaveType_"+Util.null2String(leaveRule.get("id"));
|
|
|
|
|
String name = Util.null2String(leaveRule.get("name"));
|
|
|
|
|
String unitType = Util.null2String(leaveRule.get("unitType"));
|
|
|
|
|
column = new HashMap();
|
|
|
|
|
column.put("title", name);
|
|
|
|
|
column.put("unit", KQUnitBiz.isLeaveHour(unitType) ?SystemEnv.getHtmlLabelName(391, user.getLanguage()):SystemEnv.getHtmlLabelName(1925, user.getLanguage()));
|
|
|
|
|
column.put("width", 65);
|
|
|
|
|
column.put("dataIndex", id);
|
|
|
|
|
column.put("key", id);
|
|
|
|
|
column.put("rowSpan", 2);
|
|
|
|
|
column.put("colSpan", 1);
|
|
|
|
|
column.put("showDetial","1");
|
|
|
|
|
sumChildColumnWidth+=65;
|
|
|
|
|
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{
|
|
|
|
|
KQReportFieldComInfo kqReportFieldComInfo = new KQReportFieldComInfo();
|
|
|
|
|
while (kqReportFieldComInfo.next()){
|
|
|
|
|
if(kqReportFieldComInfo.getParentid().equals(parentid)) {
|
|
|
|
|
if(!kqReportFieldComInfo.getReportType().equals("daily"))continue;
|
|
|
|
|
column = new HashMap();
|
|
|
|
|
column.put("title", SystemEnv.getHtmlLabelNames(kqReportFieldComInfo.getFieldlabel(), user.getLanguage()));
|
|
|
|
|
column.put("unit", KQReportBiz.getUnitType(kqReportFieldComInfo, user));
|
|
|
|
|
column.put("width", Util.getIntValue(kqReportFieldComInfo.getWidth()));
|
|
|
|
|
column.put("dataIndex", kqReportFieldComInfo.getFieldname());
|
|
|
|
|
column.put("key", kqReportFieldComInfo.getFieldname());
|
|
|
|
|
column.put("rowSpan", 2);
|
|
|
|
|
column.put("colSpan", 1);
|
|
|
|
|
column.put("isdaily", kqReportFieldComInfo.getReportType1().equals("daily")?"1":"0");
|
|
|
|
|
sumChildColumnWidth+=Util.getIntValue(kqReportFieldComInfo.getWidth());
|
|
|
|
|
lsChildColumns.add(column);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
KQLeaveRulesBiz kqLeaveRulesBiz = new KQLeaveRulesBiz();
|
|
|
|
|
List<Map<String, Object>> leaveRules = kqLeaveRulesBiz.getAllLeaveRules();
|
|
|
|
|
for(int i=0;leaveRules!=null&&i<leaveRules.size();i++){
|
|
|
|
|
Map<String, Object> leaveRule = leaveRules.get(i);
|
|
|
|
|
String id = "leaveType_"+Util.null2String(leaveRule.get("id"));
|
|
|
|
|
String name = Util.null2String(leaveRule.get("name"));
|
|
|
|
|
String unitType = Util.null2String(leaveRule.get("unitType"));
|
|
|
|
|
column = new HashMap();
|
|
|
|
|
column.put("title", name);
|
|
|
|
|
column.put("unit", KQUnitBiz.isLeaveHour(unitType) ?SystemEnv.getHtmlLabelName(391, user.getLanguage()):SystemEnv.getHtmlLabelName(1925, user.getLanguage()));
|
|
|
|
|
column.put("width", 65);
|
|
|
|
|
column.put("dataIndex", id);
|
|
|
|
|
column.put("key", id);
|
|
|
|
|
column.put("rowSpan", 2);
|
|
|
|
|
column.put("colSpan", 1);
|
|
|
|
|
column.put("showDetial","1");
|
|
|
|
|
sumChildColumnWidth+=65;
|
|
|
|
|
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{
|
|
|
|
|
KQReportFieldComInfo kqReportFieldComInfo = new KQReportFieldComInfo();
|
|
|
|
|
while (kqReportFieldComInfo.next()){
|
|
|
|
|
if(kqReportFieldComInfo.getParentid().equals(parentid)) {
|
|
|
|
|
if(!kqReportFieldComInfo.getReportType().equals("daily"))continue;
|
|
|
|
|
column = new HashMap();
|
|
|
|
|
column.put("title", SystemEnv.getHtmlLabelNames(kqReportFieldComInfo.getFieldlabel(), user.getLanguage()));
|
|
|
|
|
column.put("unit", KQReportBiz.getUnitType(kqReportFieldComInfo, user));
|
|
|
|
|
column.put("width", Util.getIntValue(kqReportFieldComInfo.getWidth()));
|
|
|
|
|
column.put("dataIndex", kqReportFieldComInfo.getFieldname());
|
|
|
|
|
column.put("key", kqReportFieldComInfo.getFieldname());
|
|
|
|
|
column.put("rowSpan", 2);
|
|
|
|
|
column.put("colSpan", 1);
|
|
|
|
|
column.put("isdaily", kqReportFieldComInfo.getReportType1().equals("daily")?"1":"0");
|
|
|
|
|
sumChildColumnWidth+=Util.getIntValue(kqReportFieldComInfo.getWidth());
|
|
|
|
|
lsChildColumns.add(column);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
returnMap.put("childColumns",lsChildColumns);
|
|
|
|
|
returnMap.put("sumChildColumnWidth",sumChildColumnWidth);
|
|
|
|
|
return returnMap;
|
|
|
|
@ -511,14 +512,16 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
String sql = "";
|
|
|
|
|
KQTimesArrayComInfo kqTimesArrayComInfo = new KQTimesArrayComInfo();
|
|
|
|
|
try{
|
|
|
|
|
bb.writeLog("-----getSignDetailInfo start-----");
|
|
|
|
|
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 \n" +
|
|
|
|
|
" from kq_format_detail b \n" +
|
|
|
|
|
" where resourceid = " + resourceId + " and kqdate ='" + kqDate + "' \n" +
|
|
|
|
|
" order by serialnumber \n";
|
|
|
|
|
" workenddate,workendtime,workmins,signindate,signintime,signoutdate,signouttime, \n" +
|
|
|
|
|
" attendanceMins,belatemins,graveBeLateMins,leaveearlymins,graveLeaveEarlyMins,absenteeismmins,forgotcheckMins,forgotBeginWorkCheckMins," +
|
|
|
|
|
" leaveMins,leaveInfo,evectionMins,outMins,signinid,signoutid \n" +
|
|
|
|
|
" from kq_format_detail b \n" +
|
|
|
|
|
" where resourceid = " + resourceId + " and kqdate ='" + kqDate + "' \n" +
|
|
|
|
|
" order by serialnumber \n";
|
|
|
|
|
rs.execute(sql);
|
|
|
|
|
bb.writeLog("sql: " + sql);
|
|
|
|
|
while (rs.next()) {
|
|
|
|
|
String resourceid = Util.null2String(rs.getString("resourceid"));
|
|
|
|
|
String kqdate = Util.null2String(rs.getString("kqdate"));
|
|
|
|
@ -539,8 +542,8 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
String absenteeismMins= Util.null2String(rs.getString("absenteeismMins")).trim();
|
|
|
|
|
String forgotCheckMins = Util.null2String(rs.getString("forgotcheckMins")).trim();
|
|
|
|
|
String forgotBeginWorkCheckMins = Util.null2String(rs.getString("forgotBeginWorkCheckMins")).trim();
|
|
|
|
|
String signinid = Util.null2String(rs.getString("signinid")).trim();
|
|
|
|
|
String signoutid = Util.null2String(rs.getString("signoutid")).trim();
|
|
|
|
|
String signinid = Util.null2String(rs.getString("signinid")).trim();
|
|
|
|
|
String signoutid = Util.null2String(rs.getString("signoutid")).trim();
|
|
|
|
|
int leaveMins = rs.getInt("leaveMins");
|
|
|
|
|
String leaveInfo = Util.null2String(rs.getString("leaveInfo"));
|
|
|
|
|
int evectionMins = rs.getInt("evectionMins");
|
|
|
|
@ -553,13 +556,26 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
signStatusInfo.put("workdate",workbegindate);
|
|
|
|
|
signStatusInfo.put("worktime",workbegintime);
|
|
|
|
|
signStatusInfo.put("beLateMins",beLateMins);
|
|
|
|
|
signStatusInfo.put("forgotBeginWorkCheckMins",forgotBeginWorkCheckMins);
|
|
|
|
|
signStatusInfo.put("forgotBeginWorkCheckMins",forgotBeginWorkCheckMins);
|
|
|
|
|
signStatusInfo.put("graveBeLateMins",graveBeLateMins);
|
|
|
|
|
signStatusInfo.put("absenteeismMins",absenteeismMins);
|
|
|
|
|
signStatusInfo.put("leaveMins",leaveMins);
|
|
|
|
|
signStatusInfo.put("leaveInfo",leaveInfo);
|
|
|
|
|
signStatusInfo.put("evectionMins",evectionMins);
|
|
|
|
|
signStatusInfo.put("outMins",outMins);
|
|
|
|
|
/*考勤二开--当前时间在当天班次下班点之前,不显示旷工start*/
|
|
|
|
|
String nowDay = DateUtil.format(new Date(), "yyyy-MM-dd");
|
|
|
|
|
String nowTime = DateUtil.format(new Date(), "HH:mm");
|
|
|
|
|
bb.writeLog("nowDay: " + nowDay);
|
|
|
|
|
bb.writeLog("nowTime: " + nowTime);
|
|
|
|
|
bb.writeLog("workenddate: " + workenddate);
|
|
|
|
|
bb.writeLog("workendtime: " + kqTimesArrayComInfo.turn48to24Time(workendtime));
|
|
|
|
|
|
|
|
|
|
if (workenddate.equals(nowDay) && nowTime.compareTo(kqTimesArrayComInfo.turn48to24Time(workendtime)) < 0) {
|
|
|
|
|
signStatusInfo.put("isneedcal","1");
|
|
|
|
|
}
|
|
|
|
|
bb.writeLog("signStatusInfo: " + signStatusInfo);
|
|
|
|
|
/*考勤二开--当前时间在当天班次下班点之前,不显示旷工end*/
|
|
|
|
|
|
|
|
|
|
data.put("signintime"+serialnumber, signintime.length()==0?SystemEnv.getHtmlLabelName(25994, user.getLanguage()):signintime);
|
|
|
|
|
data.put("signinstatus"+serialnumber, KQReportBiz.getSignStatus(signStatusInfo,user,"on"));
|
|
|
|
@ -578,30 +594,43 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
|
|
|
|
|
signStatusInfo.put("leaveInfo",leaveInfo);
|
|
|
|
|
signStatusInfo.put("evectionMins",evectionMins);
|
|
|
|
|
signStatusInfo.put("outMins",outMins);
|
|
|
|
|
/*考勤二开--当前时间在当天班次下班点之前,不显示旷工start*/
|
|
|
|
|
String nowDay = DateUtil.format(new Date(), "yyyy-MM-dd");
|
|
|
|
|
String nowTime = DateUtil.format(new Date(), "HH:mm");
|
|
|
|
|
bb.writeLog("nowDay: " + nowDay);
|
|
|
|
|
bb.writeLog("nowTime: " + nowTime);
|
|
|
|
|
bb.writeLog("workenddate: " + workenddate);
|
|
|
|
|
bb.writeLog("workendtime: " + kqTimesArrayComInfo.turn48to24Time(workendtime));
|
|
|
|
|
|
|
|
|
|
if (workenddate.equals(nowDay) && nowTime.compareTo(kqTimesArrayComInfo.turn48to24Time(workendtime)) < 0) {
|
|
|
|
|
signStatusInfo.put("isneedcal","1");
|
|
|
|
|
}
|
|
|
|
|
bb.writeLog("signStatusInfo: " + signStatusInfo);
|
|
|
|
|
/*考勤二开--当前时间在当天班次下班点之前,不显示旷工end*/
|
|
|
|
|
|
|
|
|
|
data.put("signouttime"+serialnumber, signouttime.length()==0?SystemEnv.getHtmlLabelName(25994, user.getLanguage()):signouttime);
|
|
|
|
|
data.put("signoutstatus"+serialnumber, KQReportBiz.getSignStatus(signStatusInfo,user,"off"));
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if(workMins>0){
|
|
|
|
|
//弹性工时打卡时间取自签到签退数据
|
|
|
|
|
//弹性工时打卡时间取自签到签退数据
|
|
|
|
|
}
|
|
|
|
|
signStatusInfo = new HashMap();
|
|
|
|
|
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"));
|
|
|
|
|
if(signoutid.length() > 0){
|
|
|
|
|
data.put("signouttime"+serialnumber, signouttime.length()==0?SystemEnv.getHtmlLabelName(25994, user.getLanguage()):signouttime);
|
|
|
|
|
data.put("signoutstatus"+serialnumber, KQReportBiz.getSignStatus(signStatusInfo,user,"off"));
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
data.put("signinstatus"+serialnumber, KQReportBiz.getSignStatus(signStatusInfo,user,"on"));
|
|
|
|
|
}
|
|
|
|
|
signStatusInfo = new HashMap();
|
|
|
|
|
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"));
|
|
|
|
|
if(signoutid.length() > 0){
|
|
|
|
|
data.put("signouttime"+serialnumber, signouttime.length()==0?SystemEnv.getHtmlLabelName(25994, user.getLanguage()):signouttime);
|
|
|
|
|
data.put("signoutstatus"+serialnumber, KQReportBiz.getSignStatus(signStatusInfo,user,"off"));
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
data.put("signinstatus"+serialnumber, KQReportBiz.getSignStatus(signStatusInfo,user,"on"));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}catch (Exception e){
|
|
|
|
|