|
@@ -700,13 +700,13 @@ public class SwdlServiceImpl extends GenericProvider implements SwdlService {
|
|
|
boolean hasAttendance = false;
|
|
boolean hasAttendance = false;
|
|
|
boolean isNormalDay = true;
|
|
boolean isNormalDay = true;
|
|
|
boolean isAbnormalDay = false;
|
|
boolean isAbnormalDay = false;
|
|
|
|
|
+ boolean isAbsenteeism = false;//改天是否存在旷工班次
|
|
|
|
|
|
|
|
boolean existAttendanceDay = false;// 非休息班次标记,当天只有有一个非休息班次就统计为true
|
|
boolean existAttendanceDay = false;// 非休息班次标记,当天只有有一个非休息班次就统计为true
|
|
|
// 比较当前记录日期与系统日期
|
|
// 比较当前记录日期与系统日期
|
|
|
int dateCompare = date.compareTo(systemDate);
|
|
int dateCompare = date.compareTo(systemDate);
|
|
|
//应出勤天数过滤,一天需要出勤多个班次只统计为一天
|
|
//应出勤天数过滤,一天需要出勤多个班次只统计为一天
|
|
|
Map shouldAttendance = new HashMap<String,Object>();
|
|
Map shouldAttendance = new HashMap<String,Object>();
|
|
|
-
|
|
|
|
|
for (Map<String, Object> record : dateRecords) {//统计次数放里面
|
|
for (Map<String, Object> record : dateRecords) {//统计次数放里面
|
|
|
String shiftName = BeanUtils.isNotEmpty("ban_ci_ming_") ? (String) record.get("ban_ci_ming_") : "";
|
|
String shiftName = BeanUtils.isNotEmpty("ban_ci_ming_") ? (String) record.get("ban_ci_ming_") : "";
|
|
|
String status1 = BeanUtils.isNotEmpty("zhuang_tai_1_") ? (String) record.get("zhuang_tai_1_") : "";
|
|
String status1 = BeanUtils.isNotEmpty("zhuang_tai_1_") ? (String) record.get("zhuang_tai_1_") : "";
|
|
@@ -792,16 +792,18 @@ public class SwdlServiceImpl extends GenericProvider implements SwdlService {
|
|
|
if (dateCompare < 0) {
|
|
if (dateCompare < 0) {
|
|
|
if (checkIn1 == null || checkIn1.isEmpty()) {
|
|
if (checkIn1 == null || checkIn1.isEmpty()) {
|
|
|
increment(userStats, "kuang_gong_ci_shu", 1);
|
|
increment(userStats, "kuang_gong_ci_shu", 1);
|
|
|
|
|
+ isAbsenteeism = true;
|
|
|
}
|
|
}
|
|
|
if (checkIn2 == null || checkIn2.isEmpty()) {
|
|
if (checkIn2 == null || checkIn2.isEmpty()) {
|
|
|
increment(userStats, "kuang_gong_ci_shu", 1);
|
|
increment(userStats, "kuang_gong_ci_shu", 1);
|
|
|
|
|
+ isAbsenteeism = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 8. 班次时长统计
|
|
|
|
|
|
|
+ // 8. 班次时长统计,标准工作时长
|
|
|
if (shiftDuration != null && !shiftDuration.isEmpty()) {
|
|
if (shiftDuration != null && !shiftDuration.isEmpty()) {
|
|
|
try {
|
|
try {
|
|
|
- double duration = Double.parseDouble(shiftDuration);
|
|
|
|
|
|
|
+ double duration = Double.parseDouble(shiftDuration)/60;
|
|
|
addTo(userStats, "ban_ci_shi_chang", duration);
|
|
addTo(userStats, "ban_ci_shi_chang", duration);
|
|
|
} catch (NumberFormatException e) {
|
|
} catch (NumberFormatException e) {
|
|
|
// 忽略格式错误
|
|
// 忽略格式错误
|
|
@@ -811,7 +813,7 @@ public class SwdlServiceImpl extends GenericProvider implements SwdlService {
|
|
|
// 9. 实际工作时长统计
|
|
// 9. 实际工作时长统计
|
|
|
if (workDuration != null && !workDuration.isEmpty()) {
|
|
if (workDuration != null && !workDuration.isEmpty()) {
|
|
|
try {
|
|
try {
|
|
|
- double duration = Double.parseDouble(workDuration);
|
|
|
|
|
|
|
+ double duration = Double.parseDouble(workDuration)/60;
|
|
|
addTo(userStats, "gong_zuo_shi_chang", duration);
|
|
addTo(userStats, "gong_zuo_shi_chang", duration);
|
|
|
} catch (NumberFormatException e) {
|
|
} catch (NumberFormatException e) {
|
|
|
// 忽略格式错误
|
|
// 忽略格式错误
|
|
@@ -862,8 +864,19 @@ public class SwdlServiceImpl extends GenericProvider implements SwdlService {
|
|
|
if (!isRestDay && isAbnormalDay && dateCompare <= 0) {
|
|
if (!isRestDay && isAbnormalDay && dateCompare <= 0) {
|
|
|
increment(userStats, "yi_chang_tian_shu", 1);
|
|
increment(userStats, "yi_chang_tian_shu", 1);
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
|
|
+ /* //旷工天数
|
|
|
|
|
+ if(!isRestDay && existAttendanceDay && isAbsenteeism && dateCompare < 0){
|
|
|
|
|
+ increment(userStats, "kuang_gong_tian_shu", 1);
|
|
|
|
|
+ }*/
|
|
|
|
|
+ }
|
|
|
|
|
+ //异常次数需要包含旷工次数,异常天数也需要包含旷工天数
|
|
|
|
|
+ int numkgcs = (Integer) userStats.get("kuang_gong_ci_shu");
|
|
|
|
|
+ int numyccs = (Integer) userStats.get("yi_chang_ci_shu");
|
|
|
|
|
+ int yiChangCiShu = (numkgcs + numyccs);
|
|
|
|
|
+ userStats.put("yi_chang_ci_shu",yiChangCiShu);
|
|
|
|
|
+ //String yiChangTianShu = userStats.get("yi_chang_tian_shu").toString() + userStats.get("kuang_gong_tian_shu").toString();
|
|
|
|
|
+ //userStats.put("yi_chang_tian_shu",yiChangTianShu);
|
|
|
// 将用户统计结果添加到List中
|
|
// 将用户统计结果添加到List中
|
|
|
resultList.add(userStats);
|
|
resultList.add(userStats);
|
|
|
}
|
|
}
|
|
@@ -887,6 +900,7 @@ public class SwdlServiceImpl extends GenericProvider implements SwdlService {
|
|
|
stats.put("user_name_",userRecords.get(0).get("user_name_"));
|
|
stats.put("user_name_",userRecords.get(0).get("user_name_"));
|
|
|
stats.put("pos_name_",userRecords.get(0).get("pos_name_"));
|
|
stats.put("pos_name_",userRecords.get(0).get("pos_name_"));
|
|
|
stats.put("gong_hao_",userRecords.get(0).get("gong_hao_"));
|
|
stats.put("gong_hao_",userRecords.get(0).get("gong_hao_"));
|
|
|
|
|
+ stats.put("kuang_gong_tian_shu", 0);
|
|
|
return stats;
|
|
return stats;
|
|
|
}
|
|
}
|
|
|
|
|
|