xiziwen 3 months ago
parent
commit
700408cd20
1 changed files with 132 additions and 252 deletions
  1. 132 252
      controller/census/income_list.go

+ 132 - 252
controller/census/income_list.go

@@ -1095,7 +1095,7 @@ func (this *InvoicePaymentController) IncomeList(c *gin.Context) {
 	}
 	// 是否导出
 	if req.IsExport == 1 {
-		ExportIncomeList(c, incomeList.List)
+		ExportIncomeList(c, incomeList.List, req.IncomeType)
 		return
 	}
 	resp.OkData("获取成功", incomeList, c)
@@ -1169,7 +1169,7 @@ func getPaymentIncomeList(ch chan base.BaseData, req fms.IncomeListReq) (baseDat
 			st := fmt.Sprint(startDate, " 00:00:00")
 			ed := fmt.Sprint(endDate, " 23:59:59")
 			cond += ` AND (d.invoice_time BETWEEN ? AND ?)`
-			pars = append(pars, st, ed, st, ed)
+			pars = append(pars, st, ed)
 		}
 
 		if req.Keyword != "" {
@@ -1239,7 +1239,7 @@ func getPaymentIncomeList(ch chan base.BaseData, req fms.IncomeListReq) (baseDat
 					FinalSellerId: v.FinalSellerId,
 					OriginAmount:  v.OriginAmount,
 					UnitName:      unitMap[v.CurrencyUnit],
-					ServicesName: v.ServicesName,
+					ServicesName:  v.ServicesName,
 				}
 				respItems = append(respItems, respItem)
 			}
@@ -1252,7 +1252,7 @@ func getPaymentIncomeList(ch chan base.BaseData, req fms.IncomeListReq) (baseDat
 	return
 }
 
-//func getCensusIncomeList(ch chan models.CensusIncomeChartResp, req fms.IncomeListReq) (incomeChart models.CensusIncomeChartResp, err error) {
+//func getCensusIncomeList(ch chan base.BaseData, req fms.IncomeListReq) (baseData base.BaseData, err error) {
 //	defer func() {
 //		if err != nil {
 //			global.LOG.Error(err)
