正在显示
5 个修改的文件
包含
69 行增加
和
69 行删除
@@ -64,15 +64,15 @@ func (srv ExcelDataService) ImportDataAttendance(importDataCommand *command.Impo | @@ -64,15 +64,15 @@ func (srv ExcelDataService) ImportDataAttendance(importDataCommand *command.Impo | ||
64 | excelImport := excel.NewExcelImport() | 64 | excelImport := excel.NewExcelImport() |
65 | excelImport.RowBegin = 3 //第二行开始读取 | 65 | excelImport.RowBegin = 3 //第二行开始读取 |
66 | excelImport.DataFields = []excel.DataField{ | 66 | excelImport.DataFields = []excel.DataField{ |
67 | - {EnName: "ProductDate", CnName: "日期"}, | ||
68 | - {EnName: "WorkshopName", CnName: "车间"}, | ||
69 | - {EnName: "LineName", CnName: "线别"}, | ||
70 | - {EnName: "SectionName", CnName: "工段"}, | ||
71 | - {EnName: "WorkerName", CnName: "姓名"}, | ||
72 | - {EnName: "AttendanceType", CnName: "类型"}, | ||
73 | - {EnName: "SignIn", CnName: "上岗时间"}, | ||
74 | - {EnName: "SignOut", CnName: "离岗时间"}, | ||
75 | - {EnName: "BreakTime", CnName: "休息时长(小时)"}, | 67 | + {EnName: "productDate", CnName: "日期"}, |
68 | + {EnName: "workshopName", CnName: "车间"}, | ||
69 | + {EnName: "lineName", CnName: "线别"}, | ||
70 | + {EnName: "sectionName", CnName: "工段"}, | ||
71 | + {EnName: "workerName", CnName: "姓名"}, | ||
72 | + {EnName: "attendanceType", CnName: "类型"}, | ||
73 | + {EnName: "signIn", CnName: "上岗时间"}, | ||
74 | + {EnName: "signOut", CnName: "离岗时间"}, | ||
75 | + {EnName: "breakTime", CnName: "休息时长(小时)"}, | ||
76 | } | 76 | } |
77 | excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader) | 77 | excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader) |
78 | if err != nil { | 78 | if err != nil { |
@@ -81,15 +81,15 @@ func (srv ExcelDataService) ImportDataAttendance(importDataCommand *command.Impo | @@ -81,15 +81,15 @@ func (srv ExcelDataService) ImportDataAttendance(importDataCommand *command.Impo | ||
81 | items := make([]importAttendance, 0) | 81 | items := make([]importAttendance, 0) |
82 | for _, v := range excelData { | 82 | for _, v := range excelData { |
83 | item := importAttendance{ | 83 | item := importAttendance{ |
84 | - ProductDate: strings.TrimSpace(v["ProductDate"]), | ||
85 | - WorkshopName: strings.TrimSpace(v["WorkshopName"]), | ||
86 | - LineName: strings.TrimSpace(v["LineName"]), | ||
87 | - SectionName: strings.TrimSpace(v["SectionName"]), | ||
88 | - WorkerName: strings.TrimSpace(v["WorkerName"]), | ||
89 | - AttendanceType: strings.TrimSpace(v["AttendanceType"]), | ||
90 | - SignIn: strings.TrimSpace(v["SignIn"]), | ||
91 | - SignOut: strings.TrimSpace(v["SignOut"]), | ||
92 | - BreakTime: strings.TrimSpace(v["BreakTime"]), | 84 | + ProductDate: strings.TrimSpace(v["productDate"]), |
85 | + WorkshopName: strings.TrimSpace(v["workshopName"]), | ||
86 | + LineName: strings.TrimSpace(v["lineName"]), | ||
87 | + SectionName: strings.TrimSpace(v["sectionName"]), | ||
88 | + WorkerName: strings.TrimSpace(v["workerName"]), | ||
89 | + AttendanceType: strings.TrimSpace(v["attendanceType"]), | ||
90 | + SignIn: strings.TrimSpace(v["signIn"]), | ||
91 | + SignOut: strings.TrimSpace(v["signOut"]), | ||
92 | + BreakTime: strings.TrimSpace(v["breakTime"]), | ||
93 | FailReason: "", | 93 | FailReason: "", |
94 | } | 94 | } |
95 | items = append(items, item) | 95 | items = append(items, item) |
@@ -14,14 +14,14 @@ func (srv ExcelDataService) ImportProductCapacities(importDataCommand *command.I | @@ -14,14 +14,14 @@ func (srv ExcelDataService) ImportProductCapacities(importDataCommand *command.I | ||
14 | excelImport := excel.NewExcelImport() | 14 | excelImport := excel.NewExcelImport() |
15 | excelImport.RowBegin = 3 //第二行开始读取 | 15 | excelImport.RowBegin = 3 //第二行开始读取 |
16 | excelImport.DataFields = []excel.DataField{ | 16 | excelImport.DataFields = []excel.DataField{ |
17 | - {EnName: "RecordDate", CnName: "日期"}, | ||
18 | - {EnName: "WorkshopName", CnName: "车间"}, | ||
19 | - {EnName: "LineName", CnName: "线别"}, | ||
20 | - {EnName: "SectionName", CnName: "工段"}, | ||
21 | - {EnName: "WorkOn", CnName: "班别"}, | ||
22 | - {EnName: "WorkerName", CnName: "姓名"}, | ||
23 | - {EnName: "BatchNumber", CnName: "批次号"}, | ||
24 | - {EnName: "Weigh", CnName: "产量(kg)"}, | 17 | + {EnName: "recordDate", CnName: "日期"}, |
18 | + {EnName: "workshopName", CnName: "车间"}, | ||
19 | + {EnName: "lineName", CnName: "线别"}, | ||
20 | + {EnName: "sectionName", CnName: "工段"}, | ||
21 | + {EnName: "workOn", CnName: "班别"}, | ||
22 | + {EnName: "workerName", CnName: "姓名"}, | ||
23 | + {EnName: "batchNumber", CnName: "批次号"}, | ||
24 | + {EnName: "weigh", CnName: "产量(kg)"}, | ||
25 | } | 25 | } |
26 | excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader) | 26 | excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader) |
27 | if err != nil { | 27 | if err != nil { |
@@ -31,14 +31,14 @@ func (srv ExcelDataService) ImportProductCapacities(importDataCommand *command.I | @@ -31,14 +31,14 @@ func (srv ExcelDataService) ImportProductCapacities(importDataCommand *command.I | ||
31 | item := productRecordCommand.BatchAddProductCapacitiesCmd{} | 31 | item := productRecordCommand.BatchAddProductCapacitiesCmd{} |
32 | for _, v := range excelData { | 32 | for _, v := range excelData { |
33 | item = productRecordCommand.BatchAddProductCapacitiesCmd{ | 33 | item = productRecordCommand.BatchAddProductCapacitiesCmd{ |
34 | - RecordDate: v["RecordDate"], | ||
35 | - WorkshopName: v["WorkshopName"], | ||
36 | - LineName: v["LineName"], | ||
37 | - SectionName: v["SectionName"], | ||
38 | - WorkerName: v["WorkerName"], | ||
39 | - BatchNumber: v["BatchNumber"], | ||
40 | - WorkOn: v["WorkOn"], | ||
41 | - Weigh: v["Weigh"], | 34 | + RecordDate: v["recordDate"], |
35 | + WorkshopName: v["workshopName"], | ||
36 | + LineName: v["lineName"], | ||
37 | + SectionName: v["sectionName"], | ||
38 | + WorkerName: v["workerName"], | ||
39 | + BatchNumber: v["batchNumber"], | ||
40 | + WorkOn: v["workOn"], | ||
41 | + Weigh: v["weigh"], | ||
42 | FailReason: "", | 42 | FailReason: "", |
43 | } | 43 | } |
44 | items = append(items, item) | 44 | items = append(items, item) |
@@ -14,13 +14,13 @@ func (srv ExcelDataService) ImportProductRecord(importDataCommand *command.Impor | @@ -14,13 +14,13 @@ func (srv ExcelDataService) ImportProductRecord(importDataCommand *command.Impor | ||
14 | excelImport := excel.NewExcelImport() | 14 | excelImport := excel.NewExcelImport() |
15 | excelImport.RowBegin = 3 //第二行开始读取 | 15 | excelImport.RowBegin = 3 //第二行开始读取 |
16 | excelImport.DataFields = []excel.DataField{ | 16 | excelImport.DataFields = []excel.DataField{ |
17 | - {EnName: "CreatedDate", CnName: "日期"}, | ||
18 | - {EnName: "WorkshopName", CnName: "车间"}, | ||
19 | - {EnName: "LineName", CnName: "线别"}, | ||
20 | - {EnName: "SectionName", CnName: "工段"}, | ||
21 | - {EnName: "WorkerName", CnName: "姓名"}, | ||
22 | - {EnName: "ProductGroupName", CnName: "班组"}, | ||
23 | - {EnName: "Weigh", CnName: "二级品重量"}, | 17 | + {EnName: "createdDate", CnName: "日期"}, |
18 | + {EnName: "workshopName", CnName: "车间"}, | ||
19 | + {EnName: "lineName", CnName: "线别"}, | ||
20 | + {EnName: "sectionName", CnName: "工段"}, | ||
21 | + {EnName: "workerName", CnName: "姓名"}, | ||
22 | + {EnName: "productGroupName", CnName: "班组"}, | ||
23 | + {EnName: "weigh", CnName: "二级品重量"}, | ||
24 | } | 24 | } |
25 | excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader) | 25 | excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader) |
26 | if err != nil { | 26 | if err != nil { |
@@ -30,14 +30,14 @@ func (srv ExcelDataService) ImportProductRecord(importDataCommand *command.Impor | @@ -30,14 +30,14 @@ func (srv ExcelDataService) ImportProductRecord(importDataCommand *command.Impor | ||
30 | item := productRecordCommand.BatchAddProductRecordCommand{} | 30 | item := productRecordCommand.BatchAddProductRecordCommand{} |
31 | for _, v := range excelData { | 31 | for _, v := range excelData { |
32 | item = productRecordCommand.BatchAddProductRecordCommand{ | 32 | item = productRecordCommand.BatchAddProductRecordCommand{ |
33 | - CreatedDate: v["CreatedDate"], | ||
34 | - WorkshopName: v["WorkshopName"], | ||
35 | - LineName: v["LineName"], | ||
36 | - SectionName: v["SectionName"], | ||
37 | - WorkerName: v["WorkerName"], | ||
38 | - BatchNumber: v["BatchNumber"], | ||
39 | - ProductGroupName: v["ProductGroupName"], | ||
40 | - Weigh: v["Weigh"], | 33 | + CreatedDate: v["createdDate"], |
34 | + WorkshopName: v["workshopName"], | ||
35 | + LineName: v["lineName"], | ||
36 | + SectionName: v["sectionName"], | ||
37 | + WorkerName: v["workerName"], | ||
38 | + BatchNumber: v["batchNumber"], | ||
39 | + ProductGroupName: v["productGroupName"], | ||
40 | + Weigh: v["weigh"], | ||
41 | FailReason: "", | 41 | FailReason: "", |
42 | } | 42 | } |
43 | items = append(items, item) | 43 | items = append(items, item) |
@@ -14,13 +14,13 @@ func (srv ExcelDataService) ImportProductTrouble(importDataCommand *command.Impo | @@ -14,13 +14,13 @@ func (srv ExcelDataService) ImportProductTrouble(importDataCommand *command.Impo | ||
14 | excelImport := excel.NewExcelImport() | 14 | excelImport := excel.NewExcelImport() |
15 | excelImport.RowBegin = 3 //第二行开始读取 | 15 | excelImport.RowBegin = 3 //第二行开始读取 |
16 | excelImport.DataFields = []excel.DataField{ | 16 | excelImport.DataFields = []excel.DataField{ |
17 | - {EnName: "RecordDate", CnName: "日期"}, | ||
18 | - {EnName: "WorkshopName", CnName: "车间"}, | ||
19 | - {EnName: "LineName", CnName: "线别"}, | ||
20 | - {EnName: "SectionName", CnName: "工段"}, | ||
21 | - {EnName: "WorkerName", CnName: "姓名"}, | ||
22 | - {EnName: "TypesName", CnName: "事故类型"}, | ||
23 | - {EnName: "AmountLoss", CnName: "损失金额"}, | 17 | + {EnName: "recordDate", CnName: "日期"}, |
18 | + {EnName: "workshopName", CnName: "车间"}, | ||
19 | + {EnName: "lineName", CnName: "线别"}, | ||
20 | + {EnName: "sectionName", CnName: "工段"}, | ||
21 | + {EnName: "workerName", CnName: "姓名"}, | ||
22 | + {EnName: "typesName", CnName: "事故类型"}, | ||
23 | + {EnName: "amountLoss", CnName: "损失金额"}, | ||
24 | } | 24 | } |
25 | excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader) | 25 | excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader) |
26 | if err != nil { | 26 | if err != nil { |
@@ -30,13 +30,13 @@ func (srv ExcelDataService) ImportProductTrouble(importDataCommand *command.Impo | @@ -30,13 +30,13 @@ func (srv ExcelDataService) ImportProductTrouble(importDataCommand *command.Impo | ||
30 | item := productTroubleCommand.BatchAddProductTroubleCommand{} | 30 | item := productTroubleCommand.BatchAddProductTroubleCommand{} |
31 | for _, v := range excelData { | 31 | for _, v := range excelData { |
32 | item = productTroubleCommand.BatchAddProductTroubleCommand{ | 32 | item = productTroubleCommand.BatchAddProductTroubleCommand{ |
33 | - RecordDate: v["RecordDate"], | ||
34 | - WorkshopName: v["WorkshopName"], | ||
35 | - LineName: v["LineName"], | ||
36 | - SectionName: v["SectionName"], | ||
37 | - WorkerName: v["WorkerName"], | ||
38 | - AmountLoss: v["AmountLoss"], | ||
39 | - TypesName: v["TypesName"], | 33 | + RecordDate: v["recordDate"], |
34 | + WorkshopName: v["workshopName"], | ||
35 | + LineName: v["lineName"], | ||
36 | + SectionName: v["sectionName"], | ||
37 | + WorkerName: v["workerName"], | ||
38 | + AmountLoss: v["amountLoss"], | ||
39 | + TypesName: v["typesName"], | ||
40 | FailReason: "", | 40 | FailReason: "", |
41 | } | 41 | } |
42 | items = append(items, item) | 42 | items = append(items, item) |
@@ -98,7 +98,7 @@ func (d *BoardShowDao) EmployeeWorkpieceRatio(companyId int, orgId int, workshop | @@ -98,7 +98,7 @@ func (d *BoardShowDao) EmployeeWorkpieceRatio(companyId int, orgId int, workshop | ||
98 | ) | 98 | ) |
99 | select * from group_employee_plan_product | 99 | select * from group_employee_plan_product |
100 | order by today desc` | 100 | order by today desc` |
101 | - var result []BoardEmployeeWorkpieceRatio | 101 | + result := make([]BoardEmployeeWorkpieceRatio, 0) |
102 | tx := d.transactionContext.PgTx | 102 | tx := d.transactionContext.PgTx |
103 | _, err := tx.Query(&result, sqlStr, companyId, orgId, workshopId) | 103 | _, err := tx.Query(&result, sqlStr, companyId, orgId, workshopId) |
104 | if err != nil { | 104 | if err != nil { |
@@ -187,7 +187,7 @@ func (d *BoardShowDao) TimeSectionProductRecord(companyId int, orgId int, worksh | @@ -187,7 +187,7 @@ func (d *BoardShowDao) TimeSectionProductRecord(companyId int, orgId int, worksh | ||
187 | companyId, orgId, workshopId, lineIdA, | 187 | companyId, orgId, workshopId, lineIdA, |
188 | companyId, orgId, workshopId, lineIdB, | 188 | companyId, orgId, workshopId, lineIdB, |
189 | } | 189 | } |
190 | - var result []BoardTimeSectionProductRecord | 190 | + result := make([]BoardTimeSectionProductRecord, 0) |
191 | tx := d.transactionContext.PgTx | 191 | tx := d.transactionContext.PgTx |
192 | _, err := tx.Query(&result, sqlStr, condition...) | 192 | _, err := tx.Query(&result, sqlStr, condition...) |
193 | return result, err | 193 | return result, err |
@@ -272,7 +272,7 @@ func (d *BoardShowDao) ProportionOfSecondLevel(companyId int, orgId int, worksho | @@ -272,7 +272,7 @@ func (d *BoardShowDao) ProportionOfSecondLevel(companyId int, orgId int, worksho | ||
272 | condition := []interface{}{ | 272 | condition := []interface{}{ |
273 | companyId, orgId, workshopId, | 273 | companyId, orgId, workshopId, |
274 | } | 274 | } |
275 | - var result []BoardProportionOfSecondLevel | 275 | + result := make([]BoardProportionOfSecondLevel, 0) |
276 | tx := d.transactionContext.PgTx | 276 | tx := d.transactionContext.PgTx |
277 | _, err := tx.Query(&result, sqlStr, condition...) | 277 | _, err := tx.Query(&result, sqlStr, condition...) |
278 | return result, err | 278 | return result, err |
@@ -331,7 +331,7 @@ func (d *BoardShowDao) SectionProductInfo(companyId int, orgId int, workshopId i | @@ -331,7 +331,7 @@ func (d *BoardShowDao) SectionProductInfo(companyId int, orgId int, workshopId i | ||
331 | condition := []interface{}{ | 331 | condition := []interface{}{ |
332 | companyId, orgId, workshopId, | 332 | companyId, orgId, workshopId, |
333 | } | 333 | } |
334 | - var result []BoardSectionProductInfo | 334 | + result := make([]BoardSectionProductInfo, 0) |
335 | tx := d.transactionContext.PgTx | 335 | tx := d.transactionContext.PgTx |
336 | _, err := tx.Query(&result, sqlStr, condition...) | 336 | _, err := tx.Query(&result, sqlStr, condition...) |
337 | return result, err | 337 | return result, err |
@@ -378,7 +378,7 @@ func (d *BoardShowDao) WorkshopPlanCompletion5Day(companyId int, orgId int, work | @@ -378,7 +378,7 @@ func (d *BoardShowDao) WorkshopPlanCompletion5Day(companyId int, orgId int, work | ||
378 | ) | 378 | ) |
379 | SELECT ts, coalesce(rate,0) total | 379 | SELECT ts, coalesce(rate,0) total |
380 | from ts_product_list` | 380 | from ts_product_list` |
381 | - var result []PlanCompletion5Day | 381 | + result := make([]PlanCompletion5Day, 0) |
382 | condition := []interface{}{ | 382 | condition := []interface{}{ |
383 | companyId, orgId, workshopId, | 383 | companyId, orgId, workshopId, |
384 | } | 384 | } |
@@ -424,7 +424,7 @@ func (d *BoardShowDao) ProductPlan(companyId int, orgId int, workshopId int) ([] | @@ -424,7 +424,7 @@ func (d *BoardShowDao) ProductPlan(companyId int, orgId int, workshopId int) ([] | ||
424 | and product_date >to_date(to_char(now() -interval '3 day', 'YYYY-MM-DD'),'YYYY-MM-DD') | 424 | and product_date >to_date(to_char(now() -interval '3 day', 'YYYY-MM-DD'),'YYYY-MM-DD') |
425 | and cast(coalesce(plan_devoted->>'weight','0')as DECIMAL) >0 | 425 | and cast(coalesce(plan_devoted->>'weight','0')as DECIMAL) >0 |
426 | order by created_at desc` | 426 | order by created_at desc` |
427 | - var result []PlanCompletion5Day | 427 | + result := make([]PlanCompletion5Day, 0) |
428 | condition := []interface{}{ | 428 | condition := []interface{}{ |
429 | companyId, orgId, workshopId, | 429 | companyId, orgId, workshopId, |
430 | companyId, orgId, workshopId, | 430 | companyId, orgId, workshopId, |
-
请 注册 或 登录 后发表评论