...
|
...
|
@@ -64,15 +64,15 @@ func (srv ExcelDataService) ImportDataAttendance(importDataCommand *command.Impo |
|
|
excelImport := excel.NewExcelImport()
|
|
|
excelImport.RowBegin = 3 //第二行开始读取
|
|
|
excelImport.DataFields = []excel.DataField{
|
|
|
{EnName: "ProductDate", CnName: "日期"},
|
|
|
{EnName: "WorkshopName", CnName: "车间"},
|
|
|
{EnName: "LineName", CnName: "线别"},
|
|
|
{EnName: "SectionName", CnName: "工段"},
|
|
|
{EnName: "WorkerName", CnName: "姓名"},
|
|
|
{EnName: "AttendanceType", CnName: "类型"},
|
|
|
{EnName: "SignIn", CnName: "上岗时间"},
|
|
|
{EnName: "SignOut", CnName: "离岗时间"},
|
|
|
{EnName: "BreakTime", CnName: "休息时长(小时)"},
|
|
|
{EnName: "productDate", CnName: "日期"},
|
|
|
{EnName: "workshopName", CnName: "车间"},
|
|
|
{EnName: "lineName", CnName: "线别"},
|
|
|
{EnName: "sectionName", CnName: "工段"},
|
|
|
{EnName: "workerName", CnName: "姓名"},
|
|
|
{EnName: "attendanceType", CnName: "类型"},
|
|
|
{EnName: "signIn", CnName: "上岗时间"},
|
|
|
{EnName: "signOut", CnName: "离岗时间"},
|
|
|
{EnName: "breakTime", CnName: "休息时长(小时)"},
|
|
|
}
|
|
|
excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader)
|
|
|
if err != nil {
|
...
|
...
|
@@ -81,15 +81,15 @@ func (srv ExcelDataService) ImportDataAttendance(importDataCommand *command.Impo |
|
|
items := make([]importAttendance, 0)
|
|
|
for _, v := range excelData {
|
|
|
item := importAttendance{
|
|
|
ProductDate: strings.TrimSpace(v["ProductDate"]),
|
|
|
WorkshopName: strings.TrimSpace(v["WorkshopName"]),
|
|
|
LineName: strings.TrimSpace(v["LineName"]),
|
|
|
SectionName: strings.TrimSpace(v["SectionName"]),
|
|
|
WorkerName: strings.TrimSpace(v["WorkerName"]),
|
|
|
AttendanceType: strings.TrimSpace(v["AttendanceType"]),
|
|
|
SignIn: strings.TrimSpace(v["SignIn"]),
|
|
|
SignOut: strings.TrimSpace(v["SignOut"]),
|
|
|
BreakTime: strings.TrimSpace(v["BreakTime"]),
|
|
|
ProductDate: strings.TrimSpace(v["productDate"]),
|
|
|
WorkshopName: strings.TrimSpace(v["workshopName"]),
|
|
|
LineName: strings.TrimSpace(v["lineName"]),
|
|
|
SectionName: strings.TrimSpace(v["sectionName"]),
|
|
|
WorkerName: strings.TrimSpace(v["workerName"]),
|
|
|
AttendanceType: strings.TrimSpace(v["attendanceType"]),
|
|
|
SignIn: strings.TrimSpace(v["signIn"]),
|
|
|
SignOut: strings.TrimSpace(v["signOut"]),
|
|
|
BreakTime: strings.TrimSpace(v["breakTime"]),
|
|
|
FailReason: "",
|
|
|
}
|
|
|
items = append(items, item)
|
...
|
...
|
|