|
@@ -139,7 +139,6 @@ func CommonDataAnaly(k, tabletag, tabledesc string, v interface{}) (k1 []string,
|
|
|
if len(res) > 0 {
|
|
|
b = true
|
|
|
for _, t1 := range res {
|
|
|
- //u.Debug(k, k1, t1.Value, t1.Weight)
|
|
|
k1 = append(k1, t1.Value)
|
|
|
weight = append(weight, t1.Weight)
|
|
|
}
|
|
@@ -527,7 +526,6 @@ func AnalyTableV2(tabs []*goquery.Selection, toptype, blockTag, con string, ityp
|
|
|
}
|
|
|
//解析表格集
|
|
|
tabres.Analy()
|
|
|
- //u.Debug(tabres.SortKV.Map)
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1284,8 +1282,6 @@ func (table *Table) FindKV() {
|
|
|
continue
|
|
|
}
|
|
|
for _, td := range tr.TDs {
|
|
|
- //u.Debug(td.Val, td.BH, td.StartRow, td.StartCol)
|
|
|
- //u.Debug(td.BH, td.Val)
|
|
|
/**
|
|
|
rt := table.StartAndEndRation[fmtkey("r", td.StartCol, td.EndCol)]
|
|
|
if rt != nil {
|
|
@@ -1400,6 +1396,7 @@ func (table *Table) FindKV() {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ //log.Println("FindKV", table.SortKV.Map)
|
|
|
}
|
|
|
|
|
|
//获取中标人顺序
|
|
@@ -1456,9 +1453,8 @@ func GetBidSort(str string, n int) int {
|
|
|
//查找每一个单元格的表头,调用FindNear
|
|
|
func (table *Table) FindTdVal(td *TD, direct, vdirect int) (b bool) {
|
|
|
near := table.FindNear(td, direct)
|
|
|
- //u.Debug(td.Val, near, direct)
|
|
|
// if near != nil {
|
|
|
- // u.Debug(td.Val, near.Val)
|
|
|
+ // log.Println("td", near.Val, td.Val)
|
|
|
// }
|
|
|
if near != nil && near.BH && (near.KeyDirect == vdirect || near.KeyDirect == 0) && (near.KVDirect == direct || near.KVDirect == 0) && near.KVDirect < 3 {
|
|
|
near.KVDirect = direct
|
|
@@ -1473,7 +1469,6 @@ func (table *Table) FindTdVal(td *TD, direct, vdirect int) (b bool) {
|
|
|
if val != nil {
|
|
|
curpos := table.SortKV.Index[key]
|
|
|
thistr := table.kTD[curpos]
|
|
|
- //u.Debug(curpos, key, thistr == near)
|
|
|
if thistr != near {
|
|
|
near.Val += "_"
|
|
|
for table.SortKV.Map[near.Val] != nil {
|
|
@@ -1559,7 +1554,7 @@ func (table *Table) FindTdVal(td *TD, direct, vdirect int) (b bool) {
|
|
|
tkey := fmtkey("k", near.TR.RowPos, near.ColPos)
|
|
|
table.SortKV.ReplaceKey(key, val, tkey)
|
|
|
} else {
|
|
|
- //u.Debug(near.Val, td.Val, val)
|
|
|
+ //log.Println("AddKey", near.Val, td.Val, val)
|
|
|
table.SortKV.AddKey(key, val)
|
|
|
pos := table.SortKV.Index[key]
|
|
|
if barr {
|
|
@@ -1582,16 +1577,10 @@ func (table *Table) FindTdVal(td *TD, direct, vdirect int) (b bool) {
|
|
|
}
|
|
|
table.kTD[pos] = near
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
b = true
|
|
|
}
|
|
|
- // else {
|
|
|
- // u.Debug(direct, near == nil, td.Val, td.StartRow, td.EndRow, td.StartCol)
|
|
|
- // if near != nil {
|
|
|
- // u.Debug(near.Val, near.BH, near.StartRow, near.EndRow, near.KVDirect, near.KeyDirect)
|
|
|
- // }
|
|
|
- // }
|
|
|
+ //log.Println("map", b, table.SortKV.Map)
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -1656,9 +1645,6 @@ func (tn *Table) CheckMultiPackageByTable() (b bool, index []string) {
|
|
|
//是数组且能找到标段之类的提示
|
|
|
arr_count := 0
|
|
|
key_index := -1
|
|
|
- // for k, v := range tn.SortKV.Map["成交供应商"].([]string) {
|
|
|
- // u.Debug(k, v)
|
|
|
- // }
|
|
|
hasPkgTd := map[string]bool{}
|
|
|
for in, k := range tn.SortKV.Keys {
|
|
|
if excludeKey.MatchString(BracketsTextReg.ReplaceAllString(k, "")) {
|
|
@@ -1817,8 +1803,6 @@ func (tn *Table) CheckMultiPackageByTable() (b bool, index []string) {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- // u.Debug(tn.SortKV.Keys)
|
|
|
- // u.Debug(tn.SortKV.Map)
|
|
|
// u.Debug(index)
|
|
|
//过滤重复及标准化!
|
|
|
standIndex := []string{}
|
|
@@ -1930,14 +1914,14 @@ func (tn *Table) CheckMultiPackageByTable() (b bool, index []string) {
|
|
|
} else if val, bvs := v1.(string); bvs && len(index) == 1 {
|
|
|
//删除子包的kv
|
|
|
k1tags, _, _, _, _ := CommonDataAnaly(k1, "", "", val)
|
|
|
- //k1tags := u.GetTags(k1)
|
|
|
if !(len(k1tags) > 0 && regexp.MustCompile("^(项目|开标|采购单位|招标机构)").MatchString(k1tags[0])) { //(k1tags[0].Value == "采购单位" || k1tags[0].Value == "项目编号")) {
|
|
|
- //u.Debug(k1, val)
|
|
|
+ //log.Println("remove", k1, val)
|
|
|
tn.assemblePackage(k1, val, index[0])
|
|
|
tn.SortKV.RemoveKey(k1)
|
|
|
}
|
|
|
//u.Debug("----==2==-------", k1)
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
} else {
|