Roc 8 mesi fa
parent
commit
7cb33c5da4
4 ha cambiato i file con 22 aggiunte e 3 eliminazioni
  1. 7 1
      controllers/report_v2.go
  2. 1 1
      models/report.go
  3. 1 1
      models/report_v2.go
  4. 13 0
      services/report_v2.go

+ 7 - 1
controllers/report_v2.go

@@ -1494,6 +1494,11 @@ func (this *ReportController) SubmitApprove() {
 		return
 	}
 
+	// 报告权限处理
+	{
+		go services.HandleReportPermission(reportItem)
+	}
+
 	br.Ret = 200
 	br.Success = true
 	br.Msg = "操作成功"
@@ -1669,7 +1674,8 @@ func fixChapterPermission() {
 		}
 	}
 
-	notIdList := []int{9675, 9675, 9740, 9749, 9768, 9773, 9791, 9792, 9793, 9850, 9851, 9852, 9852, 9852, 9853, 9854, 9856, 9857, 9857, 9858, 9859, 9860, 9861, 9862, 9862, 9863, 9866}
+	//notIdList := []int{9675, 9675, 9740, 9749, 9768, 9773, 9791, 9792, 9793, 9850, 9851, 9852, 9852, 9852, 9853, 9854, 9856, 9857, 9857, 9858, 9859, 9860, 9861, 9862, 9862, 9863, 9866}
+	notIdList := []int{}
 	allReportChapterList, err := models.GetAllReportChapter()
 	if err != nil {
 		fmt.Println("获取所有章节失败,Err:", err.Error())

+ 1 - 1
models/report.go

@@ -426,7 +426,7 @@ func GetReportStage(classifyIdFirst, classifyIdSecond, classifyIdThird int) (cou
 	} else if classifyIdSecond > 0 {
 		sql += " AND classify_id_second = ? "
 	} else {
-		sql = " AND classify_id_first = ? "
+		sql += " AND classify_id_first = ? "
 	}
 	o.Raw(sql, yearStart, classifyId).QueryRow(&count)
 

+ 1 - 1
models/report_v2.go

@@ -369,7 +369,7 @@ func GetReportListCountByAuthorized(condition string, pars []interface{}) (count
 func GetReportListByAuthorized(condition string, pars []interface{}, startSize, pageSize int) (items []*ReportList, err error) {
 	o := orm.NewOrmUsingDB("rddp")
 
-	sql := `SELECT id,classify_id_first,classify_name_first,classify_id_second,classify_name_second,classify_id_third,classify_name_third,title,stage,create_time,author,report_layout,collaborate_type,is_public_publish FROM report as a WHERE 1=1  `
+	sql := `SELECT id,classify_id_first,classify_name_first,classify_id_second,classify_name_second,classify_id_third,classify_name_third,title,stage,create_time,author,report_layout,collaborate_type,is_public_publish,abstract FROM report as a WHERE 1=1  `
 	if condition != "" {
 		sql += condition
 	}

+ 13 - 0
services/report_v2.go

@@ -1325,3 +1325,16 @@ func handleReportPermission(reportId int64, minClassifyId int) {
 
 	return
 }
+
+// HandleReportPermission
+// @Description: 报告权限处理
+// @author: Roc
+// @datetime 2024-07-12 11:17:49
+// @param reportInfo *models.Report
+func HandleReportPermission(reportInfo *models.Report) {
+	minClassifyId, _, tmpErr := getMinClassify(reportInfo)
+	if tmpErr != nil {
+		return
+	}
+	handleReportPermission(int64(reportInfo.Id), minClassifyId)
+}