Browse Source

fix:数据导出增加字段

duxin 2 years ago
parent
commit
defdd7a78c

+ 9 - 0
common/src/qfw/util/dataexport/dataexport.go

@@ -894,6 +894,11 @@ func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdo
 			} else {
 				v["bidendtime"] = ""
 			}
+			if qutil.Int64All(v["signendtime"]) > 0 {
+				v["signendtime"] = strings.Split(time.Unix(qutil.Int64All(v["signendtime"]), 0).Format("2006-01-02 15:04:05"), " ")[0]
+			} else {
+				v["signendtime"] = ""
+			}
 			//查询企业公示 法人 公司电话 公司邮箱地址
 			s_winner, ok := v["s_winner"].(string) //改为entidlistxx?
 			if ok && s_winner != "" {
@@ -988,6 +993,10 @@ func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdo
 			date := v["bidopentime"]
 			v["bidopentime"] = FormatDateWithObj(&date, Date_Short_Layout)
 		}
+		if v["signendtime"] != nil {
+			date := v["signendtime"]
+			v["signendtime"] = FormatDateWithObj(&date, Date_Short_Layout)
+		}
 		if v["_id"] != nil {
 			encodeId := CommonEncodeArticle("content", v["_id"].(string))
 			v["url"] = webdomain + "/article/content/" + encodeId + ".html"

+ 16 - 0
common/src/qfw/util/dataexport/entdataexport.go

@@ -58,6 +58,11 @@ func GetEntDataExportCount(sim, bid mg.MongodbSim, bidMgoDBName, elasticAddress,
 			v["bidendtime"] = strings.Split(time.Unix(util.Int64All(v["bidendtime"]), 0).Format("2006-01-02 15:04:05"), " ")[0]
 		} else {
 			v["bidendtime"] = ""
+		} //signendtime
+		if util.Int64All(v["signendtime"]) > 0 {
+			v["signendtime"] = strings.Split(time.Unix(util.Int64All(v["signendtime"]), 0).Format("2006-01-02 15:04:05"), " ")[0]
+		} else {
+			v["signendtime"] = ""
 		}
 		id := util.ObjToString(v["_id"])
 		if m[id] {
@@ -221,6 +226,10 @@ func FormatExportDatas(Mgo_Ent mongodb.MongodbSim, data *[]map[string]interface{
 				date := v["bidopentime"]
 				v["bidopentime"] = FormatDateWithObj(&date, Date_Short_Layout)
 			}
+			if v["signendtime"] != nil {
+				date := v["signendtime"]
+				v["signendtime"] = FormatDateWithObj(&date, Date_Short_Layout)
+			}
 			if v["currency"] == "" || v["currency"] == nil {
 				v["currency"] = "人民币"
 			}
@@ -279,6 +288,7 @@ func GetXlsx(mMap []map[string]interface{}, entId, entUserId int, filePath strin
 		row.AddCell().SetValue(v["keyword"])
 		row.AddCell().SetValue(v["area"])
 		row.AddCell().SetValue(v["city"])
+		row.AddCell().SetValue(v["district"])
 		row.AddCell().SetValue(v["title"])
 		row.AddCell().SetValue(v["subtype"])
 		row.AddCell().SetValue(v["detail"])
@@ -302,6 +312,11 @@ func GetXlsx(mMap []map[string]interface{}, entId, entUserId int, filePath strin
 		} else {
 			row.AddCell()
 		}
+		if v["signendtime"] != nil {
+			row.AddCell().SetValue(v["signendtime"])
+		} else {
+			row.AddCell()
+		}
 		if v["bidopentime"] != nil {
 			row.AddCell().SetValue(v["bidopentime"])
 		} else {
@@ -315,6 +330,7 @@ func GetXlsx(mMap []map[string]interface{}, entId, entUserId int, filePath strin
 		row.AddCell().SetValue(v["buyer"])
 		row.AddCell().SetValue(v["buyerperson"])
 		row.AddCell().SetValue(v["buyertel"])
+		row.AddCell().SetValue(v["buyeraddr"])
 		row.AddCell().SetValue(v["agency"])
 		row.AddCell().SetValue(v["s_winner"])
 		row.AddCell().SetValue(v["winnerperson"])