diff --git a/db/PrintTask.go b/db/PrintTask.go index 71200b8..ee76d22 100644 --- a/db/PrintTask.go +++ b/db/PrintTask.go @@ -1,11 +1,11 @@ package db import ( - "bufio" - "github.com/360EntSecGroup-Skylar/excelize/v2" "LAPP_PRN_Service/common" conf "LAPP_PRN_Service/config" "LAPP_PRN_Service/glog" + "bufio" + "github.com/360EntSecGroup-Skylar/excelize/v2" "os" "path" "path/filepath" @@ -74,7 +74,7 @@ func (t *PrintTask) GenPrintFile(conf *conf.EnvConfig) error { linetext := scanner.Text() for _, pd := range t.PrintDetailList { // -1 替换所有; 1 替换第一个; 5 替换前5个 - linetext = strings.Replace(linetext, pd.VarName, pd.VarPos, -1) + linetext = strings.Replace(linetext, pd.VarName, pd.VarValue, -1) } results = append(results, linetext) }