diff --git a/src/com/engine/kq/biz/KQReportBiz.java b/src/com/engine/kq/biz/KQReportBiz.java index d2560ee..ca7c676 100644 --- a/src/com/engine/kq/biz/KQReportBiz.java +++ b/src/com/engine/kq/biz/KQReportBiz.java @@ -380,11 +380,11 @@ public class KQReportBiz extends BaseBean { datas.putAll(getDailyFlowLeaveBackData(params,user)); /*考勤二开--出差公出流程餐补统计start*/ - long startTime = System.currentTimeMillis(); - datas.putAll(getDailyMealAllowanceData(params,user)); - long endTime = System.currentTimeMillis(); - long elapsedTime = endTime - startTime; // 执行时间 - bb.writeLog("getDailyMealAllowanceData执行时间:" + elapsedTime/1000 + "秒"); +// long startTime = System.currentTimeMillis(); +// datas.putAll(getDailyMealAllowanceData(params,user)); +// long endTime = System.currentTimeMillis(); +// long elapsedTime = endTime - startTime; // 执行时间 +// bb.writeLog("getDailyMealAllowanceData执行时间:" + elapsedTime/1000 + "秒"); /*考勤二开--出差公出流程餐补统计end*/ // /*考勤二开--计算驻点餐补start*/ @@ -392,22 +392,22 @@ public class KQReportBiz extends BaseBean { // /*考勤二开--计算驻点餐补end*/ //获取加班时长 - Map dailyFlowOverTimeData = getDailyFlowOverTimeDataAllowance(params, user); - - /*考勤二开--计算精密夜班餐补start*/ - startTime = System.currentTimeMillis(); - datas.putAll(getDailyNightShiftAllowanceDataTemp(params,user,dailyFlowOverTimeData)); - endTime = System.currentTimeMillis(); - elapsedTime = endTime - startTime; // 执行时间 - bb.writeLog("getDailyNightShiftAllowanceData执行时间:" + elapsedTime/1000 + "秒"); - /*考勤二开--计算精密夜班餐补end*/ - - /*考勤二开--计算鸿仁驻点餐补start*/ - startTime = System.currentTimeMillis(); - datas.putAll(getDailyOtherStatAllowanceDataTemp(params,user,dailyFlowOverTimeData)); - endTime = System.currentTimeMillis(); - elapsedTime = endTime - startTime; // 执行时间 - bb.writeLog("getDailyOtherStatAllowanceData执行时间:" + elapsedTime/1000 + "秒"); +// Map dailyFlowOverTimeData = getDailyFlowOverTimeDataAllowance(params, user); +// +// /*考勤二开--计算精密夜班餐补start*/ +// startTime = System.currentTimeMillis(); +// datas.putAll(getDailyNightShiftAllowanceDataTemp(params,user,dailyFlowOverTimeData)); +// endTime = System.currentTimeMillis(); +// elapsedTime = endTime - startTime; // 执行时间 +// bb.writeLog("getDailyNightShiftAllowanceData执行时间:" + elapsedTime/1000 + "秒"); +// /*考勤二开--计算精密夜班餐补end*/ +// +// /*考勤二开--计算鸿仁驻点餐补start*/ +// startTime = System.currentTimeMillis(); +// datas.putAll(getDailyOtherStatAllowanceDataTemp(params,user,dailyFlowOverTimeData)); +// endTime = System.currentTimeMillis(); +// elapsedTime = endTime - startTime; // 执行时间 +// bb.writeLog("getDailyOtherStatAllowanceData执行时间:" + elapsedTime/1000 + "秒"); /*考勤二开--计算鸿仁驻点餐补end*/ @@ -432,7 +432,7 @@ public class KQReportBiz extends BaseBean { /*考勤二开--出差公出流程餐补统计start*/ - datas.putAll(getDailyMealAllowanceData(params,user)); +// datas.putAll(getDailyMealAllowanceData(params,user)); /*考勤二开--出差公出流程餐补统计end*/ /*考勤二开--计算驻点餐补start*/ @@ -444,11 +444,11 @@ public class KQReportBiz extends BaseBean { /*考勤二开--计算驻点餐补end*/ /*考勤二开--计算精密夜班餐补start*/ - datas.putAll(getDailyNightShiftAllowanceData(params,user)); +// datas.putAll(getDailyNightShiftAllowanceData(params,user)); /*考勤二开--计算精密夜班餐补end*/ /*考勤二开--计算鸿仁驻点餐补start*/ - datas.putAll(getDailyOtherStatAllowanceData(params,user)); +// datas.putAll(getDailyOtherStatAllowanceData(params,user)); /*考勤二开--计算鸿仁驻点餐补end*/ diff --git a/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java b/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java index ef8111b..5adab4d 100644 --- a/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java +++ b/src/com/engine/kq/cmd/report/ExportDailyExcelCmd.java @@ -48,6 +48,7 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand flowData = kqReportBiz.getDailyFlowData(params,user); - - /*考勤二开--驻点餐补start*/ - HostarUtil hostarUtil = new HostarUtil(); - List subComoanyList = new ArrayList<>(); - String acqNoStatAllSql = "select subcompany from uf_NoStatAllSubCom where isdelete = 0 or isdelete is null"; - rs.executeQuery(acqNoStatAllSql); - while (rs.next()) { - String subcompany = Util.null2String(rs.getString("subcompany")); - if (StringUtils.isNotBlank(subcompany)) { - subComoanyList.add(subcompany); - } - } - bb.writeLog("subComoanyList: " + subComoanyList); - /*考勤二开--驻点餐补end*/ - /*考勤二开--夜班餐补start*/ - String nightshiftsub = Util.null2String(bb.getPropValue("project_hostar", "nightshiftsubcompany")); - List nightshifts = new ArrayList(); - String acqSerialSql = " select shift from uf_nightshiftmanage where isdelete is null or isdelete = 0"; - rs.executeQuery(acqSerialSql); - while (rs.next()) { - String serial = Util.null2String(rs.getString("shift")); - if (StringUtils.isNotBlank(serial)) { - nightshifts.add(serial); - } - } - /*考勤二开--夜班餐补end*/ - + long endTime = System.currentTimeMillis(); + long elapsedTime = endTime - startTime; // 执行时间 + bb.writeLog("getDailyMealAllowanceData执行时间:" + elapsedTime/1000 + "秒"); +// /*考勤二开--驻点餐补start*/ +// HostarUtil hostarUtil = new HostarUtil(); +// List subComoanyList = new ArrayList<>(); +// String acqNoStatAllSql = "select subcompany from uf_NoStatAllSubCom where isdelete = 0 or isdelete is null"; +// rs.executeQuery(acqNoStatAllSql); +// while (rs.next()) { +// String subcompany = Util.null2String(rs.getString("subcompany")); +// if (StringUtils.isNotBlank(subcompany)) { +// subComoanyList.add(subcompany); +// } +// } +// bb.writeLog("subComoanyList: " + subComoanyList); +// /*考勤二开--驻点餐补end*/ +// /*考勤二开--夜班餐补start*/ +// String nightshiftsub = Util.null2String(bb.getPropValue("project_hostar", "nightshiftsubcompany")); +// List nightshifts = new ArrayList(); +// String acqSerialSql = " select shift from uf_nightshiftmanage where isdelete is null or isdelete = 0"; +// rs.executeQuery(acqSerialSql); +// while (rs.next()) { +// String serial = Util.null2String(rs.getString("shift")); +// if (StringUtils.isNotBlank(serial)) { +// nightshifts.add(serial); +// } +// } +// /*考勤二开--夜班餐补end*/ + bb.writeLog("ExportDailyExcelCmd sql:" + sql); rs.execute(sql); while (rs.next()) { data = new ArrayList<>(); @@ -346,13 +355,13 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand> allLeaveRules = KQLeaveRulesBiz.getAllLeaveRules(); @@ -451,81 +460,81 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand dailyStatAllowanceData = kqReportBiz.getDailyStatAllowanceData(params, user); - long endTime = System.currentTimeMillis(); - long elapsedTime = endTime - startTime; // 执行时间 - bb.writeLog("执行时间:" + elapsedTime/1000 + "秒"); - - if (dailyStatAllowanceData == null || dailyStatAllowanceData.size() == 0) { - fieldValue = "0"; - } else { - Map tempMap = hostarUtil.parseMapForFilter(dailyStatAllowanceData, id + "|DailyStatAllowance"); - - double temp = Util.getDoubleValue(Util.null2String(tempMap.get(id + "|DailyStatAllowance" + "|" + kqdate ))); - if (temp <= 0) { - fieldValue = "0"; - } else { - fieldValue = String.valueOf(temp); - } - } - -// bb.writeLog("fieldValue: " + fieldValue); - } - data.add(fieldValue); - continue; - } else if ("nightAllowance".equals(fieldName)) {//考勤二开--夜班餐补 - String subcompanyId = Util.null2String(rs.getString("subcompanyid")); - String serialid = Util.null2String(rs.getString("serialid")); - if ( !subComoanyList.contains(subcompanyId) && nightshifts.contains(serialid)) { - int temp = Util.getIntValue(Util.null2String(flowData.get(id + "|DailyNightShiftAllowanceData" + "|" + kqdate ))); - if (temp <= 0) { - fieldValue = "0"; - } else { - fieldValue = String.valueOf(temp); - } -// bb.writeLog("fieldValue: " + fieldValue); - } - data.add( fieldValue); - continue; - } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 - params.put("subUserId", id); -// bb.writeLog("params: " + params ); - - Map temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); - if (temp == null || temp.size() == 0) { - data.add( "0"); - } else { - int intValue = Math.max(Util.getIntValue(Util.null2String(temp.get(id + "|DailyStatAllowance" + kqdate))) , 0); - data.add( intValue); - } - - } else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补 - int temp = Util.getIntValue(Util.null2String(flowData.get(id + "|DailyOtherStatAllowance" + "|" + kqdate ))); - if (temp <= 0) { - fieldValue = "0"; - } else { - fieldValue = String.valueOf(temp); - } -// bb.writeLog("fieldValue: " + fieldValue); - data.add(fieldValue); - continue; +// } else if ( "mealAllowance".equals(fieldName)) {//考勤二开--出差餐补 +// int intValue = Util.getIntValue(Util.null2String(flowData.get("DailyMealAllow|" + resourceId + "|" + kqdate))); +// if (intValue < 0) { +// intValue = 0; +// } +// data.add(intValue); +// continue; +// } else if ("statAllowance".equals(fieldName)) {//考勤二开--驻点餐补 +// +// String subcompanyId = Util.null2String(rs.getString("subcompanyid")); +// if ( !subComoanyList.contains(subcompanyId)) { +// +// params.put("statUser", id); +// params.put("kqdate", kqdate); +//// bb.writeLog("params: " + params ); +// +// long startTime = System.currentTimeMillis(); +// Map dailyStatAllowanceData = kqReportBiz.getDailyStatAllowanceData(params, user); +// long endTime = System.currentTimeMillis(); +// long elapsedTime = endTime - startTime; // 执行时间 +// bb.writeLog("执行时间:" + elapsedTime/1000 + "秒"); +// +// if (dailyStatAllowanceData == null || dailyStatAllowanceData.size() == 0) { +// fieldValue = "0"; +// } else { +// Map tempMap = hostarUtil.parseMapForFilter(dailyStatAllowanceData, id + "|DailyStatAllowance"); +// +// double temp = Util.getDoubleValue(Util.null2String(tempMap.get(id + "|DailyStatAllowance" + "|" + kqdate ))); +// if (temp <= 0) { +// fieldValue = "0"; +// } else { +// fieldValue = String.valueOf(temp); +// } +// } +// +//// bb.writeLog("fieldValue: " + fieldValue); +// } +// data.add(fieldValue); +// continue; +// } else if ("nightAllowance".equals(fieldName)) {//考勤二开--夜班餐补 +// String subcompanyId = Util.null2String(rs.getString("subcompanyid")); +// String serialid = Util.null2String(rs.getString("serialid")); +// if ( !subComoanyList.contains(subcompanyId) && nightshifts.contains(serialid)) { +// int temp = Util.getIntValue(Util.null2String(flowData.get(id + "|DailyNightShiftAllowanceData" + "|" + kqdate ))); +// if (temp <= 0) { +// fieldValue = "0"; +// } else { +// fieldValue = String.valueOf(temp); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// } +// data.add( fieldValue); +// continue; +// } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 +// params.put("subUserId", id); +//// bb.writeLog("params: " + params ); +// +// Map temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); +// if (temp == null || temp.size() == 0) { +// data.add( "0"); +// } else { +// int intValue = Math.max(Util.getIntValue(Util.null2String(temp.get(id + "|DailyStatAllowance" + kqdate))) , 0); +// data.add( intValue); +// } +// +// } else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补 +// int temp = Util.getIntValue(Util.null2String(flowData.get(id + "|DailyOtherStatAllowance" + "|" + kqdate ))); +// if (temp <= 0) { +// fieldValue = "0"; +// } else { +// fieldValue = String.valueOf(temp); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// data.add(fieldValue); +// continue; } else if(fieldName.equals("kqdate")){ fieldValue=kqdate+" "+com.engine.portal.util.DateUtil.getDayWeekOfDate1(DateUtil.parseToDate(kqdate)); } else { @@ -553,6 +562,7 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand> { Map definedFieldInfo = new KQFormatBiz().getDefinedField(); String definedFieldSum = Util.null2String(definedFieldInfo.get("definedFieldSum")); - String backFields = " a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle," + + String backFields = " (select sum(zm.cccb) from uf_cbxxjlb zm where zm.xm = a.id and zm.rq >= '" + fromDate + "' and zm.rq <= '" + toDate + "') as mealAllowance," + + " (select sum(zm.zdcb) from uf_cbxxjlb zm where zm.xm = a.id and zm.rq >= '" + fromDate + "' and zm.rq <= '" + toDate + "') as statAllowance," + + " (select sum(zm.jmybcb) from uf_cbxxjlb zm where zm.xm = a.id and zm.rq >= '" + fromDate + "' and zm.rq <= '" + toDate + "') as nightAllowance," + + " (select sum(zm.hrzdcb) from uf_cbxxjlb zm where zm.xm = a.id and zm.rq >= '" + fromDate + "' and zm.rq <= '" + toDate + "') as otherStatAllowance," + + " (select sum(zm.ybbz) from uf_cbxxjlb zm where zm.xm = a.id and zm.rq >= '" + fromDate + "' and zm.rq <= '" + toDate + "') as nightShiftSubsidy," + + " 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(FLOOR( b.attendanceMins / 30 ) * 30 ) 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," + @@ -433,99 +438,99 @@ public class ExportExcelCmd extends AbstractCommonCommand> { }catch (Exception e){ } fieldValue = KQDurationCalculatorUtil.getDurationRound(businessLeave); - } else if ("mealAllowance".equals(fieldName)) {//考勤二开--出差餐补 -// bb.writeLog("mealAllowance"); - Map tempMap = hostarUtil.parseMapForFilter(flowData, "DailyMealAllow|" + resourceId); -// bb.writeLog("tempMap: " + tempMap); - - if ( !tempMap.isEmpty()) { - int tempValue = 0; - for (String key: tempMap.keySet()) { - int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); - tempValue = tempValue + (Math.max(intValue, 0)); - } - fieldValue = String.valueOf(tempValue); - } -// bb.writeLog("fieldValue: " + fieldValue); - data.add(fieldValue); - continue; - } else if ("statAllowance".equals(fieldName)) {//考勤二开--驻点餐补 -// bb.writeLog("statAllowance"); -// bb.writeLog("flowData: " + flowData); - params.put("statUser", id); - bb.writeLog("params: " + params ); - - Map temp = kqReportBiz.getStatAllowanceData(params, user); - if (temp == null || temp.size() == 0) { - data.add( "0"); - } else { - Map tempMap = hostarUtil.parseMapForFilter(temp, id + "|StatAllowance"); - -// Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyStatAllowance"); -// bb.writeLog("tempMap: " + tempMap); - if ( !tempMap.isEmpty()) { - double tempValue = 0.00; - for (String key: tempMap.keySet()) { - double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); - tempValue = tempValue + (Math.max(doubleValue, 0.00)); - } - fieldValue = String.valueOf(tempValue); - } -// bb.writeLog("fieldValue: " + fieldValue); - data.add( fieldValue); - } - continue; - } else if ("nightAllowance".equals(fieldName)) {//考勤二开--精密夜班餐补 -// bb.writeLog("nightAllowance"); - Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyNightShiftAllowanceData"); -// bb.writeLog("tempMap: " + tempMap); - if ( !tempMap.isEmpty()) { - double tempValue = 0.00; - for (String key: tempMap.keySet()) { - double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); - tempValue = tempValue + (Math.max(doubleValue, 0.00)); - } - fieldValue = String.valueOf(tempValue); - } -// bb.writeLog("fieldValue: " + fieldValue); - data.add(fieldValue); - continue; - } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 - params.put("subUserId", id); - bb.writeLog("params: " + params ); - - Map temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); - if (temp == null || temp.size() == 0) { - data.add( "0"); - } else { - Map tempMap = hostarUtil.parseMapForFilter(temp, id + "|DailyNightShiftSubsidyData"); - - if ( !tempMap.isEmpty()) { - int tempValue = 0; - for (String key: tempMap.keySet()) { - int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); - tempValue = tempValue + (Math.max(intValue, 0)); - } - fieldValue = String.valueOf(tempValue); - } - data.add( fieldValue); - } - continue; - } else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补 -// bb.writeLog("otherStatAllowance"); - Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyOtherStatAllowance"); -// bb.writeLog("tempMap: " + tempMap); - if ( !tempMap.isEmpty()) { - double tempValue = 0.00; - for (String key: tempMap.keySet()) { - double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); - tempValue = tempValue + (doubleValue < 0.00 ? 0.00 : doubleValue); - } - fieldValue = String.valueOf(tempValue); - } -// bb.writeLog("fieldValue: " + fieldValue); - data.add(fieldValue); - continue; +// } else if ("mealAllowance".equals(fieldName)) {//考勤二开--出差餐补 +//// bb.writeLog("mealAllowance"); +// Map tempMap = hostarUtil.parseMapForFilter(flowData, "DailyMealAllow|" + resourceId); +//// bb.writeLog("tempMap: " + tempMap); +// +// if ( !tempMap.isEmpty()) { +// int tempValue = 0; +// for (String key: tempMap.keySet()) { +// int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); +// tempValue = tempValue + (Math.max(intValue, 0)); +// } +// fieldValue = String.valueOf(tempValue); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// data.add(fieldValue); +// continue; +// } else if ("statAllowance".equals(fieldName)) {//考勤二开--驻点餐补 +//// bb.writeLog("statAllowance"); +//// bb.writeLog("flowData: " + flowData); +// params.put("statUser", id); +// bb.writeLog("params: " + params ); +// +// Map temp = kqReportBiz.getStatAllowanceData(params, user); +// if (temp == null || temp.size() == 0) { +// data.add( "0"); +// } else { +// Map tempMap = hostarUtil.parseMapForFilter(temp, id + "|StatAllowance"); +// +//// Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyStatAllowance"); +//// bb.writeLog("tempMap: " + tempMap); +// if ( !tempMap.isEmpty()) { +// double tempValue = 0.00; +// for (String key: tempMap.keySet()) { +// double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); +// tempValue = tempValue + (Math.max(doubleValue, 0.00)); +// } +// fieldValue = String.valueOf(tempValue); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// data.add( fieldValue); +// } +// continue; +// } else if ("nightAllowance".equals(fieldName)) {//考勤二开--精密夜班餐补 +//// bb.writeLog("nightAllowance"); +// Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyNightShiftAllowanceData"); +//// bb.writeLog("tempMap: " + tempMap); +// if ( !tempMap.isEmpty()) { +// double tempValue = 0.00; +// for (String key: tempMap.keySet()) { +// double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); +// tempValue = tempValue + (Math.max(doubleValue, 0.00)); +// } +// fieldValue = String.valueOf(tempValue); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// data.add(fieldValue); +// continue; +// } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 +// params.put("subUserId", id); +// bb.writeLog("params: " + params ); +// +// Map temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); +// if (temp == null || temp.size() == 0) { +// data.add( "0"); +// } else { +// Map tempMap = hostarUtil.parseMapForFilter(temp, id + "|DailyNightShiftSubsidyData"); +// +// if ( !tempMap.isEmpty()) { +// int tempValue = 0; +// for (String key: tempMap.keySet()) { +// int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); +// tempValue = tempValue + (Math.max(intValue, 0)); +// } +// fieldValue = String.valueOf(tempValue); +// } +// data.add( fieldValue); +// } +// continue; +// } else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补 +//// bb.writeLog("otherStatAllowance"); +// Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyOtherStatAllowance"); +//// bb.writeLog("tempMap: " + tempMap); +// if ( !tempMap.isEmpty()) { +// double tempValue = 0.00; +// for (String key: tempMap.keySet()) { +// double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); +// tempValue = tempValue + (doubleValue < 0.00 ? 0.00 : doubleValue); +// } +// fieldValue = String.valueOf(tempValue); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// data.add(fieldValue); +// continue; } else if(Util.null2String(kqReportFieldComInfo.getCascadekey(fieldid)).length()>0){ fieldValue = Util.formatMultiLang(Util.null2String(rs.getString(fieldName)),""+user.getLanguage()); data.add(fieldValue); diff --git a/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java b/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java index fd0a7ff..6794d40 100644 --- a/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java +++ b/src/com/engine/kq/cmd/report/GetKQDailyReportCmd.java @@ -145,7 +145,12 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand subComoanyList = new ArrayList<>(); - String acqNoStatAllSql = "select subcompany from uf_NoStatAllSubCom where isdelete = 0 or isdelete is null"; - rs.executeQuery(acqNoStatAllSql); - while (rs.next()) { - String subcompany = Util.null2String(rs.getString("subcompany")); - if (StringUtils.isNotBlank(subcompany)) { - subComoanyList.add(subcompany); - } - } - bb.writeLog("subComoanyList: " + subComoanyList); - /*考勤二开--驻点餐补end*/ - /*考勤二开--夜班餐补start*/ - String nightshiftsub = Util.null2String(bb.getPropValue("project_hostar", "nightshiftsubcompany")); - List nightshifts = new ArrayList(); - String acqSerialSql = " select shift from uf_nightshiftmanage where isdelete is null or isdelete = 0"; - rs.executeQuery(acqSerialSql); - while (rs.next()) { - String serial = Util.null2String(rs.getString("shift")); - if (StringUtils.isNotBlank(serial)) { - nightshifts.add(serial); - } - } - /*考勤二开--夜班餐补end*/ +// /*考勤二开--驻点餐补start*/ +// HostarUtil hostarUtil = new HostarUtil(); +// List subComoanyList = new ArrayList<>(); +// String acqNoStatAllSql = "select subcompany from uf_NoStatAllSubCom where isdelete = 0 or isdelete is null"; +// rs.executeQuery(acqNoStatAllSql); +// while (rs.next()) { +// String subcompany = Util.null2String(rs.getString("subcompany")); +// if (StringUtils.isNotBlank(subcompany)) { +// subComoanyList.add(subcompany); +// } +// } +// bb.writeLog("subComoanyList: " + subComoanyList); +// /*考勤二开--驻点餐补end*/ +// /*考勤二开--夜班餐补start*/ +// String nightshiftsub = Util.null2String(bb.getPropValue("project_hostar", "nightshiftsubcompany")); +// List nightshifts = new ArrayList(); +// String acqSerialSql = " select shift from uf_nightshiftmanage where isdelete is null or isdelete = 0"; +// rs.executeQuery(acqSerialSql); +// while (rs.next()) { +// String serial = Util.null2String(rs.getString("shift")); +// if (StringUtils.isNotBlank(serial)) { +// nightshifts.add(serial); +// } +// } +// /*考勤二开--夜班餐补end*/ bb.writeLog("每日报表sql: " + sql); @@ -358,89 +363,89 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand0) {//弹性工作制没有班次 data.put("serialid", shiftManagementToolKit.getShiftOnOffWorkSections(fieldValue, user.getLanguage())); } - } else if (fieldName.equals("mealAllowance")) {//考勤二开--出差餐补 - int intValue = Util.getIntValue(Util.null2String(flowData.get("DailyMealAllow|" + resourceId + "|" + kqdate))); - if (intValue < 0) { - intValue = 0; - } - data.put(fieldName, intValue); - } else if (fieldName.equals("statAllowance")) {//考勤二开--驻点餐补 - String subcompanyId = Util.null2String(rs.getString("subcompanyid")); - - if ( !subComoanyList.contains(subcompanyId)) { - - params.put("statUser", id); - params.put("kqdate", kqdate); - bb.writeLog("params: " + params ); - -// long startTime = System.currentTimeMillis(); - Map dailyStatAllowanceData = kqReportBiz.getDailyStatAllowanceData(params, user); -// long endTime = System.currentTimeMillis(); -// long elapsedTime = endTime - startTime; // 执行时间 -// bb.writeLog("执行时间:" + elapsedTime/1000 + "秒"); - - if (dailyStatAllowanceData == null || dailyStatAllowanceData.size() == 0) { - fieldValue = "0"; - } else { - Map tempMap = hostarUtil.parseMapForFilter(dailyStatAllowanceData, id + "|DailyStatAllowance"); -// bb.writeLog("-=-=tempMap: " + tempMap); -// bb.writeLog("-=-=tempMap.key: " + id + "|DailyStatAllowance" + "|" + kqdate); - double temp = Util.getDoubleValue(Util.null2String(tempMap.get(id + "|DailyStatAllowance" + "|" + kqdate ))); -// bb.writeLog("-=-=temp: " + temp); - if (temp <= 0) { - fieldValue = "0"; - } else { - fieldValue = String.valueOf(temp); - } - } - - bb.writeLog("-=-=fieldValue: " + fieldValue); - } - data.put(fieldName, fieldValue); - } else if (fieldName.equals("nightAllowance")) {//考勤二开--精密夜班餐补 - String subcompanyId = Util.null2String(rs.getString("subcompanyid")); - String serialid = Util.null2String(rs.getString("serialid")); - if ( subcompanyId.equals(nightshiftsub) && nightshifts.contains(serialid)) { -// String key= id + "|DailyNightShiftAllowanceData" + "|" + kqdate; -// bb.writeLog("nightAllowance key: " + key ); - double temp = Util.getDoubleValue(Util.null2String(flowData.get(id + "|DailyNightShiftAllowanceData" + "|" + kqdate ))); -// bb.writeLog("nightAllowance temp: " + temp ); -// bb.writeLog("nightAllowance kqdate: " + kqdate ); - if (temp <= 0.00) { - fieldValue = "0"; - } else { - fieldValue = String.valueOf(temp); - } -// bb.writeLog("fieldValue: " + fieldValue); - } - data.put(fieldName, fieldValue); - } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 - params.put("subUserId", id); - bb.writeLog("params: " + params ); - - Map temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); -// bb.writeLog("nightShiftSubsidy temp: " + temp ); -// bb.writeLog("nightShiftSubsidy temp.size: " + temp.size() ); -// String key = id + "|DailyNightShiftSubsidyData" + kqdate; -// bb.writeLog("nightShiftSubsidy key: " + key ); - if (temp == null || temp.size() == 0) { - data.put(fieldName, "0"); - } else { - double doubleValue = Math.max(Util.getDoubleValue(Util.null2String(temp.get(id + "|DailyNightShiftSubsidyData|" + kqdate))) , 0.00); -// bb.writeLog("nightShiftSubsidy doubleValue: " + doubleValue ); -// bb.writeLog("nightShiftSubsidy kqdate: " + kqdate ); - data.put(fieldName, doubleValue); - } - - } else if (fieldName.equals("otherStatAllowance")) {//考勤二开--鸿仁驻点餐补 - double temp = Util.getDoubleValue(Util.null2String(flowData.get(id + "|DailyOtherStatAllowance" + "|" + kqdate ))); - if (temp <= 0.00) { - fieldValue = "0"; - } else { - fieldValue = String.valueOf(temp); - } -// bb.writeLog("fieldValue: " + fieldValue); - data.put(fieldName, fieldValue); +// } else if (fieldName.equals("mealAllowance")) {//考勤二开--出差餐补 +// int intValue = Util.getIntValue(Util.null2String(flowData.get("DailyMealAllow|" + resourceId + "|" + kqdate))); +// if (intValue < 0) { +// intValue = 0; +// } +// data.put(fieldName, intValue); +// } else if (fieldName.equals("statAllowance")) {//考勤二开--驻点餐补 +// String subcompanyId = Util.null2String(rs.getString("subcompanyid")); +// +// if ( !subComoanyList.contains(subcompanyId)) { +// +// params.put("statUser", id); +// params.put("kqdate", kqdate); +// bb.writeLog("params: " + params ); +// +//// long startTime = System.currentTimeMillis(); +// Map dailyStatAllowanceData = kqReportBiz.getDailyStatAllowanceData(params, user); +//// long endTime = System.currentTimeMillis(); +//// long elapsedTime = endTime - startTime; // 执行时间 +//// bb.writeLog("执行时间:" + elapsedTime/1000 + "秒"); +// +// if (dailyStatAllowanceData == null || dailyStatAllowanceData.size() == 0) { +// fieldValue = "0"; +// } else { +// Map tempMap = hostarUtil.parseMapForFilter(dailyStatAllowanceData, id + "|DailyStatAllowance"); +//// bb.writeLog("-=-=tempMap: " + tempMap); +//// bb.writeLog("-=-=tempMap.key: " + id + "|DailyStatAllowance" + "|" + kqdate); +// double temp = Util.getDoubleValue(Util.null2String(tempMap.get(id + "|DailyStatAllowance" + "|" + kqdate ))); +//// bb.writeLog("-=-=temp: " + temp); +// if (temp <= 0) { +// fieldValue = "0"; +// } else { +// fieldValue = String.valueOf(temp); +// } +// } +// +// bb.writeLog("-=-=fieldValue: " + fieldValue); +// } +// data.put(fieldName, fieldValue); +// } else if (fieldName.equals("nightAllowance")) {//考勤二开--精密夜班餐补 +// String subcompanyId = Util.null2String(rs.getString("subcompanyid")); +// String serialid = Util.null2String(rs.getString("serialid")); +// if ( subcompanyId.equals(nightshiftsub) && nightshifts.contains(serialid)) { +//// String key= id + "|DailyNightShiftAllowanceData" + "|" + kqdate; +//// bb.writeLog("nightAllowance key: " + key ); +// double temp = Util.getDoubleValue(Util.null2String(flowData.get(id + "|DailyNightShiftAllowanceData" + "|" + kqdate ))); +//// bb.writeLog("nightAllowance temp: " + temp ); +//// bb.writeLog("nightAllowance kqdate: " + kqdate ); +// if (temp <= 0.00) { +// fieldValue = "0"; +// } else { +// fieldValue = String.valueOf(temp); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// } +// data.put(fieldName, fieldValue); +// } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 +// params.put("subUserId", id); +// bb.writeLog("params: " + params ); +// +// Map temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); +//// bb.writeLog("nightShiftSubsidy temp: " + temp ); +//// bb.writeLog("nightShiftSubsidy temp.size: " + temp.size() ); +//// String key = id + "|DailyNightShiftSubsidyData" + kqdate; +//// bb.writeLog("nightShiftSubsidy key: " + key ); +// if (temp == null || temp.size() == 0) { +// data.put(fieldName, "0"); +// } else { +// double doubleValue = Math.max(Util.getDoubleValue(Util.null2String(temp.get(id + "|DailyNightShiftSubsidyData|" + kqdate))) , 0.00); +//// bb.writeLog("nightShiftSubsidy doubleValue: " + doubleValue ); +//// bb.writeLog("nightShiftSubsidy kqdate: " + kqdate ); +// data.put(fieldName, doubleValue); +// } +// +// } else if (fieldName.equals("otherStatAllowance")) {//考勤二开--鸿仁驻点餐补 +// double temp = Util.getDoubleValue(Util.null2String(flowData.get(id + "|DailyOtherStatAllowance" + "|" + kqdate ))); +// if (temp <= 0.00) { +// fieldValue = "0"; +// } else { +// fieldValue = String.valueOf(temp); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// data.put(fieldName, fieldValue); } else { fieldValue = Util.null2String(rs.getString(fieldName)); if (kqReportFieldComInfo.getUnittype().equals("2") && fieldValue.length() > 0) { @@ -509,7 +514,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand> { RecordSet rs = new RecordSet(); String sql = ""; try{ + bb.writeLog("GetKQReportCmd start."); String pageUid = PageUidFactory.getHrmPageUid("KQReport"); SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); @@ -172,7 +173,12 @@ public class GetKQReportCmd extends AbstractCommonCommand> { Map definedFieldInfo = new KQFormatBiz().getDefinedField(); String definedFieldSum = Util.null2String(definedFieldInfo.get("definedFieldSum")); - String backFields = " a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle," + + String backFields = " (select sum(zm.cccb) from uf_cbxxjlb zm where zm.xm = a.id and zm.rq >= '" + fromDate + "' and zm.rq <= '" + toDate + "') as mealAllowance," + + " (select sum(zm.zdcb) from uf_cbxxjlb zm where zm.xm = a.id and zm.rq >= '" + fromDate + "' and zm.rq <= '" + toDate + "') as statAllowance," + + " (select sum(zm.jmybcb) from uf_cbxxjlb zm where zm.xm = a.id and zm.rq >= '" + fromDate + "' and zm.rq <= '" + toDate + "') as nightAllowance," + + " (select sum(zm.hrzdcb) from uf_cbxxjlb zm where zm.xm = a.id and zm.rq >= '" + fromDate + "' and zm.rq <= '" + toDate + "') as otherStatAllowance," + + " (select sum(zm.ybbz) from uf_cbxxjlb zm where zm.xm = a.id and zm.rq >= '" + fromDate + "' and zm.rq <= '" + toDate + "') as nightShiftSubsidy," + + " 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(FLOOR( b.attendanceMins / 30 ) * 30 ) 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," + @@ -435,99 +441,99 @@ public class GetKQReportCmd extends AbstractCommonCommand> { } else{ fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id+"|"+fieldName))); } - } else if ("mealAllowance".equals(fieldName)) {//考勤二开--出差餐补 -// bb.writeLog("mealAllowance"); - Map tempMap = hostarUtil.parseMapForFilter(flowData, "DailyMealAllow|" + resourceId); -// bb.writeLog("tempMap: " + tempMap); - - if ( !tempMap.isEmpty()) { - int tempValue = 0; - for (String key: tempMap.keySet()) { - int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); - tempValue = tempValue + (Math.max(intValue, 0)); - } - fieldValue = String.valueOf(tempValue); - } -// bb.writeLog("fieldValue: " + fieldValue); - data.put(fieldName, fieldValue); - } else if ("statAllowance".equals(fieldName)) {//考勤二开--驻点餐补 - bb.writeLog("statAllowance"); - - params.put("statUser", id); - bb.writeLog("params: " + params ); - - Map temp = kqReportBiz.getStatAllowanceData(params, user); - if (temp == null || temp.size() == 0) { - data.put(fieldName, "0"); - } else { - Map tempMap = hostarUtil.parseMapForFilter(temp, id + "|StatAllowance"); - -// Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyStatAllowance"); -// bb.writeLog("tempMap: " + tempMap); - if ( !tempMap.isEmpty()) { - double tempValue = 0.00; - for (String key: tempMap.keySet()) { - double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); - tempValue = tempValue + (Math.max(doubleValue, 0.00)); - } - fieldValue = String.valueOf(tempValue); - } -// bb.writeLog("fieldValue: " + fieldValue); - data.put(fieldName, fieldValue); - } - - - } else if ("nightAllowance".equals(fieldName)) {//考勤二开--精密夜班餐补 -// bb.writeLog("nightAllowance"); -// bb.writeLog("flowData: " + flowData); - Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyNightShiftAllowanceData"); -// bb.writeLog("tempMap: " + tempMap); - if ( !tempMap.isEmpty()) { - double tempValue = 0.00; - for (String key: tempMap.keySet()) { - double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); - tempValue = tempValue + (Math.max(doubleValue, 0.00)); - } - fieldValue = String.valueOf(tempValue); - } -// bb.writeLog("fieldValue: " + fieldValue); - data.put(fieldName, fieldValue); - } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 - params.put("subUserId", id); - bb.writeLog("params: " + params ); - - Map temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); - if (temp == null || temp.size() == 0) { - data.put(fieldName, "0"); - } else { - Map tempMap = hostarUtil.parseMapForFilter(temp, id + "|DailyNightShiftSubsidyData"); - - if ( !tempMap.isEmpty()) { - int tempValue = 0; - for (String key: tempMap.keySet()) { - int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); - tempValue = tempValue + (Math.max(intValue, 0)); - } - fieldValue = String.valueOf(tempValue); - } - data.put(fieldName, fieldValue); - } - - } else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补 -// bb.writeLog("otherStatAllowance"); -// bb.writeLog("flowData: " + flowData); - Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyOtherStatAllowance"); -// bb.writeLog("tempMap: " + tempMap); - if ( !tempMap.isEmpty()) { - double tempValue = 0.00; - for (String key: tempMap.keySet()) { - double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); - tempValue = tempValue + (Math.max(doubleValue, 0.00)); - } - fieldValue = String.valueOf(tempValue); - } -// bb.writeLog("fieldValue: " + fieldValue); - data.put(fieldName, fieldValue); +// } else if ("mealAllowance".equals(fieldName)) {//考勤二开--出差餐补 +//// bb.writeLog("mealAllowance"); +// Map tempMap = hostarUtil.parseMapForFilter(flowData, "DailyMealAllow|" + resourceId); +//// bb.writeLog("tempMap: " + tempMap); +// +// if ( !tempMap.isEmpty()) { +// int tempValue = 0; +// for (String key: tempMap.keySet()) { +// int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); +// tempValue = tempValue + (Math.max(intValue, 0)); +// } +// fieldValue = String.valueOf(tempValue); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// data.put(fieldName, fieldValue); +// } else if ("statAllowance".equals(fieldName)) {//考勤二开--驻点餐补 +// bb.writeLog("statAllowance"); +// +// params.put("statUser", id); +// bb.writeLog("params: " + params ); +// +// Map temp = kqReportBiz.getStatAllowanceData(params, user); +// if (temp == null || temp.size() == 0) { +// data.put(fieldName, "0"); +// } else { +// Map tempMap = hostarUtil.parseMapForFilter(temp, id + "|StatAllowance"); +// +//// Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyStatAllowance"); +//// bb.writeLog("tempMap: " + tempMap); +// if ( !tempMap.isEmpty()) { +// double tempValue = 0.00; +// for (String key: tempMap.keySet()) { +// double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); +// tempValue = tempValue + (Math.max(doubleValue, 0.00)); +// } +// fieldValue = String.valueOf(tempValue); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// data.put(fieldName, fieldValue); +// } +// +// +// } else if ("nightAllowance".equals(fieldName)) {//考勤二开--精密夜班餐补 +//// bb.writeLog("nightAllowance"); +//// bb.writeLog("flowData: " + flowData); +// Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyNightShiftAllowanceData"); +//// bb.writeLog("tempMap: " + tempMap); +// if ( !tempMap.isEmpty()) { +// double tempValue = 0.00; +// for (String key: tempMap.keySet()) { +// double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); +// tempValue = tempValue + (Math.max(doubleValue, 0.00)); +// } +// fieldValue = String.valueOf(tempValue); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// data.put(fieldName, fieldValue); +// } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 +// params.put("subUserId", id); +// bb.writeLog("params: " + params ); +// +// Map temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); +// if (temp == null || temp.size() == 0) { +// data.put(fieldName, "0"); +// } else { +// Map tempMap = hostarUtil.parseMapForFilter(temp, id + "|DailyNightShiftSubsidyData"); +// +// if ( !tempMap.isEmpty()) { +// int tempValue = 0; +// for (String key: tempMap.keySet()) { +// int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); +// tempValue = tempValue + (Math.max(intValue, 0)); +// } +// fieldValue = String.valueOf(tempValue); +// } +// data.put(fieldName, fieldValue); +// } +// +// } else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补 +//// bb.writeLog("otherStatAllowance"); +//// bb.writeLog("flowData: " + flowData); +// Map tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyOtherStatAllowance"); +//// bb.writeLog("tempMap: " + tempMap); +// if ( !tempMap.isEmpty()) { +// double tempValue = 0.00; +// for (String key: tempMap.keySet()) { +// double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); +// tempValue = tempValue + (Math.max(doubleValue, 0.00)); +// } +// fieldValue = String.valueOf(tempValue); +// } +//// bb.writeLog("fieldValue: " + fieldValue); +// data.put(fieldName, fieldValue); } else { fieldValue = Util.null2String(rs.getString(fieldName)); if(Util.null2String(kqReportFieldComInfo.getUnittype()).length()>0) { @@ -611,7 +617,7 @@ public class GetKQReportCmd extends AbstractCommonCommand> { retmap.put("ishavenext", isHaveNext); }catch (Exception e){ writeLog(e); - bb.writeLog("GetKQReportCmd Exception: " + e); + bb.writeLog("GetKQReportCmd Exception: " + e.getMessage()); } return retmap; }