正在显示
1 个修改的文件
包含
13 行增加
和
13 行删除
@@ -321,10 +321,10 @@ func (srv ExcelDataService) ImportCost(importDataCommand *command.ImportDataComm | @@ -321,10 +321,10 @@ func (srv ExcelDataService) ImportCost(importDataCommand *command.ImportDataComm | ||
321 | if err != nil { | 321 | if err != nil { |
322 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "上传图片失败") | 322 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "上传图片失败") |
323 | } | 323 | } |
324 | - ossFile = append(ossFile,ossFile1) | 324 | + ossFile = append(ossFile, ossFile1) |
325 | } | 325 | } |
326 | //图片2 | 326 | //图片2 |
327 | - _,mBytes2,err := f.GetPicture(f.GetSheetName(index), "F"+fmt.Sprintf("%v", excelImport.RowBegin+key+1)) | 327 | + _, mBytes2, err := f.GetPicture(f.GetSheetName(index), "F"+fmt.Sprintf("%v", excelImport.RowBegin+key+1)) |
328 | if err != nil { | 328 | if err != nil { |
329 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "读取图片失败") | 329 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "读取图片失败") |
330 | } | 330 | } |
@@ -333,10 +333,10 @@ func (srv ExcelDataService) ImportCost(importDataCommand *command.ImportDataComm | @@ -333,10 +333,10 @@ func (srv ExcelDataService) ImportCost(importDataCommand *command.ImportDataComm | ||
333 | if err != nil { | 333 | if err != nil { |
334 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "上传图片失败") | 334 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "上传图片失败") |
335 | } | 335 | } |
336 | - ossFile = append(ossFile,ossFile2) | 336 | + ossFile = append(ossFile, ossFile2) |
337 | } | 337 | } |
338 | //图片3 | 338 | //图片3 |
339 | - _,mBytes3,err := f.GetPicture(f.GetSheetName(index), "G"+fmt.Sprintf("%v", excelImport.RowBegin+key+1)) | 339 | + _, mBytes3, err := f.GetPicture(f.GetSheetName(index), "G"+fmt.Sprintf("%v", excelImport.RowBegin+key+1)) |
340 | if err != nil { | 340 | if err != nil { |
341 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "读取图片失败") | 341 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "读取图片失败") |
342 | } | 342 | } |
@@ -345,7 +345,7 @@ func (srv ExcelDataService) ImportCost(importDataCommand *command.ImportDataComm | @@ -345,7 +345,7 @@ func (srv ExcelDataService) ImportCost(importDataCommand *command.ImportDataComm | ||
345 | if err != nil { | 345 | if err != nil { |
346 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "上传图片失败") | 346 | return nil, application.ThrowError(application.INTERNAL_SERVER_ERROR, "上传图片失败") |
347 | } | 347 | } |
348 | - ossFile = append(ossFile,ossFile3) | 348 | + ossFile = append(ossFile, ossFile3) |
349 | } | 349 | } |
350 | //choiceId, err := strconv.Atoi(v["choiceId"]) | 350 | //choiceId, err := strconv.Atoi(v["choiceId"]) |
351 | choiceId := domain.NodeType{}.GetIdByName(strings.TrimSpace(v["choiceId"])) | 351 | choiceId := domain.NodeType{}.GetIdByName(strings.TrimSpace(v["choiceId"])) |
@@ -382,7 +382,7 @@ func (srv ExcelDataService) ImportCost(importDataCommand *command.ImportDataComm | @@ -382,7 +382,7 @@ func (srv ExcelDataService) ImportCost(importDataCommand *command.ImportDataComm | ||
382 | YesterdayActual: strings.TrimSpace(v["yesterdayActual"]), | 382 | YesterdayActual: strings.TrimSpace(v["yesterdayActual"]), |
383 | Types: importCostCommand.Types, | 383 | Types: importCostCommand.Types, |
384 | } | 384 | } |
385 | - if len(ossFile) >0 { | 385 | + if len(ossFile) > 0 { |
386 | item.Urls = ossFile | 386 | item.Urls = ossFile |
387 | } else { | 387 | } else { |
388 | item.Urls = []string{} | 388 | item.Urls = []string{} |
@@ -398,15 +398,15 @@ func (srv ExcelDataService) ImportCost(importDataCommand *command.ImportDataComm | @@ -398,15 +398,15 @@ func (srv ExcelDataService) ImportCost(importDataCommand *command.ImportDataComm | ||
398 | "successCount": 0, | 398 | "successCount": 0, |
399 | "fail": map[string]interface{}{ | 399 | "fail": map[string]interface{}{ |
400 | "header": map[string]string{ | 400 | "header": map[string]string{ |
401 | - "failReason": "错误详情", | ||
402 | - "projectCode": "项目编码", | ||
403 | - "itemName": "细项名称", | 401 | + "failReason": "错误详情", |
402 | + "projectCode": "项目编码", | ||
403 | + "itemName": "细项名称", | ||
404 | }, | 404 | }, |
405 | - "body": []map[string]interface{}{ | ||
406 | - {"failReason":result.Msg,"projectCode":"","itemName":""}, | 405 | + "body": []map[string]interface{}{ |
406 | + {"failReason": result.Msg, "projectCode": "", "itemName": ""}, | ||
407 | }, | 407 | }, |
408 | }, | 408 | }, |
409 | - "successData":nil, | 409 | + "successData": nil, |
410 | }, nil | 410 | }, nil |
411 | } else { | 411 | } else { |
412 | return result.Data, nil | 412 | return result.Data, nil |
@@ -451,7 +451,7 @@ func (srv ExcelDataService) fieldValueAllEmpty(param map[string]string) bool { | @@ -451,7 +451,7 @@ func (srv ExcelDataService) fieldValueAllEmpty(param map[string]string) bool { | ||
451 | // FileImportTemplate 导入模板 | 451 | // FileImportTemplate 导入模板 |
452 | func (srv ExcelDataService) FileImportTemplate(importDataCommand *command.ImportDataCommand) (interface{}, error) { | 452 | func (srv ExcelDataService) FileImportTemplate(importDataCommand *command.ImportDataCommand) (interface{}, error) { |
453 | var mapTemplate = map[string]string{ | 453 | var mapTemplate = map[string]string{ |
454 | - domain.ImportCompanyUser: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/opportunity/dev_online/20220222/object/1645495589_cFNDGRTfCxYMZ5hPYzfKxThYd3ywARRz.xlsx", | 454 | + domain.ImportCompanyUser: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/opportunity/dev_online/20220427/object/1651040510_YxpaeFBaZfGKxs6dERrsKeZY5ha7ByrQ.xlsx", |
455 | domain.ImportOrganization: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210916/object/1631807490_r2XWhGmbWWmpbeePBkZ3EJQFKcZEMpEm.xlsx", | 455 | domain.ImportOrganization: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210916/object/1631807490_r2XWhGmbWWmpbeePBkZ3EJQFKcZEMpEm.xlsx", |
456 | domain.ImportDividendsOrders: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210927/object/1632743206_NPYTKw6RGhXn4TpYNEQhGGdCkXKXTnxM.xlsx", | 456 | domain.ImportDividendsOrders: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210927/object/1632743206_NPYTKw6RGhXn4TpYNEQhGGdCkXKXTnxM.xlsx", |
457 | domain.ImportCooperationUser: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210926/object/1632635345_SbfzmkXjQHhCwPw4MB7zb5EBBtdp2MSE.xlsx", | 457 | domain.ImportCooperationUser: "https://timeless-world.oss-cn-shenzhen.aliyuncs.com/open-api/dev_online/20210926/object/1632635345_SbfzmkXjQHhCwPw4MB7zb5EBBtdp2MSE.xlsx", |
-
请 注册 或 登录 后发表评论