diff --git a/service/order_service.go b/service/order_service.go index b7c7030..008184f 100644 --- a/service/order_service.go +++ b/service/order_service.go @@ -684,6 +684,14 @@ func (orderService) buildOrdersExcel(orders []model.Order, sheet string, f *exce policyNo = order.OrderResult.PolicyNo policyCreatedAt = order.OrderResult.CreatedAt.Format(time.DateTime) } + assuredName := "" + if order.Assured != nil { + assuredName = order.Assured.AssuredName + } + applicantName := "" + if order.Applicant != nil { + applicantName = order.Applicant.ApplicantName + } f.SetCellValue(sheet, excel.CellKey(row, &col), order.OrderNo) f.SetCellValue(sheet, excel.CellKey(row, &col), order.OrderSn) f.SetCellValue(sheet, excel.CellKey(row, &col), "易交易电子信息交易中心") @@ -692,8 +700,8 @@ func (orderService) buildOrdersExcel(orders []model.Order, sheet string, f *exce f.SetCellValue(sheet, excel.CellKey(row, &col), "紫金财产保险股份有限公司福建分公司") f.SetCellValue(sheet, excel.CellKey(row, &col), "投标保证保险") f.SetCellValue(sheet, excel.CellKey(row, &col), policyNo) - f.SetCellValue(sheet, excel.CellKey(row, &col), order.Assured.AssuredName) - f.SetCellValue(sheet, excel.CellKey(row, &col), order.Applicant.ApplicantName) + f.SetCellValue(sheet, excel.CellKey(row, &col), assuredName) + f.SetCellValue(sheet, excel.CellKey(row, &col), applicantName) f.SetCellValue(sheet, excel.CellKey(row, &col), policyCreatedAt) f.SetCellValue(sheet, excel.CellKey(row, &col), order.Project.StartDate) f.SetCellValue(sheet, excel.CellKey(row, &col), "180天")