diff --git a/src/com/engine/kq/biz/KQReportBiz.java b/src/com/engine/kq/biz/KQReportBiz.java index ca0ddc9..d1672a2 100644 --- a/src/com/engine/kq/biz/KQReportBiz.java +++ b/src/com/engine/kq/biz/KQReportBiz.java @@ -1,11 +1,8 @@ package com.engine.kq.biz; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; -import com.engine.kq.biz.chain.shiftinfo.ShiftInfoBean; import com.engine.kq.cmd.attendanceButton.ButtonStatusEnum; -import com.engine.kq.enums.FlowReportTypeEnum; import com.engine.kq.enums.KqSplitFlowTypeEnum; import com.engine.kq.log.KQLog; import com.engine.kq.util.KQDurationCalculatorUtil; @@ -85,12 +82,12 @@ public class KQReportBiz extends BaseBean { try { Map kqdate = null; List datas = null; - Map data = null; + Map data = null; sql = " select kqdate,serialid, workbegindate, workbegintime,workenddate, workendtime," + - " signintime,signouttime,beLateMins,graveBeLateMins,leaveEarlyMins,graveLeaveEarlyMins," + - " absenteeismMins, forgotCheckMins,forgotBeginWorkCheckMins,otherinfo "+ - " from kq_format_detail " + - " where resourceid=? and kqdate>=? and kqdate<=? "; + " signintime,signouttime,beLateMins,graveBeLateMins,leaveEarlyMins,graveLeaveEarlyMins," + + " absenteeismMins, forgotCheckMins,forgotBeginWorkCheckMins,otherinfo "+ + " from kq_format_detail " + + " where resourceid=? and kqdate>=? and kqdate<=? "; if(!isAll){ if(rs.getDBType().equalsIgnoreCase("oracle") || Util.null2String(rs.getOrgindbtype()).equals("dm") || Util.null2String(rs.getOrgindbtype()).equals("st")) { sql += " and beLateMins+graveBeLateMins+leaveEarlyMins+graveLeaveEarlyMins+absenteeismMins+forgotCheckMins+nvl(forgotBeginWorkCheckMins,0)>0 "; @@ -150,7 +147,7 @@ public class KQReportBiz extends BaseBean { kqdate = new HashMap<>(); datas = new ArrayList<>(); - kqdate.put("kqdate",Util.null2String(rs.getString("kqdate"))); + kqdate.put("kqdate", Util.null2String(rs.getString("kqdate"))); if(workbegindate.length()>0){ data = new HashMap<>(); data.put("workbegindate",workbegindate); @@ -294,23 +291,23 @@ public class KQReportBiz extends BaseBean { }else if(fieldName.equals("officialBusiness")){ unitType = KQExitRulesBiz.getMinimumUnit().equals("3")?"2":"1";//单位类型 }else if(parentid.equals("overtime") || parentid.equals("overtime_nonleave") || parentid.equals("overtime_4leave")){ - unitType = (KQOvertimeRulesBiz.getMinimumUnit()==3 || KQOvertimeRulesBiz.getMinimumUnit()==5 ||KQOvertimeRulesBiz.getMinimumUnit()==6)?"2":"1";//单位类型 + unitType = (KQOvertimeRulesBiz.getMinimumUnit()==3 || KQOvertimeRulesBiz.getMinimumUnit()==5 || KQOvertimeRulesBiz.getMinimumUnit()==6)?"2":"1";//单位类型 } } if(Util.null2String(unitType).length()>0){ if(unitType.equals("1")){ - unitTypeName=SystemEnv.getHtmlLabelName(1925, user.getLanguage()); + unitTypeName= SystemEnv.getHtmlLabelName(1925, user.getLanguage()); }else if(unitType.equals("2")){ - unitTypeName=SystemEnv.getHtmlLabelName(391, user.getLanguage()); + unitTypeName= SystemEnv.getHtmlLabelName(391, user.getLanguage()); }else if(unitType.equals("3")){ - unitTypeName=SystemEnv.getHtmlLabelName(18083, user.getLanguage()); + unitTypeName= SystemEnv.getHtmlLabelName(18083, user.getLanguage()); } } return unitTypeName; } - public Map getFlowData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getFlowData(Map params, User user){ + Map datas = new HashMap<>();; try{ datas.putAll(getFlowLeaveData(params,user)); datas.putAll(getFlowEvectionOutData(params,user)); @@ -423,8 +420,8 @@ public class KQReportBiz extends BaseBean { * @param user * @return */ - public Map getSaturdayFlowLeaveData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getSaturdayFlowLeaveData(Map params, User user){ + Map datas = new HashMap<>();; try{ RecordSet rs = new RecordSet(); String sql = ""; @@ -434,7 +431,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -615,8 +612,8 @@ public class KQReportBiz extends BaseBean { * @param user * @return */ - public Map getDailySaturdayFlowLeaveData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getDailySaturdayFlowLeaveData(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -625,7 +622,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -709,8 +706,8 @@ public class KQReportBiz extends BaseBean { * @param user * @return */ - public Map getDailyFlowData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getDailyFlowData(Map params, User user){ + Map datas = new HashMap<>();; try{ datas.putAll(getDailyFlowLeaveData(params,user)); datas.putAll(getDailyFlowEvectionOutData(params,user)); @@ -728,8 +725,8 @@ public class KQReportBiz extends BaseBean { * @param user * @return */ - public Map getFlowEvectionOutData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getFlowEvectionOutData(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -743,7 +740,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -836,8 +833,8 @@ public class KQReportBiz extends BaseBean { * @param user * @return */ - public Map getDailyFlowEvectionOutData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getDailyFlowEvectionOutData(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -851,7 +848,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -944,8 +941,8 @@ public class KQReportBiz extends BaseBean { * @param user * @return */ - public Map getFlowLeaveData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getFlowLeaveData(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -954,7 +951,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -994,7 +991,7 @@ public class KQReportBiz extends BaseBean { sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' "); } - sql = " select resourceid, newleavetype, durationrule, sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.LEAVE.getTablename()+" b "+ + sql = " select resourceid, newleavetype, durationrule, sum(duration) as val from hrmresource a, "+ KqSplitFlowTypeEnum.LEAVE.getTablename()+" b "+ " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere + " group by resourceid, newleavetype, durationrule "; rs.execute(sql); @@ -1035,8 +1032,8 @@ public class KQReportBiz extends BaseBean { * @param user * @return */ - public Map getFlowLeaveBackData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getFlowLeaveBackData(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -1045,7 +1042,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -1085,7 +1082,7 @@ public class KQReportBiz extends BaseBean { sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' "); } - sql = " select resourceid, newleavetype, durationrule, sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.LEAVEBACK.getTablename()+" b "+ + sql = " select resourceid, newleavetype, durationrule, sum(duration) as val from hrmresource a, "+ KqSplitFlowTypeEnum.LEAVEBACK.getTablename()+" b "+ " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere + " group by resourceid, newleavetype, durationrule "; rs.execute(sql); @@ -1126,8 +1123,8 @@ public class KQReportBiz extends BaseBean { * @param user * @return */ - public Map getFlowProcessChangeData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getFlowProcessChangeData(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -1138,7 +1135,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -1178,9 +1175,9 @@ public class KQReportBiz extends BaseBean { sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' "); } - sql = " select resourceid, durationrule, changetype,sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.PROCESSCHANGE.getTablename()+" b "+ - " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+ - " group by resourceid, durationrule,changetype "; + sql = " select resourceid, durationrule, changetype,sum(duration) as val from hrmresource a, "+ KqSplitFlowTypeEnum.PROCESSCHANGE.getTablename()+" b "+ + " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+ + " group by resourceid, durationrule,changetype "; rs.execute(sql); while (rs.next()) { String resourceid = rs.getString("resourceid"); @@ -1229,8 +1226,8 @@ public class KQReportBiz extends BaseBean { * @param user * @return */ - public Map getDailyFlowLeaveData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getDailyFlowLeaveData(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -1239,7 +1236,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -1279,9 +1276,9 @@ public class KQReportBiz extends BaseBean { sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' "); } - sql = " select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+KqSplitFlowTypeEnum.LEAVE.getTablename()+" b "+ - " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere + - " group by resourceid, newleavetype, durationrule,belongdate "; + sql = " select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+ KqSplitFlowTypeEnum.LEAVE.getTablename()+" b "+ + " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere + + " group by resourceid, newleavetype, durationrule,belongdate "; rs.execute(sql); while (rs.next()) { String resourceid = rs.getString("resourceid"); @@ -1321,8 +1318,8 @@ public class KQReportBiz extends BaseBean { * @param user * @return */ - public Map getDailyFlowLeaveBackData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getDailyFlowLeaveBackData(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -1331,7 +1328,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -1371,9 +1368,9 @@ public class KQReportBiz extends BaseBean { sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' "); } - sql = " select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+KqSplitFlowTypeEnum.LEAVEBACK.getTablename()+" b "+ - " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere + - " group by resourceid, newleavetype, durationrule,belongdate "; + sql = " select resourceid, newleavetype, durationrule, sum(duration) as val,belongdate from hrmresource a, "+ KqSplitFlowTypeEnum.LEAVEBACK.getTablename()+" b "+ + " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere + + " group by resourceid, newleavetype, durationrule,belongdate "; rs.execute(sql); while (rs.next()) { String resourceid = rs.getString("resourceid"); @@ -1411,8 +1408,8 @@ public class KQReportBiz extends BaseBean { * 获取实际加班数据,包括流程,打卡生成的 * @return */ - public Map getFlowOverTimeDataNew(Map params, User user){ - Map datas = new HashMap<>();; + public Map getFlowOverTimeDataNew(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -1421,7 +1418,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -1467,9 +1464,9 @@ public class KQReportBiz extends BaseBean { String valueField = ""; sql = " select resourceid,changeType, sum(cast(duration_min as decimal(18,4))) as val,paidLeaveEnable "+ - " from hrmresource a, kq_flow_overtime b "+ - " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere+ - " group by resourceid,changeType,paidLeaveEnable "; + " from hrmresource a, kq_flow_overtime b "+ + " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere+ + " group by resourceid,changeType,paidLeaveEnable "; rs.execute(sql); kqLog.info("getFlowOverTimeDataNew:sql:"+sql); while (rs.next()) { @@ -1519,8 +1516,8 @@ public class KQReportBiz extends BaseBean { * 获取加班数据 * @return */ - public Map getFlowOverTimeData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getFlowOverTimeData(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -1529,7 +1526,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -1580,7 +1577,7 @@ public class KQReportBiz extends BaseBean { } sql = " select resourceid,changeType, " +valueField+ - " from hrmresource a, "+KqSplitFlowTypeEnum.OVERTIME.getTablename()+" b "+ + " from hrmresource a, "+ KqSplitFlowTypeEnum.OVERTIME.getTablename()+" b "+ " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere+ " group by resourceid,changeType,durationrule "; rs.execute(sql); @@ -1617,8 +1614,8 @@ public class KQReportBiz extends BaseBean { * 获取每日加班数据 * @return */ - public Map getDailyFlowOverTimeData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getDailyFlowOverTimeData(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -1627,7 +1624,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -1678,9 +1675,9 @@ public class KQReportBiz extends BaseBean { } sql = " select resourceid,changeType,belongdate,paidLeaveEnable, sum(cast(duration_min as decimal(18,4))) as val "+ - " from hrmresource a, kq_flow_overtime b "+ - " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere+ - " group by resourceid,changeType,paidLeaveEnable,belongdate "; + " from hrmresource a, kq_flow_overtime b "+ + " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' " +sqlWhere+ + " group by resourceid,changeType,paidLeaveEnable,belongdate "; rs.execute(sql); while (rs.next()) { String resourceid = rs.getString("resourceid"); @@ -1722,8 +1719,8 @@ public class KQReportBiz extends BaseBean { * 异常冲抵 * @return */ - public Map getFlowOtherData(Map params, User user){ - Map datas = new HashMap<>();; + public Map getFlowOtherData(Map params, User user){ + Map datas = new HashMap<>();; RecordSet rs = new RecordSet(); String sql = ""; String sqlWhere = " "; @@ -1734,7 +1731,7 @@ public class KQReportBiz extends BaseBean { JSONObject jsonObj = JSON.parseObject(Util.null2String(params.get("data"))); String fromDate = Util.null2String(jsonObj.get("fromDate")); String toDate = Util.null2String(jsonObj.get("toDate")); - String typeselect =Util.null2String(jsonObj.get("typeselect")); + String typeselect = Util.null2String(jsonObj.get("typeselect")); if(typeselect.length()==0)typeselect = "3"; if(!typeselect.equals("") && !typeselect.equals("0")&& !typeselect.equals("6")){ if(typeselect.equals("1")){ @@ -1774,7 +1771,7 @@ public class KQReportBiz extends BaseBean { sqlWhere += " and a.loginid is not null "+(rs.getDBType().equals("oracle")?"":" and a.loginid<>'' "); } - sql = " select resourceid, durationrule, sum(duration) as val from hrmresource a, "+KqSplitFlowTypeEnum.OTHER.getTablename()+" b "+ + sql = " select resourceid, durationrule, sum(duration) as val from hrmresource a, "+ KqSplitFlowTypeEnum.OTHER.getTablename()+" b "+ " where a.id = b.resourceid and belongdate >='"+fromDate+"' and belongdate <='"+toDate+"' "+sqlWhere+ " group by resourceid, durationrule "; rs.execute(sql); @@ -1814,21 +1811,21 @@ public class KQReportBiz extends BaseBean { * @param toDate * @return */ - public Map getDetialDatas(String resourceId,String fromDate, String toDate, User user){ + public Map getDetialDatas(String resourceId, String fromDate, String toDate, User user){ KQLeaveRulesComInfo kqLeaveRulesComInfo = new KQLeaveRulesComInfo(); - Map datas = new HashMap<>(); - Map data = null; - Map tmpdatas = new HashMap<>(); - Map tmpdata = null; - Map tmpmap = null; + Map datas = new HashMap<>(); + Map data = null; + Map tmpdatas = new HashMap<>(); + Map tmpdata = null; + Map tmpmap = null; RecordSet rs = new RecordSet(); String sql = ""; try { sql = " select resourceid, kqdate, workMins, belatemins, graveBeLateMins, leaveearlymins, graveLeaveEarlyMins, absenteeismmins, forgotcheckMins, forgotBeginWorkCheckMins, "+ - " leaveMins,leaveInfo,evectionMins,outMins " + - " from kq_format_detail " + - " where resourceid = ? and kqdate>=? and kqdate<=? "+ - " order by resourceid, kqdate, serialnumber "; + " leaveMins,leaveInfo,evectionMins,outMins " + + " from kq_format_detail " + + " where resourceid = ? and kqdate>=? and kqdate<=? "+ + " order by resourceid, kqdate, serialnumber "; rs.executeQuery(sql,resourceId, fromDate,toDate); while (rs.next()) { String key = rs.getString("resourceid") + "|" + rs.getString("kqdate"); @@ -1850,12 +1847,12 @@ public class KQReportBiz extends BaseBean { if(datas.get(key)==null){ data = new HashMap<>(); }else{ - data = (Map)datas.get(key); + data = (Map)datas.get(key); tmptext = Util.null2String(data.get("text")); } tmpdata = new HashMap<>(); if(tmpdatas.get(key)!=null){ - tmpmap = (Map)tmpdatas.get(key); + tmpmap = (Map)tmpdatas.get(key); flag = Util.null2String(tmpmap.get("text")); } @@ -1893,38 +1890,38 @@ public class KQReportBiz extends BaseBean { } } } - if (leaveMins > 0) {//请假 - Map jsonObject = null; - if(leaveInfo.length()>0){ - jsonObject = JSON.parseObject(leaveInfo); - for (Entry entry : jsonObject.entrySet()) { - String newLeaveType = entry.getKey(); - String tmpLeaveMins = Util.null2String(entry.getValue()); - if(text.indexOf(kqLeaveRulesComInfo.getLeaveName(newLeaveType))==-1){ + if (leaveMins > 0) {//请假 + Map jsonObject = null; + if(leaveInfo.length()>0){ + jsonObject = JSON.parseObject(leaveInfo); + for (Entry entry : jsonObject.entrySet()) { + String newLeaveType = entry.getKey(); + String tmpLeaveMins = Util.null2String(entry.getValue()); + if(text.indexOf(kqLeaveRulesComInfo.getLeaveName(newLeaveType))==-1){ + if (text.length() > 0) text += " "; + //text += kqLeaveRulesComInfo.getLeaveName(newLeaveType)+tmpLeaveMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage()); + text += Util.formatMultiLang( kqLeaveRulesComInfo.getLeaveName(newLeaveType),""+user.getLanguage()); + } + } + }else{ + if(text.indexOf(SystemEnv.getHtmlLabelName(670, user.getLanguage()))==-1) { if (text.length() > 0) text += " "; - //text += kqLeaveRulesComInfo.getLeaveName(newLeaveType)+tmpLeaveMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage()); - text += Util.formatMultiLang( kqLeaveRulesComInfo.getLeaveName(newLeaveType),""+user.getLanguage()); + text += SystemEnv.getHtmlLabelName(670, user.getLanguage()); } } - }else{ - if(text.indexOf(SystemEnv.getHtmlLabelName(670, user.getLanguage()))==-1) { + } + if (evectionMins > 0) {//出差 + if(text.indexOf(SystemEnv.getHtmlLabelName(20084, user.getLanguage()))==-1) { if (text.length() > 0) text += " "; - text += SystemEnv.getHtmlLabelName(670, user.getLanguage()); + text += SystemEnv.getHtmlLabelName(20084, user.getLanguage()); } } - } - if (evectionMins > 0) {//出差 - if(text.indexOf(SystemEnv.getHtmlLabelName(20084, user.getLanguage()))==-1) { - if (text.length() > 0) text += " "; - text += SystemEnv.getHtmlLabelName(20084, user.getLanguage()); - } - } - if (outMins > 0) {//公出 - if(text.indexOf(SystemEnv.getHtmlLabelName(24058, user.getLanguage()))==-1) { - if (text.length() > 0) text += " "; - text += SystemEnv.getHtmlLabelName(24058, user.getLanguage()); + if (outMins > 0) {//公出 + if(text.indexOf(SystemEnv.getHtmlLabelName(24058, user.getLanguage()))==-1) { + if (text.length() > 0) text += " "; + text += SystemEnv.getHtmlLabelName(24058, user.getLanguage()); + } } - } if(text.length()==0) { text = "√"; @@ -1944,10 +1941,10 @@ public class KQReportBiz extends BaseBean { //全部搞一遍 if(tmpdatas != null){ // writeLog(n+">>>tmpdatas="+JSONObject.toJSONString(tmpdatas)); - Map data1 = null; - for(Entry entry : tmpdatas.entrySet()){ + Map data1 = null; + for(Entry entry : tmpdatas.entrySet()){ String mapKey = Util.null2String(entry.getKey()); - Map mapValue = (Map)entry.getValue(); + Map mapValue = (Map)entry.getValue(); String flag = Util.null2String(mapValue.get("text")); if("true".equals(flag)){//需要加工的数据 data1 = new HashMap<>(); @@ -2003,11 +2000,11 @@ public class KQReportBiz extends BaseBean { return serialCount; } - public static String getSignStatus(Map signInfo, User user){ + public static String getSignStatus(Map signInfo, User user){ return getSignStatus(signInfo,user,""); } - public static String getSignStatus(Map signInfo, User user,String onOrOff){ + public static String getSignStatus(Map signInfo, User user, String onOrOff){ KQLeaveRulesComInfo kqLeaveRulesComInfo = new KQLeaveRulesComInfo(); String text = ""; String workdate = Util.null2String(signInfo.get("workdate")); @@ -2027,32 +2024,21 @@ public class KQReportBiz extends BaseBean { int evectionMins = Util.getIntValue(Util.null2String(signInfo.get("evectionMins"))); int outMins = Util.getIntValue(Util.null2String(signInfo.get("outMins"))); - String resourceId = Util.null2String(signInfo.get("resourceId")); - String kqDate = Util.null2String(signInfo.get("kqdate")); - String flowinfo = Util.null2String(signInfo.get("flowinfo")); - KQTimesArrayComInfo kqTimesArrayComInfo = new KQTimesArrayComInfo(); - int split_time_index = 0; - ShiftInfoBean shiftInfoBean = KQDurationCalculatorUtil.getWorkTime(resourceId, kqDate, false); - List halfWorkIndex = shiftInfoBean.getHalfWorkIndex(); - if(halfWorkIndex != null && !halfWorkIndex.isEmpty()) { - int[] halfWorkIndexs = halfWorkIndex.get(0); - split_time_index = halfWorkIndexs[1];//半天的时间 - } if(worktime.length()>0){ if (absenteeismMins > 0) {//旷工 - text = SystemEnv.getHtmlLabelName(20085, user.getLanguage())+absenteeismMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage()); + text = SystemEnv.getHtmlLabelName(20085, user.getLanguage())+absenteeismMins+ SystemEnv.getHtmlLabelName(15049, user.getLanguage()); }else { if (beLateMins > 0) {//迟到 - text = SystemEnv.getHtmlLabelName(20081, user.getLanguage())+beLateMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage()); + text = SystemEnv.getHtmlLabelName(20081, user.getLanguage())+beLateMins+ SystemEnv.getHtmlLabelName(15049, user.getLanguage()); } if (graveBeLateMins > 0) {//严重迟到 - text = SystemEnv.getHtmlLabelName( 500546, user.getLanguage())+graveBeLateMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage()); + text = SystemEnv.getHtmlLabelName( 500546, user.getLanguage())+graveBeLateMins+ SystemEnv.getHtmlLabelName(15049, user.getLanguage()); } if (leaveEarlyMins > 0) {//早退 - text = SystemEnv.getHtmlLabelName(20082, user.getLanguage())+leaveEarlyMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage()); + text = SystemEnv.getHtmlLabelName(20082, user.getLanguage())+leaveEarlyMins+ SystemEnv.getHtmlLabelName(15049, user.getLanguage()); } if (graveLeaveEarlyMins > 0) {//严重早退 - text = SystemEnv.getHtmlLabelName(500547, user.getLanguage())+graveLeaveEarlyMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage()); + text = SystemEnv.getHtmlLabelName(500547, user.getLanguage())+graveLeaveEarlyMins+ SystemEnv.getHtmlLabelName(15049, user.getLanguage()); } if (forgotCheckMins > 0) {//漏签 text = SystemEnv.getHtmlLabelName(20086, user.getLanguage()); @@ -2065,73 +2051,23 @@ public class KQReportBiz extends BaseBean { } if (leaveMins > 0) {//请假 - Map jsonObject = null; -// if(leaveInfo.length()>0){ -// jsonObject = JSON.parseObject(leaveInfo); -// for (Map.Entry entry : jsonObject.entrySet()) { -// String newLeaveType = entry.getKey(); -// String tmpLeaveMins = Util.null2String(entry.getValue()); -// if(text.indexOf(kqLeaveRulesComInfo.getLeaveName(newLeaveType))==-1){ -// if (text.length() > 0) text += " "; -// //text += kqLeaveRulesComInfo.getLeaveName(newLeaveType)+tmpLeaveMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage()); -// text += Util.formatMultiLang(kqLeaveRulesComInfo.getLeaveName(newLeaveType),""+user.getLanguage()); -// } -// } -// }else{ -// if(text.indexOf(SystemEnv.getHtmlLabelName(670, user.getLanguage()))==-1) { -// if (text.length() > 0) text += " "; -// text += SystemEnv.getHtmlLabelName(670, user.getLanguage()); -// } -// } - - if(flowinfo.length() > 0) { - jsonObject = JSON.parseObject(flowinfo); - String jsonKey = ""; - String jsonValue = ""; - if (jsonObject.containsKey(FlowReportTypeEnum.LEAVE.getFlowType())) { - jsonKey = FlowReportTypeEnum.LEAVE.getFlowType(); - jsonValue = SystemEnv.getHtmlLabelName(670, user.getLanguage()); - } - if (jsonKey.length() > 0) { - JSONArray jsonArray = (JSONArray) jsonObject.get(jsonKey); - String text4temp = ""; - if (jsonArray != null && !jsonArray.isEmpty()) { - //客户不存在多个重复流程的情况,只是显示第一个就行 - for (int i = 0; i < jsonArray.size(); i++) { - JSONObject jsonObject1 = (JSONObject) jsonArray.get(i); - if (jsonObject1 != null && !jsonObject1.isEmpty()) { - String newLeaveType = Util.null2s(Util.null2String(jsonObject1.get("newLeaveType")), ""); - String begintime = Util.null2s(Util.null2String(jsonObject1.get("begintime")), ""); - String endtime = Util.null2s(Util.null2String(jsonObject1.get("endtime")), ""); - int beginIdx = kqTimesArrayComInfo.getArrayindexByTimes(begintime); - int endIdx = kqTimesArrayComInfo.getArrayindexByTimes(endtime); - if (jsonKey.equalsIgnoreCase(FlowReportTypeEnum.LEAVE.getFlowType())) { - if (newLeaveType.length() > 0) { - jsonValue = kqLeaveRulesComInfo.getLeaveName(newLeaveType); - } - } - if (beginIdx <= split_time_index && endIdx <= split_time_index) { - //上午 - if ("on".equalsIgnoreCase(onOrOff)) { - text4temp = jsonValue; - } - } else if (beginIdx >= split_time_index && endIdx >= split_time_index) { - //下午 - if ("off".equalsIgnoreCase(onOrOff)) { - text4temp = jsonValue; - } - } else { - //全天 - text4temp = jsonValue; - } - } - } - if(text4temp.length()>0){ - if (text.length() > 0) text += " "; - text += text4temp; - } + Map jsonObject = null; + if(leaveInfo.length()>0){ + jsonObject = JSON.parseObject(leaveInfo); + for (Entry entry : jsonObject.entrySet()) { + String newLeaveType = entry.getKey(); + String tmpLeaveMins = Util.null2String(entry.getValue()); + if(text.indexOf(kqLeaveRulesComInfo.getLeaveName(newLeaveType))==-1){ + if (text.length() > 0) text += " "; + //text += kqLeaveRulesComInfo.getLeaveName(newLeaveType)+tmpLeaveMins+SystemEnv.getHtmlLabelName(15049, user.getLanguage()); + text += Util.formatMultiLang(kqLeaveRulesComInfo.getLeaveName(newLeaveType),""+user.getLanguage()); } } + }else{ + if(text.indexOf(SystemEnv.getHtmlLabelName(670, user.getLanguage()))==-1) { + if (text.length() > 0) text += " "; + text += SystemEnv.getHtmlLabelName(670, user.getLanguage()); + } } } if (evectionMins > 0) {//出差 @@ -2148,14 +2084,14 @@ public class KQReportBiz extends BaseBean { } if(text.equals("")){ boolean needCal = new KQFormatBiz().needCal(workdate,worktime); - text = needCal?SystemEnv.getHtmlLabelName(225, user.getLanguage()):""; + text = needCal? SystemEnv.getHtmlLabelName(225, user.getLanguage()):""; } }else{ if (leaveMins > 0) {//请假 - Map jsonObject = null; + Map jsonObject = null; if(leaveInfo.length()>0){ jsonObject = JSON.parseObject(leaveInfo); - for (Entry entry : jsonObject.entrySet()) { + for (Entry entry : jsonObject.entrySet()) { String newLeaveType = entry.getKey(); String tmpLeaveMins = Util.null2String(entry.getValue()); if(text.indexOf(kqLeaveRulesComInfo.getLeaveName(newLeaveType))==-1){ @@ -2242,11 +2178,11 @@ public class KQReportBiz extends BaseBean { return text; } - public static boolean getShowFlowText(String leaveInfo,String onOrOff){ - Map jsonObject = null; + public static boolean getShowFlowText(String leaveInfo, String onOrOff){ + Map jsonObject = null; jsonObject = JSON.parseObject(leaveInfo); String flow_signtype = ""; - for (Entry entry : jsonObject.entrySet()) { + for (Entry entry : jsonObject.entrySet()) { String tmpSignType = Util.null2String(entry.getValue()); flow_signtype += ","+tmpSignType; } @@ -2256,7 +2192,7 @@ public class KQReportBiz extends BaseBean { return isShowFlowText(flow_signtype,onOrOff); } - public static boolean isShowFlowText(String flow_signtype,String onOrOff){ + public static boolean isShowFlowText(String flow_signtype, String onOrOff){ boolean showFlowText = true; if(flow_signtype.length() > 0){ @@ -2400,7 +2336,7 @@ public class KQReportBiz extends BaseBean { rs1.executeUpdate(delSql); } - Map result = kqFlowActiontBiz.handleKQFlowAction(proc_set_id, usedetails, Util.getIntValue(requestid), kqtype, Util.getIntValue(workflowid), isForce1,isUpgrade1,map); + Map result = kqFlowActiontBiz.handleKQFlowAction(proc_set_id, usedetails, Util.getIntValue(requestid), kqtype, Util.getIntValue(workflowid), isForce1,isUpgrade1,map); if(!result.isEmpty()){ @@ -2421,7 +2357,7 @@ public class KQReportBiz extends BaseBean { * @param bcfs * @return */ - public double getOverTimeCount(String startdate,String enddate,String userid,String jblx,String bcfs){ + public double getOverTimeCount(String startdate, String enddate, String userid, String jblx, String bcfs){ double result = 0.00; RecordSet rs = new RecordSet(); rs.executeQuery("select sum(gjsc) as count from uf_jbtz where gzrq >= ? and gzrq <= ? and jbr=? and jblx=? and bcfs=?",startdate,enddate,userid,jblx,bcfs); @@ -2440,7 +2376,7 @@ public class KQReportBiz extends BaseBean { * @param bcfs * @return */ - public double getOverTimeDailyCount(String kqdate,String userid,String jblx,String bcfs){ + public double getOverTimeDailyCount(String kqdate, String userid, String jblx, String bcfs){ double result = 0.00; RecordSet rs = new RecordSet(); rs.executeQuery("select sum(gjsc) as count from uf_jbtz where gzrq = ? and jbr=? and jblx=? and bcfs=?",kqdate,userid,jblx,bcfs); @@ -2457,30 +2393,21 @@ public class KQReportBiz extends BaseBean { * @param userid * @return */ - public double getNightSubsidyDaily(String kqdate,String userid){ + public double getNightSubsidyDaily(String kqdate, String userid){ double result = 0.00; RecordSet rs = new RecordSet(); int sixnight_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","sixnight_serialid")); int twelvehours_night_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","twelvehours_night_serialid")); - int night_rest_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","night_rest_serialid")); rs.executeQuery("select * from kq_format_total where kqdate = ? and resourceid=?",kqdate,userid); rs.writeLog("select * from kq_format_total where kqdate = '"+ kqdate +"' and resourceid="+ userid); while(rs.next()){ int serialid = Util.getIntValue(rs.getString("serialid")); double attendanceMins = Util.getDoubleValue(rs.getString("attendanceMins"),0.00); - attendanceMins = attendanceMins / 60; double overTimeTotal = getOverTimeTotal(kqdate,userid); double time = attendanceMins+overTimeTotal; - //1、 12小时工作制夜班、做六休一夜班有夜班补贴,并且出勤(上班时间+加班时间)>=8小时,统计一次 - if(serialid == sixnight_serialid || serialid == twelvehours_night_serialid){ + if(serialid == sixnight_serialid|| serialid == twelvehours_night_serialid){ if(time >= 8){ - result ++; - } - } - //2、当一线人员排“夜休”班次,并且加班台账当天导入的加班时长>=8小时,统计一次。 - if(serialid == night_rest_serialid){ - if(overTimeTotal >= 8){ - result ++; + result = 1; } } } @@ -2494,37 +2421,24 @@ public class KQReportBiz extends BaseBean { * @param userid * @return */ - public double getNightSubsidyTotal(String fromDate,String toDate,String userid){ + public double getNightSubsidyTotal(String fromDate, String toDate, String userid){ double result = 0.00; RecordSet rs = new RecordSet(); int sixnight_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","sixnight_serialid")); int twelvehours_night_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","twelvehours_night_serialid")); - int night_rest_serialid = Integer.parseInt(rs.getPropValue("nbjh_ygdjblc","night_rest_serialid")); rs.executeQuery("select * from kq_format_total where kqdate >= ? and kqdate <= ? and resourceid=?",fromDate,toDate,userid); rs.writeLog("select * from kq_format_total where kqdate >= '"+ fromDate +"' and kqdate <= '"+ toDate +"' and resourceid="+ userid); while(rs.next()){ int serialid = Util.getIntValue(rs.getString("serialid")); String kqdate = Util.null2String(rs.getString("kqdate")); double attendanceMins = Util.getDoubleValue(rs.getString("attendanceMins"),0.00); - attendanceMins = attendanceMins / 60; - rs.writeLog("========= getNightSubsidyTotal attendanceMins ========== "+ attendanceMins); double overTimeTotal = getOverTimeTotal(kqdate,userid); - rs.writeLog("========= getNightSubsidyTotal overTimeTotal ========== "+ overTimeTotal); double time = attendanceMins+overTimeTotal; - rs.writeLog("========= getNightSubsidyTotal time ========== "+ time); - if(serialid == sixnight_serialid || serialid == twelvehours_night_serialid){ + if(serialid == sixnight_serialid|| serialid == twelvehours_night_serialid){ if(time >= 8){ result++; } } - rs.writeLog("========= getNightSubsidyTotal result 111 ========== "+ result); - //2、当一线人员排“夜休”班次,并且加班台账当天导入的加班时长>=8小时,统计一次。 - if(serialid == night_rest_serialid){ - if(overTimeTotal >= 8){ - result ++; - } - } - rs.writeLog("========= getNightSubsidyTotal result 222 ========== "+ result); } return result; } @@ -2535,7 +2449,7 @@ public class KQReportBiz extends BaseBean { * @param userid * @return */ - public double getOverTimeTotal(String kqdate,String userid){ + public double getOverTimeTotal(String kqdate, String userid){ double result = 0.00; RecordSet rs = new RecordSet(); rs.executeQuery("select sum(gjsc)as gjsc from uf_jbtz where gzrq=? and jbr=?",kqdate,userid); @@ -2552,17 +2466,18 @@ public class KQReportBiz extends BaseBean { * @param userid * @return */ - public int getFillCardCount(String fromDate,String toDate,String userid){ + public int getFillCardCount(String fromDate, String toDate, String userid){ int result = 0; RecordSet rs = new RecordSet(); String tablename = rs.getPropValue("nbjh_ygdjblc","fillcard_table"); String tablename_dt = tablename+"_dt1"; - rs.executeQuery("select b.* from "+ tablename +" a,"+ tablename_dt +" b,workflow_requestbase c " + - "where a.requestid = c.requestid and a.id=b.mainid and c.currentnodetype=3 " + - "and a.detail_signdate >=? and a.detail_signdate <=? and a.resourceId=?",fromDate,toDate,userid); - while(rs.next()){ - result++; + rs.executeQuery("select b.* from "+ tablename +" a,"+ tablename_dt +" b,workflow_requestbase c" + + "where a.requestid = c.requestid and a.id=b.mainid and c.currentnodetype=3" + + "and a.ksrq >=? and a.jsrq <=? and a.resourceId=?",fromDate,toDate,userid); + if(rs.next()){ + } + result = rs.getCounts(); return result; } @@ -2572,16 +2487,16 @@ public class KQReportBiz extends BaseBean { * @param userid * @return */ - public int getFillCardCountDaily(String kqdate,String userid){ + public int getFillCardCountDaily(String kqdate, String userid){ int result = 0; RecordSet rs = new RecordSet(); String tablename = rs.getPropValue("nbjh_ygdjblc","fillcard_table"); String tablename_dt = tablename+"_dt1"; - rs.executeQuery("select b.* from "+ tablename +" a,"+ tablename_dt +" b,workflow_requestbase c " + - "where a.requestid = c.requestid and a.id=b.mainid and c.currentnodetype=3 " + + rs.executeQuery("select b.* from "+ tablename +" a,"+ tablename_dt +" b,workflow_requestbase c" + + "where a.requestid = c.requestid and a.id=b.mainid and c.currentnodetype=3" + "and b.detail_signdate =? and a.resourceId=?",kqdate,userid); - while(rs.next()){ - result ++; + if(rs.next()){ + result = 1; } return result; } diff --git a/src/com/engine/kq/cmd/report/GetKQReportCmd.java b/src/com/engine/kq/cmd/report/GetKQReportCmd.java index 28f18ca..78815a2 100644 --- a/src/com/engine/kq/cmd/report/GetKQReportCmd.java +++ b/src/com/engine/kq/cmd/report/GetKQReportCmd.java @@ -5,15 +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.KQFormatBiz; -import com.engine.kq.biz.KQHolidaySetBiz; -import com.engine.kq.biz.KQLeaveRulesBiz; -import com.engine.kq.biz.KQOvertimeRulesBiz; -import com.engine.kq.biz.KQReportBiz; -import com.engine.kq.biz.KQReportFieldComInfo; -import com.engine.kq.biz.KQSettingsComInfo; -import com.engine.kq.biz.KQShiftManagementComInfo; -import com.engine.kq.biz.KQUnitBiz; +import com.engine.kq.biz.*; import com.engine.kq.util.KQDurationCalculatorUtil; import com.engine.kq.util.PageUidFactory; import org.apache.commons.lang3.StringUtils; @@ -31,11 +23,7 @@ import weaver.hrm.resource.ResourceComInfo; import weaver.systeminfo.SystemEnv; import java.math.BigDecimal; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; public class GetKQReportCmd extends AbstractCommonCommand> { @@ -198,7 +186,7 @@ public class GetKQReportCmd extends AbstractCommonCommand> { String definedFieldSum = Util.null2String(definedFieldInfo.get("definedFieldSum")); //支援班次统计 String supportSerId = new BaseBean().getPropValue("nbkq_main", "supportSerId"); - String backFields = " (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayworkdays," + + String backFields = " (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayworkdays," + " (select count(0) from kq_shiftschedule where resourceid = a.id and kqdate >='" + fromDate + "' and kqdate <='" + toDate + "' and serialid=" + supportSerId + " )as supportTotal," + " (select sum(zma.attendancedays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and (DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) AND zma.kqdate NOT IN (select holidayDate from KQ_HolidaySet where changeType = 3 AND zma.groupid = groupId)) as saturdayattendancedays," + " (select sum(zma.workdays) from kq_format_total zma where zma.resourceid = a.id and zma.kqdate >='" + fromDate + "' and zma.kqdate <='" + toDate + "' and ((DATEPART(dw, zma.kqdate) != 7 and DATEPART(dw, zma.kqdate) != 1) or ((DATEPART(dw, zma.kqdate) = 7 or DATEPART(dw, zma.kqdate) = 1) and zma.kqdate IN (select holidayDate from KQ_HolidaySet where changeType = 3 and zma.groupid = groupId)))) as weekdayworkdays," + diff --git a/src/weaver/general/SendMail.java b/src/weaver/general/SendMail.java index 7e6603c..d106d68 100644 --- a/src/weaver/general/SendMail.java +++ b/src/weaver/general/SendMail.java @@ -28,6 +28,7 @@ import java.util.*; import java.io.*; import java.net.*; +import com.sun.net.ssl.internal.www.protocol.https.BASE64Encoder; import org.apache.oro.text.regex.*; import weaver.system.*; @@ -1478,7 +1479,7 @@ public class SendMail extends MailErrorBean { InputStream is = (InputStream) fileContentList.get(i); String filename = (String) fileNameList.get(i); String ctype = FileTypeMap.getDefaultFileTypeMap().getContentType(filename); - sun.misc.BASE64Encoder enc = new sun.misc.BASE64Encoder(); + BASE64Encoder enc = new BASE64Encoder(); filename = "=?UTF-8?B?" + enc.encode(filename.getBytes("UTF-8")) + "?="; filename = filename.replace("\n", ""); // 当文件名过长时 StringBuffer sb = new StringBuffer(filename.length()); // 需要