@@ -1260,24 +1260,14 @@ func getPaymentIncomeList(ch chan base.BaseData, req fms.IncomeListReq) (baseDat
 //				go alarm_msg.SendAlarmMsg("获取业务收入金额统计数据异常,Err:"+err.Error(), 3)
 //			}
 //		}
-//		ch <- incomeChart
+//		ch <- baseData
 //	}()
 //
-//	var dateSlice []string
-//	var totalMoneySlice, prevTotalMoneySlice []float64
-//	var yoySlice []string
-//
 //	var reqStartDate, reqEndDate time.Time
 //	historyTime, _ := time.Parse(utils.FormatDate, "2023-04-01")
 //
 //	// 套餐筛选
 //	if req.ServiceTypes != "" {
-//		serviceTypes := strings.Split(req.ServiceTypes, ",")
-//		registerIds, e := fms.GetContractRegisterIdsByTempId(serviceTypes)
-//		if e != nil {
-//			err = fmt.Errorf("获取合同登记IDs失败, Err: %s", e.Error())
-//			return
-//		}
 //		// 勾选套餐筛选时忽略导入的历史数据
 //		if req.StartDate == "" {
 //			req.StartDate = "2023-04"
@@ -1297,276 +1287,161 @@ func getPaymentIncomeList(ch chan base.BaseData, req fms.IncomeListReq) (baseDat
 //		reqEndDate, _ = time.Parse(utils.FormatDateTime, ed)
 //	}
 //
+//	//timeNow, _ := time.Parse("2006-01", time.Now().Format("2006-01"))
 //
-//		//timeNow, _ := time.Parse("2006-01", time.Now().Format("2006-01"))
-//
-//		var endDateTime time.Time
-//		var prevEndDateTime time.Time
-//		var prevStartDate, prevEndDate string
-//		var startDate, endDate string
-//		//开始日期
-//		if req.StartDate != "" && req.EndDate != "" {
-//			startDate = reqStartDate.AddDate(0, i, 0).Format("2006-01")
-//			prevStartDate = reqStartDate.AddDate(-1, i, 0).Format("2006-01")
-//		} else {
-//			startDate = latestTime.AddDate(0, i-numMonth, 0).Format("2006-01")
-//			prevStartDate = latestTime.AddDate(-1, i-numMonth, 0).Format("2006-01")
-//		}
+//	var endDateTime time.Time
+//	var startDate, endDate string
+//	//开始日期
+//	if req.StartDate != "" && req.EndDate != "" {
+//		startDate = reqStartDate.Format("2006-01")
 //		startDate = fmt.Sprint(startDate, "-01")
-//		prevStartDate = fmt.Sprint(prevStartDate, "-01")
-//		startDateTime, _ := time.Parse(utils.FormatDate, startDate)
-//		prevStartDateTime, _ := time.Parse(utils.FormatDate, prevStartDate)
+//	}
 //
-//		//结束日期
-//		if req.StartDate != "" && req.EndDate != "" {
-//			endDateTime = reqStartDate.AddDate(0, i+1, -1)
-//			prevEndDateTime = reqStartDate.AddDate(-1, i+1, -1)
-//			if reqEndDate.After(latestTime) {
-//				endDateTime = latestTime.AddDate(0, i-numMonth+1, -1)
-//				prevEndDateTime = latestTime.AddDate(-1, i-numMonth+1, -1)
-//			}
-//		} else {
-//			endDateTime = latestTime.AddDate(0, i-numMonth+1, -1)
-//			prevEndDateTime = latestTime.AddDate(-1, i-numMonth+1, -1)
-//		}
-//		endDate = endDateTime.Format(utils.FormatDate)
-//		prevEndDate = prevEndDateTime.Format(utils.FormatDate)
+//	startDateTime, _ := time.Parse(utils.FormatDate, startDate)
 //
-//		cond := `1 = 1`
-//		histrtyCond := `1 = 1`
-//		pars := make([]interface{}, 0)
-//		historyPars := make([]interface{}, 0)
+//	//结束日期
+//	if req.StartDate != "" && req.EndDate != "" {
+//		endDate = reqEndDate.Format(utils.FormatDate)
+//	}
 //
-//		prevCond := `1 = 1`
-//		prevHistoryCond := `1 = 1`
-//		prevPars := make([]interface{}, 0)
-//		prevHistoryPars := make([]interface{}, 0)
+//	cond := `1 = 1`
+//	histrtyCond := `1 = 1`
+//	pars := make([]interface{}, 0)
+//	historyPars := make([]interface{}, 0)
 //
-//		if req.CompanyType == 1 {
-//			cond += ` AND b.contract_type = 1 `
-//			prevCond += ` AND b.contract_type = 1 `
-//			histrtyCond += ` AND new_company = 1 `
-//			prevHistoryCond += ` AND new_company = 1 `
-//		} else if req.CompanyType == 2 {
-//			cond += ` AND b.contract_type IN (2,3,4) `
-//			prevCond += ` AND b.contract_type IN (2,3,4) `
-//			histrtyCond += ` AND new_company = 0 `
-//			prevHistoryCond += ` AND new_company = 0 `
-//		} else if req.CompanyType == 3 {
-//			//未续约收入金额=去年同期总收入金额(新客户+老客户)-当期老客户收入金额
-//			cond += ` AND b.contract_type IN (2,3,4) `
-//			//prevCond += ` AND b.contract_type IN (2,3,4) `
-//			histrtyCond += ` AND new_company = 0 `
-//			//prevHistoryCond += ` AND new_company = 0 `
-//		}
+//	if req.CompanyType == 1 {
+//		cond += ` AND b.contract_type = 1 `
+//		histrtyCond += ` AND new_company = 1 `
+//	} else if req.CompanyType == 2 {
+//		cond += ` AND b.contract_type IN (2,3,4) `
+//		histrtyCond += ` AND new_company = 0 `
+//	} else if req.CompanyType == 3 {
+//		//未续约收入金额=去年同期总收入金额(新客户+老客户)-当期老客户收入金额
+//		cond += ` AND b.contract_type IN (2,3,4) `
+//		histrtyCond += ` AND new_company = 0 `
+//	}
+//
+//	if req.SellerIds != "" {
+//		sellerIds := strings.Split(req.SellerIds, ",")
+//		cond += ` AND (c.seller_id in ? OR d.seller_id in ?)`
+//		pars = append(pars, sellerIds, sellerIds)
 //
-//		if req.SellerIds != "" {
-//			sellerIds := strings.Split(req.SellerIds, ",")
-//			cond += ` AND (c.seller_id in ? OR d.seller_id in ?)`
-//			pars = append(pars, sellerIds, sellerIds)
-//			prevCond += ` AND (c.seller_id in ? OR d.seller_id in ?)`
-//			prevPars = append(prevPars, sellerIds, sellerIds)
-//			histrtyCond += ` AND seller_id in ? `
-//			prevHistoryCond += ` AND seller_id in ? `
-//			historyPars = append(historyPars, sellerIds)
-//			prevHistoryPars = append(prevHistoryPars, sellerIds)
+//		histrtyCond += ` AND seller_id in ? `
+//		historyPars = append(historyPars, sellerIds)
+//	}
+//
+//	// 套餐筛选
+//	if req.ServiceTypes != "" {
+//		serviceTypes := strings.Split(req.ServiceTypes, ",")
+//		registerIds, e := fms.GetContractRegisterIdsByTempId(serviceTypes)
+//		if e != nil {
+//			err = fmt.Errorf("获取合同登记IDs失败, Err: %s", e.Error())
+//			return
+//		}
+//		if len(registerIds) > 0 {
+//			cond += ` AND a.register_id IN ?`
+//			pars = append(pars, registerIds)
+//		} else {
+//			cond += ` AND 1 = 2`
 //		}
+//	}
 //
-//		// 套餐筛选
-//		if req.ServiceTypes != "" {
-//			serviceTypes := strings.Split(req.ServiceTypes, ",")
-//			registerIds, e := fms.GetContractRegisterIdsByTempId(serviceTypes)
+//	{
+//		st := fmt.Sprint(startDate, " 00:00:00")
+//		ed := fmt.Sprint(endDate, " 23:59:59")
+//		//校验日期,分段查询
+//		if startDateTime.After(historyTime) || startDateTime.Equal(historyTime) {
+//			//全部走新查询
+//			cond += ` AND ((c.invoice_time BETWEEN ? AND ?) or (d.invoice_time BETWEEN ? AND ?))`
+//			pars = append(pars, st, ed, st, ed)
+//			summaryIds, e := fms.GetInvoicePaymentCensusSummaryDataIds(cond, pars)
 //			if e != nil {
-//				err = fmt.Errorf("获取合同登记IDs失败, Err: %s", e.Error())
 //				return
 //			}
-//			if len(registerIds) > 0 {
-//				cond += ` AND a.register_id IN ?`
-//				prevCond += ` AND a.register_id IN ?`
-//				pars = append(pars, registerIds)
-//				prevPars = append(pars, registerIds)
-//			} else {
-//				cond += ` AND 1 = 2`
-//				prevCond += ` AND 1 = 2`
-//			}
-//		}
-//
-//		//fmt.Println("i:",i)
-//		//fmt.Println("j:",j)
-//		{
-//			//本期
-//			st := fmt.Sprint(startDate, " 00:00:00")
-//			ed := fmt.Sprint(endDate, " 23:59:59")
-//			//校验日期,分段查询
-//			if startDateTime.After(historyTime) || startDateTime.Equal(historyTime) {
-//				//全部走新查询
-//				cond += ` AND ((c.invoice_time BETWEEN ? AND ?) or (d.invoice_time BETWEEN ? AND ?))`
-//				pars = append(pars, st, ed, st, ed)
-//				summaryIds, e := fms.GetInvoicePaymentCensusSummaryDataIds(cond, pars)
-//				if e != nil {
-//					return
-//				}
 //
-//				// 开票到款金额合计(换算后)
-//				var amountTotal float64
+//			// 开票到款金额合计(换算后)
+//			var amountTotal float64
 //
-//				if len(summaryIds) > 0 {
-//					amountCond := `a.id IN ? `
-//					amountPars := make([]interface{}, 0)
-//					amountPars = append(amountPars, summaryIds)
-//					if req.SellerIds != "" {
-//						sellerIds := strings.Split(req.SellerIds, ",")
-//						amountCond += ` AND (( b.seller_id IN ? AND a.invoice_id <> 0 AND b.invoice_time BETWEEN ? AND ?)`
-//						amountCond += `OR ( d.seller_id IN ? AND  a.payment_id <> 0 AND a.invoice_id = 0 AND d.invoice_time BETWEEN ? AND ?)) `
-//						amountPars = append(amountPars, sellerIds, st, ed, sellerIds, st, ed)
-//					} else {
-//						amountCond += ` AND ((a.invoice_id <> 0 AND b.invoice_time BETWEEN ? AND ?)`
-//						amountCond += `OR (a.payment_id <> 0 AND a.invoice_id = 0 AND d.invoice_time BETWEEN ? AND ?)`
-//						amountPars = append(amountPars, st, ed, st, ed)
-//					}
-//					results, e := fms.GetContractSummaryIncomeAmount(amountCond, amountPars)
-//					if e != nil {
-//						err = fmt.Errorf("获取汇总数据失败, Err: %s", e.Error())
-//						return
-//					}
-//					//dataList = append(dataList, results...)
-//					var amountSum float64
-//					for _, result := range results {
-//						incomeChart.DataList = append(incomeChart.DataList, result)
-//						amountSum += result.Amount
-//						fmt.Println("result.Amount:", result.Amount)
-//					}
-//					amountTotal, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", amountSum), 64)
-//					accumulate += amountTotal
-//					partAccumulate += amountTotal
-//				}
-//				if i == j || i == numMonth {
-//					if req.ListParam == "4" {
-//						totalMoneySlice = append(totalMoneySlice, accumulate)
-//						if startDateTime.Month() == 12 {
-//							accumulate = 0
-//						}
-//					} else if req.ListParam == "0" {
-//						totalMoneySlice = append(totalMoneySlice, amountTotal)
-//					} else if i > 0 || i == numMonth {
-//						totalMoneySlice = append(totalMoneySlice, partAccumulate)
-//						fmt.Println("partAccumulate:", partAccumulate)
-//						partAccumulate = 0.0
-//					}
+//			if len(summaryIds) > 0 {
+//				amountCond := `a.id IN ? `
+//				amountPars := make([]interface{}, 0)
+//				amountPars = append(amountPars, summaryIds)
+//				if req.SellerIds != "" {
+//					sellerIds := strings.Split(req.SellerIds, ",")
+//					amountCond += ` AND (( b.seller_id IN ? AND a.invoice_id <> 0 AND b.invoice_time BETWEEN ? AND ?)`
+//					amountCond += `OR ( d.seller_id IN ? AND  a.payment_id <> 0 AND a.invoice_id = 0 AND d.invoice_time BETWEEN ? AND ?)) `
+//					amountPars = append(amountPars, sellerIds, st, ed, sellerIds, st, ed)
+//				} else {
+//					amountCond += ` AND ((a.invoice_id <> 0 AND b.invoice_time BETWEEN ? AND ?)`
+//					amountCond += `OR (a.payment_id <> 0 AND a.invoice_id = 0 AND d.invoice_time BETWEEN ? AND ?)`
+//					amountPars = append(amountPars, st, ed, st, ed)
 //				}
-//			} else if endDateTime.Before(historyTime) || endDateTime.Equal(historyTime) {
-//				//全部走旧查询
-//				//fmt.Println("旧查询")
-//				//fmt.Println("st:",st)
-//				//fmt.Println("ed:",ed)
-//				histrtyCond += ` AND (invoice_time BETWEEN ? AND ? )`
-//				historyPars = append(historyPars, st, ed)
-//				//fmt.Println("st:",st)
-//				//fmt.Println("ed:",ed)
-//				// 开票到款金额合计(换算后)
-//				var amountTotal float64
-//				results, e := fms.GetIncomeHistory(histrtyCond, historyPars)
+//				results, e := fms.GetContractSummaryIncomeAmount(amountCond, amountPars)
 //				if e != nil {
 //					err = fmt.Errorf("获取汇总数据失败, Err: %s", e.Error())
 //					return
 //				}
-//				var amountSum float64
 //				//dataList = append(dataList, results...)
+//				var amountSum float64
 //				for _, result := range results {
 //					incomeChart.DataList = append(incomeChart.DataList, result)
 //					amountSum += result.Amount
+//					fmt.Println("result.Amount:", result.Amount)
 //				}
 //				amountTotal, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", amountSum), 64)
 //				accumulate += amountTotal
 //				partAccumulate += amountTotal
+//			}
+//		} else if endDateTime.Before(historyTime) || endDateTime.Equal(historyTime) {
+//			//全部走旧查询
+//			//fmt.Println("旧查询")
+//			//fmt.Println("st:",st)
+//			//fmt.Println("ed:",ed)
+//			histrtyCond += ` AND (invoice_time BETWEEN ? AND ? )`
+//			historyPars = append(historyPars, st, ed)
+//			//fmt.Println("st:",st)
+//			//fmt.Println("ed:",ed)
+//			// 开票到款金额合计(换算后)
+//			var amountTotal float64
+//			results, e := fms.GetIncomeHistory(histrtyCond, historyPars)
+//			if e != nil {
+//				err = fmt.Errorf("获取汇总数据失败, Err: %s", e.Error())
+//				return
+//			}
+//			var amountSum float64
+//			//dataList = append(dataList, results...)
+//			for _, result := range results {
+//				incomeChart.DataList = append(incomeChart.DataList, result)
+//				amountSum += result.Amount
+//			}
+//			amountTotal, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", amountSum), 64)
+//			accumulate += amountTotal
+//			partAccumulate += amountTotal
 //
-//				if i == j || i == numMonth {
-//					if req.ListParam == "4" {
-//						totalMoneySlice = append(totalMoneySlice, accumulate)
-//						if startDateTime.Month() == 12 {
-//							accumulate = 0
-//						}
-//					} else if req.ListParam == "0" {
-//						totalMoneySlice = append(totalMoneySlice, amountTotal)
-//					} else if i > 0 || i == numMonth {
-//						totalMoneySlice = append(totalMoneySlice, partAccumulate)
-//						partAccumulate = 0.0
+//			if i == j || i == numMonth {
+//				if req.ListParam == "4" {
+//					totalMoneySlice = append(totalMoneySlice, accumulate)
+//					if startDateTime.Month() == 12 {
+//						accumulate = 0
 //					}
+//				} else if req.ListParam == "0" {
+//					totalMoneySlice = append(totalMoneySlice, amountTotal)
+//				} else if i > 0 || i == numMonth {
+//					totalMoneySlice = append(totalMoneySlice, partAccumulate)
+//					partAccumulate = 0.0
 //				}
-//
-//				//fmt.Println("partAccumulate:",partAccumulate)
 //			}
 //
+//			//fmt.Println("partAccumulate:",partAccumulate)
 //		}
 //
-//
-//	fmt.Println("prevTotalMoneySlice:", len(prevTotalMoneySlice))
-//	fmt.Println("totalMoneySlice:", len(totalMoneySlice))
-//
-//	if req.CompanyType != 3 {
-//		//计算同比值
-//		for i := range prevTotalMoneySlice {
-//			var yoy float64
-//			var yoyStr string
-//			//fmt.Println("1:", prevTotalMoneySlice[i])
-//			//fmt.Println("2:", totalMoneySlice[i])
-//			//fmt.Println("3:", totalMoneySlice[i]-prevTotalMoneySlice[i])
-//			totalMoneySlice[i], _ = strconv.ParseFloat(fmt.Sprintf("%.2f", totalMoneySlice[i]), 64)
-//			if prevTotalMoneySlice[i] != 0 && totalMoneySlice[i] != 0 {
-//				yoy = (totalMoneySlice[i] - prevTotalMoneySlice[i]) / prevTotalMoneySlice[i]
-//				yoyStr = fmt.Sprintf("%.4f", yoy)
-//
-//				if i == len(prevTotalMoneySlice)-1 && i > 0 && req.ListParam == "3" {
-//					fmt.Println("totalMoneySlice[i-1]:", totalMoneySlice[i-1])
-//					yoy = (totalMoneySlice[i] - totalMoneySlice[i-1]) / totalMoneySlice[i-1]
-//					yoyStr = fmt.Sprintf("%.4f", yoy)
-//				}
-//			}
-//			yoySlice = append(yoySlice, yoyStr)
-//		}
-//	} else {
-//		// 当筛选条件是”月度“时,并且客户是”未续约“客户,展示柱形图和曲线图
-//		// 当筛选条件是”季度“、”半年度“、”年度“、”月度统计“时,并且客户是”未续约“时,仅展示柱形图,无曲线图
-//		// 未续约收入金额=去年同期总收入金额(新客户+老客户)-当期老客户收入金额
-//		// 移动平均值:若是10月份,计算8月,9月,10月,这三个月的收入金额平均值
-//		for i := range prevTotalMoneySlice {
-//			totalMoneySlice[i], _ = strconv.ParseFloat(fmt.Sprintf("%.2f", prevTotalMoneySlice[i]-totalMoneySlice[i]), 64)
-//
-//			var yoy float64
-//			var yoyStr string
-//			if i > 1 && req.ListParam == "0" {
-//				// 前俩月没有
-//				yoy = (totalMoneySlice[i] + totalMoneySlice[i-1] + totalMoneySlice[i-2]) / 3
-//				yoyStr = fmt.Sprintf("%.4f", yoy)
-//				yoySlice = append(yoySlice, yoyStr)
-//			} else {
-//				yoySlice = append(yoySlice, "")
-//			}
-//		}
 //	}
 //
-//	incomeChart.Title = "开票到款统计图"
-//	incomeChart.Date = dateSlice[:len(totalMoneySlice)]
-//	incomeChart.TotalMoney = totalMoneySlice
-//	incomeChart.PrevTotalMoney = prevTotalMoneySlice
-//	incomeChart.Yoy = yoySlice
-//
-//	//redisJsonData, err := json.Marshal(incomeChart)
-//	//if err == nil {
-//	//	global.Redis.SetEX(context.TODO(), key, string(redisJsonData), time.Minute*30)
-//	//}
-//	//} else {
-//	//	err = json.Unmarshal([]byte(redisJsonData), &incomeChart)
-//	//	if err != nil {
-//	//		fmt.Println("近两年的收入统计数据,json转换失败")
-//	//	}
-//	//}
-//
 //	return
 //}
 
 // ExportIncomeList 导出业务收入统计列表
-func ExportIncomeList(c *gin.Context, results interface{}) {
+func ExportIncomeList(c *gin.Context, results interface{}, incomeType int) {
 	list := results.([]*fms.IncomeSummaryRespItem)
 	// 生成Excel文件
 	xlsxFile := xlsx.NewFile()
@@ -1587,7 +1462,12 @@ func ExportIncomeList(c *gin.Context, results interface{}) {
 	}
 
 	// 数据表头
-	rowTitle := []string{"开票日期", "新客户(1)", "客户名称", "金额", "销售"}
+	rowTitle := make([]string, 0)
+	if incomeType == 0 {
+		rowTitle = []string{"客户名称", "新客户(1)", "开票日期", "开票金额", "金额单位", "开票金额(换算后)", "销售名称", "套餐名称"}
+	} else {
+		rowTitle = []string{"客户名称", "新客户(1)", "到款日期", "到款金额", "金额单位", "到款金额(换算后)", "销售名称", "套餐名称"}
+	}
 	titleRow := sheet.AddRow()
 	for i := range rowTitle {
 		v := titleRow.AddCell()
@@ -1605,13 +1485,13 @@ func ExportIncomeList(c *gin.Context, results interface{}) {
 		if v.ContractType == 1 {
 			newCompany = 1
 		}
-		dataRow.AddCell().SetString(strconv.Itoa(newCompany)) // 新客户
-		dataRow.AddCell().SetString(v.InvoiceDate) // 开票到款日期
+		dataRow.AddCell().SetString(strconv.Itoa(newCompany))            // 新客户
+		dataRow.AddCell().SetString(v.InvoiceDate)                       // 开票到款日期
 		dataRow.AddCell().SetString(fmt.Sprintf("%.2f", v.OriginAmount)) // 开票到款金额
-		dataRow.AddCell().SetString(v.UnitName) // 金额单位
-		dataRow.AddCell().SetString(fmt.Sprintf("%.2f", v.Amount)) // 开票到款金额 换算后
-		dataRow.AddCell().SetString(v.SellerName)             // 销售员
-		dataRow.AddCell().SetString(v.ServicesName)           // 套餐名称
+		dataRow.AddCell().SetString(v.UnitName)                          // 金额单位
+		dataRow.AddCell().SetString(fmt.Sprintf("%.2f", v.Amount))       // 开票到款金额 换算后
+		dataRow.AddCell().SetString(v.SellerName)                        // 销售员
+		dataRow.AddCell().SetString(v.ServicesName)                      // 套餐名称
 	}
 
 	// 输出文件