|
@@ -8,6 +8,7 @@ import (
|
|
log "github.com/donnie4w/go-logger/logger"
|
|
log "github.com/donnie4w/go-logger/logger"
|
|
"github.com/go-ego/gse"
|
|
"github.com/go-ego/gse"
|
|
"github.com/tealeg/xlsx"
|
|
"github.com/tealeg/xlsx"
|
|
|
|
+ "go.mongodb.org/mongo-driver/bson"
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
|
"io"
|
|
"io"
|
|
"io/ioutil"
|
|
"io/ioutil"
|
|
@@ -44,106 +45,7 @@ var (
|
|
|
|
|
|
//导出数据-bidding相关
|
|
//导出数据-bidding相关
|
|
func exportFromArrToBiddingData(coll_name string) {
|
|
func exportFromArrToBiddingData(coll_name string) {
|
|
- arr := []string{
|
|
|
|
- "640fcb4556e044e9137e8d76",
|
|
|
|
- "64102c5a8aea8786d1cf2252",
|
|
|
|
- "64102cb28aea8786d1cf23e3",
|
|
|
|
- "64102c5b8aea8786d1cf2266",
|
|
|
|
- "641424cf779467cff193c9b6",
|
|
|
|
- "640e94c7779467cff188ec14",
|
|
|
|
- "640efcac8aea8786d1ce8dae",
|
|
|
|
- "640ea0f88aea8786d1ce0767",
|
|
|
|
- "6413d13f56e044e9138b3ee8",
|
|
|
|
- "64117b818aea8786d1cffbf9",
|
|
|
|
- "64142a108aea8786d1d1cc90",
|
|
|
|
- "6417b1408aea8786d1d2782c",
|
|
|
|
- "64104dd1779467cff18cd583",
|
|
|
|
- "6413e37a8aea8786d1d17828",
|
|
|
|
- "6412148456e044e91386c106",
|
|
|
|
- "641685da56e044e91391551c",
|
|
|
|
- "640ff99856e044e9137f6193",
|
|
|
|
- "640e9509779467cff188ece2",
|
|
|
|
- "6412817a56e044e91387d432",
|
|
|
|
- "64118dce8aea8786d1d02185",
|
|
|
|
- "6412b48d779467cff190ba27",
|
|
|
|
- "6415dc5f779467cff1952d6d",
|
|
|
|
- "64127ada779467cff190087b",
|
|
|
|
- "6415dc5a779467cff1952d6c",
|
|
|
|
- "641509ec779467cff194b6a4",
|
|
|
|
- "640fe3ec779467cff18b530e",
|
|
|
|
- "640e9767779467cff188f76b",
|
|
|
|
- "640fd583779467cff18b140a",
|
|
|
|
- "6412b613779467cff190bfd1",
|
|
|
|
- "641299ce779467cff19083b3",
|
|
|
|
- "64116f49779467cff18e791f",
|
|
|
|
- "640fea318aea8786d1cede7e",
|
|
|
|
- "641025618aea8786d1cf17dc",
|
|
|
|
- "641173568aea8786d1cff098",
|
|
|
|
- "6412b0258aea8786d1d0b6a1",
|
|
|
|
- "6412d2388aea8786d1d0e31f",
|
|
|
|
- "6412d2388aea8786d1d0e31c",
|
|
|
|
- "6413f6a48aea8786d1d18fa1",
|
|
|
|
- "640e99ed8aea8786d1cdfaa6",
|
|
|
|
- "6410296f8aea8786d1cf1d64",
|
|
|
|
- "641029708aea8786d1cf1d7d",
|
|
|
|
- "641031678aea8786d1cf2b35",
|
|
|
|
- "641031688aea8786d1cf2b49",
|
|
|
|
- "641031688aea8786d1cf2b55",
|
|
|
|
- "641031688aea8786d1cf2b5e",
|
|
|
|
- "641031688aea8786d1cf2b61",
|
|
|
|
- "641031698aea8786d1cf2b77",
|
|
|
|
- "641031698aea8786d1cf2b71",
|
|
|
|
- "64119a3a56e044e91385475d",
|
|
|
|
- "640efb4456e044e9137d9b0f",
|
|
|
|
- "6411db9e56e044e913861625",
|
|
|
|
- "6415894856e044e9138f867d",
|
|
|
|
- "64103b4256e044e9138061fe",
|
|
|
|
- "640fda5756e044e9137edcc3",
|
|
|
|
- "6411a5e056e044e91385785f",
|
|
|
|
- "641138d456e044e913838d6d",
|
|
|
|
- "64120bce56e044e91386a8e9",
|
|
|
|
- "6411e9cf56e044e913863a76",
|
|
|
|
- "6411433556e044e91383bcc7",
|
|
|
|
- "6412b6ec56e044e913888145",
|
|
|
|
- "640fd3ad56e044e9137eb73f",
|
|
|
|
- "64162c6e56e044e91390ab01",
|
|
|
|
- "641215d356e044e91386c4b6",
|
|
|
|
- "641320e356e044e91389d08b",
|
|
|
|
- "640e8e9f56e044e9137bc09f",
|
|
|
|
- "6410222756e044e9137fe011",
|
|
|
|
- "641138d356e044e913838d4f",
|
|
|
|
- "641755db56e044e91392e551",
|
|
|
|
- "6411433556e044e91383bcc2",
|
|
|
|
- "640fd3b556e044e9137eb907",
|
|
|
|
- "6412f21356e044e913896c76",
|
|
|
|
- "6416dd4f56e044e91391e1d4",
|
|
|
|
- "6410713b56e044e9138127d1",
|
|
|
|
- "640e8ea956e044e9137bc1e5",
|
|
|
|
- "640eddf6779467cff189d726",
|
|
|
|
- "641033c8779467cff18c6852",
|
|
|
|
- "64111023779467cff18d411e",
|
|
|
|
- "6412cfd5779467cff1913608",
|
|
|
|
- "6411234d779467cff18d818c",
|
|
|
|
- "6413ae8c779467cff1923893",
|
|
|
|
- "64126e1e779467cff18fd257",
|
|
|
|
- "640e847d779467cff188a713",
|
|
|
|
- "640eec62779467cff18a254a",
|
|
|
|
- "6411366d779467cff18dd385",
|
|
|
|
- "640ec8e6779467cff18973ea",
|
|
|
|
- "64113681779467cff18dd40b",
|
|
|
|
- "64144303779467cff1944f06",
|
|
|
|
- "641598f1779467cff195188f",
|
|
|
|
- "6413bd6a779467cff19254c1",
|
|
|
|
- "640fe753779467cff18b6144",
|
|
|
|
- "641421ec779467cff193b896",
|
|
|
|
- "6412e314779467cff191957d",
|
|
|
|
- "64140864779467cff19345b6",
|
|
|
|
- "6412ff8b779467cff191f1a6",
|
|
|
|
- "6415a2e5779467cff1951c91",
|
|
|
|
- "640e7fc8779467cff188953c",
|
|
|
|
- "640f04bb779467cff18a72f9",
|
|
|
|
- "6412cfd9779467cff191361e",
|
|
|
|
- }
|
|
|
|
|
|
+ arr := []string{}
|
|
isok := 0
|
|
isok := 0
|
|
for _, v := range arr {
|
|
for _, v := range arr {
|
|
data := save_mgo.FindById("bidding", v)
|
|
data := save_mgo.FindById("bidding", v)
|
|
@@ -237,6 +139,8 @@ func encodeSEUrl(str string) {
|
|
var SE = qu.SimpleEncrypt{Key: "topJYBX2019"}
|
|
var SE = qu.SimpleEncrypt{Key: "topJYBX2019"}
|
|
log.Debug(SE.EncodeString(str))
|
|
log.Debug(SE.EncodeString(str))
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+//解密~base64
|
|
func decodeSEUrl(str string) {
|
|
func decodeSEUrl(str string) {
|
|
var SE = qu.SimpleEncrypt{Key: "topJYBX2019"}
|
|
var SE = qu.SimpleEncrypt{Key: "topJYBX2019"}
|
|
log.Debug(SE.DecodeString(str))
|
|
log.Debug(SE.DecodeString(str))
|
|
@@ -259,111 +163,623 @@ func encodeJyUrl() {
|
|
|
|
|
|
//解密数据id
|
|
//解密数据id
|
|
func decodeFeedBackInfo() {
|
|
func decodeFeedBackInfo() {
|
|
- arr := []string{
|
|
|
|
- "QltALDogbAcFB1xEW0QvYHNrBVUJXUNZ",
|
|
|
|
- "QltBemshbVMIUFwVV0dybyZpUVYDC0Fd",
|
|
|
|
- "QltBemshOgAIUFwVV0dybyZpUVYDChFc",
|
|
|
|
- "QltBemshbVAIUFwVV0dybyZpUVYDC0JZ",
|
|
|
|
- "QltBfmt2O1QHBgBAWUcpPyRpCwNSABZZ",
|
|
|
|
- "QltAL2B2OwUHBgBAWUcpPyRpCghUWkVb",
|
|
|
|
- "QltALz8hOVEIUFwVV0dybyZpUVUJXRUK",
|
|
|
|
- "QltALzhyPgoIUFwVV0dybyZpUVUBDkJY",
|
|
|
|
- "QltBeT1za1QFB1xEW0QvYHNrClICXBFX",
|
|
|
|
- "QltBe24gYAMIUFwVV0dybyZpUVZXWxJW",
|
|
|
|
- "QltBfmsjaQIIUFwVV0dybyZpVgFSWk1f",
|
|
|
|
- "QltBfTtzbAIIUFwVV0dybyZpVgIGAUYM",
|
|
|
|
- "QltBem0mPAMHBgBAWUcpPyRpClNVDExc",
|
|
|
|
- "QltBeTxxb1MIUFwVV0dybyZpVgEGAUZX",
|
|
|
|
- "QltBeGh2YAYFB1xEW0QvYHNrCgZSCERZ",
|
|
|
|
- "QltBfGF3PFMFB1xEW0QvYHNrCwEEDEUM",
|
|
|
|
- "QltALD97YQoFB1xEW0QvYHNrBVYHCE1c",
|
|
|
|
- "QltAL2B3aAsHBgBAWUcpPyRpCghUWhFd",
|
|
|
|
- "QltBeGFzb1MFB1xEW0QvYHNrCgdVDUdd",
|
|
|
|
- "QltBe2EmO1cIUFwVV0dybyZpVgADCExa",
|
|
|
|
- "QltBeDt2YFYHBgBAWUcpPyRpCwBTWEZY",
|
|
|
|
- "QltBfz0hbVQHBgBAWUcpPyRpCwUDXUIL",
|
|
|
|
- "QltBeG4jPFMHBgBAWUcpPyRpCwABAUMN",
|
|
|
|
- "QltBfz0hbVMHBgBAWUcpPyRpCwUDXUIM",
|
|
|
|
- "QltBf2l7PVEHBgBAWUcpPyRpCwRTDxVb",
|
|
|
|
- "QltALDxxPVEHBgBAWUcpPyRpClIECkQK",
|
|
|
|
- "QltAL2B1bgUHBgBAWUcpPyRpCghXDkIN",
|
|
|
|
- "QltALD13YAEHBgBAWUcpPyRpClIADUQO",
|
|
|
|
- "QltBeDt0aQEHBgBAWUcpPyRpCwBTXxBe",
|
|
|
|
- "QltBeGB7O1cHBgBAWUcpPyRpCwAJChZc",
|
|
|
|
- "QltBe28kbAsHBgBAWUcpPyRpClUGAEUJ",
|
|
|
|
- "QltALDwjawMIUFwVV0dybyZpUVVVXEMK",
|
|
|
|
- "QltBemt3bgMIUFwVV0dybyZpUVYADhAM",
|
|
|
|
- "QltBe25xbQQIUFwVV0dybyZpUVZXCU1X",
|
|
|
|
- "QltBeDtyagcIUFwVV0dybyZpVgBTDxVe",
|
|
|
|
- "QltBeD1wawoIUFwVV0dybyZpVgBUCkUJ",
|
|
|
|
- "QltBeD1wawoIUFwVV0dybyZpVgBUCkUM",
|
|
|
|
- "QltBeT90OQYIUFwVV0dybyZpVgEJXxVe",
|
|
|
|
- "QltAL2B7PVYIUFwVV0dybyZpUVRXWBVZ",
|
|
|
|
- "QltBemt7blQIUFwVV0dybyZpUVYAXUJb",
|
|
|
|
- "QltBemt7bwIIUFwVV0dybyZpUVYAXUML",
|
|
|
|
- "QltBempzbgUIUFwVV0dybyZpUVYDW0da",
|
|
|
|
- "QltBempzbgoIUFwVV0dybyZpUVYDW0BW",
|
|
|
|
- "QltBempzbgoIUFwVV0dybyZpUVYDW0Fa",
|
|
|
|
- "QltBempzbgoIUFwVV0dybyZpUVYDW0EK",
|
|
|
|
- "QltBempzbgoIUFwVV0dybyZpUVYDW0Je",
|
|
|
|
- "QltBempzbgsIUFwVV0dybyZpUVYDW0NY",
|
|
|
|
- "QltBempzbgsIUFwVV0dybyZpUVYDW0Ne",
|
|
|
|
- "QltBe2Aja1MFB1xEW0QvYHNrCgUFDkEL",
|
|
|
|
- "QltALz8gbAYFB1xEW0QvYHNrBVQIW0QJ",
|
|
|
|
- "QltBez0gYVcFB1xEW0QvYHNrCgYAD0Za",
|
|
|
|
- "QltBf2F7bAoFB1xEW0QvYHNrClYJD0ML",
|
|
|
|
- "QltBemogbAAFB1xEW0QvYHNrCgAHCBIK",
|
|
|
|
- "QltALD0jbQUFB1xEW0QvYHNrBVVVWhdc",
|
|
|
|
- "QltBezh3PQIFB1xEW0QvYHNrCgUGAUEJ",
|
|
|
|
- "QltBe2p6PAYFB1xEW0QvYHNrCgMJXUIL",
|
|
|
|
- "QltBeGkgO1cFB1xEW0QvYHNrCgZQARFW",
|
|
|
|
- "QltBezx7O1QFB1xEW0QvYHNrCgYCWENZ",
|
|
|
|
- "QltBe21xawcFB1xEW0QvYHNrCgNTWhdY",
|
|
|
|
- "QltBeDt0PVEFB1xEW0QvYHNrCggJCEBa",
|
|
|
|
- "QltALD1xOVYFB1xEW0QvYHNrBVVTDkcJ",
|
|
|
|
- "QltBfGshblcFB1xEW0QvYHNrCwBQW0Re",
|
|
|
|
- "QltBeGh3PAEFB1xEW0QvYHNrCgZSDRZZ",
|
|
|
|
- "QltBeWtyPQEFB1xEW0QvYHNrCglVCUwN",
|
|
|
|
- "QltAL2EnYVQFB1xEW0QvYHNrBVJSCU0J",
|
|
|
|
- "QltBemtwagUFB1xEW0QvYHNrBVZUCUVe",
|
|
|
|
- "QltBe2p6PAEFB1xEW0QvYHNrCgMJXUAJ",
|
|
|
|
- "QltBfWx3PFAFB1xEW0QvYHNrCwJUDEFe",
|
|
|
|
- "QltBe21xawcFB1xEW0QvYHNrCgNTWhdd",
|
|
|
|
- "QltALD1xOgcFB1xEW0QvYHNrBVVTAERY",
|
|
|
|
- "QltBeD9waQEFB1xEW0QvYHNrCgkHWkNZ",
|
|
|
|
- "QltBfD0mbFQFB1xEW0QvYHNrCwFUCBBb",
|
|
|
|
- "QltBem5za1AFB1xEW0QvYHNrCgEDDhBe",
|
|
|
|
- "QltAL2EnOQsFB1xEW0QvYHNrBVJSCBFa",
|
|
|
|
- "QltALz0mPgQHBgBAWUcpPyRpCglVDkZZ",
|
|
|
|
- "QltBempxOwoHBgBAWUcpPyRpClMHAUFd",
|
|
|
|
- "QltBe2hyagEHBgBAWUcpPyRpClQFCEUK",
|
|
|
|
- "QltBeDokPAcHBgBAWUcpPyRpCwECD0RX",
|
|
|
|
- "QltBe2txbFYHBgBAWUcpPyRpClQJCEwM",
|
|
|
|
- "QltBeTgnYFEHBgBAWUcpPyRpCwICAU1c",
|
|
|
|
- "QltBeG8naVcHBgBAWUcpPyRpClZVC0FY",
|
|
|
|
- "QltAL2F2b1YHBgBAWUcpPyRpCghQDkVc",
|
|
|
|
- "QltALzwhbgAHBgBAWUcpPyRpClEDDEAO",
|
|
|
|
- "QltBe2p0blYHBgBAWUcpPyRpClRVCkxa",
|
|
|
|
- "QltALzp6PQQHBgBAWUcpPyRpCgkGChEO",
|
|
|
|
- "QltBe2p0YAMHBgBAWUcpPyRpClRVDUQN",
|
|
|
|
- "QltBfm1xaAEHBgBAWUcpPyRpCwQFX0RZ",
|
|
|
|
- "QltBf2B6PgMHBgBAWUcpPyRpCwUAAUwJ",
|
|
|
|
- "QltBeTsmblMHBgBAWUcpPyRpCwIEDRde",
|
|
|
|
- "QltALDx1bQEHBgBAWUcpPyRpClIHCEBb",
|
|
|
|
- "QltBfmtzPVEHBgBAWUcpPyRpCwNTAU1Z",
|
|
|
|
- "QltBeDxxaQYHBgBAWUcpPyRpCwEIDEML",
|
|
|
|
- "QltBfml6bgYHBgBAWUcpPyRpCwMFDBZZ",
|
|
|
|
- "QltBeD8kYFAHBgBAWUcpPyRpCwFXCBVZ",
|
|
|
|
- "QltBfzhwPQcHBgBAWUcpPyRpCwUAWk1e",
|
|
|
|
- "QltAL24kOwoHBgBAWUcpPyRpCggIDEcM",
|
|
|
|
- "QltALGl2OlAHBgBAWUcpPyRpClEGCxJW",
|
|
|
|
- "QltBeDokPAsHBgBAWUcpPyRpCwECD0UK",
|
|
|
|
- }
|
|
|
|
|
|
+ arr := []string{}
|
|
for _, v := range arr {
|
|
for _, v := range arr {
|
|
decodeSEUrl(v)
|
|
decodeSEUrl(v)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//清洗医疗名称
|
|
|
|
+func testCleanMedicalName() {
|
|
|
|
+ dataArr, _ := save_mgo.Find("111111", nil, bson.M{"_id": 1}, nil)
|
|
|
|
+ isok := 0
|
|
|
|
+ var reg1 *regexp.Regexp = regexp.MustCompile("[((].*[))]")
|
|
|
|
+ var reg2 *regexp.Regexp = regexp.MustCompile("^([\u4E00-\u9FA5]+)([A-Za-z]+)$")
|
|
|
|
+
|
|
|
|
+ for _, v := range dataArr {
|
|
|
|
+ tmpid := BsonTOStringId(v["_id"])
|
|
|
|
+ new_name := qu.ObjToString(v["name"])
|
|
|
|
+ new_name = strings.ReplaceAll(new_name, " ", "")
|
|
|
|
+ if reg1.MatchString(new_name) {
|
|
|
|
+ new_name = reg1.ReplaceAllString(new_name, "")
|
|
|
|
+ }
|
|
|
|
+ if reg2.MatchString(new_name) {
|
|
|
|
+ new_name = reg2.ReplaceAllString(new_name, "${1}")
|
|
|
|
+ }
|
|
|
|
+ if utf8.RuneCountInString(new_name) > 10 {
|
|
|
|
+ new_name = ""
|
|
|
|
+ }
|
|
|
|
+ save_mgo.UpdateById("111111", tmpid, map[string]interface{}{
|
|
|
|
+ "$set": map[string]interface{}{
|
|
|
|
+ "new_name": new_name,
|
|
|
|
+ },
|
|
|
|
+ })
|
|
|
|
+ isok++
|
|
|
|
+ }
|
|
|
|
+ log.Debug("is over ", isok)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func cleanName(s string) string {
|
|
|
|
+ news := ""
|
|
|
|
+ isTrue := false
|
|
|
|
+ for _, c := range s {
|
|
|
|
+ if unicode.Is(unicode.Han, c) || unicode.IsLetter(c) {
|
|
|
|
+ isTrue = true
|
|
|
|
+ }
|
|
|
|
+ if isTrue {
|
|
|
|
+ news += string(c)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return news
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//迭代性能测试
|
|
|
|
+func testMongoLevel1() {
|
|
|
|
+ tmpid, total := "403655e927198cc9c10fcc49", 0
|
|
|
|
+ for {
|
|
|
|
+ q := bson.M{"_id": bson.M{"$gt": StringTOBsonId(tmpid)}}
|
|
|
|
+ dataArr, _ := save_mgo.FindLimit("bidding", q, bson.M{"_id": 1}, nil, 5000)
|
|
|
|
+ total += len(dataArr)
|
|
|
|
+ if total > 3000000 {
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ if len(dataArr) == 0 {
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ tmpid = BsonTOStringId(dataArr[len(dataArr)-1]["_id"])
|
|
|
|
+ }
|
|
|
|
+ log.Debug("is page over ", total)
|
|
|
|
+}
|
|
|
|
+func testMongoLevel2() {
|
|
|
|
+ sess := save_mgo.GetMgoConn()
|
|
|
|
+ defer save_mgo.DestoryMongoConn(sess)
|
|
|
|
+ q, total := bson.M{"_id": bson.M{"$gt": StringTOBsonId("403655e927198cc9c10fcc49")}}, 0
|
|
|
|
+ it := sess.DB(save_mgo.DbName).C("bidding").Find(&q).Sort("_id").Iter()
|
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
|
+ if total > 3000000 {
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ tmp = make(map[string]interface{})
|
|
|
|
+ }
|
|
|
|
+ log.Debug("is iter over ", total)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//接口调用大模型数据
|
|
|
|
+func callChatGlmApi(from string) {
|
|
|
|
+ prompt := ""
|
|
|
|
+ if from == "buyer" {
|
|
|
|
+ prompt = "你是一名数据标注员,请抽取文中的采购单位"
|
|
|
|
+ } else if from == "area" {
|
|
|
|
+ prompt = "你是一名数据识别员,请识别文中的项目地区"
|
|
|
|
+ } else if from == "winner" {
|
|
|
|
+ prompt = "你是一名数据标注员,请抽取文中的中标单位"
|
|
|
|
+ } else if from == "bidamount" {
|
|
|
|
+ prompt = "你是一名数据识别员,请抽取文中的中标金额"
|
|
|
|
+ } else {
|
|
|
|
+ log.Debug("参数参数有误~~~")
|
|
|
|
+ return
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dataArr, _ := save_mgo.Find("zktest_chatglm_"+from, nil, nil, map[string]interface{}{"detail": 1, "href": 1})
|
|
|
|
+ for k, v := range dataArr {
|
|
|
|
+ if k%10 == 0 {
|
|
|
|
+ log.Debug("cur index ", k)
|
|
|
|
+ }
|
|
|
|
+ detail := qu.ObjToString(v["detail"])
|
|
|
|
+ new_prompt := detail + "\n" + prompt
|
|
|
|
+ body := map[string]interface{}{"identity": "剑鱼chat", "prompt": new_prompt}
|
|
|
|
+ data := postChatGlm("http://192.168.3.109:12001",
|
|
|
|
+ body, "application/json")
|
|
|
|
+ response := ""
|
|
|
|
+ if qu.IntAll(data["status"]) == 200 {
|
|
|
|
+ response = qu.ObjToString(data["response"])
|
|
|
|
+ } else {
|
|
|
|
+ response = "请求异常"
|
|
|
|
+ }
|
|
|
|
+ tmpid := qu.ObjToString(v["_id"])
|
|
|
|
+ save_mgo.Save("111111_"+from, map[string]interface{}{
|
|
|
|
+ "_id": tmpid,
|
|
|
|
+ "jyhref": fmt.Sprintf(Url, qu.CommonEncodeArticle("content", tmpid)),
|
|
|
|
+ "href": qu.ObjToString(v["href"]),
|
|
|
|
+ "detail": detail,
|
|
|
|
+ "response": response,
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ log.Debug("is over ~~~")
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func postChatGlm(url string, data interface{}, contentType string) map[string]interface{} {
|
|
|
|
+ task <- struct{}{}
|
|
|
|
+ defer func() {
|
|
|
|
+ <-task
|
|
|
|
+ }()
|
|
|
|
+ client := &http.Client{Timeout: 10 * time.Second}
|
|
|
|
+ jsonStr, _ := json.Marshal(data)
|
|
|
|
+ resp, err := client.Post(url, contentType, bytes.NewBuffer(jsonStr))
|
|
|
|
+ if err != nil {
|
|
|
|
+ log.Debug("请求错误~", err)
|
|
|
|
+ return map[string]interface{}{}
|
|
|
|
+ }
|
|
|
|
+ result, _ := ioutil.ReadAll(resp.Body)
|
|
|
|
+ dict := make(map[string]interface{})
|
|
|
|
+ json.Unmarshal(result, &dict)
|
|
|
|
+ //fmt.Println("post...start")
|
|
|
|
+ return dict
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//导出无中标单位的数据
|
|
|
|
+func export0427wininfo() {
|
|
|
|
+ elastic.InitElasticSize("http://127.0.0.1:13002", 10)
|
|
|
|
+ total := int64(0)
|
|
|
|
+ esclient := elastic.GetEsConn()
|
|
|
|
+ defer elastic.DestoryEsConn(esclient)
|
|
|
|
+ if esclient == nil {
|
|
|
|
+ log.Debug("连接池异常")
|
|
|
|
+ }
|
|
|
|
+ //26号当天数据
|
|
|
|
+ query1 := es_elastic.NewRangeQuery("publishtime").Gte(1682438400).Lt(1682524800)
|
|
|
|
+ query2 := es_elastic.NewMissingFilter("winner")
|
|
|
|
+ query3 := es_elastic.NewMissingFilter("bidamount")
|
|
|
|
+
|
|
|
|
+ cursor, err := esclient.Scan("bidding").Query(es_elastic.NewBoolQuery().Must(query1, query2, query3)).Size(200).Do()
|
|
|
|
+ if err != nil || cursor.Results == nil || cursor.Results.Hits == nil {
|
|
|
|
+ log.Debug("异常~", err)
|
|
|
|
+ }
|
|
|
|
+ total += cursor.TotalHits()
|
|
|
|
+ log.Debug("当前查询正常数:", cursor.TotalHits(), "总数:", total)
|
|
|
|
+ numDocs, isok := 0, 0
|
|
|
|
+ //多线程 - 处理数据
|
|
|
|
+ temp := map[string]int{}
|
|
|
|
+ pool_es := make(chan bool, 1)
|
|
|
|
+ wg_es := &sync.WaitGroup{}
|
|
|
|
+ for {
|
|
|
|
+ searchResult, err := cursor.Next()
|
|
|
|
+ if err != nil {
|
|
|
|
+ if err.Error() == "EOS" {
|
|
|
|
+ break
|
|
|
|
+ } else {
|
|
|
|
+ log.Debug("cursor searchResult", err)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for _, hit := range searchResult.Hits.Hits {
|
|
|
|
+ tmp := make(map[string]interface{})
|
|
|
|
+ err := json.Unmarshal(*hit.Source, &tmp)
|
|
|
|
+ if err != nil {
|
|
|
|
+ log.Debug("json Unmarshal error")
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ if numDocs%1000 == 0 {
|
|
|
|
+ log.Debug("当前条数:", numDocs, " 符合条数:", isok)
|
|
|
|
+ }
|
|
|
|
+ numDocs++
|
|
|
|
+ if isok >= 100 {
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ pool_es <- true
|
|
|
|
+ wg_es.Add(1)
|
|
|
|
+ go func(tmp map[string]interface{}) {
|
|
|
|
+ defer func() {
|
|
|
|
+ <-pool_es
|
|
|
|
+ wg_es.Done()
|
|
|
|
+ }()
|
|
|
|
+ site := qu.ObjToString(tmp["site"])
|
|
|
|
+ subtype := qu.ObjToString(tmp["subtype"])
|
|
|
|
+ if subtype == "中标" || subtype == "成交" || subtype == "合同" {
|
|
|
|
+ num := qu.IntAll(temp[site])
|
|
|
|
+ if num < 2 {
|
|
|
|
+ isok++
|
|
|
|
+ temp[site] = num + 1
|
|
|
|
+ save_mgo.Save("zktest_chatglm_wininfo", tmp)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }(tmp)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ wg_es.Wait()
|
|
|
|
+ log.Debug("遍历完毕...", total, numDocs, isok)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//导出-大模型验证的-疑似问题-buyer与地域
|
|
|
|
+func export0425buyer() {
|
|
|
|
+ elastic.InitElasticSize("http://127.0.0.1:13002", 10)
|
|
|
|
+ total := int64(0)
|
|
|
|
+ esclient := elastic.GetEsConn()
|
|
|
|
+ defer elastic.DestoryEsConn(esclient)
|
|
|
|
+ if esclient == nil {
|
|
|
|
+ log.Debug("连接池异常")
|
|
|
|
+ }
|
|
|
|
+ query1 := es_elastic.NewRangeQuery("publishtime").Gte(1682265600).Lt(1682352000)
|
|
|
|
+ query2 := es_elastic.NewTermQuery("toptype", "招标")
|
|
|
|
+ query4 := es_elastic.NewMissingFilter("buyer")
|
|
|
|
+ cursor, err := esclient.Scan("bidding").Query(es_elastic.NewBoolQuery().Must(query1, query2, query4)).Size(200).Do()
|
|
|
|
+ if err != nil || cursor.Results == nil || cursor.Results.Hits == nil {
|
|
|
|
+ log.Debug("异常~", err)
|
|
|
|
+ }
|
|
|
|
+ total += cursor.TotalHits()
|
|
|
|
+ log.Debug("当前查询正常数:", cursor.TotalHits(), "总数:", total)
|
|
|
|
+ numDocs, isok := 0, 0
|
|
|
|
+ //多线程 - 处理数据
|
|
|
|
+ temp := map[string]int{}
|
|
|
|
+ pool_es := make(chan bool, 1)
|
|
|
|
+ wg_es := &sync.WaitGroup{}
|
|
|
|
+ for {
|
|
|
|
+ searchResult, err := cursor.Next()
|
|
|
|
+ if err != nil {
|
|
|
|
+ if err.Error() == "EOS" {
|
|
|
|
+ break
|
|
|
|
+ } else {
|
|
|
|
+ log.Debug("cursor searchResult", err)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for _, hit := range searchResult.Hits.Hits {
|
|
|
|
+ tmp := make(map[string]interface{})
|
|
|
|
+ err := json.Unmarshal(*hit.Source, &tmp)
|
|
|
|
+ if err != nil {
|
|
|
|
+ log.Debug("json Unmarshal error")
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ if numDocs%1000 == 0 {
|
|
|
|
+ log.Debug("当前条数:", numDocs, " 符合条数:", isok)
|
|
|
|
+ }
|
|
|
|
+ numDocs++
|
|
|
|
+ if isok >= 100 {
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ pool_es <- true
|
|
|
|
+ wg_es.Add(1)
|
|
|
|
+ go func(tmp map[string]interface{}) {
|
|
|
|
+ defer func() {
|
|
|
|
+ <-pool_es
|
|
|
|
+ wg_es.Done()
|
|
|
|
+ }()
|
|
|
|
+ site := qu.ObjToString(tmp["site"])
|
|
|
|
+ num := qu.IntAll(temp[site])
|
|
|
|
+ if num < 2 {
|
|
|
|
+ isok++
|
|
|
|
+ temp[site] = num + 1
|
|
|
|
+ save_mgo.Save("zktest_chatglm_buyer", tmp)
|
|
|
|
+ }
|
|
|
|
+ }(tmp)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ wg_es.Wait()
|
|
|
|
+ log.Debug("遍历完毕...", total, numDocs, isok)
|
|
|
|
+}
|
|
|
|
+func export0425region() {
|
|
|
|
+ elastic.InitElasticSize("http://127.0.0.1:13002", 10)
|
|
|
|
+ total := int64(0)
|
|
|
|
+ esclient := elastic.GetEsConn()
|
|
|
|
+ defer elastic.DestoryEsConn(esclient)
|
|
|
|
+ if esclient == nil {
|
|
|
|
+ log.Debug("连接池异常")
|
|
|
|
+ }
|
|
|
|
+ query1 := es_elastic.NewRangeQuery("publishtime").Gte(1682265600).Lt(1682352000)
|
|
|
|
+ query4 := es_elastic.NewTermQuery("area", "全国")
|
|
|
|
+ cursor, err := esclient.Scan("bidding").Query(es_elastic.NewBoolQuery().Must(query1, query4)).Size(200).Do()
|
|
|
|
+ if err != nil || cursor.Results == nil || cursor.Results.Hits == nil {
|
|
|
|
+ log.Debug("异常~", err)
|
|
|
|
+ }
|
|
|
|
+ total += cursor.TotalHits()
|
|
|
|
+ log.Debug("当前查询正常数:", cursor.TotalHits(), "总数:", total)
|
|
|
|
+ numDocs, isok := 0, 0
|
|
|
|
+ //多线程 - 处理数据
|
|
|
|
+ temp := map[string]int{}
|
|
|
|
+ pool_es := make(chan bool, 1)
|
|
|
|
+ wg_es := &sync.WaitGroup{}
|
|
|
|
+ for {
|
|
|
|
+ searchResult, err := cursor.Next()
|
|
|
|
+ if err != nil {
|
|
|
|
+ if err.Error() == "EOS" {
|
|
|
|
+ break
|
|
|
|
+ } else {
|
|
|
|
+ log.Debug("cursor searchResult", err)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ for _, hit := range searchResult.Hits.Hits {
|
|
|
|
+ tmp := make(map[string]interface{})
|
|
|
|
+ err := json.Unmarshal(*hit.Source, &tmp)
|
|
|
|
+ if err != nil {
|
|
|
|
+ log.Debug("json Unmarshal error")
|
|
|
|
+ continue
|
|
|
|
+ }
|
|
|
|
+ if numDocs%1000 == 0 {
|
|
|
|
+ log.Debug("当前条数:", numDocs, " 符合条数:", isok)
|
|
|
|
+ }
|
|
|
|
+ numDocs++
|
|
|
|
+ if isok >= 100 {
|
|
|
|
+ break
|
|
|
|
+ }
|
|
|
|
+ pool_es <- true
|
|
|
|
+ wg_es.Add(1)
|
|
|
|
+ go func(tmp map[string]interface{}) {
|
|
|
|
+ defer func() {
|
|
|
|
+ <-pool_es
|
|
|
|
+ wg_es.Done()
|
|
|
|
+ }()
|
|
|
|
+ site := qu.ObjToString(tmp["site"])
|
|
|
|
+ num := qu.IntAll(temp[site])
|
|
|
|
+ if num < 2 {
|
|
|
|
+ isok++
|
|
|
|
+ temp[site] = num + 1
|
|
|
|
+ save_mgo.Save("zktest_chatglm_region", tmp)
|
|
|
|
+ }
|
|
|
|
+ }(tmp)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ wg_es.Wait()
|
|
|
|
+ log.Debug("遍历完毕...", total, numDocs, isok)
|
|
|
|
+}
|
|
|
|
+func tongji0424() {
|
|
|
|
+ var SE = qu.SimpleEncrypt{Key: "topJYBX2019"}
|
|
|
|
+ temp := map[string]string{}
|
|
|
|
+ fileNameArr := []string{"1.xlsx", "2.xlsx", "3.xlsx"}
|
|
|
|
+ for _, filename := range fileNameArr {
|
|
|
|
+ isok := 0
|
|
|
|
+ ff, _ := xlsx.OpenFile("res/" + filename)
|
|
|
|
+ for _, sheet := range ff.Sheets {
|
|
|
|
+ for row_index, row := range sheet.Rows {
|
|
|
|
+ var str []string
|
|
|
|
+ for _, cell := range row.Cells {
|
|
|
|
+ s := cell.String()
|
|
|
|
+ s = strings.ReplaceAll(s, " ", "")
|
|
|
|
+ s = strings.ReplaceAll(s, " ", "")
|
|
|
|
+ str = append(str, s)
|
|
|
|
+ }
|
|
|
|
+ if row_index > 0 {
|
|
|
|
+ area := qu.ObjToString(str[0])
|
|
|
|
+ city := qu.ObjToString(str[1])
|
|
|
|
+ subtype := qu.ObjToString(str[2])
|
|
|
|
+ budget := qu.Float64All(str[3])
|
|
|
|
+ bidamount := qu.Float64All(str[4])
|
|
|
|
+ buyer := qu.ObjToString(str[5])
|
|
|
|
+ s_winner := qu.ObjToString(str[6])
|
|
|
|
+ encry_id := qu.ObjToString(str[7])
|
|
|
|
+ tmpid := SE.DecodeString(encry_id)
|
|
|
|
+ if temp[encry_id] == "" {
|
|
|
|
+ temp[encry_id] = encry_id
|
|
|
|
+ isok++
|
|
|
|
+ data := map[string]interface{}{
|
|
|
|
+ "_id": StringTOBsonId(tmpid),
|
|
|
|
+ "area": area,
|
|
|
|
+ "city": city,
|
|
|
|
+ "subtype": subtype,
|
|
|
|
+ "budget": budget,
|
|
|
|
+ "bidamount": bidamount,
|
|
|
|
+ "buyer": buyer,
|
|
|
|
+ "s_winner": s_winner,
|
|
|
|
+ "encry_id": encry_id,
|
|
|
|
+ }
|
|
|
|
+ if data != nil {
|
|
|
|
+ save_mgo.Save("111111", data)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ log.Debug("is over ", isok)
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+func export0424() {
|
|
|
|
+ q := map[string]interface{}{}
|
|
|
|
+ dataArr, _ := save_mgo.Find("zktest_accuracy_new", q, nil, map[string]interface{}{
|
|
|
|
+ "_id": 1,
|
|
|
|
+ })
|
|
|
|
+ for _, v := range dataArr {
|
|
|
|
+ tmpid := BsonTOStringId(v["_id"])
|
|
|
|
+ info := save_mgo.FindById("bidding", tmpid)
|
|
|
|
+ if info != nil && len(info) > 0 {
|
|
|
|
+ data := map[string]interface{}{
|
|
|
|
+ "_id": info["_id"],
|
|
|
|
+ "area": qu.ObjToString(info["area"]),
|
|
|
|
+ "city": qu.ObjToString(info["city"]),
|
|
|
|
+ "subtype": qu.ObjToString(info["subtype"]),
|
|
|
|
+ "budget": qu.Float64All(info["budget"]),
|
|
|
|
+ "bidamount": qu.Float64All(info["bidamount"]),
|
|
|
|
+ "buyer": qu.ObjToString(info["buyer"]),
|
|
|
|
+ "s_winner": qu.ObjToString(info["s_winner"]),
|
|
|
|
+ }
|
|
|
|
+ save_mgo.Save("zktest_accuracy_info", data)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+func accuracy0424() {
|
|
|
|
+ q := map[string]interface{}{}
|
|
|
|
+ dataArr1, _ := save_mgo.Find("zktest_accuracy_info", q, nil, nil)
|
|
|
|
+ dataArr2, _ := save_mgo.Find("zktest_accuracy_new", q, nil, nil)
|
|
|
|
+ temp1 := map[string]map[string]interface{}{}
|
|
|
|
+ temp2 := map[string]map[string]interface{}{}
|
|
|
|
+ for _, v := range dataArr1 {
|
|
|
|
+ tmpid := BsonTOStringId(v["_id"])
|
|
|
|
+ temp1[tmpid] = v
|
|
|
|
+ }
|
|
|
|
+ for _, v := range dataArr2 {
|
|
|
|
+ tmpid := BsonTOStringId(v["_id"])
|
|
|
|
+ temp2[tmpid] = v
|
|
|
|
+ }
|
|
|
|
+ log.Debug(len(temp1), "~", len(temp2))
|
|
|
|
+ fieldArr := []string{"buyer", "s_winner", "budget", "bidamount", "area", "city"}
|
|
|
|
+ t1, t2, t3, t4, t5, t6 := 0, 0, 0, 0, 0, 0
|
|
|
|
+ c1, c2, c3, c4, c5, c6 := 0, 0, 0, 0, 0, 0
|
|
|
|
+ for tmpid, info2 := range temp2 {
|
|
|
|
+ info1 := temp1[tmpid]
|
|
|
|
+ for _, key := range fieldArr {
|
|
|
|
+ if key == "buyer" {
|
|
|
|
+ t1++
|
|
|
|
+ if qu.ObjToString(info1[key]) == qu.ObjToString(info2[key]) {
|
|
|
|
+ c1++
|
|
|
|
+ }
|
|
|
|
+ } else if key == "s_winner" {
|
|
|
|
+ t2++
|
|
|
|
+ if qu.ObjToString(info1[key]) == qu.ObjToString(info2[key]) {
|
|
|
|
+ c2++
|
|
|
|
+ }
|
|
|
|
+ } else if key == "budget" {
|
|
|
|
+ t3++
|
|
|
|
+ if qu.Float64All(info1[key]) == qu.Float64All(info2[key]) {
|
|
|
|
+ c3++
|
|
|
|
+ }
|
|
|
|
+ } else if key == "bidamount" {
|
|
|
|
+ t4++
|
|
|
|
+ if qu.Float64All(info1[key]) == qu.Float64All(info2[key]) {
|
|
|
|
+ c4++
|
|
|
|
+ }
|
|
|
|
+ } else if key == "area" {
|
|
|
|
+ t5++
|
|
|
|
+ if qu.ObjToString(info1[key]) == qu.ObjToString(info2[key]) {
|
|
|
|
+ c5++
|
|
|
|
+ }
|
|
|
|
+ } else if key == "city" {
|
|
|
|
+ t6++
|
|
|
|
+ if qu.ObjToString(info1[key]) == qu.ObjToString(info2[key]) {
|
|
|
|
+ c6++
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ log.Debug("数据数", t1, t2, t3, t4, t5, t6)
|
|
|
|
+ log.Debug("正确数", c1, c2, c3, c4, c5, c6)
|
|
|
|
+ log.Debug("正确率", accuracyRate(t1, c1), "~", accuracyRate(t2, c2), "~", accuracyRate(t3, c3), "~", accuracyRate(t4, c4), "~", accuracyRate(t5, c5), "~", accuracyRate(t6, c6))
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//统计筛选数据
|
|
|
|
+func statisticalScreeningDataInfo() {
|
|
|
|
+ collArr := []string{
|
|
|
|
+ "20230207Ldx_jsfk_qx",
|
|
|
|
+ "20230207Ldx_sxsgl_qx",
|
|
|
|
+ "20230207Ldx_xljk_qx",
|
|
|
|
+ "20230209Ldx_xyaq",
|
|
|
|
+ "20230213Ldx_zhxy_2_1",
|
|
|
|
+ "20230213Ldx_zhxy_2_2",
|
|
|
|
+ "20230223Ldx_zhjs",
|
|
|
|
+ "20230317Ldx_zhty",
|
|
|
|
+ }
|
|
|
|
+ t1, t2, t3, t4, t5, t6 := 0, 0, 0, 0, 0, 0
|
|
|
|
+ c1, c2, c3, c4, c5, c6 := 0, 0, 0, 0, 0, 0
|
|
|
|
+ for _, coll := range collArr {
|
|
|
|
+ q := map[string]interface{}{}
|
|
|
|
+ dataArr, _ := save_mgo.Find(coll, q, nil, map[string]interface{}{
|
|
|
|
+ "v_baseinfo.toptype": 1,
|
|
|
|
+ "v_taginfo": 1,
|
|
|
|
+ })
|
|
|
|
+ //t1, t2, t3, t4, t5, t6 := 0, 0, 0, 0, 0, 0
|
|
|
|
+ //c1, c2, c3, c4, c5, c6 := 0, 0, 0, 0, 0, 0
|
|
|
|
+ for _, v := range dataArr {
|
|
|
|
+ v_baseinfo := *qu.ObjToMap(v["v_baseinfo"])
|
|
|
|
+ v_taginfo := *qu.ObjToMap(v["v_taginfo"])
|
|
|
|
+ toptype := qu.ObjToString(v_baseinfo["toptype"])
|
|
|
|
+ for k1, v1 := range v_taginfo {
|
|
|
|
+ b := false
|
|
|
|
+ if qu.IntAll(v1) == 1 {
|
|
|
|
+ b = true
|
|
|
|
+ }
|
|
|
|
+ switch k1 {
|
|
|
|
+ case "buyer":
|
|
|
|
+ {
|
|
|
|
+ t1++
|
|
|
|
+ if b {
|
|
|
|
+ c1++
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ case "s_winner":
|
|
|
|
+ {
|
|
|
|
+ if toptype == "结果" {
|
|
|
|
+ t2++
|
|
|
|
+ if b {
|
|
|
|
+ c2++
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ case "budget":
|
|
|
|
+ {
|
|
|
|
+ t3++
|
|
|
|
+ if b {
|
|
|
|
+ c3++
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ case "bidamount":
|
|
|
|
+ {
|
|
|
|
+ if toptype == "结果" {
|
|
|
|
+ t4++
|
|
|
|
+ if b {
|
|
|
|
+ c4++
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ case "area":
|
|
|
|
+ {
|
|
|
|
+ t5++
|
|
|
|
+ if b {
|
|
|
|
+ c5++
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ case "city":
|
|
|
|
+ {
|
|
|
|
+ t6++
|
|
|
|
+ if b {
|
|
|
|
+ c6++
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ default:
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ log.Debug("当前表~", coll, "~完毕~")
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ log.Debug("is over ~~~~~")
|
|
|
|
+ log.Debug("数据数", t1, t2, t3, t4, t5, t6)
|
|
|
|
+ log.Debug("正确数", c1, c2, c3, c4, c5, c6)
|
|
|
|
+ log.Debug("正确率", accuracyRate(t1, c1), "~", accuracyRate(t2, c2), "~", accuracyRate(t3, c3), "~", accuracyRate(t4, c4), "~", accuracyRate(t5, c5), "~", accuracyRate(t6, c6))
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func accuracyRate(n2 int, n1 int) string {
|
|
|
|
+ str := fmt.Sprintf("%.2f", float64(n1)/float64(n2))
|
|
|
|
+ return str
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//筛选异常数据
|
|
|
|
+func filterTheAbnormalInfo() {
|
|
|
|
+ sess := save_mgo.GetMgoConn()
|
|
|
|
+ defer save_mgo.DestoryMongoConn(sess)
|
|
|
|
+ q, total := map[string]interface{}{}, 0
|
|
|
|
+ isok := 0
|
|
|
|
+ it := sess.DB(save_mgo.DbName).C("zzzzzzkkk_rg_info_new").Find(&q).Sort("_id").Iter()
|
|
|
|
+ for tmp := make(map[string]interface{}); it.Next(&tmp); total++ {
|
|
|
|
+ if total%10000 == 0 {
|
|
|
|
+ log.Debug("curent index ", total, "~", isok)
|
|
|
|
+ }
|
|
|
|
+ subtype := qu.ObjToString(tmp["subtype"])
|
|
|
|
+ s_winner := qu.ObjToString(tmp["s_winner"])
|
|
|
|
+ bidamount := qu.Float64All(tmp["bidamount"])
|
|
|
|
+ if subtype == "中标" || subtype == "成交" || subtype == "合同" {
|
|
|
|
+ if s_winner == "" && bidamount == float64(0) {
|
|
|
|
+ isok++
|
|
|
|
+ if tmp["package"] != nil {
|
|
|
|
+ log.Debug(tmp["_id"])
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ tmp = make(map[string]interface{})
|
|
|
|
+ }
|
|
|
|
+ log.Debug("is over ", total, "~", isok)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//解析数据
|
|
|
|
+func exportErrInfo0328() {
|
|
|
|
+ dataArr, _ := save_mgo.Find("zzzzzzkkk_rg_info_err", nil, nil, nil)
|
|
|
|
+ for _, v := range dataArr {
|
|
|
|
+ tmpid := BsonTOStringId(v["_id"])
|
|
|
|
+ info := save_mgo.FindById("zzzzzzkkk_rg_source", tmpid)
|
|
|
|
+ save_mgo.Save("zzzzzzkkk_rg_info", info)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+//修复数据
|
|
func repair0317() {
|
|
func repair0317() {
|
|
//20230314Zdx_xx_new
|
|
//20230314Zdx_xx_new
|
|
dataArr, _ := save_mgo.Find("20230314Zdx_xx_new", nil, nil, nil)
|
|
dataArr, _ := save_mgo.Find("20230314Zdx_xx_new", nil, nil, nil)
|