|
@@ -188,7 +188,33 @@ func GetEntDataExportCount(sim, bid mg.MongodbSim, bidMgoDBName, elasticAddress,
|
|
|
data = res
|
|
|
return
|
|
|
}*/
|
|
|
-func GetEntDataExportCountIdArr(sim, bid mg.MongodbSim, bidMgoDBName, elasticAddress, _id string, entId, entUserId int, url string, maxCount int) (count, newCount int, err error) {
|
|
|
+func GetEntDataExportCountIdArr(sim, bid mg.MongodbSim, bidMgoDBName, elasticAddress, _id string, entId, entUserId int, dataPkgRemoveRepeatAddr string, maxCount int) (count, newCount int, err error) {
|
|
|
+ log.Println(fmt.Sprintf("GetEntDataExportCountIdArr entId:%v,entUserId:%v", entId, entUserId))
|
|
|
+ start := time.Now()
|
|
|
+ defer func() {
|
|
|
+ util.Catch()
|
|
|
+ log.Printf("GetEntDataExportCountIdArr entId:%v,entUserId:%v 总耗时:%v\n", entId, entUserId, time.Since(start))
|
|
|
+ }()
|
|
|
+ count = GetDataExportSearchCountByScdId(sim, bid, bidMgoDBName, elasticAddress, _id)
|
|
|
+ log.Printf("耗时: GetEntDataExportCountIdArr-GetDataExportSearchCountByScdId entId:%v,entUserId:%v,Since:%v \n", entId, entUserId, time.Since(start))
|
|
|
+ if count > maxCount || count == -1 {
|
|
|
+ count = maxCount
|
|
|
+ }
|
|
|
+ log.Println("GetEntDataExportCountIdArr-count", entId, entUserId, count)
|
|
|
+ //数据导出数据查询
|
|
|
+ ids, err := GetDataExportIdArrByScdId(sim, elasticAddress, _id, count)
|
|
|
+ log.Printf("耗时: GetEntDataExportCountIdArr-GetDataExportSearchResultByScdId entId:%v,entUserId:%v,Since:%v \n", entId, entUserId, time.Since(start))
|
|
|
+ if err != nil {
|
|
|
+ log.Println("GetEntDataExportCountIdArr 企业数据导出错误 ", entId, entUserId, err)
|
|
|
+ return 0, 0, fmt.Errorf("企业数据导出错误")
|
|
|
+ }
|
|
|
+ m, _ := NoRepeatData(dataPkgRemoveRepeatAddr, map[string]interface{}{"entid": entId, "ids": ids})
|
|
|
+ newCount = len(m)
|
|
|
+ log.Printf("GetEntDataExportCountIdArr 企业数据导出--数据遍历完成:entId:%v,entUserId:%v,newCount:%v,Since:%v \n", entId, entUserId, newCount)
|
|
|
+ return
|
|
|
+}
|
|
|
+
|
|
|
+/*func GetEntDataExportCountIdArr(sim, bid mg.MongodbSim, bidMgoDBName, elasticAddress, _id string, entId, entUserId int, url string, maxCount int) (count, newCount int, err error) {
|
|
|
log.Println(fmt.Sprintf("GetEntDataExportCountIdArr entId:%v,entUserId:%v", entId, entUserId))
|
|
|
start := time.Now()
|
|
|
defer func() {
|
|
@@ -275,7 +301,7 @@ func GetEntDataExportCountIdArr(sim, bid mg.MongodbSim, bidMgoDBName, elasticAdd
|
|
|
searchsWaitGroup.Wait()
|
|
|
log.Printf("GetEntDataExportCountIdArr 企业数据导出--数据遍历完成:entId:%v,entUserId:%v,newCount:%v,Since:%v \n", entId, entUserId, newCount, time.Since(postStart))
|
|
|
return
|
|
|
-}
|
|
|
+}*/
|
|
|
func FormatExportDatas(Mgo_Ent mongodb.MongodbSim, data *[]map[string]interface{}, webdomain string, dataType string, entId int) *[]map[string]interface{} {
|
|
|
//格式化输出
|
|
|
var (
|