fix: loss

main
Leo 6 months ago
parent fd3ef2be09
commit 2a0d1a86f9

@ -13,7 +13,7 @@ import (
func GenExcelFile(m1 map[string]*service.HighOptLossUnder, m2 map[string]*service.HighOptLossHistory) { func GenExcelFile(m1 map[string]*service.HighOptLossUnder, m2 map[string]*service.HighOptLossHistory) {
// Open the Excel file // Open the Excel file
f, err := excelize.OpenFile("/Users/leo/Documents/光衰通报/光衰/2025/光衰通报(4月16日).xlsx") f, err := excelize.OpenFile("/Users/leo/Documents/光衰通报/光衰/2025/光衰通报(5月30日).xlsx")
if err != nil { if err != nil {
fmt.Println(err) fmt.Println(err)
return return
@ -281,10 +281,10 @@ func GenExcelFile(m1 map[string]*service.HighOptLossUnder, m2 map[string]*servic
f.SetCellValue("汇总", sumCell, cast.ToInt(value)) f.SetCellValue("汇总", sumCell, cast.ToInt(value))
} }
} }
//TODO 2 //TODO 3
done, _ := f.GetCellValue("汇总", "K24") done, _ := f.GetCellValue("汇总", "K24")
total, _ := f.GetCellValue("汇总", "L24") total, _ := f.GetCellValue("汇总", "L24")
f.SetCellValue("汇总", "M23", mathkit.FloatRound(cast.ToFloat64(done)/cast.ToFloat64(total), 4)) f.SetCellValue("汇总", "M24", mathkit.FloatRound(cast.ToFloat64(done)/cast.ToFloat64(total), 4))
//设置表头 //设置表头
content := fmt.Sprintf("西湖智家光衰通报:%s", time.Now().Format("1月2日")) content := fmt.Sprintf("西湖智家光衰通报:%s", time.Now().Format("1月2日"))

Loading…
Cancel
Save