餐补报表优化

dev-ld
zhangming 1 year ago
parent 93a9d1f237
commit 33722523d3

@ -380,11 +380,11 @@ public class KQReportBiz extends BaseBean {
datas.putAll(getDailyFlowLeaveBackData(params,user)); datas.putAll(getDailyFlowLeaveBackData(params,user));
/*考勤二开--出差公出流程餐补统计start*/ /*考勤二开--出差公出流程餐补统计start*/
long startTime = System.currentTimeMillis(); // long startTime = System.currentTimeMillis();
datas.putAll(getDailyMealAllowanceData(params,user)); // datas.putAll(getDailyMealAllowanceData(params,user));
long endTime = System.currentTimeMillis(); // long endTime = System.currentTimeMillis();
long elapsedTime = endTime - startTime; // 执行时间 // long elapsedTime = endTime - startTime; // 执行时间
bb.writeLog("getDailyMealAllowanceData执行时间" + elapsedTime/1000 + "秒"); // bb.writeLog("getDailyMealAllowanceData执行时间" + elapsedTime/1000 + "秒");
/*考勤二开--出差公出流程餐补统计end*/ /*考勤二开--出差公出流程餐补统计end*/
// /*考勤二开--计算驻点餐补start*/ // /*考勤二开--计算驻点餐补start*/
@ -392,22 +392,22 @@ public class KQReportBiz extends BaseBean {
// /*考勤二开--计算驻点餐补end*/ // /*考勤二开--计算驻点餐补end*/
//获取加班时长 //获取加班时长
Map<String, Object> dailyFlowOverTimeData = getDailyFlowOverTimeDataAllowance(params, user); // Map<String, Object> dailyFlowOverTimeData = getDailyFlowOverTimeDataAllowance(params, user);
//
/*考勤二开--计算精密夜班餐补start*/ // /*考勤二开--计算精密夜班餐补start*/
startTime = System.currentTimeMillis(); // startTime = System.currentTimeMillis();
datas.putAll(getDailyNightShiftAllowanceDataTemp(params,user,dailyFlowOverTimeData)); // datas.putAll(getDailyNightShiftAllowanceDataTemp(params,user,dailyFlowOverTimeData));
endTime = System.currentTimeMillis(); // endTime = System.currentTimeMillis();
elapsedTime = endTime - startTime; // 执行时间 // elapsedTime = endTime - startTime; // 执行时间
bb.writeLog("getDailyNightShiftAllowanceData执行时间" + elapsedTime/1000 + "秒"); // bb.writeLog("getDailyNightShiftAllowanceData执行时间" + elapsedTime/1000 + "秒");
/*考勤二开--计算精密夜班餐补end*/ // /*考勤二开--计算精密夜班餐补end*/
//
/*考勤二开--计算鸿仁驻点餐补start*/ // /*考勤二开--计算鸿仁驻点餐补start*/
startTime = System.currentTimeMillis(); // startTime = System.currentTimeMillis();
datas.putAll(getDailyOtherStatAllowanceDataTemp(params,user,dailyFlowOverTimeData)); // datas.putAll(getDailyOtherStatAllowanceDataTemp(params,user,dailyFlowOverTimeData));
endTime = System.currentTimeMillis(); // endTime = System.currentTimeMillis();
elapsedTime = endTime - startTime; // 执行时间 // elapsedTime = endTime - startTime; // 执行时间
bb.writeLog("getDailyOtherStatAllowanceData执行时间" + elapsedTime/1000 + "秒"); // bb.writeLog("getDailyOtherStatAllowanceData执行时间" + elapsedTime/1000 + "秒");
/*考勤二开--计算鸿仁驻点餐补end*/ /*考勤二开--计算鸿仁驻点餐补end*/
@ -432,7 +432,7 @@ public class KQReportBiz extends BaseBean {
/*考勤二开--出差公出流程餐补统计start*/ /*考勤二开--出差公出流程餐补统计start*/
datas.putAll(getDailyMealAllowanceData(params,user)); // datas.putAll(getDailyMealAllowanceData(params,user));
/*考勤二开--出差公出流程餐补统计end*/ /*考勤二开--出差公出流程餐补统计end*/
/*考勤二开--计算驻点餐补start*/ /*考勤二开--计算驻点餐补start*/
@ -444,11 +444,11 @@ public class KQReportBiz extends BaseBean {
/*考勤二开--计算驻点餐补end*/ /*考勤二开--计算驻点餐补end*/
/*考勤二开--计算精密夜班餐补start*/ /*考勤二开--计算精密夜班餐补start*/
datas.putAll(getDailyNightShiftAllowanceData(params,user)); // datas.putAll(getDailyNightShiftAllowanceData(params,user));
/*考勤二开--计算精密夜班餐补end*/ /*考勤二开--计算精密夜班餐补end*/
/*考勤二开--计算鸿仁驻点餐补start*/ /*考勤二开--计算鸿仁驻点餐补start*/
datas.putAll(getDailyOtherStatAllowanceData(params,user)); // datas.putAll(getDailyOtherStatAllowanceData(params,user));
/*考勤二开--计算鸿仁驻点餐补end*/ /*考勤二开--计算鸿仁驻点餐补end*/

@ -48,6 +48,7 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
String sql = ""; String sql = "";
try { try {
bb.writeLog("ExportDailyExcelCmd start.");
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
DepartmentComInfo departmentComInfo = new DepartmentComInfo(); DepartmentComInfo departmentComInfo = new DepartmentComInfo();
ResourceComInfo resourceComInfo = new ResourceComInfo(); ResourceComInfo resourceComInfo = new ResourceComInfo();
@ -185,7 +186,12 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
forgotBeginWorkCheck_field = " isnull(b.forgotBeginWorkCheck,0) "; forgotBeginWorkCheck_field = " isnull(b.forgotBeginWorkCheck,0) ";
} }
String backFields = " a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder," + String backFields = " (select zm.cccb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as mealAllowance," +
" (select zm.zdcb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as statAllowance," +
" (select zm.jmybcb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as nightAllowance," +
" (select zm.hrzdcb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as otherStatAllowance," +
" (select zm.ybbz from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as nightShiftSubsidy," +
" 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,FLOOR( b.attendanceMins / 30 ) * 30 AS attendanceMins ,b.beLate," + " b.kqdate, b.workdays,b.workMins,b.serialid, b.attendancedays,FLOOR( b.attendanceMins / 30 ) * 30 AS attendanceMins ,b.beLate," +
" b.beLateMins,b.graveBeLate,b.graveBeLateMins,b.leaveEearly,b.leaveEarlyMins,b.graveLeaveEarly," + " b.beLateMins,b.graveBeLate,b.graveBeLateMins,b.leaveEearly,b.leaveEarlyMins,b.graveLeaveEarly," +
" b.graveLeaveEarlyMins,b.absenteeism,b.signdays,b.signmins, "+ " b.graveLeaveEarlyMins,b.absenteeism,b.signdays,b.signmins, "+
@ -232,34 +238,37 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
KQSettingsComInfo kqSettingsComInfo = new KQSettingsComInfo(); KQSettingsComInfo kqSettingsComInfo = new KQSettingsComInfo();
String isShowFullPath = Util.null2String(kqSettingsComInfo.getMain_val(fullPathMainKey),"0"); String isShowFullPath = Util.null2String(kqSettingsComInfo.getMain_val(fullPathMainKey),"0");
long startTime = System.currentTimeMillis();
Map<String,Object> flowData = kqReportBiz.getDailyFlowData(params,user); Map<String,Object> flowData = kqReportBiz.getDailyFlowData(params,user);
long endTime = System.currentTimeMillis();
/*考勤二开--驻点餐补start*/ long elapsedTime = endTime - startTime; // 执行时间
HostarUtil hostarUtil = new HostarUtil(); bb.writeLog("getDailyMealAllowanceData执行时间" + elapsedTime/1000 + "秒");
List<String> subComoanyList = new ArrayList<>(); // /*考勤二开--驻点餐补start*/
String acqNoStatAllSql = "select subcompany from uf_NoStatAllSubCom where isdelete = 0 or isdelete is null"; // HostarUtil hostarUtil = new HostarUtil();
rs.executeQuery(acqNoStatAllSql); // List<String> subComoanyList = new ArrayList<>();
while (rs.next()) { // String acqNoStatAllSql = "select subcompany from uf_NoStatAllSubCom where isdelete = 0 or isdelete is null";
String subcompany = Util.null2String(rs.getString("subcompany")); // rs.executeQuery(acqNoStatAllSql);
if (StringUtils.isNotBlank(subcompany)) { // while (rs.next()) {
subComoanyList.add(subcompany); // String subcompany = Util.null2String(rs.getString("subcompany"));
} // if (StringUtils.isNotBlank(subcompany)) {
} // subComoanyList.add(subcompany);
bb.writeLog("subComoanyList: " + subComoanyList); // }
/*考勤二开--驻点餐补end*/ // }
/*考勤二开--夜班餐补start*/ // bb.writeLog("subComoanyList: " + subComoanyList);
String nightshiftsub = Util.null2String(bb.getPropValue("project_hostar", "nightshiftsubcompany")); // /*考勤二开--驻点餐补end*/
List<String> nightshifts = new ArrayList<String>(); // /*考勤二开--夜班餐补start*/
String acqSerialSql = " select shift from uf_nightshiftmanage where isdelete is null or isdelete = 0"; // String nightshiftsub = Util.null2String(bb.getPropValue("project_hostar", "nightshiftsubcompany"));
rs.executeQuery(acqSerialSql); // List<String> nightshifts = new ArrayList<String>();
while (rs.next()) { // String acqSerialSql = " select shift from uf_nightshiftmanage where isdelete is null or isdelete = 0";
String serial = Util.null2String(rs.getString("shift")); // rs.executeQuery(acqSerialSql);
if (StringUtils.isNotBlank(serial)) { // while (rs.next()) {
nightshifts.add(serial); // String serial = Util.null2String(rs.getString("shift"));
} // if (StringUtils.isNotBlank(serial)) {
} // nightshifts.add(serial);
/*考勤二开--夜班餐补end*/ // }
// }
// /*考勤二开--夜班餐补end*/
bb.writeLog("ExportDailyExcelCmd sql:" + sql);
rs.execute(sql); rs.execute(sql);
while (rs.next()) { while (rs.next()) {
data = new ArrayList<>(); data = new ArrayList<>();
@ -346,13 +355,13 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
fieldValue = Util.null2String(signDetailInfo.get("signoutstatus3")); fieldValue = Util.null2String(signDetailInfo.get("signoutstatus3"));
data.add(fieldValue); data.add(fieldValue);
continue; continue;
} else if (fieldName.equals("mealAllowance")) {//考勤二开--出差餐补 // } else if (fieldName.equals("mealAllowance")) {//考勤二开--出差餐补
int intValue = Util.getIntValue(Util.null2String(flowData.get("DailyMealAllow|" + resourceId + "|" + kqdate))); // int intValue = Util.getIntValue(Util.null2String(flowData.get("DailyMealAllow|" + resourceId + "|" + kqdate)));
if (intValue < 0) { // if (intValue < 0) {
intValue = 0; // intValue = 0;
} // }
data.add(intValue); // data.add(intValue);
continue; // continue;
} else if(fieldName.equals("leave")){ } else if(fieldName.equals("leave")){
//请假 //请假
List<Map<String, Object>> allLeaveRules = KQLeaveRulesBiz.getAllLeaveRules(); List<Map<String, Object>> allLeaveRules = KQLeaveRulesBiz.getAllLeaveRules();
@ -451,81 +460,81 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
}catch (Exception e){ }catch (Exception e){
} }
fieldValue = KQDurationCalculatorUtil.getDurationRound(businessLeave); fieldValue = KQDurationCalculatorUtil.getDurationRound(businessLeave);
} else if ( "mealAllowance".equals(fieldName)) {//考勤二开--出差餐补 // } else if ( "mealAllowance".equals(fieldName)) {//考勤二开--出差餐补
int intValue = Util.getIntValue(Util.null2String(flowData.get("DailyMealAllow|" + resourceId + "|" + kqdate))); // int intValue = Util.getIntValue(Util.null2String(flowData.get("DailyMealAllow|" + resourceId + "|" + kqdate)));
if (intValue < 0) { // if (intValue < 0) {
intValue = 0; // intValue = 0;
} // }
data.add(intValue); // data.add(intValue);
continue; // continue;
} else if ("statAllowance".equals(fieldName)) {//考勤二开--驻点餐补 // } else if ("statAllowance".equals(fieldName)) {//考勤二开--驻点餐补
//
String subcompanyId = Util.null2String(rs.getString("subcompanyid")); // String subcompanyId = Util.null2String(rs.getString("subcompanyid"));
if ( !subComoanyList.contains(subcompanyId)) { // if ( !subComoanyList.contains(subcompanyId)) {
//
params.put("statUser", id); // params.put("statUser", id);
params.put("kqdate", kqdate); // params.put("kqdate", kqdate);
// bb.writeLog("params: " + params ); //// bb.writeLog("params: " + params );
//
long startTime = System.currentTimeMillis(); // long startTime = System.currentTimeMillis();
Map<String, Object> dailyStatAllowanceData = kqReportBiz.getDailyStatAllowanceData(params, user); // Map<String, Object> dailyStatAllowanceData = kqReportBiz.getDailyStatAllowanceData(params, user);
long endTime = System.currentTimeMillis(); // long endTime = System.currentTimeMillis();
long elapsedTime = endTime - startTime; // 执行时间 // long elapsedTime = endTime - startTime; // 执行时间
bb.writeLog("执行时间:" + elapsedTime/1000 + "秒"); // bb.writeLog("执行时间:" + elapsedTime/1000 + "秒");
//
if (dailyStatAllowanceData == null || dailyStatAllowanceData.size() == 0) { // if (dailyStatAllowanceData == null || dailyStatAllowanceData.size() == 0) {
fieldValue = "0"; // fieldValue = "0";
} else { // } else {
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(dailyStatAllowanceData, id + "|DailyStatAllowance"); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(dailyStatAllowanceData, id + "|DailyStatAllowance");
//
double temp = Util.getDoubleValue(Util.null2String(tempMap.get(id + "|DailyStatAllowance" + "|" + kqdate ))); // double temp = Util.getDoubleValue(Util.null2String(tempMap.get(id + "|DailyStatAllowance" + "|" + kqdate )));
if (temp <= 0) { // if (temp <= 0) {
fieldValue = "0"; // fieldValue = "0";
} else { // } else {
fieldValue = String.valueOf(temp); // fieldValue = String.valueOf(temp);
} // }
} // }
//
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
} // }
data.add(fieldValue); // data.add(fieldValue);
continue; // continue;
} else if ("nightAllowance".equals(fieldName)) {//考勤二开--夜班餐补 // } else if ("nightAllowance".equals(fieldName)) {//考勤二开--夜班餐补
String subcompanyId = Util.null2String(rs.getString("subcompanyid")); // String subcompanyId = Util.null2String(rs.getString("subcompanyid"));
String serialid = Util.null2String(rs.getString("serialid")); // String serialid = Util.null2String(rs.getString("serialid"));
if ( !subComoanyList.contains(subcompanyId) && nightshifts.contains(serialid)) { // if ( !subComoanyList.contains(subcompanyId) && nightshifts.contains(serialid)) {
int temp = Util.getIntValue(Util.null2String(flowData.get(id + "|DailyNightShiftAllowanceData" + "|" + kqdate ))); // int temp = Util.getIntValue(Util.null2String(flowData.get(id + "|DailyNightShiftAllowanceData" + "|" + kqdate )));
if (temp <= 0) { // if (temp <= 0) {
fieldValue = "0"; // fieldValue = "0";
} else { // } else {
fieldValue = String.valueOf(temp); // fieldValue = String.valueOf(temp);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
} // }
data.add( fieldValue); // data.add( fieldValue);
continue; // continue;
} else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 // } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助
params.put("subUserId", id); // params.put("subUserId", id);
// bb.writeLog("params: " + params ); //// bb.writeLog("params: " + params );
//
Map<String, Object> temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); // Map<String, Object> temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user);
if (temp == null || temp.size() == 0) { // if (temp == null || temp.size() == 0) {
data.add( "0"); // data.add( "0");
} else { // } else {
int intValue = Math.max(Util.getIntValue(Util.null2String(temp.get(id + "|DailyStatAllowance" + kqdate))) , 0); // int intValue = Math.max(Util.getIntValue(Util.null2String(temp.get(id + "|DailyStatAllowance" + kqdate))) , 0);
data.add( intValue); // data.add( intValue);
} // }
//
} else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补 // } else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补
int temp = Util.getIntValue(Util.null2String(flowData.get(id + "|DailyOtherStatAllowance" + "|" + kqdate ))); // int temp = Util.getIntValue(Util.null2String(flowData.get(id + "|DailyOtherStatAllowance" + "|" + kqdate )));
if (temp <= 0) { // if (temp <= 0) {
fieldValue = "0"; // fieldValue = "0";
} else { // } else {
fieldValue = String.valueOf(temp); // fieldValue = String.valueOf(temp);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
data.add(fieldValue); // data.add(fieldValue);
continue; // continue;
} else if(fieldName.equals("kqdate")){ } else if(fieldName.equals("kqdate")){
fieldValue=kqdate+" "+com.engine.portal.util.DateUtil.getDayWeekOfDate1(DateUtil.parseToDate(kqdate)); fieldValue=kqdate+" "+com.engine.portal.util.DateUtil.getDayWeekOfDate1(DateUtil.parseToDate(kqdate));
} else { } else {
@ -553,6 +562,7 @@ public class ExportDailyExcelCmd extends AbstractCommonCommand<Map<String, Objec
retmap.putAll(exportMap); retmap.putAll(exportMap);
retmap.put("status", "1"); retmap.put("status", "1");
} catch (Exception e) { } catch (Exception e) {
bb.writeLog("ExportDailyExcelCmd error:" + e.getMessage());
retmap.put("status", "-1"); retmap.put("status", "-1");
retmap.put("message", SystemEnv.getHtmlLabelName(382661, user.getLanguage())); retmap.put("message", SystemEnv.getHtmlLabelName(382661, user.getLanguage()));
writeLog(e); writeLog(e);

@ -206,7 +206,12 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
Map<String,Object> definedFieldInfo = new KQFormatBiz().getDefinedField(); Map<String,Object> definedFieldInfo = new KQFormatBiz().getDefinedField();
String definedFieldSum = Util.null2String(definedFieldInfo.get("definedFieldSum")); String definedFieldSum = Util.null2String(definedFieldInfo.get("definedFieldSum"));
String backFields = " a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle," + String backFields = " (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(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(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," + " sum(b.graveBeLate) as graveBeLate, sum(b.graveBeLateMins) as graveBeLateMins,sum(b.leaveEearly) as leaveEearly," +
@ -433,99 +438,99 @@ public class ExportExcelCmd extends AbstractCommonCommand<Map<String, Object>> {
}catch (Exception e){ }catch (Exception e){
} }
fieldValue = KQDurationCalculatorUtil.getDurationRound(businessLeave); fieldValue = KQDurationCalculatorUtil.getDurationRound(businessLeave);
} else if ("mealAllowance".equals(fieldName)) {//考勤二开--出差餐补 // } else if ("mealAllowance".equals(fieldName)) {//考勤二开--出差餐补
// bb.writeLog("mealAllowance"); //// bb.writeLog("mealAllowance");
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, "DailyMealAllow|" + resourceId); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, "DailyMealAllow|" + resourceId);
// bb.writeLog("tempMap: " + tempMap); //// bb.writeLog("tempMap: " + tempMap);
//
if ( !tempMap.isEmpty()) { // if ( !tempMap.isEmpty()) {
int tempValue = 0; // int tempValue = 0;
for (String key: tempMap.keySet()) { // for (String key: tempMap.keySet()) {
int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); // int intValue = Util.getIntValue(Util.null2String(tempMap.get(key)));
tempValue = tempValue + (Math.max(intValue, 0)); // tempValue = tempValue + (Math.max(intValue, 0));
} // }
fieldValue = String.valueOf(tempValue); // fieldValue = String.valueOf(tempValue);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
data.add(fieldValue); // data.add(fieldValue);
continue; // continue;
} else if ("statAllowance".equals(fieldName)) {//考勤二开--驻点餐补 // } else if ("statAllowance".equals(fieldName)) {//考勤二开--驻点餐补
// bb.writeLog("statAllowance"); //// bb.writeLog("statAllowance");
// bb.writeLog("flowData: " + flowData); //// bb.writeLog("flowData: " + flowData);
params.put("statUser", id); // params.put("statUser", id);
bb.writeLog("params: " + params ); // bb.writeLog("params: " + params );
//
Map<String, Object> temp = kqReportBiz.getStatAllowanceData(params, user); // Map<String, Object> temp = kqReportBiz.getStatAllowanceData(params, user);
if (temp == null || temp.size() == 0) { // if (temp == null || temp.size() == 0) {
data.add( "0"); // data.add( "0");
} else { // } else {
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(temp, id + "|StatAllowance"); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(temp, id + "|StatAllowance");
//
// Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyStatAllowance"); //// Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyStatAllowance");
// bb.writeLog("tempMap: " + tempMap); //// bb.writeLog("tempMap: " + tempMap);
if ( !tempMap.isEmpty()) { // if ( !tempMap.isEmpty()) {
double tempValue = 0.00; // double tempValue = 0.00;
for (String key: tempMap.keySet()) { // for (String key: tempMap.keySet()) {
double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); // double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key)));
tempValue = tempValue + (Math.max(doubleValue, 0.00)); // tempValue = tempValue + (Math.max(doubleValue, 0.00));
} // }
fieldValue = String.valueOf(tempValue); // fieldValue = String.valueOf(tempValue);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
data.add( fieldValue); // data.add( fieldValue);
} // }
continue; // continue;
} else if ("nightAllowance".equals(fieldName)) {//考勤二开--精密夜班餐补 // } else if ("nightAllowance".equals(fieldName)) {//考勤二开--精密夜班餐补
// bb.writeLog("nightAllowance"); //// bb.writeLog("nightAllowance");
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyNightShiftAllowanceData"); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyNightShiftAllowanceData");
// bb.writeLog("tempMap: " + tempMap); //// bb.writeLog("tempMap: " + tempMap);
if ( !tempMap.isEmpty()) { // if ( !tempMap.isEmpty()) {
double tempValue = 0.00; // double tempValue = 0.00;
for (String key: tempMap.keySet()) { // for (String key: tempMap.keySet()) {
double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); // double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key)));
tempValue = tempValue + (Math.max(doubleValue, 0.00)); // tempValue = tempValue + (Math.max(doubleValue, 0.00));
} // }
fieldValue = String.valueOf(tempValue); // fieldValue = String.valueOf(tempValue);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
data.add(fieldValue); // data.add(fieldValue);
continue; // continue;
} else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 // } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助
params.put("subUserId", id); // params.put("subUserId", id);
bb.writeLog("params: " + params ); // bb.writeLog("params: " + params );
//
Map<String, Object> temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); // Map<String, Object> temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user);
if (temp == null || temp.size() == 0) { // if (temp == null || temp.size() == 0) {
data.add( "0"); // data.add( "0");
} else { // } else {
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(temp, id + "|DailyNightShiftSubsidyData"); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(temp, id + "|DailyNightShiftSubsidyData");
//
if ( !tempMap.isEmpty()) { // if ( !tempMap.isEmpty()) {
int tempValue = 0; // int tempValue = 0;
for (String key: tempMap.keySet()) { // for (String key: tempMap.keySet()) {
int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); // int intValue = Util.getIntValue(Util.null2String(tempMap.get(key)));
tempValue = tempValue + (Math.max(intValue, 0)); // tempValue = tempValue + (Math.max(intValue, 0));
} // }
fieldValue = String.valueOf(tempValue); // fieldValue = String.valueOf(tempValue);
} // }
data.add( fieldValue); // data.add( fieldValue);
} // }
continue; // continue;
} else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补 // } else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补
// bb.writeLog("otherStatAllowance"); //// bb.writeLog("otherStatAllowance");
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyOtherStatAllowance"); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyOtherStatAllowance");
// bb.writeLog("tempMap: " + tempMap); //// bb.writeLog("tempMap: " + tempMap);
if ( !tempMap.isEmpty()) { // if ( !tempMap.isEmpty()) {
double tempValue = 0.00; // double tempValue = 0.00;
for (String key: tempMap.keySet()) { // for (String key: tempMap.keySet()) {
double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); // double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key)));
tempValue = tempValue + (doubleValue < 0.00 ? 0.00 : doubleValue); // tempValue = tempValue + (doubleValue < 0.00 ? 0.00 : doubleValue);
} // }
fieldValue = String.valueOf(tempValue); // fieldValue = String.valueOf(tempValue);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
data.add(fieldValue); // data.add(fieldValue);
continue; // continue;
} else if(Util.null2String(kqReportFieldComInfo.getCascadekey(fieldid)).length()>0){ } else if(Util.null2String(kqReportFieldComInfo.getCascadekey(fieldid)).length()>0){
fieldValue = Util.formatMultiLang(Util.null2String(rs.getString(fieldName)),""+user.getLanguage()); fieldValue = Util.formatMultiLang(Util.null2String(rs.getString(fieldName)),""+user.getLanguage());
data.add(fieldValue); data.add(fieldValue);

@ -145,7 +145,12 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
forgotBeginWorkCheck_field = " isnull(b.forgotBeginWorkCheck,0) "; forgotBeginWorkCheck_field = " isnull(b.forgotBeginWorkCheck,0) ";
} }
String backFields = " a.id,a.lastname,a.subcompanyid1 as subcompanyid,a.departmentid, a.workcode,b.jobtitle,a.dsporder," + String backFields = " (select zm.cccb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as mealAllowance," +
" (select zm.zdcb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as statAllowance," +
" (select zm.jmybcb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as nightAllowance," +
" (select zm.hrzdcb from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as otherStatAllowance," +
" (select zm.ybbz from uf_cbxxjlb zm where zm.xm = a.id and zm.rq = b.kqdate) as nightShiftSubsidy," +
" 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,FLOOR( b.attendanceMins / 30 ) * 30 AS attendanceMins," + " b.kqdate, b.workdays,b.workMins,b.serialid, b.attendancedays,FLOOR( b.attendanceMins / 30 ) * 30 AS attendanceMins," +
" b.beLate,b.beLateMins,b.graveBeLate,b.graveBeLateMins,b.leaveEearly,b.leaveEarlyMins," + " b.beLate,b.beLateMins,b.graveBeLate,b.graveBeLateMins,b.leaveEearly,b.leaveEarlyMins," +
" b.signdays,b.signmins, "+ " b.signdays,b.signmins, "+
@ -243,31 +248,31 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
KQSettingsComInfo kqSettingsComInfo = new KQSettingsComInfo(); KQSettingsComInfo kqSettingsComInfo = new KQSettingsComInfo();
String isShowFullPath = Util.null2String(kqSettingsComInfo.getMain_val(fullPathMainKey),"0"); String isShowFullPath = Util.null2String(kqSettingsComInfo.getMain_val(fullPathMainKey),"0");
/*考勤二开--驻点餐补start*/ // /*考勤二开--驻点餐补start*/
HostarUtil hostarUtil = new HostarUtil(); // HostarUtil hostarUtil = new HostarUtil();
List<String> subComoanyList = new ArrayList<>(); // List<String> subComoanyList = new ArrayList<>();
String acqNoStatAllSql = "select subcompany from uf_NoStatAllSubCom where isdelete = 0 or isdelete is null"; // String acqNoStatAllSql = "select subcompany from uf_NoStatAllSubCom where isdelete = 0 or isdelete is null";
rs.executeQuery(acqNoStatAllSql); // rs.executeQuery(acqNoStatAllSql);
while (rs.next()) { // while (rs.next()) {
String subcompany = Util.null2String(rs.getString("subcompany")); // String subcompany = Util.null2String(rs.getString("subcompany"));
if (StringUtils.isNotBlank(subcompany)) { // if (StringUtils.isNotBlank(subcompany)) {
subComoanyList.add(subcompany); // subComoanyList.add(subcompany);
} // }
} // }
bb.writeLog("subComoanyList: " + subComoanyList); // bb.writeLog("subComoanyList: " + subComoanyList);
/*考勤二开--驻点餐补end*/ // /*考勤二开--驻点餐补end*/
/*考勤二开--夜班餐补start*/ // /*考勤二开--夜班餐补start*/
String nightshiftsub = Util.null2String(bb.getPropValue("project_hostar", "nightshiftsubcompany")); // String nightshiftsub = Util.null2String(bb.getPropValue("project_hostar", "nightshiftsubcompany"));
List<String> nightshifts = new ArrayList<String>(); // List<String> nightshifts = new ArrayList<String>();
String acqSerialSql = " select shift from uf_nightshiftmanage where isdelete is null or isdelete = 0"; // String acqSerialSql = " select shift from uf_nightshiftmanage where isdelete is null or isdelete = 0";
rs.executeQuery(acqSerialSql); // rs.executeQuery(acqSerialSql);
while (rs.next()) { // while (rs.next()) {
String serial = Util.null2String(rs.getString("shift")); // String serial = Util.null2String(rs.getString("shift"));
if (StringUtils.isNotBlank(serial)) { // if (StringUtils.isNotBlank(serial)) {
nightshifts.add(serial); // nightshifts.add(serial);
} // }
} // }
/*考勤二开--夜班餐补end*/ // /*考勤二开--夜班餐补end*/
bb.writeLog("每日报表sql: " + sql); bb.writeLog("每日报表sql: " + sql);
@ -358,89 +363,89 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
if (fieldValue.length()>0) {//弹性工作制没有班次 if (fieldValue.length()>0) {//弹性工作制没有班次
data.put("serialid", shiftManagementToolKit.getShiftOnOffWorkSections(fieldValue, user.getLanguage())); data.put("serialid", shiftManagementToolKit.getShiftOnOffWorkSections(fieldValue, user.getLanguage()));
} }
} else if (fieldName.equals("mealAllowance")) {//考勤二开--出差餐补 // } else if (fieldName.equals("mealAllowance")) {//考勤二开--出差餐补
int intValue = Util.getIntValue(Util.null2String(flowData.get("DailyMealAllow|" + resourceId + "|" + kqdate))); // int intValue = Util.getIntValue(Util.null2String(flowData.get("DailyMealAllow|" + resourceId + "|" + kqdate)));
if (intValue < 0) { // if (intValue < 0) {
intValue = 0; // intValue = 0;
} // }
data.put(fieldName, intValue); // data.put(fieldName, intValue);
} else if (fieldName.equals("statAllowance")) {//考勤二开--驻点餐补 // } else if (fieldName.equals("statAllowance")) {//考勤二开--驻点餐补
String subcompanyId = Util.null2String(rs.getString("subcompanyid")); // String subcompanyId = Util.null2String(rs.getString("subcompanyid"));
//
if ( !subComoanyList.contains(subcompanyId)) { // if ( !subComoanyList.contains(subcompanyId)) {
//
params.put("statUser", id); // params.put("statUser", id);
params.put("kqdate", kqdate); // params.put("kqdate", kqdate);
bb.writeLog("params: " + params ); // bb.writeLog("params: " + params );
//
// long startTime = System.currentTimeMillis(); //// long startTime = System.currentTimeMillis();
Map<String, Object> dailyStatAllowanceData = kqReportBiz.getDailyStatAllowanceData(params, user); // Map<String, Object> dailyStatAllowanceData = kqReportBiz.getDailyStatAllowanceData(params, user);
// long endTime = System.currentTimeMillis(); //// long endTime = System.currentTimeMillis();
// long elapsedTime = endTime - startTime; // 执行时间 //// long elapsedTime = endTime - startTime; // 执行时间
// bb.writeLog("执行时间:" + elapsedTime/1000 + "秒"); //// bb.writeLog("执行时间:" + elapsedTime/1000 + "秒");
//
if (dailyStatAllowanceData == null || dailyStatAllowanceData.size() == 0) { // if (dailyStatAllowanceData == null || dailyStatAllowanceData.size() == 0) {
fieldValue = "0"; // fieldValue = "0";
} else { // } else {
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(dailyStatAllowanceData, id + "|DailyStatAllowance"); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(dailyStatAllowanceData, id + "|DailyStatAllowance");
// bb.writeLog("-=-=tempMap: " + tempMap); //// bb.writeLog("-=-=tempMap: " + tempMap);
// bb.writeLog("-=-=tempMap.key: " + id + "|DailyStatAllowance" + "|" + kqdate); //// bb.writeLog("-=-=tempMap.key: " + id + "|DailyStatAllowance" + "|" + kqdate);
double temp = Util.getDoubleValue(Util.null2String(tempMap.get(id + "|DailyStatAllowance" + "|" + kqdate ))); // double temp = Util.getDoubleValue(Util.null2String(tempMap.get(id + "|DailyStatAllowance" + "|" + kqdate )));
// bb.writeLog("-=-=temp: " + temp); //// bb.writeLog("-=-=temp: " + temp);
if (temp <= 0) { // if (temp <= 0) {
fieldValue = "0"; // fieldValue = "0";
} else { // } else {
fieldValue = String.valueOf(temp); // fieldValue = String.valueOf(temp);
} // }
} // }
//
bb.writeLog("-=-=fieldValue: " + fieldValue); // bb.writeLog("-=-=fieldValue: " + fieldValue);
} // }
data.put(fieldName, fieldValue); // data.put(fieldName, fieldValue);
} else if (fieldName.equals("nightAllowance")) {//考勤二开--精密夜班餐补 // } else if (fieldName.equals("nightAllowance")) {//考勤二开--精密夜班餐补
String subcompanyId = Util.null2String(rs.getString("subcompanyid")); // String subcompanyId = Util.null2String(rs.getString("subcompanyid"));
String serialid = Util.null2String(rs.getString("serialid")); // String serialid = Util.null2String(rs.getString("serialid"));
if ( subcompanyId.equals(nightshiftsub) && nightshifts.contains(serialid)) { // if ( subcompanyId.equals(nightshiftsub) && nightshifts.contains(serialid)) {
// String key= id + "|DailyNightShiftAllowanceData" + "|" + kqdate; //// String key= id + "|DailyNightShiftAllowanceData" + "|" + kqdate;
// bb.writeLog("nightAllowance key: " + key ); //// bb.writeLog("nightAllowance key: " + key );
double temp = Util.getDoubleValue(Util.null2String(flowData.get(id + "|DailyNightShiftAllowanceData" + "|" + kqdate ))); // double temp = Util.getDoubleValue(Util.null2String(flowData.get(id + "|DailyNightShiftAllowanceData" + "|" + kqdate )));
// bb.writeLog("nightAllowance temp: " + temp ); //// bb.writeLog("nightAllowance temp: " + temp );
// bb.writeLog("nightAllowance kqdate: " + kqdate ); //// bb.writeLog("nightAllowance kqdate: " + kqdate );
if (temp <= 0.00) { // if (temp <= 0.00) {
fieldValue = "0"; // fieldValue = "0";
} else { // } else {
fieldValue = String.valueOf(temp); // fieldValue = String.valueOf(temp);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
} // }
data.put(fieldName, fieldValue); // data.put(fieldName, fieldValue);
} else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 // } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助
params.put("subUserId", id); // params.put("subUserId", id);
bb.writeLog("params: " + params ); // bb.writeLog("params: " + params );
//
Map<String, Object> temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); // Map<String, Object> temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user);
// bb.writeLog("nightShiftSubsidy temp: " + temp ); //// bb.writeLog("nightShiftSubsidy temp: " + temp );
// bb.writeLog("nightShiftSubsidy temp.size: " + temp.size() ); //// bb.writeLog("nightShiftSubsidy temp.size: " + temp.size() );
// String key = id + "|DailyNightShiftSubsidyData" + kqdate; //// String key = id + "|DailyNightShiftSubsidyData" + kqdate;
// bb.writeLog("nightShiftSubsidy key: " + key ); //// bb.writeLog("nightShiftSubsidy key: " + key );
if (temp == null || temp.size() == 0) { // if (temp == null || temp.size() == 0) {
data.put(fieldName, "0"); // data.put(fieldName, "0");
} else { // } else {
double doubleValue = Math.max(Util.getDoubleValue(Util.null2String(temp.get(id + "|DailyNightShiftSubsidyData|" + kqdate))) , 0.00); // double doubleValue = Math.max(Util.getDoubleValue(Util.null2String(temp.get(id + "|DailyNightShiftSubsidyData|" + kqdate))) , 0.00);
// bb.writeLog("nightShiftSubsidy doubleValue: " + doubleValue ); //// bb.writeLog("nightShiftSubsidy doubleValue: " + doubleValue );
// bb.writeLog("nightShiftSubsidy kqdate: " + kqdate ); //// bb.writeLog("nightShiftSubsidy kqdate: " + kqdate );
data.put(fieldName, doubleValue); // data.put(fieldName, doubleValue);
} // }
//
} else if (fieldName.equals("otherStatAllowance")) {//考勤二开--鸿仁驻点餐补 // } else if (fieldName.equals("otherStatAllowance")) {//考勤二开--鸿仁驻点餐补
double temp = Util.getDoubleValue(Util.null2String(flowData.get(id + "|DailyOtherStatAllowance" + "|" + kqdate ))); // double temp = Util.getDoubleValue(Util.null2String(flowData.get(id + "|DailyOtherStatAllowance" + "|" + kqdate )));
if (temp <= 0.00) { // if (temp <= 0.00) {
fieldValue = "0"; // fieldValue = "0";
} else { // } else {
fieldValue = String.valueOf(temp); // fieldValue = String.valueOf(temp);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
data.put(fieldName, fieldValue); // data.put(fieldName, fieldValue);
} else { } else {
fieldValue = Util.null2String(rs.getString(fieldName)); fieldValue = Util.null2String(rs.getString(fieldName));
if (kqReportFieldComInfo.getUnittype().equals("2") && fieldValue.length() > 0) { if (kqReportFieldComInfo.getUnittype().equals("2") && fieldValue.length() > 0) {
@ -509,7 +514,7 @@ public class GetKQDailyReportCmd extends AbstractCommonCommand<Map<String, Objec
retmap.put("ishavepre", isHavePre); retmap.put("ishavepre", isHavePre);
retmap.put("ishavenext", isHaveNext); retmap.put("ishavenext", isHaveNext);
}catch (Exception e){ }catch (Exception e){
writeLog(e); bb.writeLog("GetKQDailyReportCmd error:" + e.getMessage());
} }
bb.writeLog("GetKQDailyReportCmd end."); bb.writeLog("GetKQDailyReportCmd end.");
return retmap; return retmap;

@ -39,6 +39,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
RecordSet rs = new RecordSet(); RecordSet rs = new RecordSet();
String sql = ""; String sql = "";
try{ try{
bb.writeLog("GetKQReportCmd start.");
String pageUid = PageUidFactory.getHrmPageUid("KQReport"); String pageUid = PageUidFactory.getHrmPageUid("KQReport");
SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo(); SubCompanyComInfo subCompanyComInfo = new SubCompanyComInfo();
@ -172,7 +173,12 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
Map<String,Object> definedFieldInfo = new KQFormatBiz().getDefinedField(); Map<String,Object> definedFieldInfo = new KQFormatBiz().getDefinedField();
String definedFieldSum = Util.null2String(definedFieldInfo.get("definedFieldSum")); String definedFieldSum = Util.null2String(definedFieldInfo.get("definedFieldSum"));
String backFields = " a.id,a.lastname,a.workcode,a.dsporder,b.resourceid,a.subcompanyid1 as subcompanyid,a.departmentid,a.jobtitle," + String backFields = " (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(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(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," + " sum(b.graveBeLate) as graveBeLate, sum(b.graveBeLateMins) as graveBeLateMins,sum(b.leaveEearly) as leaveEearly," +
@ -435,99 +441,99 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
} else{ } else{
fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id+"|"+fieldName))); fieldValue = KQDurationCalculatorUtil.getDurationRound(Util.null2String(flowData.get(id+"|"+fieldName)));
} }
} else if ("mealAllowance".equals(fieldName)) {//考勤二开--出差餐补 // } else if ("mealAllowance".equals(fieldName)) {//考勤二开--出差餐补
// bb.writeLog("mealAllowance"); //// bb.writeLog("mealAllowance");
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, "DailyMealAllow|" + resourceId); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, "DailyMealAllow|" + resourceId);
// bb.writeLog("tempMap: " + tempMap); //// bb.writeLog("tempMap: " + tempMap);
//
if ( !tempMap.isEmpty()) { // if ( !tempMap.isEmpty()) {
int tempValue = 0; // int tempValue = 0;
for (String key: tempMap.keySet()) { // for (String key: tempMap.keySet()) {
int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); // int intValue = Util.getIntValue(Util.null2String(tempMap.get(key)));
tempValue = tempValue + (Math.max(intValue, 0)); // tempValue = tempValue + (Math.max(intValue, 0));
} // }
fieldValue = String.valueOf(tempValue); // fieldValue = String.valueOf(tempValue);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
data.put(fieldName, fieldValue); // data.put(fieldName, fieldValue);
} else if ("statAllowance".equals(fieldName)) {//考勤二开--驻点餐补 // } else if ("statAllowance".equals(fieldName)) {//考勤二开--驻点餐补
bb.writeLog("statAllowance"); // bb.writeLog("statAllowance");
//
params.put("statUser", id); // params.put("statUser", id);
bb.writeLog("params: " + params ); // bb.writeLog("params: " + params );
//
Map<String, Object> temp = kqReportBiz.getStatAllowanceData(params, user); // Map<String, Object> temp = kqReportBiz.getStatAllowanceData(params, user);
if (temp == null || temp.size() == 0) { // if (temp == null || temp.size() == 0) {
data.put(fieldName, "0"); // data.put(fieldName, "0");
} else { // } else {
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(temp, id + "|StatAllowance"); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(temp, id + "|StatAllowance");
//
// Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyStatAllowance"); //// Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyStatAllowance");
// bb.writeLog("tempMap: " + tempMap); //// bb.writeLog("tempMap: " + tempMap);
if ( !tempMap.isEmpty()) { // if ( !tempMap.isEmpty()) {
double tempValue = 0.00; // double tempValue = 0.00;
for (String key: tempMap.keySet()) { // for (String key: tempMap.keySet()) {
double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); // double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key)));
tempValue = tempValue + (Math.max(doubleValue, 0.00)); // tempValue = tempValue + (Math.max(doubleValue, 0.00));
} // }
fieldValue = String.valueOf(tempValue); // fieldValue = String.valueOf(tempValue);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
data.put(fieldName, fieldValue); // data.put(fieldName, fieldValue);
} // }
//
//
} else if ("nightAllowance".equals(fieldName)) {//考勤二开--精密夜班餐补 // } else if ("nightAllowance".equals(fieldName)) {//考勤二开--精密夜班餐补
// bb.writeLog("nightAllowance"); //// bb.writeLog("nightAllowance");
// bb.writeLog("flowData: " + flowData); //// bb.writeLog("flowData: " + flowData);
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyNightShiftAllowanceData"); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyNightShiftAllowanceData");
// bb.writeLog("tempMap: " + tempMap); //// bb.writeLog("tempMap: " + tempMap);
if ( !tempMap.isEmpty()) { // if ( !tempMap.isEmpty()) {
double tempValue = 0.00; // double tempValue = 0.00;
for (String key: tempMap.keySet()) { // for (String key: tempMap.keySet()) {
double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); // double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key)));
tempValue = tempValue + (Math.max(doubleValue, 0.00)); // tempValue = tempValue + (Math.max(doubleValue, 0.00));
} // }
fieldValue = String.valueOf(tempValue); // fieldValue = String.valueOf(tempValue);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
data.put(fieldName, fieldValue); // data.put(fieldName, fieldValue);
} else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助 // } else if ("nightShiftSubsidy".equals(fieldName)) {//考勤二开--夜班补助
params.put("subUserId", id); // params.put("subUserId", id);
bb.writeLog("params: " + params ); // bb.writeLog("params: " + params );
//
Map<String, Object> temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user); // Map<String, Object> temp = kqReportBiz.getDailyNightShiftSubsidyData(params, user);
if (temp == null || temp.size() == 0) { // if (temp == null || temp.size() == 0) {
data.put(fieldName, "0"); // data.put(fieldName, "0");
} else { // } else {
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(temp, id + "|DailyNightShiftSubsidyData"); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(temp, id + "|DailyNightShiftSubsidyData");
//
if ( !tempMap.isEmpty()) { // if ( !tempMap.isEmpty()) {
int tempValue = 0; // int tempValue = 0;
for (String key: tempMap.keySet()) { // for (String key: tempMap.keySet()) {
int intValue = Util.getIntValue(Util.null2String(tempMap.get(key))); // int intValue = Util.getIntValue(Util.null2String(tempMap.get(key)));
tempValue = tempValue + (Math.max(intValue, 0)); // tempValue = tempValue + (Math.max(intValue, 0));
} // }
fieldValue = String.valueOf(tempValue); // fieldValue = String.valueOf(tempValue);
} // }
data.put(fieldName, fieldValue); // data.put(fieldName, fieldValue);
} // }
//
} else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补 // } else if ("otherStatAllowance".equals(fieldName)) {//考勤二开--鸿仁驻点餐补
// bb.writeLog("otherStatAllowance"); //// bb.writeLog("otherStatAllowance");
// bb.writeLog("flowData: " + flowData); //// bb.writeLog("flowData: " + flowData);
Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyOtherStatAllowance"); // Map<String, Object> tempMap = hostarUtil.parseMapForFilter(flowData, id + "|DailyOtherStatAllowance");
// bb.writeLog("tempMap: " + tempMap); //// bb.writeLog("tempMap: " + tempMap);
if ( !tempMap.isEmpty()) { // if ( !tempMap.isEmpty()) {
double tempValue = 0.00; // double tempValue = 0.00;
for (String key: tempMap.keySet()) { // for (String key: tempMap.keySet()) {
double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key))); // double doubleValue = Util.getDoubleValue(Util.null2String(tempMap.get(key)));
tempValue = tempValue + (Math.max(doubleValue, 0.00)); // tempValue = tempValue + (Math.max(doubleValue, 0.00));
} // }
fieldValue = String.valueOf(tempValue); // fieldValue = String.valueOf(tempValue);
} // }
// bb.writeLog("fieldValue: " + fieldValue); //// bb.writeLog("fieldValue: " + fieldValue);
data.put(fieldName, fieldValue); // data.put(fieldName, fieldValue);
} else { } else {
fieldValue = Util.null2String(rs.getString(fieldName)); fieldValue = Util.null2String(rs.getString(fieldName));
if(Util.null2String(kqReportFieldComInfo.getUnittype()).length()>0) { if(Util.null2String(kqReportFieldComInfo.getUnittype()).length()>0) {
@ -611,7 +617,7 @@ public class GetKQReportCmd extends AbstractCommonCommand<Map<String, Object>> {
retmap.put("ishavenext", isHaveNext); retmap.put("ishavenext", isHaveNext);
}catch (Exception e){ }catch (Exception e){
writeLog(e); writeLog(e);
bb.writeLog("GetKQReportCmd Exception: " + e); bb.writeLog("GetKQReportCmd Exception: " + e.getMessage());
} }
return retmap; return retmap;
} }

Loading…
Cancel
Save