|
@@ -10,6 +10,7 @@ import (
|
|
qu "qfw/util"
|
|
qu "qfw/util"
|
|
"qfw/util/elastic"
|
|
"qfw/util/elastic"
|
|
redis "qfw/util/redis"
|
|
redis "qfw/util/redis"
|
|
|
|
+ "strconv"
|
|
"strings"
|
|
"strings"
|
|
"time"
|
|
"time"
|
|
|
|
|
|
@@ -70,16 +71,17 @@ func AuditOneField(c *gin.Context) {
|
|
start := c.GetInt("start")
|
|
start := c.GetInt("start")
|
|
limit := c.GetInt("length")
|
|
limit := c.GetInt("length")
|
|
auditattr, _ := c.GetPostForm("auditattr")
|
|
auditattr, _ := c.GetPostForm("auditattr")
|
|
|
|
+ check, _ := strconv.Atoi(auditattr)
|
|
query := map[string]interface{}{}
|
|
query := map[string]interface{}{}
|
|
- if auditattr != "-1" {
|
|
|
|
|
|
+ if check != -1 {
|
|
query = map[string]interface{}{
|
|
query = map[string]interface{}{
|
|
- field + "_" + auditattr: 1,
|
|
|
|
|
|
+ "check": check,
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
query = map[string]interface{}{
|
|
query = map[string]interface{}{
|
|
"$or": []interface{}{
|
|
"$or": []interface{}{
|
|
- map[string]interface{}{field + "_ok": 1},
|
|
|
|
- map[string]interface{}{field + "_err": 1},
|
|
|
|
|
|
+ map[string]interface{}{"check": 1},
|
|
|
|
+ map[string]interface{}{"check": 0},
|
|
},
|
|
},
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -107,24 +109,24 @@ func AllAudit(c *gin.Context) {
|
|
} else { //批量审核
|
|
} else { //批量审核
|
|
SaveDb := ""
|
|
SaveDb := ""
|
|
FieldBd := 0
|
|
FieldBd := 0
|
|
- ElasticClientIndex := ""
|
|
|
|
- ElasticClientType := ""
|
|
|
|
|
|
+ // ElasticClientIndex := ""
|
|
|
|
+ // ElasticClientType := ""
|
|
RedisName := util.QYK_RedisName
|
|
RedisName := util.QYK_RedisName
|
|
if field == "winner" {
|
|
if field == "winner" {
|
|
SaveDb = util.ElasticClientDB
|
|
SaveDb = util.ElasticClientDB
|
|
FieldBd = util.WinnerDB
|
|
FieldBd = util.WinnerDB
|
|
- ElasticClientIndex = util.ElasticClientIndex
|
|
|
|
- ElasticClientType = util.ElasticClientType
|
|
|
|
|
|
+ // ElasticClientIndex = util.ElasticClientIndex
|
|
|
|
+ // ElasticClientType = util.ElasticClientType
|
|
} else if field == "buyer" {
|
|
} else if field == "buyer" {
|
|
SaveDb = util.ElasticClientBuyerDB
|
|
SaveDb = util.ElasticClientBuyerDB
|
|
FieldBd = util.BuyerDB
|
|
FieldBd = util.BuyerDB
|
|
- ElasticClientIndex = util.ElasticClientBuyerIndex
|
|
|
|
- ElasticClientType = util.ElasticClientBuyerType
|
|
|
|
|
|
+ // ElasticClientIndex = util.ElasticClientBuyerIndex
|
|
|
|
+ // ElasticClientType = util.ElasticClientBuyerType
|
|
} else {
|
|
} else {
|
|
SaveDb = util.ElasticClientAgencyDB
|
|
SaveDb = util.ElasticClientAgencyDB
|
|
FieldBd = util.AgencyDB
|
|
FieldBd = util.AgencyDB
|
|
- ElasticClientIndex = util.ElasticClientAgencyIndex
|
|
|
|
- ElasticClientType = util.ElasticClientAgencyType
|
|
|
|
|
|
+ // ElasticClientIndex = util.ElasticClientAgencyIndex
|
|
|
|
+ // ElasticClientType = util.ElasticClientAgencyType
|
|
}
|
|
}
|
|
//redis
|
|
//redis
|
|
qykredis := redis.RedisPool[RedisName].Get()
|
|
qykredis := redis.RedisPool[RedisName].Get()
|
|
@@ -156,11 +158,11 @@ func AllAudit(c *gin.Context) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- _, err := escon.Index().Index(ElasticClientIndex).Type(ElasticClientType).Id(sid).BodyJson(e).Refresh(true).Do()
|
|
|
|
- if err != nil {
|
|
|
|
- c.JSON(200, gin.H{"rep": false, "msg": "更新es错误"})
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ // _, err := escon.Index().Index(ElasticClientIndex).Type(ElasticClientType).Id(sid).BodyJson(e).Refresh(true).Do()
|
|
|
|
+ // if err != nil {
|
|
|
|
+ // c.JSON(200, gin.H{"rep": false, "msg": "更新es错误"})
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
//删除标记数据
|
|
//删除标记数据
|
|
query := map[string]interface{}{
|
|
query := map[string]interface{}{
|
|
@@ -177,8 +179,8 @@ func AllAudit(c *gin.Context) {
|
|
func DataSave(c *gin.Context) {
|
|
func DataSave(c *gin.Context) {
|
|
SaveDb := ""
|
|
SaveDb := ""
|
|
FieldBd := 0
|
|
FieldBd := 0
|
|
- ElasticClientIndex := ""
|
|
|
|
- ElasticClientType := ""
|
|
|
|
|
|
+ // ElasticClientIndex := ""
|
|
|
|
+ // ElasticClientType := ""
|
|
RedisName := util.QYK_RedisName
|
|
RedisName := util.QYK_RedisName
|
|
//企业名称
|
|
//企业名称
|
|
e := make(map[string]interface{})
|
|
e := make(map[string]interface{})
|
|
@@ -188,8 +190,8 @@ func DataSave(c *gin.Context) {
|
|
if field == "winner" {
|
|
if field == "winner" {
|
|
SaveDb = util.ElasticClientDB
|
|
SaveDb = util.ElasticClientDB
|
|
FieldBd = util.WinnerDB
|
|
FieldBd = util.WinnerDB
|
|
- ElasticClientIndex = util.ElasticClientIndex
|
|
|
|
- ElasticClientType = util.ElasticClientType
|
|
|
|
|
|
+ // ElasticClientIndex = util.ElasticClientIndex
|
|
|
|
+ // ElasticClientType = util.ElasticClientType
|
|
capital, _ := c.GetPostForm("capital")
|
|
capital, _ := c.GetPostForm("capital")
|
|
capitalfloat := clear.ObjToMoney([]interface{}{capital, ""})[0]
|
|
capitalfloat := clear.ObjToMoney([]interface{}{capital, ""})[0]
|
|
business_scope, _ := c.GetPostForm("business_scope")
|
|
business_scope, _ := c.GetPostForm("business_scope")
|
|
@@ -200,8 +202,8 @@ func DataSave(c *gin.Context) {
|
|
} else if field == "buyer" {
|
|
} else if field == "buyer" {
|
|
SaveDb = util.ElasticClientBuyerDB
|
|
SaveDb = util.ElasticClientBuyerDB
|
|
FieldBd = util.BuyerDB
|
|
FieldBd = util.BuyerDB
|
|
- ElasticClientIndex = util.ElasticClientBuyerIndex
|
|
|
|
- ElasticClientType = util.ElasticClientBuyerType
|
|
|
|
|
|
+ // ElasticClientIndex = util.ElasticClientBuyerIndex
|
|
|
|
+ // ElasticClientType = util.ElasticClientBuyerType
|
|
buyerclass, _ := c.GetPostForm("buyerclass")
|
|
buyerclass, _ := c.GetPostForm("buyerclass")
|
|
ranks, _ := c.GetPostForm("ranks")
|
|
ranks, _ := c.GetPostForm("ranks")
|
|
buyer_type, _ := c.GetPostForm("type")
|
|
buyer_type, _ := c.GetPostForm("type")
|
|
@@ -213,8 +215,8 @@ func DataSave(c *gin.Context) {
|
|
} else {
|
|
} else {
|
|
SaveDb = util.ElasticClientAgencyDB
|
|
SaveDb = util.ElasticClientAgencyDB
|
|
FieldBd = util.AgencyDB
|
|
FieldBd = util.AgencyDB
|
|
- ElasticClientIndex = util.ElasticClientAgencyIndex
|
|
|
|
- ElasticClientType = util.ElasticClientAgencyType
|
|
|
|
|
|
+ // ElasticClientIndex = util.ElasticClientAgencyIndex
|
|
|
|
+ // ElasticClientType = util.ElasticClientAgencyType
|
|
ranks, _ := c.GetPostForm("ranks")
|
|
ranks, _ := c.GetPostForm("ranks")
|
|
agency_type, _ := c.GetPostForm("type")
|
|
agency_type, _ := c.GetPostForm("type")
|
|
e["ranks"] = ranks
|
|
e["ranks"] = ranks
|
|
@@ -279,13 +281,13 @@ func DataSave(c *gin.Context) {
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- escon := elastic.GetEsConn()
|
|
|
|
- defer elastic.DestoryEsConn(escon)
|
|
|
|
- _, err := escon.Index().Index(ElasticClientIndex).Type(ElasticClientType).Id(sid).BodyJson(e).Refresh(true).Do()
|
|
|
|
- if err != nil {
|
|
|
|
- c.JSON(200, gin.H{"rep": false, "msg": "更新es错误"})
|
|
|
|
- return
|
|
|
|
- }
|
|
|
|
|
|
+ // escon := elastic.GetEsConn()
|
|
|
|
+ // defer elastic.DestoryEsConn(escon)
|
|
|
|
+ // _, err := escon.Index().Index(ElasticClientIndex).Type(ElasticClientType).Id(sid).BodyJson(e).Refresh(true).Do()
|
|
|
|
+ // if err != nil {
|
|
|
|
+ // c.JSON(200, gin.H{"rep": false, "msg": "更新es错误"})
|
|
|
|
+ // return
|
|
|
|
+ // }
|
|
}
|
|
}
|
|
//删除标记数据
|
|
//删除标记数据
|
|
coll, _ := c.GetPostForm("coll")
|
|
coll, _ := c.GetPostForm("coll")
|