作者 Your Name

Merge branch 'dev' into test

... ... @@ -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)
... ...
... ... @@ -14,14 +14,14 @@ func (srv ExcelDataService) ImportProductCapacities(importDataCommand *command.I
excelImport := excel.NewExcelImport()
excelImport.RowBegin = 3 //第二行开始读取
excelImport.DataFields = []excel.DataField{
{EnName: "RecordDate", CnName: "日期"},
{EnName: "WorkshopName", CnName: "车间"},
{EnName: "LineName", CnName: "线别"},
{EnName: "SectionName", CnName: "工段"},
{EnName: "WorkOn", CnName: "班别"},
{EnName: "WorkerName", CnName: "姓名"},
{EnName: "BatchNumber", CnName: "批次号"},
{EnName: "Weigh", CnName: "产量(kg)"},
{EnName: "recordDate", CnName: "日期"},
{EnName: "workshopName", CnName: "车间"},
{EnName: "lineName", CnName: "线别"},
{EnName: "sectionName", CnName: "工段"},
{EnName: "workOn", CnName: "班别"},
{EnName: "workerName", CnName: "姓名"},
{EnName: "batchNumber", CnName: "批次号"},
{EnName: "weigh", CnName: "产量(kg)"},
}
excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader)
if err != nil {
... ... @@ -31,14 +31,14 @@ func (srv ExcelDataService) ImportProductCapacities(importDataCommand *command.I
item := productRecordCommand.BatchAddProductCapacitiesCmd{}
for _, v := range excelData {
item = productRecordCommand.BatchAddProductCapacitiesCmd{
RecordDate: v["RecordDate"],
WorkshopName: v["WorkshopName"],
LineName: v["LineName"],
SectionName: v["SectionName"],
WorkerName: v["WorkerName"],
BatchNumber: v["BatchNumber"],
WorkOn: v["WorkOn"],
Weigh: v["Weigh"],
RecordDate: v["recordDate"],
WorkshopName: v["workshopName"],
LineName: v["lineName"],
SectionName: v["sectionName"],
WorkerName: v["workerName"],
BatchNumber: v["batchNumber"],
WorkOn: v["workOn"],
Weigh: v["weigh"],
FailReason: "",
}
items = append(items, item)
... ...
... ... @@ -14,13 +14,13 @@ func (srv ExcelDataService) ImportProductRecord(importDataCommand *command.Impor
excelImport := excel.NewExcelImport()
excelImport.RowBegin = 3 //第二行开始读取
excelImport.DataFields = []excel.DataField{
{EnName: "CreatedDate", CnName: "日期"},
{EnName: "WorkshopName", CnName: "车间"},
{EnName: "LineName", CnName: "线别"},
{EnName: "SectionName", CnName: "工段"},
{EnName: "WorkerName", CnName: "姓名"},
{EnName: "ProductGroupName", CnName: "班组"},
{EnName: "Weigh", CnName: "二级品重量"},
{EnName: "createdDate", CnName: "日期"},
{EnName: "workshopName", CnName: "车间"},
{EnName: "lineName", CnName: "线别"},
{EnName: "sectionName", CnName: "工段"},
{EnName: "workerName", CnName: "姓名"},
{EnName: "productGroupName", CnName: "班组"},
{EnName: "weigh", CnName: "二级品重量"},
}
excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader)
if err != nil {
... ... @@ -30,14 +30,14 @@ func (srv ExcelDataService) ImportProductRecord(importDataCommand *command.Impor
item := productRecordCommand.BatchAddProductRecordCommand{}
for _, v := range excelData {
item = productRecordCommand.BatchAddProductRecordCommand{
CreatedDate: v["CreatedDate"],
WorkshopName: v["WorkshopName"],
LineName: v["LineName"],
SectionName: v["SectionName"],
WorkerName: v["WorkerName"],
BatchNumber: v["BatchNumber"],
ProductGroupName: v["ProductGroupName"],
Weigh: v["Weigh"],
CreatedDate: v["createdDate"],
WorkshopName: v["workshopName"],
LineName: v["lineName"],
SectionName: v["sectionName"],
WorkerName: v["workerName"],
BatchNumber: v["batchNumber"],
ProductGroupName: v["productGroupName"],
Weigh: v["weigh"],
FailReason: "",
}
items = append(items, item)
... ...
... ... @@ -14,13 +14,13 @@ func (srv ExcelDataService) ImportProductTrouble(importDataCommand *command.Impo
excelImport := excel.NewExcelImport()
excelImport.RowBegin = 3 //第二行开始读取
excelImport.DataFields = []excel.DataField{
{EnName: "RecordDate", CnName: "日期"},
{EnName: "WorkshopName", CnName: "车间"},
{EnName: "LineName", CnName: "线别"},
{EnName: "SectionName", CnName: "工段"},
{EnName: "WorkerName", CnName: "姓名"},
{EnName: "TypesName", CnName: "事故类型"},
{EnName: "AmountLoss", CnName: "损失金额"},
{EnName: "recordDate", CnName: "日期"},
{EnName: "workshopName", CnName: "车间"},
{EnName: "lineName", CnName: "线别"},
{EnName: "sectionName", CnName: "工段"},
{EnName: "workerName", CnName: "姓名"},
{EnName: "typesName", CnName: "事故类型"},
{EnName: "amountLoss", CnName: "损失金额"},
}
excelData, err := converter.OpenImportFileFromIoReader(excelImport, importDataCommand.Reader, importDataCommand.FileExt) //excelImport.OpenExcelFromIoReader(importDataCommand.Reader)
if err != nil {
... ... @@ -30,13 +30,13 @@ func (srv ExcelDataService) ImportProductTrouble(importDataCommand *command.Impo
item := productTroubleCommand.BatchAddProductTroubleCommand{}
for _, v := range excelData {
item = productTroubleCommand.BatchAddProductTroubleCommand{
RecordDate: v["RecordDate"],
WorkshopName: v["WorkshopName"],
LineName: v["LineName"],
SectionName: v["SectionName"],
WorkerName: v["WorkerName"],
AmountLoss: v["AmountLoss"],
TypesName: v["TypesName"],
RecordDate: v["recordDate"],
WorkshopName: v["workshopName"],
LineName: v["lineName"],
SectionName: v["sectionName"],
WorkerName: v["workerName"],
AmountLoss: v["amountLoss"],
TypesName: v["typesName"],
FailReason: "",
}
items = append(items, item)
... ...
... ... @@ -98,7 +98,7 @@ func (d *BoardShowDao) EmployeeWorkpieceRatio(companyId int, orgId int, workshop
)
select * from group_employee_plan_product
order by today desc`
var result []BoardEmployeeWorkpieceRatio
result := make([]BoardEmployeeWorkpieceRatio, 0)
tx := d.transactionContext.PgTx
_, err := tx.Query(&result, sqlStr, companyId, orgId, workshopId)
if err != nil {
... ... @@ -187,7 +187,7 @@ func (d *BoardShowDao) TimeSectionProductRecord(companyId int, orgId int, worksh
companyId, orgId, workshopId, lineIdA,
companyId, orgId, workshopId, lineIdB,
}
var result []BoardTimeSectionProductRecord
result := make([]BoardTimeSectionProductRecord, 0)
tx := d.transactionContext.PgTx
_, err := tx.Query(&result, sqlStr, condition...)
return result, err
... ... @@ -272,7 +272,7 @@ func (d *BoardShowDao) ProportionOfSecondLevel(companyId int, orgId int, worksho
condition := []interface{}{
companyId, orgId, workshopId,
}
var result []BoardProportionOfSecondLevel
result := make([]BoardProportionOfSecondLevel, 0)
tx := d.transactionContext.PgTx
_, err := tx.Query(&result, sqlStr, condition...)
return result, err
... ... @@ -331,7 +331,7 @@ func (d *BoardShowDao) SectionProductInfo(companyId int, orgId int, workshopId i
condition := []interface{}{
companyId, orgId, workshopId,
}
var result []BoardSectionProductInfo
result := make([]BoardSectionProductInfo, 0)
tx := d.transactionContext.PgTx
_, err := tx.Query(&result, sqlStr, condition...)
return result, err
... ... @@ -378,7 +378,7 @@ func (d *BoardShowDao) WorkshopPlanCompletion5Day(companyId int, orgId int, work
)
SELECT ts, coalesce(rate,0) total
from ts_product_list`
var result []PlanCompletion5Day
result := make([]PlanCompletion5Day, 0)
condition := []interface{}{
companyId, orgId, workshopId,
}
... ... @@ -424,7 +424,7 @@ func (d *BoardShowDao) ProductPlan(companyId int, orgId int, workshopId int) ([]
and product_date >to_date(to_char(now() -interval '3 day', 'YYYY-MM-DD'),'YYYY-MM-DD')
and cast(coalesce(plan_devoted->>'weight','0')as DECIMAL) >0
order by created_at desc`
var result []PlanCompletion5Day
result := make([]PlanCompletion5Day, 0)
condition := []interface{}{
companyId, orgId, workshopId,
companyId, orgId, workshopId,
... ...