作者 Your Name

更改导入

@@ -61,11 +61,11 @@ func (srv ExcelDataService) FileImportTemplate(importDataCommand *command.Import @@ -61,11 +61,11 @@ func (srv ExcelDataService) FileImportTemplate(importDataCommand *command.Import
61 //domain.ImportCooperationUser: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210926/object/1632635345_SbfzmkXjQHhCwPw4MB7zb5EBBtdp2MSE.xlsx", 61 //domain.ImportCooperationUser: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210926/object/1632635345_SbfzmkXjQHhCwPw4MB7zb5EBBtdp2MSE.xlsx",
62 //domain.ImportDividendsReturnOrders: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210927/object/1632743214_rNHm6ZBXZaC5xKTrsE7M4h45MY6n6Ff3.xlsx", 62 //domain.ImportDividendsReturnOrders: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210927/object/1632743214_rNHm6ZBXZaC5xKTrsE7M4h45MY6n6Ff3.xlsx",
63 //二级品审核导入 63 //二级品审核导入
64 - "ImportProductRecordLevel2": "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/test/20221030/object/1667144411_R3h4nQxxcMJ7ympktMsYBBQ6bAcFC6xj.xlsx", 64 + //"ImportProductRecordLevel2": "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/test/20221030/object/1667144411_R3h4nQxxcMJ7ympktMsYBBQ6bAcFC6xj.xlsx",
65 //工时管理导入 65 //工时管理导入
66 - "ImportAttendance": "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/test/20221030/object/1667144523_w66QpzZTfxsmhbM5mmBrHjpytcydMNs2.xlsx", 66 + //"ImportAttendance": "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/test/20221030/object/1667144523_w66QpzZTfxsmhbM5mmBrHjpytcydMNs2.xlsx",
67 //事故管理导入 67 //事故管理导入
68 - "ImportProductTrouble": "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/test/20221030/object/1667144570_xYKYMrMnXWTyasDPnX2JNXEZHd3rJsWG.xlsx", 68 + // "ImportProductTrouble": "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/test/20221030/object/1667144570_xYKYMrMnXWTyasDPnX2JNXEZHd3rJsWG.xlsx",
69 } 69 }
70 var url string 70 var url string
71 var ok bool 71 var ok bool
@@ -62,7 +62,7 @@ func (data *importAttendance) validField() error { @@ -62,7 +62,7 @@ func (data *importAttendance) validField() error {
62 // 导入生产计划 62 // 导入生产计划
63 func (srv ExcelDataService) ImportDataAttendance(importDataCommand *command.ImportDataCommand) (interface{}, error) { 63 func (srv ExcelDataService) ImportDataAttendance(importDataCommand *command.ImportDataCommand) (interface{}, error) {
64 excelImport := excel.NewExcelImport() 64 excelImport := excel.NewExcelImport()
65 - excelImport.RowBegin = 2 //第二行开始读取 65 + excelImport.RowBegin = 3 //第二行开始读取
66 excelImport.DataFields = []excel.DataField{ 66 excelImport.DataFields = []excel.DataField{
67 {EnName: "ProductDate", CnName: "日期"}, 67 {EnName: "ProductDate", CnName: "日期"},
68 {EnName: "WorkshopName", CnName: "车间"}, 68 {EnName: "WorkshopName", CnName: "车间"},
@@ -267,5 +267,5 @@ func (srv ExcelDataService) BatchAddAttendance(operate domain.OperateInfo, param @@ -267,5 +267,5 @@ func (srv ExcelDataService) BatchAddAttendance(operate domain.OperateInfo, param
267 if err := transactionContext.CommitTransaction(); err != nil { 267 if err := transactionContext.CommitTransaction(); err != nil {
268 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error()) 268 return nil, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
269 } 269 }
270 - return nil, err 270 + return nil, nil
271 } 271 }
@@ -640,8 +640,8 @@ func (productRecordService *ProductRecordService) BatchAddProductRecord(operate @@ -640,8 +640,8 @@ func (productRecordService *ProductRecordService) BatchAddProductRecord(operate
640 if err != nil { 640 if err != nil {
641 e := fmt.Sprintf("【发送产量统计任务失败】 ProductRecordId=%d, %s", productRecordList[i].ProductRecordId, err.Error()) 641 e := fmt.Sprintf("【发送产量统计任务失败】 ProductRecordId=%d, %s", productRecordList[i].ProductRecordId, err.Error())
642 log.Logger.Error(e) 642 log.Logger.Error(e)
643 - return failRows, err 643 + return failRows, application.ThrowError(application.TRANSACTION_ERROR, err.Error())
644 } 644 }
645 } 645 }
646 - return failRows, err 646 + return failRows, nil
647 } 647 }