@@ -54,4 +54,5 @@ var (
KeyFilterReg = regexp.MustCompile("^(项目|中标|公告)$")
KeyRetainReg = regexp.MustCompile("[\\p{Han}a-zA-Z0-9]")
SaveBiddingField = []string{"_id", "area", "city", "buyerclass", "publishtime", "s_subscopeclass", "subtype", "title", "toptype", "buyer", "bidamount", "budget", "projectname", "projectcode", "s_winner", "agency", "bidopentime", "attachment_count"}
+ SpaceReg = regexp.MustCompile("\\s+")
)
@@ -221,6 +221,21 @@ func GetKeySets(a_key interface{}) ([]*KeySet, error) {
if err == nil {
err = json.Unmarshal(_bs, &keySets)
}
+ for _, v := range keySets {
+ keys, appendKeys, notKeys := []string{}, []string{}, []string{}
+ for _, vv := range v.Keys {
+ keys = append(keys, SpaceReg.Split(strings.TrimSpace(vv), -1)...)
+ }
+ for _, vv := range v.AppendKeys {
+ appendKeys = append(appendKeys, SpaceReg.Split(strings.TrimSpace(vv), -1)...)
+ for _, vv := range v.NotKeys {
+ notKeys = append(notKeys, SpaceReg.Split(strings.TrimSpace(vv), -1)...)
+ v.Keys = keys
+ v.AppendKeys = appendKeys
+ v.NotKeys = notKeys
return keySets, err