...
|
...
|
@@ -408,3 +408,151 @@ func (data ExportWorkshopProductiveData) DataListLen() int { |
|
|
func (data ExportWorkshopProductiveData) TableTitle() []string {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
//ExportEmployeeAttendanceStaticsData 导出员工产能数据
|
|
|
type ExportEmployeeAttendanceStaticsData struct {
|
|
|
SourceData []allied_creation_manufacture.SearchEmployeeAttendanceStaticsItem
|
|
|
SelectedField []string
|
|
|
}
|
|
|
|
|
|
var _ excel.ExcelMaker = (*ExportEmployeeAttendanceStaticsData)(nil)
|
|
|
|
|
|
func (data ExportEmployeeAttendanceStaticsData) AllFields() []DataFieldOptions {
|
|
|
return []DataFieldOptions{
|
|
|
{EnName: "signDate", CnName: "日期"},
|
|
|
{EnName: "workshopName", CnName: "车间名称"},
|
|
|
{EnName: "lineName", CnName: "线别"},
|
|
|
{EnName: "sectionName", CnName: "工段"},
|
|
|
{EnName: "userName", CnName: "姓名"},
|
|
|
{EnName: "employeeTypeDescription", CnName: "员工类型"},
|
|
|
{EnName: "attendanceTypeDescription", CnName: "类别"},
|
|
|
{EnName: "workTime", CnName: "工时"},
|
|
|
{EnName: "attendanceStatusDescription", CnName: "状态"},
|
|
|
{EnName: "orgName", CnName: "组织机构"},
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (data ExportEmployeeAttendanceStaticsData) DataFieldList() []excel.DataField {
|
|
|
fields := []excel.DataField{}
|
|
|
allFields := data.AllFields()
|
|
|
for _, value2 := range allFields {
|
|
|
if len(data.SelectedField) == 0 || value2.IsDefault {
|
|
|
fields = append(fields, excel.DataField{EnName: value2.EnName, CnName: value2.CnName})
|
|
|
continue
|
|
|
}
|
|
|
for _, value3 := range data.SelectedField {
|
|
|
if value2.EnName == value3 {
|
|
|
fields = append(fields, excel.DataField{EnName: value2.EnName, CnName: value2.CnName})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return fields
|
|
|
}
|
|
|
|
|
|
func (data ExportEmployeeAttendanceStaticsData) CellValue(index int, enName string) (value interface{}) {
|
|
|
if index > data.DataListLen() {
|
|
|
return ""
|
|
|
}
|
|
|
switch enName {
|
|
|
case "signDate":
|
|
|
return data.SourceData[index].SignDate
|
|
|
case "workshopName":
|
|
|
return data.SourceData[index].WorkshopName
|
|
|
case "lineName":
|
|
|
return data.SourceData[index].LineName
|
|
|
case "sectionName":
|
|
|
return data.SourceData[index].SectionName
|
|
|
case "userName":
|
|
|
return data.SourceData[index].ProductWorker.UserName
|
|
|
case "employeeTypeDescription":
|
|
|
return data.SourceData[index].EmployeeTypeDescription
|
|
|
case "attendanceTypeDescription":
|
|
|
return data.SourceData[index].AttendanceTypeDescription
|
|
|
case "workTime":
|
|
|
return fmt.Sprintf("%vh", data.SourceData[index].WorkTime)
|
|
|
case "attendanceStatusDescription":
|
|
|
return data.SourceData[index].AttendanceStatusDescription
|
|
|
case "orgName":
|
|
|
return data.SourceData[index].OrgName
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
func (data ExportEmployeeAttendanceStaticsData) DataListLen() int {
|
|
|
return len(data.SourceData)
|
|
|
}
|
|
|
|
|
|
func (data ExportEmployeeAttendanceStaticsData) TableTitle() []string {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
//ExportWorkshopAttendanceStaticsData 导出车间工时统计
|
|
|
type ExportWorkshopAttendanceStaticsData struct {
|
|
|
SourceData []allied_creation_manufacture.SearchWorkshopWorkTimeStaticsItem
|
|
|
SelectedField []string
|
|
|
}
|
|
|
|
|
|
var _ excel.ExcelMaker = (*ExportWorkshopAttendanceStaticsData)(nil)
|
|
|
|
|
|
func (data ExportWorkshopAttendanceStaticsData) AllFields() []DataFieldOptions {
|
|
|
return []DataFieldOptions{
|
|
|
{EnName: "recordDate", CnName: "日期"},
|
|
|
{EnName: "workshopName", CnName: "车间名称"},
|
|
|
{EnName: "lineName", CnName: "线别"},
|
|
|
{EnName: "sectionName", CnName: "工段"},
|
|
|
{EnName: "eftWorkTime", CnName: "固定工时"},
|
|
|
{EnName: "edWorkTime", CnName: "临时工时"},
|
|
|
{EnName: "epWorkTime", CnName: "派遣工时"},
|
|
|
{EnName: "orgName", CnName: "组织机构"},
|
|
|
}
|
|
|
}
|
|
|
|
|
|
func (data ExportWorkshopAttendanceStaticsData) DataFieldList() []excel.DataField {
|
|
|
fields := []excel.DataField{}
|
|
|
allFields := data.AllFields()
|
|
|
for _, value2 := range allFields {
|
|
|
if len(data.SelectedField) == 0 || value2.IsDefault {
|
|
|
fields = append(fields, excel.DataField{EnName: value2.EnName, CnName: value2.CnName})
|
|
|
continue
|
|
|
}
|
|
|
for _, value3 := range data.SelectedField {
|
|
|
if value2.EnName == value3 {
|
|
|
fields = append(fields, excel.DataField{EnName: value2.EnName, CnName: value2.CnName})
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return fields
|
|
|
}
|
|
|
|
|
|
func (data ExportWorkshopAttendanceStaticsData) CellValue(index int, enName string) (value interface{}) {
|
|
|
if index > data.DataListLen() {
|
|
|
return ""
|
|
|
}
|
|
|
switch enName {
|
|
|
case "recordDate":
|
|
|
return data.SourceData[index].RecordDate
|
|
|
case "workshopName":
|
|
|
return data.SourceData[index].WorkshopName
|
|
|
case "lineName":
|
|
|
return data.SourceData[index].LineName
|
|
|
case "sectionName":
|
|
|
return data.SourceData[index].SectionName
|
|
|
case "eftWorkTime":
|
|
|
return data.SourceData[index].EftWorkTime
|
|
|
case "edWorkTime":
|
|
|
return data.SourceData[index].EdWorkTime
|
|
|
case "epWorkTime":
|
|
|
return data.SourceData[index].EptWorkTime
|
|
|
case "orgName":
|
|
|
return data.SourceData[index].OrgName
|
|
|
}
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
func (data ExportWorkshopAttendanceStaticsData) DataListLen() int {
|
|
|
return len(data.SourceData)
|
|
|
}
|
|
|
|
|
|
func (data ExportWorkshopAttendanceStaticsData) TableTitle() []string {
|
|
|
return nil
|
|
|
} |
...
|
...
|
|