|
@@ -8,7 +8,9 @@ import (
|
|
|
"fmt"
|
|
|
"jy/mongodbutil"
|
|
|
"log"
|
|
|
+ "qfw/common/src/qfw/util"
|
|
|
qu "qfw/util"
|
|
|
+ "strings"
|
|
|
|
|
|
"github.com/tealeg/xlsx"
|
|
|
"gopkg.in/mgo.v2/bson"
|
|
@@ -39,8 +41,8 @@ type Data struct {
|
|
|
}
|
|
|
|
|
|
func init() {
|
|
|
- flag.StringVar(&Sid, "sid", "5d348c0ca5cb26b9b76a4bb8", "开始id")
|
|
|
- flag.StringVar(&Eid, "eid", "5d34ae22a5cb26b9b7850b43", "结束id")
|
|
|
+ flag.StringVar(&Sid, "sid", "5cc87219a5cb26b9b719a6be", "开始id")
|
|
|
+ flag.StringVar(&Eid, "eid", "5d0c876aa5cb26b9b7078df8", "结束id")
|
|
|
flag.Parse()
|
|
|
qu.ReadConfig(&SysConfig)
|
|
|
Premgo = mongodbutil.MgoFactory(1, 3, 120, qu.ObjToString(SysConfig["premgo"]), qu.ObjToString(SysConfig["predb"]))
|
|
@@ -77,14 +79,21 @@ func createXlsx() {
|
|
|
style := (*row).Cells[1].GetStyle()
|
|
|
style.Font.Color = "000000"
|
|
|
(*row).Cells[0].SetString(field)
|
|
|
- (*row).Cells[1].SetInt(Compares[field].PreExtNum)
|
|
|
(*row).Cells[1].SetStyle(style)
|
|
|
- (*row).Cells[2].SetInt(Compares[field].NewExtNum)
|
|
|
(*row).Cells[2].SetStyle(style)
|
|
|
- (*row).Cells[3].SetInt(Compares[field].EqNum)
|
|
|
(*row).Cells[3].SetStyle(style)
|
|
|
- (*row).Cells[4].SetInt(Compares[field].NEqNum)
|
|
|
(*row).Cells[4].SetStyle(style)
|
|
|
+ if Compares[field] == nil{
|
|
|
+ (*row).Cells[1].SetInt(0)
|
|
|
+ (*row).Cells[2].SetInt(0)
|
|
|
+ (*row).Cells[3].SetInt(0)
|
|
|
+ (*row).Cells[4].SetInt(0)
|
|
|
+ }else {
|
|
|
+ (*row).Cells[1].SetInt(Compares[field].PreExtNum)
|
|
|
+ (*row).Cells[2].SetInt(Compares[field].NewExtNum)
|
|
|
+ (*row).Cells[3].SetInt(Compares[field].EqNum)
|
|
|
+ (*row).Cells[4].SetInt(Compares[field].NEqNum)
|
|
|
+ }
|
|
|
}
|
|
|
sh.Rows[k] = row
|
|
|
}
|
|
@@ -126,6 +135,9 @@ func getVersionData() {
|
|
|
if rd == nil {
|
|
|
rd = map[string]*Data{}
|
|
|
}
|
|
|
+ if v[key] == nil && strings.TrimSpace(util.ObjToString(v[key])) == ""{
|
|
|
+ continue
|
|
|
+ }
|
|
|
rd[qu.BsonIdToSId(v["_id"])] = &Data{
|
|
|
Id: qu.BsonIdToSId(v["_id"]),
|
|
|
PreVal: fmt.Sprint(v[key]),
|
|
@@ -142,6 +154,9 @@ func getVersionData() {
|
|
|
if rd == nil {
|
|
|
rd = map[string]*Data{}
|
|
|
}
|
|
|
+ if v[field] == nil && strings.TrimSpace(util.ObjToString(v[field])) == ""{
|
|
|
+ continue
|
|
|
+ }
|
|
|
_id := qu.BsonIdToSId(v["_id"])
|
|
|
tmp := rd[_id]
|
|
|
if tmp != nil {
|