|
@@ -8,6 +8,7 @@ import (
|
|
|
"eta/eta_api/utils"
|
|
|
"fmt"
|
|
|
"github.com/rdlucklib/rdluck_tools/paging"
|
|
|
+ "strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
)
|
|
@@ -214,29 +215,38 @@ func (this *SmartReportResourceController) Remove() {
|
|
|
br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
- if req.ResourceId <= 0 {
|
|
|
+ if req.ResourceIds == "" {
|
|
|
br.Msg = "参数有误"
|
|
|
- br.ErrMsg = "报告ID为空"
|
|
|
+ br.ErrMsg = "图片ID为空"
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- ob := new(smart_report.SmartReportResource)
|
|
|
- item, e := ob.GetItemById(req.ResourceId)
|
|
|
- if e != nil {
|
|
|
- if e.Error() == utils.ErrNoRow() {
|
|
|
- br.Ret = 200
|
|
|
- br.Success = true
|
|
|
- br.Msg = "操作成功"
|
|
|
+ ids := strings.Split(req.ResourceIds, ",")
|
|
|
+ for _, idStr := range ids {
|
|
|
+ ob := new(smart_report.SmartReportResource)
|
|
|
+ id,err := strconv.Atoi(idStr)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "参数解析异常!"
|
|
|
+ br.ErrMsg = "参数解析失败,Err:" + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ item, e := ob.GetItemById(id)
|
|
|
+ if e != nil {
|
|
|
+ if e.Error() == utils.ErrNoRow() {
|
|
|
+ br.Ret = 200
|
|
|
+ br.Success = true
|
|
|
+ br.Msg = "操作成功"
|
|
|
+ return
|
|
|
+ }
|
|
|
+ br.Msg = "操作失败"
|
|
|
+ br.ErrMsg = "获取资源失败, Err: " + e.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if e = item.Del(); e != nil {
|
|
|
+ br.Msg = "操作失败"
|
|
|
+ br.ErrMsg = "删除资源失败, Err: " + e.Error()
|
|
|
return
|
|
|
}
|
|
|
- br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "获取资源失败, Err: " + e.Error()
|
|
|
- return
|
|
|
- }
|
|
|
- if e = item.Del(); e != nil {
|
|
|
- br.Msg = "操作失败"
|
|
|
- br.ErrMsg = "删除资源失败, Err: " + e.Error()
|
|
|
- return
|
|
|
}
|
|
|
|
|
|
br.Ret = 200
|