作者 Your Name

Merge branch 'dev' into test

... ... @@ -2,6 +2,7 @@ package service
import (
"errors"
"fmt"
"strconv"
"strings"
"time"
... ... @@ -216,21 +217,22 @@ func (srv ExcelDataService) BatchAddAttendance(operate domain.OperateInfo, param
continue
}
//检查上岗时间格式
signIn, err := time.ParseInLocation("15:04:05", param[i].SignIn, time.Local)
signInStr := fmt.Sprintf("%s %s", param[i].ProductDate, param[i].SignIn)
signIn, err := time.ParseInLocation("2006-01-02 15:04:05", signInStr, time.Local)
if err != nil {
param[i].FailReason = "上岗时间格式错误,例 15:04:05。"
failRows = append(failRows, param[i])
continue
}
signIn = productDate.Add(time.Duration(signIn.Second()) * time.Second)
//检查离岗时间格式
signOut, err := time.ParseInLocation("15:04:05", param[i].SignOut, time.Local)
signOutStr := fmt.Sprintf("%s %s", param[i].ProductDate, param[i].SignOut)
signOut, err := time.ParseInLocation("2006-01-02 15:04:05", signOutStr, time.Local)
if err != nil {
param[i].FailReason = "离岗时间格式错误,例 15:04:05。"
failRows = append(failRows, param[i])
continue
}
signOut = productDate.Add(time.Duration(signOut.Second()) * time.Second)
//检查员工姓名
var worker *domain.User
workKey := param[i].WorkshopName + "/" + param[i].WorkerName
... ...