|
@@ -53,48 +53,48 @@ func Init() {
|
|
|
}
|
|
|
|
|
|
//测试环境
|
|
|
- //MgoT = &mongodb.MongodbSim{
|
|
|
- // MongodbAddr: "192.168.3.149:27102",
|
|
|
- // //MongodbAddr: "192.168.3.206:27002",
|
|
|
- // DbName: "mixdata",
|
|
|
- // Size: 10,
|
|
|
- // UserName: "root",
|
|
|
- // Password: "root",
|
|
|
- // //Direct: true,
|
|
|
- //}
|
|
|
- //MgoT.InitPool()
|
|
|
- //
|
|
|
- ////测试环境es
|
|
|
- //Es = &elastic.Elastic{
|
|
|
- // S_esurl: "http://192.168.3.149:9201",
|
|
|
- // //S_esurl: "http://172.17.4.184:19805",
|
|
|
- // I_size: 10,
|
|
|
- // Username: "",
|
|
|
- // Password: "",
|
|
|
- //}
|
|
|
- //Es.InitElasticSize()
|
|
|
-
|
|
|
- //正式环境
|
|
|
MgoT = &mongodb.MongodbSim{
|
|
|
- MongodbAddr: "172.17.189.140:27080",
|
|
|
- //MongodbAddr: "127.0.0.1:27083",
|
|
|
- Size: 10,
|
|
|
+ MongodbAddr: "192.168.3.149:27102",
|
|
|
+ //MongodbAddr: "192.168.3.206:27002",
|
|
|
DbName: "mixdata",
|
|
|
- UserName: "SJZY_RWbid_ES",
|
|
|
- Password: "SJZY@B4i4D5e6S",
|
|
|
- //Direct: true,
|
|
|
+ Size: 10,
|
|
|
+ UserName: "root",
|
|
|
+ Password: "root",
|
|
|
+ // Direct: true,
|
|
|
}
|
|
|
MgoT.InitPool()
|
|
|
|
|
|
+ //测试环境es
|
|
|
Es = &elastic.Elastic{
|
|
|
- //S_esurl: "http://127.0.0.1:19908",
|
|
|
- S_esurl: "http://172.17.4.184:19908",
|
|
|
+ S_esurl: "http://192.168.3.149:9201",
|
|
|
+ //S_esurl: "http://172.17.4.184:19805",
|
|
|
I_size: 10,
|
|
|
- Username: "jybid",
|
|
|
- Password: "Top2023_JEB01i@31",
|
|
|
+ Username: "",
|
|
|
+ Password: "",
|
|
|
}
|
|
|
Es.InitElasticSize()
|
|
|
|
|
|
+ //正式环境
|
|
|
+ // MgoT = &mongodb.MongodbSim{
|
|
|
+ // MongodbAddr: "172.17.189.140:27080",
|
|
|
+ // //MongodbAddr: "127.0.0.1:27083",
|
|
|
+ // Size: 10,
|
|
|
+ // DbName: "mixdata",
|
|
|
+ // UserName: "SJZY_RWbid_ES",
|
|
|
+ // Password: "SJZY@B4i4D5e6S",
|
|
|
+ // //Direct: true,
|
|
|
+ // }
|
|
|
+ // MgoT.InitPool()
|
|
|
+
|
|
|
+ // Es = &elastic.Elastic{
|
|
|
+ // //S_esurl: "http://127.0.0.1:19908",
|
|
|
+ // S_esurl: "http://172.17.4.184:19908",
|
|
|
+ // I_size: 10,
|
|
|
+ // Username: "jybid",
|
|
|
+ // Password: "Top2023_JEB01i@31",
|
|
|
+ // }
|
|
|
+ // Es.InitElasticSize()
|
|
|
+
|
|
|
}
|
|
|
|
|
|
func main() {
|
|
@@ -154,6 +154,8 @@ func main() {
|
|
|
err := Es.UpdateDocument("qyxy", id, updateEs)
|
|
|
if err != nil && err.Error() != "Document not updated: noop" {
|
|
|
log.Println("qyxy es update err", err, id)
|
|
|
+ } else {
|
|
|
+ log.Println("ID ", id)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -198,6 +200,7 @@ func getCreditLabel(appID, privateKeyPEM, certNo, sceneCode string) (createLabel
|
|
|
labelDe := util.ObjToString((*label)["label_definition"])
|
|
|
|
|
|
newName, subtype := getLabel(labelName)
|
|
|
+ log.Println("newName,subtype ", newName, subtype)
|
|
|
data := CreditLabel{}
|
|
|
data.ZhimaCode = labelCode
|
|
|
data.ZhimaDefinition = labelDe
|
|
@@ -205,9 +208,9 @@ func getCreditLabel(appID, privateKeyPEM, certNo, sceneCode string) (createLabel
|
|
|
data.ZhimaSubtype = subtype
|
|
|
data.ZhimaName = newName
|
|
|
data.ZhimaValue = labelName
|
|
|
- if subtype != "" {
|
|
|
- createLabels = append(createLabels, data)
|
|
|
- }
|
|
|
+ // if subtype != "" {
|
|
|
+ createLabels = append(createLabels, data)
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -226,6 +229,7 @@ func getLabel(labelName string) (newName, subtype string) {
|
|
|
// }
|
|
|
// }
|
|
|
newName = getNewName(labelName)
|
|
|
+ log.Println("old ", labelName, " new ", newName)
|
|
|
subtype = ""
|
|
|
if ZhimaMap[newName] != "" {
|
|
|
subtype = ZhimaMap[newName]
|
|
@@ -243,7 +247,7 @@ func getNewName(name string) string {
|
|
|
} else if strings.Contains(name, "公开项目中标") {
|
|
|
return "年度公开项目中标"
|
|
|
} else if ZhimaMap[name] != "" {
|
|
|
- return ZhimaMap[name]
|
|
|
+ return name
|
|
|
} else if strings.Contains(name, "年A级纳税人") {
|
|
|
return "A级纳税人连续年限"
|
|
|
} else if strings.Contains(name, "年A级纳税人") {
|
|
@@ -264,6 +268,52 @@ func getNewName(name string) string {
|
|
|
return "季度网络销量靠前"
|
|
|
} else if strings.Contains(name, "月销量全网前") {
|
|
|
return "月度网络销量靠前"
|
|
|
+ } else if strings.Contains(name, "绝对控股") {
|
|
|
+ return "绝对控股公司数"
|
|
|
+ } else if strings.Contains(name, "拥有") && strings.Contains(name, "作品") {
|
|
|
+ return "拥有作品"
|
|
|
+ } else if strings.Contains(name, "拥有") && strings.Contains(name, "著作权") {
|
|
|
+ return "拥有软件著作权"
|
|
|
+ } else if strings.Contains(name, "作品创作量位于同行业TOP") {
|
|
|
+ return "作品创作量位于同行业TOP数"
|
|
|
+ } else if strings.Contains(name, "作品创作量位于同行业前") {
|
|
|
+ return "作品创作量位于同行业TOP"
|
|
|
+ } else if strings.Contains(name, "年作品创作量极速增长") && strings.Contains(name, "连续") {
|
|
|
+ return "作品创作量极速增长连续年"
|
|
|
+ } else if strings.Contains(name, "年作品创作量增长") && strings.Contains(name, "连续") {
|
|
|
+ return "作品创作量增长连续年"
|
|
|
+ } else if strings.Contains(name, "个月作品创作量增长") && strings.Contains(name, "连续") {
|
|
|
+ return "作品创作量增长连续月"
|
|
|
+ } else if strings.Contains(name, "年软件研发量增长") && strings.Contains(name, "连续") {
|
|
|
+ return "软件研发量增长连续年"
|
|
|
+ } else if strings.Contains(name, "个月软件研发量增长") && strings.Contains(name, "连续") {
|
|
|
+ return "软件研发量增长连续月"
|
|
|
+ } else if strings.Contains(name, "货架商品数同行前") {
|
|
|
+ return "货架商品数位于同行TOP"
|
|
|
+ } else if strings.Contains(name, "类目直播销量前") && strings.Contains(name, "%") {
|
|
|
+ return "直播带货销量位于平台TOP"
|
|
|
+ } else if strings.Contains(name, "类目直播销量前") {
|
|
|
+ return "直播带货销量位于平台TOP数"
|
|
|
+ } else if strings.Contains(name, "个月直播销量增长") && strings.Contains(name, "连续") {
|
|
|
+ return "直播带货销量增长连续月"
|
|
|
+ } else if strings.Contains(name, "类目短视频销量平台前") && strings.Contains(name, "%") {
|
|
|
+ return "短视频带货销量位于平台TOP"
|
|
|
+ } else if strings.Contains(name, "类目短视频销量平台前") {
|
|
|
+ return "短视频带货销量位于平台TOP数"
|
|
|
+ } else if strings.Contains(name, "个月短视频销量增长") && strings.Contains(name, "连续") {
|
|
|
+ return "短视频带货销量增长连续月"
|
|
|
+ } else if strings.Contains(name, "年度网络销量同行前") && strings.Contains(name, "%") {
|
|
|
+ return "年度网络销量位于同行TOP"
|
|
|
+ } else if strings.Contains(name, "季度网络销量同行前") && strings.Contains(name, "%") {
|
|
|
+ return "季度网络销量位于同行TOP"
|
|
|
+ } else if strings.Contains(name, "月网络销量同行前") && strings.Contains(name, "%") {
|
|
|
+ return "月网络销量位于同行TOP"
|
|
|
+ } else if strings.Contains(name, "年度网络销量同行前") {
|
|
|
+ return "年度网络销量位于同行TOP数"
|
|
|
+ } else if strings.Contains(name, "季度网络销量同行前") {
|
|
|
+ return "季度网络销量位于同行TOP数"
|
|
|
+ } else if strings.Contains(name, "月网络销量同行前") {
|
|
|
+ return "月网络销量位于同行TOP数"
|
|
|
}
|
|
|
strs := RemoveNumbers(name)
|
|
|
strs = RemoveSpecialChars(strs)
|
|
@@ -272,6 +322,9 @@ func getNewName(name string) string {
|
|
|
if strings.Contains(name, k) {
|
|
|
return k
|
|
|
}
|
|
|
+ if strings.Contains(k, name) {
|
|
|
+ return k
|
|
|
+ }
|
|
|
isOk := true
|
|
|
for _, v := range strings.Split(strs, "年") {
|
|
|
if !strings.Contains(k, v) && v != "" {
|