|
@@ -67,7 +67,7 @@ func GetNotkeyAndKeyAddWord(list []map[string]interface{}, fieldMap map[string]i
|
|
|
tmp_nkw := nkw_addArr[0]
|
|
|
if tmp_nkw != "" {
|
|
|
cr := &CommonReg{}
|
|
|
- cr.CsVal = tmp_nkw //记录原值
|
|
|
+ cr.CsVal = tmp_nkw //记录原值
|
|
|
if LetterCase.MatchString(tmp_nkw) { //判断附加词中是否有英文
|
|
|
tmp_nkw = strings.ToUpper(tmp_nkw) //附加词中有英文全部转为大写
|
|
|
cr.IsLetter = true //含字母
|
|
@@ -119,7 +119,7 @@ func GetNotkeyAndKeyAddWord(list []map[string]interface{}, fieldMap map[string]i
|
|
|
tmp_aw := aw_addArr[0]
|
|
|
if tmp_aw != "" {
|
|
|
cr := &CommonReg{}
|
|
|
- cr.CsVal = tmp_aw //记录原值
|
|
|
+ cr.CsVal = tmp_aw //记录原值
|
|
|
if LetterCase.MatchString(tmp_aw) { //判断附加词中是否有英文
|
|
|
tmp_aw = strings.ToUpper(tmp_aw) //附加词中有英文全部转为大写
|
|
|
cr.IsLetter = true //含字母
|
|
@@ -353,7 +353,7 @@ func RegMatch(fieldText map[string]interface{}, matchType []string, matchReg *Re
|
|
|
for n, arc := range ar.AndRegKid { //ar.AndRegKid若有值必不小于2
|
|
|
if indexArr := arc.CrVal.FindAllStringIndex(text, -1); len(indexArr) < 1 { //匹配失败(ar.AndRegKid中任意一个未匹配则失败)
|
|
|
break
|
|
|
- } else { //匹配成功,判断字母
|
|
|
+ } else { //匹配成功,判断字母
|
|
|
if arc.IsLetter && !CheckLetter(text, arc.CrVal, indexArr) { //reg有字母,判断是否是包含关系(AAAIBBB or AI)
|
|
|
break
|
|
|
}
|
|
@@ -387,7 +387,7 @@ func MapDataToArr(tmpMap map[string]bool) (tmpArr []string) {
|
|
|
}
|
|
|
|
|
|
//合并数据
|
|
|
-func MergeData(history, tmp map[string]interface{}, isTagRule, isDepartRmvRep bool) {
|
|
|
+func MergeData(history, tmp map[string]interface{}, isTagRule, isDepartRmvRep bool, pushModel int) {
|
|
|
//matchkey、matchtype、ruleid均非空
|
|
|
matchkey1 := qu.ObjToString(history["matchkey"])
|
|
|
matchkey2 := qu.ObjToString(tmp["matchkey"])
|
|
@@ -425,7 +425,60 @@ func MergeData(history, tmp map[string]interface{}, isTagRule, isDepartRmvRep bo
|
|
|
departid1 := qu.ObjToString(history["departid"])
|
|
|
departid2 := qu.ObjToString(tmp["departid"])
|
|
|
history["departid"] = MergeField(departid1, departid2)
|
|
|
+ if pushModel == 1 {
|
|
|
+ item1 := qu.ObjToString(history["item"])
|
|
|
+ item2 := qu.ObjToString(tmp["item"])
|
|
|
+ history["item"] = MergeField(item1, item2)
|
|
|
+ history["itemdist"].(map[string]interface{})[departname2] = matchkey2
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+func MergeDatas(history, tmp map[string]interface{}, isTagRule, isDepartRmvRep bool) {
|
|
|
+ //matchkey、matchtype、ruleid均非空
|
|
|
+ matchkey1 := qu.ObjToString(history["matchkey"])
|
|
|
+ matchkey2 := qu.ObjToString(tmp["matchkey"])
|
|
|
+ history["matchkey"] = MergeField(matchkey1, matchkey2)
|
|
|
+
|
|
|
+ matchkeytype1 := qu.ObjToString(history["matchtype"])
|
|
|
+ matchkeytype2 := qu.ObjToString(tmp["matchtype"])
|
|
|
+ history["matchtype"] = MergeField(matchkeytype1, matchkeytype2)
|
|
|
+
|
|
|
+ ruleid1 := qu.ObjToString(history["ruleid"])
|
|
|
+ ruleid2 := qu.ObjToString(tmp["ruleid"])
|
|
|
+ history["ruleid"] = MergeField(ruleid1, ruleid2)
|
|
|
+
|
|
|
+ rulename1 := qu.ObjToString(history["rulename"])
|
|
|
+ rulename2 := qu.ObjToString(tmp["rulename"])
|
|
|
+ history["rulename"] = MergeField(rulename1, rulename2)
|
|
|
+
|
|
|
+ item1 := qu.ObjToString(history["item"])
|
|
|
+ item2 := qu.ObjToString(tmp["item"])
|
|
|
+ history["item"] = MergeField(item1, item2)
|
|
|
+ history["itemdist"].(map[string]interface{})[item2] = matchkey2
|
|
|
+ qu.Debug("组装后的item:", history["item"], history["itemdist"])
|
|
|
+
|
|
|
+ if isTagRule { //标签模式 tagname、tagid合并
|
|
|
+ tagname1 := qu.ObjToString(history["tagname"])
|
|
|
+ tagname2 := qu.ObjToString(tmp["tagname"])
|
|
|
+ if tagNameResult := MergeField(tagname1, tagname2); tagNameResult != "" {
|
|
|
+ history["tagname"] = tagNameResult
|
|
|
+ }
|
|
|
+
|
|
|
+ tagid1 := qu.ObjToString(history["tagid"])
|
|
|
+ tagid2 := qu.ObjToString(tmp["tagid"])
|
|
|
+ if tagIdResult := MergeField(tagid1, tagid2); tagIdResult != "" {
|
|
|
+ history["tagid"] = tagIdResult
|
|
|
+ }
|
|
|
}
|
|
|
+ //if isDepartRmvRep { //全局模式 部门合并
|
|
|
+ departname1 := qu.ObjToString(history["departname"])
|
|
|
+ departname2 := qu.ObjToString(tmp["departname"])
|
|
|
+ history["departname"] = MergeField(departname1, departname2)
|
|
|
+ departid1 := qu.ObjToString(history["departid"])
|
|
|
+ departid2 := qu.ObjToString(tmp["departid"])
|
|
|
+ history["departid"] = MergeField(departid1, departid2)
|
|
|
+ //}
|
|
|
}
|
|
|
|
|
|
//合并字段
|
|
@@ -1011,7 +1064,7 @@ func RegMatchTest(fieldText map[string]interface{}, matchType []string, matchReg
|
|
|
qu.Debug("nnnn---", n, arc.CrVal, arc.IsLetter)
|
|
|
if indexArr := arc.CrVal.FindAllStringIndex(text, -1); len(indexArr) < 1 { //匹配失败(ar.AndRegKid中任意一个未匹配则失败)
|
|
|
break
|
|
|
- } else { //匹配成功,判断字母
|
|
|
+ } else { //匹配成功,判断字母
|
|
|
if arc.IsLetter && !CheckLetter(text, arc.CrVal, indexArr) { //reg有字母,判断是否是包含关系(AAAIBBB or AI)
|
|
|
break
|
|
|
}
|
|
@@ -1280,7 +1333,7 @@ func GetXlsxs(mMap []map[string]interface{}, fn, email, id string, isfile, isHen
|
|
|
row.AddCell().SetValue(v["projectname"]) //项目名称
|
|
|
row.AddCell().SetValue(v["buyer"]) //采购单位
|
|
|
row.AddCell().SetValue(v["buyer_type"]) //采购单位类别---私有标签tagname
|
|
|
- if v["bidamount"] != nil { //中标金额
|
|
|
+ if v["bidamount"] != nil { //中标金额
|
|
|
row.AddCell().SetFloat(qu.Float64All(v["bidamount"]))
|
|
|
} else {
|
|
|
row.AddCell()
|