|
@@ -118,8 +118,8 @@ func (this *ReportController) AddChapter() {
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
|
|
|
- condition += " AND title=? "
|
|
|
- pars = append(pars, req.Title)
|
|
|
+ condition += " AND report_id = ? AND title=? "
|
|
|
+ pars = append(pars, req.ReportId, req.Title)
|
|
|
count, err := models.GetCountReportChapterByCondition(condition, pars)
|
|
|
if err != nil {
|
|
|
br.Msg = "新增失败"
|
|
@@ -216,13 +216,21 @@ func (this *ReportController) EditChapterBaseInfoAndPermission() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ // 获取章节详情
|
|
|
+ reportChapterInfo, err := models.GetReportChapterInfoById(reportChapterId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "报告章节信息有误"
|
|
|
+ br.ErrMsg = "报告章节信息有误, Err: " + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
// 判断名称是否重复
|
|
|
{
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
|
|
|
- condition += " AND title=? AND report_chapter_id != ? "
|
|
|
- pars = append(pars, req.Title, reportChapterId)
|
|
|
+ condition += " AND report_id = ? AND title=? AND report_chapter_id != ? "
|
|
|
+ pars = append(pars, reportChapterInfo.ReportId, req.Title, reportChapterId)
|
|
|
count, err := models.GetCountReportChapterByCondition(condition, pars)
|
|
|
if err != nil {
|
|
|
br.Msg = "新增失败"
|
|
@@ -237,13 +245,6 @@ func (this *ReportController) EditChapterBaseInfoAndPermission() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 获取章节详情
|
|
|
- reportChapterInfo, err := models.GetReportChapterInfoById(reportChapterId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "报告章节信息有误"
|
|
|
- br.ErrMsg = "报告章节信息有误, Err: " + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
// 获取报告详情
|
|
|
reportInfo, err := models.GetReportByReportId(reportChapterInfo.ReportId)
|
|
|
if err != nil {
|
|
@@ -1498,13 +1499,21 @@ func (this *ReportController) EditChapterTitle() {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ // 获取章节详情
|
|
|
+ reportChapterInfo, err := models.GetReportChapterInfoById(reportChapterId)
|
|
|
+ if err != nil {
|
|
|
+ br.Msg = "报告章节信息有误"
|
|
|
+ br.ErrMsg = "报告章节信息有误, Err: " + err.Error()
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
// 判断名称是否重复
|
|
|
{
|
|
|
var condition string
|
|
|
var pars []interface{}
|
|
|
|
|
|
- condition += " AND title=? AND report_chapter_id != ? "
|
|
|
- pars = append(pars, req.Title, reportChapterId)
|
|
|
+ condition += " AND report_id = ? AND title=? AND report_chapter_id != ? "
|
|
|
+ pars = append(pars, reportChapterInfo.ReportId, req.Title, reportChapterId)
|
|
|
count, err := models.GetCountReportChapterByCondition(condition, pars)
|
|
|
if err != nil {
|
|
|
br.Msg = "新增失败"
|
|
@@ -1519,14 +1528,6 @@ func (this *ReportController) EditChapterTitle() {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- // 获取章节详情
|
|
|
- reportChapterInfo, err := models.GetReportChapterInfoById(reportChapterId)
|
|
|
- if err != nil {
|
|
|
- br.Msg = "报告章节信息有误"
|
|
|
- br.ErrMsg = "报告章节信息有误, Err: " + err.Error()
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
// 获取报告详情
|
|
|
reportInfo, err := models.GetReportByReportId(reportChapterInfo.ReportId)
|
|
|
if err != nil {
|