xuzhiheng пре 2 година
родитељ
комит
7c2bd8397a
2 измењених фајлова са 43 додато и 35 уклоњено
  1. 12 8
      customerdata/src/util.go
  2. 31 27
      src/history/util_history.go

+ 12 - 8
customerdata/src/util.go

@@ -709,10 +709,12 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, a
 				}
 			}
 		}
-		details := qu.ObjToString(info["detail"])
-		if details != "" {
-			tmp["details"] = details
-		}
+		tmp["details"] = qu.ObjToString(info["detail"])
+		tmp["owner"] = qu.ObjToString(info["owner"])
+		tmp["total_investment"] = qu.ObjToString(info["total_investment"])
+		tmp["approvestatus"] = qu.ObjToString(info["approvestatus"])
+		tmp["approvetime"] = qu.Int64All(info["approvetime"])
+		tmp["project_completedate"] = qu.Int64All(info["project_completedate"])
 	} else {
 		infos := MgoBidding.FindOne("bidding_back", map[string]interface{}{"_id": mongodb.StringTOBsonId(id)})
 		if infos != nil && len(infos) > 0 {
@@ -763,10 +765,12 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, a
 					}
 				}
 			}
-			details := qu.ObjToString(infos["detail"])
-			if details != "" {
-				tmp["details"] = details
-			}
+			tmp["details"] = qu.ObjToString(info["detail"])
+			tmp["owner"] = qu.ObjToString(info["owner"])
+			tmp["total_investment"] = qu.ObjToString(info["total_investment"])
+			tmp["approvestatus"] = qu.ObjToString(info["approvestatus"])
+			tmp["approvetime"] = qu.Int64All(info["approvetime"])
+			tmp["project_completedate"] = qu.Int64All(info["project_completedate"])
 		}
 	}
 	//祥和不锈钢

+ 31 - 27
src/history/util_history.go

@@ -30,7 +30,7 @@ var LetterCase2 = regexp.MustCompile("[A-Za-z0-9]")
 var FilteReg = regexp.MustCompile("[{}]*")
 var Gmails []*mail.GmailAuth
 
