瀏覽代碼

update

tmp
DengBiao 8 月之前
父節點
當前提交
f7120ddc7c
共有 1 個檔案被更改,包括 6 行新增0 行删除
  1. +6
    -0
      app/admin/svc/svc_data_statisstics.go

+ 6
- 0
app/admin/svc/svc_data_statisstics.go 查看文件

@@ -1754,6 +1754,7 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
xlsx.SetCellStyle("Sheet1", "A1", "E1", style)
xlsx.SetColWidth("Sheet1", "A", "E", 20)

var incomeTotal, refundTotal, realityAmountTotal, rateFeeTotal float64
j := 3 //表头前两行用了,只能从第三行开始
for _, v := range m {
var income, refund string
@@ -1795,8 +1796,13 @@ func CentralKitchenForSchoolDataStatisticsExport(req md.CentralKitchenForSchoolD
realityAmount := utils.StrToFloat64(income) - utils.StrToFloat64(refund)
rateFee := realityAmount * 0.0038
xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{v.Name, income, refund, realityAmount, rateFee})
incomeTotal += utils.StrToFloat64(income)
refundTotal += utils.StrToFloat64(refund)
realityAmountTotal += realityAmount
rateFeeTotal += rateFee
j++
}
xlsx.SetSheetRow("Sheet1", "A"+strconv.Itoa(j), &[]interface{}{"总计", incomeTotal, refundTotal, realityAmountTotal, rateFeeTotal})
//将文件保存至服务器
xlsx.SaveAs("./static" + downloadPath)
break


Loading…
取消
儲存