Browse Source

update

tmp
DengBiao 9 months ago
parent
commit
f7120ddc7c
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      app/admin/svc/svc_data_statisstics.go

+ 6
- 0
app/admin/svc/svc_data_statisstics.go View File

@@ -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…
Cancel
Save