浏览代码

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


正在加载...
取消
保存