Procházet zdrojové kódy

Merge branch 'master' of https://app.yhyue.com/moapp/jypkg into master

zhangxinlei1996 před 2 roky
rodič
revize
caca99efa5

+ 10 - 7
common/src/qfw/util/dataexport/dataexport.go

@@ -656,7 +656,7 @@ func GetDataExportSelectResult(bidding mg.MongodbSim, biddingName string, scd *S
 		"_id": 1, "title": 1, "detail": 1, "area": 1, "city": 1, "publishtime": 1, "projectname": 1, "buyer": 1, "s_winner": 1, "bidamount": 1, "subtype": 1, "toptype": 1, "filetext": 1, "purchasing": 1,
 	}
 	if dataType == "2" {
-		for _, key := range []string{"href", "projectcode", "buyerperson", "buyertel", "budget", "bidopentime", "agency", "projectscope", "winnerperson", "winnertel", "bidendtime"} {
+		for _, key := range []string{"href", "projectcode", "buyerperson", "buyertel", "budget", "bidopentime", "agency", "projectscope", "winnerperson", "winnertel", "bidendtime", "district", "signendtime", "buyeraddr"} {
 			selectMap[key] = 1
 		}
 	}
@@ -889,11 +889,6 @@ func FormatExportData(entmg mg.MongodbSim, data *[]map[string]interface{}, webdo
 	for _, v := range *data {
 		//有中标企业 且 高级字段查询
 		if dataType == "2" {
-			if qutil.Int64All(v["bidendtime"]) > 0 {
-				v["bidendtime"] = strings.Split(time.Unix(qutil.Int64All(v["bidendtime"]), 0).Format("2006-01-02 15:04:05"), " ")[0]
-			} else {
-				v["bidendtime"] = ""
-			}
 			//查询企业公示 法人 公司电话 公司邮箱地址
 			s_winner, ok := v["s_winner"].(string) //改为entidlistxx?
 			if ok && s_winner != "" {
@@ -988,6 +983,14 @@ 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["bidendtime"] != nil {
+			date := v["bidendtime"]
+			v["bidendtime"] = FormatDateWithObj(&date, Date_Short_Layout)
+		}
 		if v["_id"] != nil {
 			encodeId := CommonEncodeArticle("content", v["_id"].(string))
 			v["url"] = webdomain + "/article/content/" + encodeId + ".html"
@@ -1050,7 +1053,7 @@ func doSearch(sql string, start, count int, dataType string) *[]map[string]inter
 		if dataType != "" {
 			dataexport_field := `"_id","title","detail","area","city","publishtime","projectname","buyer","s_winner","bidamount","subtype","toptype","filetext","purchasing"`
 			if dataType == "2" {
-				dataexport_field += `,"href","projectcode","buyerperson","buyertel","budget","bidopentime","agency","projectscope","winnerperson","winnertel","bidendtime"`
+				dataexport_field += `,"href","projectcode","buyerperson","buyertel","budget","bidopentime","agency","projectscope","winnerperson","winnertel","bidendtime", "district", "signendtime", "buyeraddr"`
 			}
 			sql = sql[:len(sql)-1] + `,"_source":[` + dataexport_field + "]}"
 		}

+ 18 - 4
common/src/qfw/util/dataexport/entdataexport.go

@@ -54,10 +54,13 @@ func GetEntDataExportCount(sim, bid mg.MongodbSim, bidMgoDBName, elasticAddress,
 		insertFlag = "true"
 	}
 	for _, v := range *res {
-		if util.Int64All(v["bidendtime"]) > 0 {
-			v["bidendtime"] = strings.Split(time.Unix(util.Int64All(v["bidendtime"]), 0).Format("2006-01-02 15:04:05"), " ")[0]
-		} else {
-			v["bidendtime"] = ""
+		if v["signendtime"] != nil {
+			date := v["signendtime"]
+			v["signendtime"] = FormatDateWithObj(&date, Date_Short_Layout)
+		}
+		if v["bidendtime"] != nil {
+			date := v["bidendtime"]
+			v["bidendtime"] = FormatDateWithObj(&date, Date_Short_Layout)
 		}
 		id := util.ObjToString(v["_id"])
 		if m[id] {
@@ -221,6 +224,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 +286,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 +310,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 +328,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"])

+ 2 - 30
common/src/qfw/util/jy/userMerge.go

@@ -2,7 +2,6 @@ package jy
 
 import (
 	"fmt"
-	"net/http"
 	"strings"
 
 	qutil "app.yhyue.com/moapp/jybase/common"
@@ -10,7 +9,6 @@ import (
 	"app.yhyue.com/moapp/jybase/go-xweb/httpsession"
 	. "app.yhyue.com/moapp/jybase/mongodb"
 	"app.yhyue.com/moapp/jybase/mysql"
-	usercenter "app.yhyue.com/moapp/jybase/usercenter"
 	"go.mongodb.org/mongo-driver/bson"
 )
 
@@ -108,6 +106,7 @@ func (this *UserMerge) FlushSession(userData *map[string]interface{}, userId str
 	}
 	ClearBigVipUserPower(userId) //大会员状态刷新
 	sessionVal["userId"] = userId
+	sessionVal["mgoUserId"] = userId
 	nickName, _ := (*userData)["s_nickname"].(string)
 	phone, _ := (*userData)["s_phone"].(string)
 	if nickName == "" {
@@ -136,33 +135,6 @@ func (this *UserMerge) FlushSession(userData *map[string]interface{}, userId str
 	sessionVal["s_appponetype"], _ = (*userData)["s_appponetype"].(string)
 	sessionVal["s_appversion"], _ = (*userData)["s_appversion"].(string)
 	sessionVal["app_name"] = nickName
-	if base_userid := qutil.IntAllDef((*userData)["base_user_id"], 0); base_userid != 0 {
-		sessionVal["base_user_id"] = base_userid
-
-		identity := usercenter.GetUserIdentity(this.userCenterApi, userId, int64(base_userid), 0, &http.Cookie{})
-		if identity != nil {
-			if identity.PersonId > 0 {
-				sessionVal["personId"] = identity.PersonId
-			}
-			if identity.UserName != "" {
-				sessionVal["userName"] = identity.UserName
-			}
-			if identity.UserAccountId > 0 {
-				sessionVal["userAccountId"] = identity.UserAccountId
-			}
-			if identity.EntAccountId > 0 {
-				sessionVal["entAccountId"] = identity.EntAccountId
-			}
-			if identity.EntUserAccountId > 0 {
-				sessionVal["entUserAccountId"] = identity.EntUserAccountId
-			}
-			if identity.UserPositionId > 0 {
-				sessionVal["userPositionId"] = identity.UserPositionId
-			}
-			if identity.EntUserPositionId > 0 {
-				sessionVal["entUserPositionId"] = identity.EntUserPositionId
-			}
-		}
-	}
+	sessionVal["base_user_id"] = qutil.IntAll((*userData)["base_user_id"])
 	this.sess.SetMultiple(sessionVal)
 }