|
@@ -742,7 +742,7 @@ func ChartBatchUpdateAndUpload(chartClassifyInfo *data_manage.ChartClassify, sys
|
|
|
offset := 0
|
|
|
pageSize := 100
|
|
|
success := 0
|
|
|
-
|
|
|
+
|
|
|
// 循环更新100个图表数据
|
|
|
for i := 0; offset < total; i++ {
|
|
|
// 查询需要更新的图表信息
|
|
@@ -786,7 +786,13 @@ func ChartBatchUpdateAndUpload(chartClassifyInfo *data_manage.ChartClassify, sys
|
|
|
offset := 0
|
|
|
pageSize := 100
|
|
|
success := 0
|
|
|
- for i := 0; offset < total; i++ {
|
|
|
+ // 计算需要分多少页
|
|
|
+ pageNum := total / pageSize
|
|
|
+ if total % pageSize != 0 {
|
|
|
+ pageNum += 1
|
|
|
+ }
|
|
|
+ // 循环更新100个图表数据
|
|
|
+ for i := 0; i < pageNum; i++ {
|
|
|
chartInfos, e := data_manage.GetChartInfoListByCondition(condition, []interface{}{upChartClassifyIdList}, offset, pageSize)
|
|
|
if e != nil {
|
|
|
err = fmt.Errorf("查询需要新增的图表信息失败: %v", e)
|
|
@@ -806,8 +812,6 @@ func ChartBatchUpdateAndUpload(chartClassifyInfo *data_manage.ChartClassify, sys
|
|
|
}
|
|
|
success += 1
|
|
|
}
|
|
|
-
|
|
|
- offset += pageSize
|
|
|
}
|
|
|
utils.FileLog.Info("批量上传已经上架的分类下的图表到资源库中完成, 新增图表数据总数:", success)
|
|
|
|
|
@@ -871,8 +875,13 @@ func ChartInfoDeleteBatch(chartClassifyInfo *data_manage.ChartClassify, sysUser
|
|
|
pageSize := 100
|
|
|
success := 0
|
|
|
|
|
|
+ // 计算需要分多少页
|
|
|
+ pageNum := total / pageSize
|
|
|
+ if total % pageSize != 0 {
|
|
|
+ pageNum += 1
|
|
|
+ }
|
|
|
// 循环更新100个图表数据
|
|
|
- for i := 0; offset < total; i++ {
|
|
|
+ for i := 0; i < pageNum; i++ {
|
|
|
// 查询需要更新的图表信息
|
|
|
chartInfos, e := data_manage.GetChartInfoListByCondition(condition, []interface{}{chartClassifyInfo.Source, chartClassifyIdList}, offset, pageSize)
|
|
|
if e != nil {
|
|
@@ -894,7 +903,7 @@ func ChartInfoDeleteBatch(chartClassifyInfo *data_manage.ChartClassify, sysUser
|
|
|
success += 1
|
|
|
}
|
|
|
|
|
|
- offset += pageSize
|
|
|
+ // offset += pageSize
|
|
|
}
|
|
|
fmt.Println("删除图表数据完成, 删除图表数据总数:", success)
|
|
|
return
|
|
@@ -945,8 +954,13 @@ func ChartInfoDeleteBatchByChartInfoIds(chartInfoIds []int, chartClassifyId int)
|
|
|
pageSize := 100
|
|
|
success := 0
|
|
|
|
|
|
+ // 计算需要分多少页
|
|
|
+ pageNum := total / pageSize
|
|
|
+ if total % pageSize != 0 {
|
|
|
+ pageNum += 1
|
|
|
+ }
|
|
|
// 循环更新100个图表数据
|
|
|
- for i := 0; offset < total; i++ {
|
|
|
+ for i := 0; i < pageNum; i++ {
|
|
|
// 查询需要更新的图表信息
|
|
|
chartInfos, e := data_manage.GetChartInfoListByCondition(condition, []interface{}{chartInfoIds}, offset, pageSize)
|
|
|
if e != nil {
|
|
@@ -968,7 +982,7 @@ func ChartInfoDeleteBatchByChartInfoIds(chartInfoIds []int, chartClassifyId int)
|
|
|
success += 1
|
|
|
}
|
|
|
|
|
|
- offset += pageSize
|
|
|
+ //offset += pageSize
|
|
|
}
|
|
|
fmt.Println("删除图表数据完成, 删除图表数据总数:", success)
|
|
|
return
|