...
|
...
|
@@ -25,7 +25,7 @@ func (ptr *PGWorkerAttendanceReportService) Report(cid, oid int, report *domain. |
|
|
record *domain.ProductAttendanceRecord
|
|
|
//workStationId string //具体工位
|
|
|
workStation *domain.WorkStation
|
|
|
attendanceType int = domain.ParticipateNormal
|
|
|
attendanceType int = domain.ParticipateSupport
|
|
|
worker *domain.User
|
|
|
org *domain.Org
|
|
|
)
|
...
|
...
|
@@ -59,15 +59,14 @@ func (ptr *PGWorkerAttendanceReportService) Report(cid, oid int, report *domain. |
|
|
}
|
|
|
|
|
|
groupMembers, groupMembersKeyFunc := FindGroupMembers(productGroupRepository, cid, oid, workStation.WorkStationId)
|
|
|
if v, ok := groupMembers[groupMembersKeyFunc(worker.UserId)]; !ok {
|
|
|
attendanceType = domain.ParticipateSupport
|
|
|
} else {
|
|
|
if v, ok := groupMembers[groupMembersKeyFunc(worker.UserId)]; ok {
|
|
|
attendanceType = domain.ParticipateNormal
|
|
|
groupId = v.GroupId
|
|
|
groupName = v.GroupName
|
|
|
}
|
|
|
|
|
|
beginTime := utils.GetZeroTime(report.ActionTime)
|
|
|
endTime := report.ActionTime
|
|
|
endTime := time.Now()
|
|
|
_, records, _ := attendanceRecordDao.WorkerAttendanceRecords(cid, oid, worker.UserId, "", beginTime, endTime)
|
|
|
for i := 0; i < len(records); i++ {
|
|
|
r := records[i]
|
...
|
...
|
@@ -106,6 +105,12 @@ func (ptr *PGWorkerAttendanceReportService) Report(cid, oid int, report *domain. |
|
|
log.Logger.Debug(fmt.Sprintf("【考勤汇报】 已存在同一时间段的考勤记录 考勤ID:%v 用户:%v 打卡时间:%v", r.ProductAttendanceId, worker.UserId, report.ActionTime))
|
|
|
return struct{}{}, nil
|
|
|
}
|
|
|
if r.WorkStation.WorkStationId == workStation.WorkStationId && utils.TimeAfterEqual(r.SignOut.Add(time.Minute*5), report.ActionTime) {
|
|
|
isSignIn = false
|
|
|
record = r
|
|
|
log.Logger.Debug(fmt.Sprintf("【考勤汇报】 已存在同一时间段的考勤记录,小于离岗时间5min 考勤ID:%v 用户:%v 打卡时间:%v", r.ProductAttendanceId, worker.UserId, report.ActionTime))
|
|
|
break
|
|
|
}
|
|
|
continue
|
|
|
}
|
|
|
// 存在未结束的打卡记录
|
...
|
...
|
|