|
@@ -528,6 +528,8 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
|
|
|
saveWorkAttendance(personId, temperature, recordTime, date.toString("yyyy-MM-dd"), workPersonScheduling.getId(),
|
|
|
workEndShift.getId(), result, minutes, "2", workStatus,workOverPerson);
|
|
|
|
|
|
+ //计算本班次上班时间
|
|
|
+
|
|
|
//查询当前下班的班次是否与其它班次有连班,如果有则将之前连班最早的上班打卡到现在下班打卡之间的班次都算正常上下
|
|
|
// workJoin(personId, temperature, date, workPersonScheduling, shiftList, fullFormat, workEndShift, endIndex, personInfo);
|
|
|
}
|
|
@@ -623,6 +625,7 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
|
|
|
String personScheduleId, String workShiftId, String result, Integer minutes,
|
|
|
String classify, String workStatus, WorkOverPerson workOverPerson) {
|
|
|
long offsetMinute = 0;
|
|
|
+ int workMinutes = 0;
|
|
|
|
|
|
try {
|
|
|
WorkShiftInfo workShiftInfo = workShiftInfoService.get(workShiftId);
|
|
@@ -642,6 +645,21 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
|
|
|
closingTime = closingTime.plusDays(workShiftInfo.getClosingDayType());
|
|
|
|
|
|
offsetMinute = Minutes.minutesBetween(new DateTime(recordTime), closingTime).getMinutes();
|
|
|
+
|
|
|
+ //计算本班次上班时长(下班时间-上班时间)
|
|
|
+ List<WorkScheduleAttendance> onWorkList = workScheduleAttendanceDAO.findByPersonScheduleIdAndClassify(personScheduleId, workShiftId, "1");
|
|
|
+
|
|
|
+ if(onWorkList.size()>0){
|
|
|
+ WorkScheduleAttendance workStartAttendance = onWorkList.get(0);
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(workStartAttendance.getResult()) &&
|
|
|
+ !"0".equals(workStartAttendance.getResult())){
|
|
|
+ workMinutes = Minutes.minutesBetween(
|
|
|
+ new DateTime(workStartAttendance.getRecordTime()),
|
|
|
+ new DateTime(recordTime))
|
|
|
+ .getMinutes();
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -668,6 +686,7 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
|
|
|
workEndAttendance.setRecordTime(recordTime);
|
|
|
workEndAttendance.setCreateTime(new Date());
|
|
|
workEndAttendance.setOffsetMinute(new BigDecimal(offsetMinute));
|
|
|
+ workEndAttendance.setWorkMinute(new BigDecimal(workMinutes));
|
|
|
|
|
|
if(workOverPerson!=null){
|
|
|
workEndAttendance.setWorkOverPersonId(workOverPerson.getId());
|
|
@@ -685,6 +704,7 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
|
|
|
workEndAttendance.setRecordTime(recordTime);
|
|
|
workEndAttendance.setUpdateTime(new Date());
|
|
|
workEndAttendance.setOffsetMinute(new BigDecimal(offsetMinute));
|
|
|
+ workEndAttendance.setWorkMinute(new BigDecimal(workMinutes));
|
|
|
|
|
|
if(workOverPerson!=null){
|
|
|
workEndAttendance.setWorkOverPersonId(workOverPerson.getId());
|
|
@@ -694,7 +714,7 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private List<WorkScheduleAttendance> findByPersonScheduleIdAndClassify(String personScheduleId, String workShiftId, String classify) {
|
|
|
+ public List<WorkScheduleAttendance> findByPersonScheduleIdAndClassify(String personScheduleId, String workShiftId, String classify) {
|
|
|
List<WorkScheduleAttendance> attendanceList = workScheduleAttendanceDAO.findByPersonScheduleIdAndClassify(personScheduleId, workShiftId, classify);
|
|
|
|
|
|
return attendanceList;
|
|
@@ -1250,4 +1270,14 @@ public class WorkScheduleAttendanceServiceImpl implements WorkScheduleAttendance
|
|
|
public List<Map> statScheduleAttendanceByDate(Long personId, Date startDate, Date endDate) {
|
|
|
return workScheduleAttendanceDAO.statScheduleAttendanceByDate(personId,startDate,endDate);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<WorkScheduleAttendance> findEmptyWorkMinuteList(int limit) {
|
|
|
+ return workScheduleAttendanceDAO.findEmptyWorkMinuteList(limit);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int updateWorkMinute(WorkScheduleAttendance wsa) {
|
|
|
+ return workScheduleAttendanceDAO.updateWorkMinute(wsa);
|
|
|
+ }
|
|
|
}
|