DengBiao pirms 8 mēnešiem
vecāks
revīzija
f7120ddc7c
1 mainītis faili ar 6 papildinājumiem un 0 dzēšanām
  1. +6
    -0
      app/admin/svc/svc_data_statisstics.go

+ 6
- 0
app/admin/svc/svc_data_statisstics.go Parādīt failu

@@ -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


Notiek ielāde…
Atcelt
Saglabāt