-//匹配方式map
+// 匹配方式map
 var MatchType = map[string]interface{}{
 	"1": "title",
 	"2": "detail",
@@ -43,7 +43,7 @@ var MatchType = map[string]interface{}{
 	"9": "s_winner",
 }
 
-//字段与释义对应关系
+// 字段与释义对应关系
 var FieldMap = map[string]interface{}{
 	"title":            "公告标题",
 	"content":          "公告内容",
@@ -130,7 +130,7 @@ var FieldMap = map[string]interface{}{
 	"id":               "唯一标识",
 }
 
-//加载排除词、附加词、关键词
+// 加载排除词、附加词、关键词
 func GetNotkeyAndKeyAddWord(list []map[string]interface{}, fieldMap map[string]interface{}, hasNotKey bool) (kws []*KeyWord, aws []*AddWord, nkws []*NotKeyWord, tagnames, buyerclasss []string) {
 	defer qu.Catch()
 	for _, rules := range list {
@@ -303,7 +303,7 @@ func GetNotkeyAndKeyAddWord(list []map[string]interface{}, fieldMap map[string]i
 	return
 }
 
-//根据时间获取起始和终止ID范围
+// 根据时间获取起始和终止ID范围
 func GetIdRange() (bson.M, bool) {
 	defer qu.Catch()
 	now := time.Now().Unix()
@@ -375,7 +375,7 @@ func GetIdRange() (bson.M, bool) {
 
 }
 
-//处理文本
+// 处理文本
 func ProcessData(text string) string {
 	defer qu.Catch()
 	text = strings.ToUpper(text)               //文本中的英文全转为大写
@@ -383,7 +383,7 @@ func ProcessData(text string) string {
 	return text
 }
 
-//校验字母
+// 校验字母
 func CheckLetter(text string, reg *regexp.Regexp, indexArr [][]int) (flag bool) {
 	defer qu.Catch()
 	for _, tmpArr := range indexArr {
@@ -415,7 +415,7 @@ func CheckLetter(text string, reg *regexp.Regexp, indexArr [][]int) (flag bool)
 	return
 }
 
-//匹配
+// 匹配
 func RegMatch(fieldText map[string]interface{}, matchType []string, matchReg *Reg, matchKey map[string]bool, matchKeyType map[string]bool, goon, isAddWord bool) (match bool) {
 	defer qu.Catch()
 	if len(matchType) == 0 && isAddWord { //特殊处理附加词为空的情况
@@ -483,7 +483,7 @@ func RegMatch(fieldText map[string]interface{}, matchType []string, matchReg *Re
 	return
 }
 
-//map数据转数组
+// map数据转数组
 func MapDataToArr(tmpMap map[string]bool) (tmpArr []string) {
 	for tm, _ := range tmpMap {
 		tmpArr = append(tmpArr, tm)
@@ -491,7 +491,7 @@ func MapDataToArr(tmpMap map[string]bool) (tmpArr []string) {
 	return
 }
 
-//合并数据
+// 合并数据
 func MergeData(history, tmp map[string]interface{}, isTagRule, isDepartRmvRep bool, pushModel int) {
 	//matchkey、matchtype、ruleid均非空
 	matchkey1 := qu.ObjToString(history["matchkey"])
@@ -586,7 +586,7 @@ func MergeDatas(history, tmp map[string]interface{}, isTagRule, isDepartRmvRep b
 	//}
 }
 
-//合并字段
+// 合并字段
 func MergeField(str1, str2 string) string {
 	if str1 == "" {
 		return str2
@@ -609,7 +609,7 @@ func MergeField(str1, str2 string) string {
 	return strings.Join(slice1, ",")
 }
 
-//补充信息并保存
+// 补充信息并保存
 func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, historyId, appid string, isFilter, noticeFilter, dataTable, entId, i_contact int, xlsxData *XlsxData, dataSave string) {
 	if IsSearchHosp { //医院信息
 		SearchHospInfo(tmp)
@@ -860,10 +860,12 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 				}
 			}
 		}
-		details := qu.ObjToString(info["detail"])
-		if details != "" {
-			tmp["details"] = details
-		}
+		tmp["details"] = qu.ObjToString(info["detail"])
+		tmp["owner"] = qu.ObjToString(info["owner"])
+		tmp["total_investment"] = qu.ObjToString(info["total_investment"])
+		tmp["approvestatus"] = qu.ObjToString(info["approvestatus"])
+		tmp["approvetime"] = qu.Int64All(info["approvetime"])
+		tmp["project_completedate"] = qu.Int64All(info["project_completedate"])
 	} else {
 		infos := MgoBidding.FindOne("bidding_back", map[string]interface{}{"_id": mongodb.StringTOBsonId(id)})
 		if infos != nil && len(infos) > 0 {
@@ -914,10 +916,12 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 					}
 				}
 			}
-			details := qu.ObjToString(infos["detail"])
-			if details != "" {
-				tmp["details"] = details
-			}
+			tmp["details"] = qu.ObjToString(info["detail"])
+			tmp["owner"] = qu.ObjToString(info["owner"])
+			tmp["total_investment"] = qu.ObjToString(info["total_investment"])
+			tmp["approvestatus"] = qu.ObjToString(info["approvestatus"])
+			tmp["approvetime"] = qu.Int64All(info["approvetime"])
+			tmp["project_completedate"] = qu.Int64All(info["project_completedate"])
 		}
 	}
 	//祥和不锈钢
@@ -1004,7 +1008,7 @@ func AssembelSave(tmp map[string]interface{}, IsSearchHosp, IsSearchEnps bool, h
 	}
 }
 
-//查询第三方医院等级信息和招标客户的社会征信代码
+// 查询第三方医院等级信息和招标客户的社会征信代码
 func SearchHospInfo(tmp map[string]interface{}) {
 	if buyer := qu.ObjToString(tmp["buyer"]); buyer != "" { //buyer存在
 		//医院等级
@@ -1024,7 +1028,7 @@ func SearchHospInfo(tmp map[string]interface{}) {
 	}
 }
 
-//查询第三方中标企业信息
+// 查询第三方中标企业信息
 func SearchEnterpriseInfo(tmp map[string]interface{}) {
 	if s_winner := qu.ObjToString(tmp["s_winner"]); s_winner != "" {
 		winner := strings.Split(s_winner, ",")[0] //取第一个中标单位
@@ -1142,7 +1146,7 @@ func SearchEnterpriseInfos(tmp map[string]interface{}, s_winner string) {
 	}
 }
 
-//数据存库
+// 数据存库
 func SaveMgo() {
 	log.Println("Mgo Save...")
 	arru := make([]map[string]interface{}, 500)
@@ -1181,7 +1185,7 @@ func SaveMgo() {
 	}
 }
 
-//数据存库
+// 数据存库
 func SaveUsermailMgo() {
 	log.Println("Mgo Save Usermail...")
 	arru := make([]map[string]interface{}, 500)
@@ -1220,7 +1224,7 @@ func SaveUsermailMgo() {
 	}
 }
 
-//打印初始化信息
+// 打印初始化信息
 func PrintLog(cus *Customer) {
 	qu.Debug("----------------------打标签规则----------------------------")
 	for i, tr := range cus.TagRules {
@@ -1305,7 +1309,7 @@ func PrintLog(cus *Customer) {
 	}
 }
 
-//匹配
+// 匹配
 func RegMatchTest(fieldText map[string]interface{}, matchType []string, matchReg *Reg, matchKey map[string]bool, matchKeyType map[string]bool, goon, isAddWord bool) (match bool) {
 	defer qu.Catch()
 	qu.Debug("matchType---", matchType)
@@ -1388,7 +1392,7 @@ func RegMatchTest(fieldText map[string]interface{}, matchType []string, matchReg
 	return
 }
 
-//发布时间不在范围内(7天)不要这条数据
+// 发布时间不在范围内(7天)不要这条数据
 func SkipData(tmp map[string]interface{}) bool {
 	comeIn := qu.Int64All(tmp["comeintime"])
 	if qu.Int64All(tmp["publishtime"]) > (comeIn - 7*24*60*60) {
@@ -2456,7 +2460,7 @@ func GetWinnerStyle(s_winner string, v map[string]interface{}) {
 	}
 }
 
-//历史数据存到mysql pushentniche推送表中
+// 历史数据存到mysql pushentniche推送表中
 func saveMysqlPush(tmp map[string]interface{}, entId int) bool {
 	saveMap := map[string]interface{}{}
 	saveMap["entid"] = entId