Quellcode durchsuchen

备份 抽取 - 文件字段

zhengkun vor 3 Jahren
Ursprung
Commit
dfcf867713

+ 14 - 14
src/jy/extract/extract.go

@@ -684,7 +684,7 @@ func (e *ExtractTask) ExtractDetail(j *ju.Job, isSite bool, codeSite string) {
 					continue
 				}
 
-				if vc.Field =="bidamount" {
+				if vc.Field =="signendtime" {
 					//log.Debug("调试抽取字段")
 				}
 				////抽取-前置规则
@@ -1753,7 +1753,7 @@ func ExtRuleKV(j *ju.Job, in *RegLuaInfo, t *TaskInfo) {
 				if v.Type != "table" && !strings.Contains(v.Type, "colon") && !strings.Contains(v.Type, "space") {
 					continue
 				}
-				if v.Field=="中标金额" ||v.Field=="bidamount" {
+				if v.Field=="docendtime" {
 					//log.Debug("调试字段...")
 				}
 				text := qu.ObjToString(v.Value)
@@ -2610,18 +2610,18 @@ func checkFields(tmp map[string]interface{}) map[string]interface{} {
 
 
 	//临时
-	//bidopentime := qu.Int64All(tmp["bidopentime"])
-	//bidendtime := qu.Int64All(tmp["bidendtime"])
-	//timeLayout := "2006-01-02 15:04:05"
-	//
-	//if bidopentime>0 {
-	//	bidopentime_str := time.Unix(bidopentime, 0).Format(timeLayout) //设置时间戳 使用模板格式化为日期字符串
-	//	tmp["bidopentime"] = bidopentime_str
-	//}
-	//if bidendtime>0 {
-	//	bidendtime_str := time.Unix(bidendtime, 0).Format(timeLayout) //设置时间戳 使用模板格式化为日期字符串
-	//	tmp["bidendtime"] = bidendtime_str
-	//}
+	docstarttime := qu.Int64All(tmp["docstarttime"])
+	docendtime := qu.Int64All(tmp["docendtime"])
+	timeLayout := "2006-01-02 15:04:05"
+
+	if docstarttime>0 {
+		time_1 := time.Unix(docstarttime, 0).Format(timeLayout) //设置时间戳 使用模板格式化为日期字符串
+		tmp["docstarttime"] = time_1
+	}
+	if docendtime>0 {
+		time_2 := time.Unix(docendtime, 0).Format(timeLayout) //设置时间戳 使用模板格式化为日期字符串
+		tmp["docendtime"] = time_2
+	}
 
 	jyhref:= fmt.Sprintf(JYUrl, qu.CommonEncodeArticle("content", qu.BsonIdToSId(tmp["_id"])))
 	tmp["jytest_href"] = jyhref

+ 1 - 0
src/jy/extract/extractudp.go

@@ -262,6 +262,7 @@ func ExtractByUdp(sid, eid string, ra *net.UDPAddr, instanceId ...string) {
 					log.Debug(index, qu.BsonIdToSId(v["_id"]), "//开标记录")
 					continue
 				}
+
 				_id := qu.BsonIdToSId(v["_id"])
 				var j, jf *ju.Job
 				var isSite bool

+ 4 - 0
src/jy/extract/score.go

@@ -115,6 +115,10 @@ func ScoreFields(j *ju.Job, ftag map[string][]*Tag) map[string][]*ju.ExtField {
 		if field == "projectcode" {
 			tmps = projectWeightClear(tmps)
 		}
+		if field=="docendtime" {
+			//log.Println("调试调试")
+		}
+
 		if field == "budget" || field == "bidamount" {
 			for tmpsindex, tmpsvalue := range tmps {
 				if (strings.Contains(tmpsvalue.RuleText, "总")||strings.Contains(tmpsvalue.Code, "总价")) && tmpsvalue.RuleText!="总价(元)" &&(tmpsvalue.Type == "colon"||tmpsvalue.Type == "table" ) {

+ 1 - 1
src/jy/pretreated/analystep.go

@@ -17,7 +17,7 @@ import (
 //投标文件格式 技术评分明细表
 var yjReg *regexp.Regexp = regexp.MustCompile("(打分表|负责人|单位|个人|投标人|项目|企业)业绩|主要人员相关资料|唱标记录|标的名称|否决投标的?情况说明")
 var blTextReg *regexp.Regexp = regexp.MustCompile("(打分表|负责人|单位|个人|投标人|项目|企业)业绩|主要人员相关资料|唱标记录|否决投标的?情况说明")
-var unblTextReg *regexp.Regexp = regexp.MustCompile("(项目业绩案例)")
+var unblTextReg *regexp.Regexp = regexp.MustCompile("(项目业绩案例|类似项目业绩)")
 
 
 var hisReg = regexp.MustCompile("(开标记录|开标记录及投标报价|类似业绩|历史业绩|填报项目业绩|[得评]+[审打]{0,2}分情况|无效标)[::\n]*.*?[\n]?(</td>)")

+ 14 - 8
src/jy/pretreated/analytable.go

@@ -107,7 +107,12 @@ var (
 	NullTdReg      = regexp.MustCompile("(首选|第[一二三四五1-5])(中标|成交)?(名(称)?|(候选|排序)?(人|单位|供应商))")
 	NullTxtBid     = "成交供应商排名"
 	projectnameReg = regexp.MustCompile("((公开)?招标)*[((第]*[一二三四五六七八九十a-zA-Z0-9]+(标段|包|标|段)[))]*$")
-	MhSpilt        = regexp.MustCompile("[::]")
+	MhSpilt        = regexp.MustCompile("[::]") //降低冒号权重
+	//指定字段且时间格式
+	UnTimeSpiltKey    = regexp.MustCompile("(招标文件获取截止时间|招标文件获取开始时间|报名截止时间|报名开始时间|投标文件递交开始时间|开工日期|竣工日期)")
+	UnTimeSpiltValue  = regexp.MustCompile("\\d{1,2}[::]\\d{1,2}")
+
+
 	//识别采购单位联系人、联系电话、代理机构联系人、联系电话  -- 名称有异常
 	ContactInfoVagueReg = regexp.MustCompile("邮政编码|邮编|名称|(征求意见|报名审核购买)?((联系人?(及|和)?|办公|单位)?(((联系)?(电话|方式|号码)([//及]传真|及手机)?|手机)(号码)?|邮箱(地址)?|(详细)?(地(址|点)))|(联系|收料)(人(姓名)?|方式)|传真|电子邮件|(主要负责|项目(负责|联系)|经办)人)|采购方代表")
 	ContactInfoMustReg  = regexp.MustCompile("^(" + ContactInfoVagueReg.String() + ")$")
@@ -191,8 +196,8 @@ func CommonDataAnaly(k, tabletag, tabledesc string, v interface{}, isSite bool,
 	//当取到标准化值时,放入数组
 	if len(res) > 0 {
 		for _, t1 := range res {
-			//降低冒号值的权重
-			if MhSpilt.MatchString(v1) {
+			//降低冒号值的权重-不适合日期格式的数据
+			if MhSpilt.MatchString(v1) && !(UnTimeSpiltKey.MatchString(t1.Value) && UnTimeSpiltValue.MatchString(v1)){
 				t1.Weight -= 50
 			}
 			if winnerOrderAndBidResult.MatchString(tabletag) && t1.Value == "采购单位联系人" { //处理table中项目负责人
@@ -726,7 +731,8 @@ func (table *Table) MergerToTableresult() {
 					bp.Budget = v1.Budget
 					bp.IsTrueBudget = v1.IsTrueBudget
 				}
-				bp.Text += bp.Text
+				//fmt.Println(utf8.RuneCountInString(bp.Text))
+				//bp.Text += bp.Text
 				if len(v1.WinnerOrder) > 0 && len(bp.WinnerOrder) == 0 {
 					bp.WinnerOrder = v1.WinnerOrder
 				}
@@ -1896,9 +1902,9 @@ func (table *Table) FindTdVal(td *TD, direct, vdirect int) (b bool) {
 		if key == "名称" && near.StartCol == 0 && near.Rowspan > 0 {
 			new_key := ""
 			tr := table.TRs[:td.TR.RowPos]
-			if len(tr)>len(tr)-1 {
+			if len(tr)>len(tr)-1 && len(tr)>0 {
 				tds := tr[len(tr)-1].TDs
-				if len(tds)>td.EndCol {
+				if len(tds)>td.EndCol && tds !=nil {
 					td1 := tds[td.EndCol]
 					if zbhxrSecondReg.MatchString(td1.Val) {
 						new_key = td1.Val
@@ -1924,9 +1930,9 @@ func (table *Table) FindTdVal(td *TD, direct, vdirect int) (b bool) {
 		} else if zbhxrReg.MatchString(key) && findCandidate2.MatchString(td.Val) {
 			new_key := "中标单位"
 			tr_top := table.TRs[:td.TR.RowPos]
-			if len(tr_top)>len(tr_top)-1 { //上临查询
+			if len(tr_top)>len(tr_top)-1 && len(tr_top)>0{ //上临查询
 				tds := tr_top[len(tr_top)-1].TDs
-				if len(tds)>td.EndCol {
+				if len(tds)>td.EndCol && tds !=nil{
 					td1 := tds[td.EndCol]
 					if zbhxrSortNameReg.MatchString(td1.Val) {
 						new_key = td1.Val

+ 1 - 1
udps/main.go

@@ -23,7 +23,7 @@ func main() {
 	flag.IntVar(&tmptime, "tmptime", 0, "时间查询")
 	flag.StringVar(&tmpkey, "tmpkey", "", "时间字段")
 
-	flag.StringVar(&id1, "gtid", "114168ea1a75b8f44678a39b", "gtid")
+	flag.StringVar(&id1, "gtid", "124ed30f4f7bde5444f1eb84", "gtid")
 	flag.StringVar(&id2, "lteid", "9142e5741a75b8f4467b3276", "lteid")
 
 	flag.StringVar(&ids, "ids", "", "id1,id2")