|
@@ -816,7 +816,7 @@ func SkipData(tmp map[string]interface{}) bool {
|
|
|
return false
|
|
|
}
|
|
|
|
|
|
-func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
+func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile bool) {
|
|
|
if id != "" {
|
|
|
query := bson.M{
|
|
|
"_id": bson.ObjectIdHex(id),
|
|
@@ -828,8 +828,18 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
if err != nil {
|
|
|
log.Println("fields file not foud", err.Error())
|
|
|
}
|
|
|
+ style := xlsx.NewStyle()
|
|
|
+ style.Font.Size = 12
|
|
|
+ style.Font.Bold = true
|
|
|
+ style.Alignment.Vertical = "center"
|
|
|
+ style.Alignment.Horizontal = "center"
|
|
|
if dataType == 1 {
|
|
|
sh := xf.Sheets[0]
|
|
|
+ if isfile {
|
|
|
+ cell := sh.Rows[0].AddCell()
|
|
|
+ cell.SetValue("附件")
|
|
|
+ cell.SetStyle(style)
|
|
|
+ }
|
|
|
for i, v := range mMap {
|
|
|
row := sh.AddRow()
|
|
|
row.AddCell().SetInt(i + 1)
|
|
@@ -852,11 +862,19 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
}
|
|
|
row.AddCell().SetValue(v["projectname"])
|
|
|
row.AddCell().SetValue(v["detail"])
|
|
|
- row.AddCell().SetValue(v["s_jyhref"])
|
|
|
+ row.AddCell().SetValue(v["jybxhref"])
|
|
|
+ if isfile {
|
|
|
+ row.AddCell().SetValue(v["filetext"])
|
|
|
+ }
|
|
|
}
|
|
|
xf.Sheets = xf.Sheets[0:1]
|
|
|
} else if dataType == 2 {
|
|
|
sh := xf.Sheets[1]
|
|
|
+ if isfile {
|
|
|
+ cell := sh.Rows[0].AddCell()
|
|
|
+ cell.SetValue("附件")
|
|
|
+ cell.SetStyle(style)
|
|
|
+ }
|
|
|
for i, v := range mMap {
|
|
|
row := sh.AddRow()
|
|
|
row.AddCell().SetInt(i + 1)
|
|
@@ -872,7 +890,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
row.AddCell()
|
|
|
}
|
|
|
row.AddCell().SetValue(v["href"])
|
|
|
- row.AddCell().SetValue(v["s_jyhref"])
|
|
|
+ row.AddCell().SetValue(v["jybxhref"])
|
|
|
row.AddCell().SetValue(v["projectcode"])
|
|
|
row.AddCell().SetValue(v["projectname"])
|
|
|
row.AddCell().SetValue(v["projectscope"])
|
|
@@ -895,19 +913,28 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
row.AddCell().SetValue(v["buyerperson"])
|
|
|
row.AddCell().SetValue(v["buyertel"])
|
|
|
row.AddCell().SetValue(v["agency"])
|
|
|
- row.AddCell().SetValue(v["winner"])
|
|
|
+ row.AddCell().SetValue(v["s_winner"])
|
|
|
row.AddCell().SetValue(v["winnerperson"])
|
|
|
row.AddCell().SetValue(v["winnertel"])
|
|
|
row.AddCell().SetValue(v["legal_person"])
|
|
|
row.AddCell().SetValue(v["company_phone"])
|
|
|
row.AddCell().SetValue(v["company_email"])
|
|
|
+ if isfile {
|
|
|
+ row.AddCell().SetValue(v["filetext"])
|
|
|
+ }
|
|
|
}
|
|
|
xf.Sheets = xf.Sheets[1:2]
|
|
|
} else {
|
|
|
sh := xf.Sheets[2]
|
|
|
+ if isfile {
|
|
|
+ cell := sh.Rows[0].AddCell()
|
|
|
+ cell.SetValue("附件")
|
|
|
+ cell.SetStyle(style)
|
|
|
+ }
|
|
|
for _, v := range mMap {
|
|
|
row := sh.AddRow()
|
|
|
// row.AddCell().SetInt(i + 1)
|
|
|
+ row.AddCell().SetValue(v["rulename"])
|
|
|
row.AddCell().SetValue(v["matchkey"])
|
|
|
row.AddCell().SetValue(v["area"])
|
|
|
row.AddCell().SetValue(v["city"])
|
|
@@ -942,6 +969,9 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string) {
|
|
|
row.AddCell().SetValue(v["stock_name"])
|
|
|
ids := SE.EncodeString(qu.ObjToString(v["id"]))
|
|
|
row.AddCell().SetValue(ids)
|
|
|
+ if isfile {
|
|
|
+ row.AddCell().SetValue(v["filetext"])
|
|
|
+ }
|
|
|
}
|
|
|
xf.Sheets = xf.Sheets[2:3]
|
|
|
}
|