Browse Source

替换字段错了

master
娄文智 3 years ago
parent
commit
a8c11000a0
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      db/PrintTask.go

+ 3
- 3
db/PrintTask.go View File

@ -1,11 +1,11 @@
package db package db
import ( import (
"bufio"
"github.com/360EntSecGroup-Skylar/excelize/v2"
"LAPP_PRN_Service/common" "LAPP_PRN_Service/common"
conf "LAPP_PRN_Service/config" conf "LAPP_PRN_Service/config"
"LAPP_PRN_Service/glog" "LAPP_PRN_Service/glog"
"bufio"
"github.com/360EntSecGroup-Skylar/excelize/v2"
"os" "os"
"path" "path"
"path/filepath" "path/filepath"
@ -74,7 +74,7 @@ func (t *PrintTask) GenPrintFile(conf *conf.EnvConfig) error {
linetext := scanner.Text() linetext := scanner.Text()
for _, pd := range t.PrintDetailList { for _, pd := range t.PrintDetailList {
// -1 替换所有; 1 替换第一个; 5 替换前5个 // -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) results = append(results, linetext)
} }


Loading…
Cancel
Save