|
@@ -5,6 +5,7 @@ import (
|
|
"log"
|
|
"log"
|
|
"mongodb"
|
|
"mongodb"
|
|
"qfw/util"
|
|
"qfw/util"
|
|
|
|
+ "strconv"
|
|
"strings"
|
|
"strings"
|
|
|
|
|
|
"github.com/shopspring/decimal"
|
|
"github.com/shopspring/decimal"
|
|
@@ -84,7 +85,7 @@ func main() {
|
|
|
|
|
|
sess := Mgo.GetMgoConn()
|
|
sess := Mgo.GetMgoConn()
|
|
defer Mgo.DestoryMongoConn(sess)
|
|
defer Mgo.DestoryMongoConn(sess)
|
|
-
|
|
|
|
|
|
+ contentMap := map[string]bool{}
|
|
file := xlsx.NewFile()
|
|
file := xlsx.NewFile()
|
|
sheet, err := file.AddSheet("sheet1")
|
|
sheet, err := file.AddSheet("sheet1")
|
|
if err != nil {
|
|
if err != nil {
|
|
@@ -407,6 +408,15 @@ func main() {
|
|
log.Println("remark ", remark)
|
|
log.Println("remark ", remark)
|
|
if isOk {
|
|
if isOk {
|
|
row := sheet.AddRow()
|
|
row := sheet.AddRow()
|
|
|
|
+ expurasingtime := strconv.Itoa(util.IntAll(p1["expurasingtime"]))
|
|
|
|
+ buyer_purchase := util.ObjToString(p1["buyer"])
|
|
|
|
+ totalprice := strconv.FormatFloat(util.Float64All(p1["totalprice"]), 'f', -1, 64)
|
|
|
|
+ content := projectname_purchase + buyer_purchase + expurasingtime + totalprice
|
|
|
|
+ if contentMap[content] {
|
|
|
|
+ continue
|
|
|
|
+ } else {
|
|
|
|
+ contentMap[content] = true
|
|
|
|
+ }
|
|
for _, v := range FiedlsPurchase {
|
|
for _, v := range FiedlsPurchase {
|
|
if v == "projectname_purchase" || v == "projectscope_purchase" || v == "item" || v == "buyer_purchase" ||
|
|
if v == "projectname_purchase" || v == "projectscope_purchase" || v == "item" || v == "buyer_purchase" ||
|
|
v == "totalprice" || v == "expurasingtime" || v == "cgyxxqhref" || v == "remark" {
|
|
v == "totalprice" || v == "expurasingtime" || v == "cgyxxqhref" || v == "remark" {
|