caipin %!s(int64=4) %!d(string=hai) anos
pai
achega
344085f1b4

+ 6 - 6
dao/tree_contract_dao.go

@@ -403,12 +403,12 @@ func (d *TreeContractDao) Create(data *models.CmTreeContracts) error {
 	}
 
 	// 更新合同节树ID
-	data.TreeId = data.Id
-	_, err = session.Id(data.Id).Update(data)
-	if err != nil {
-		log.Println(" error=", err)
-		return errors.New("新增失败")
-	}
+	// data.TreeId = data.Id
+	// _, err = session.Id(data.Id).Update(data)
+	// if err != nil {
+	// 	log.Println(" error=", err)
+	// 	return errors.New("新增失败")
+	// }
 
 	err = session.Commit()
 	if err != nil {

+ 1 - 0
services/contract_section_tree_service.go

@@ -111,6 +111,7 @@ func (s *contractService) SectionAdd(sectionData *viewmodels.TreeSectionContract
 	// 新增项目节
 	sectionCM := &models.CmTreeContracts{}
 	sectionCM.Id = lastId.Id + 1
+	sectionCM.TreeId = lastId.Id + 1
 	sectionCM.TreeType = treeType
 	sectionCM.ParentId = sectionFather.TreeId
 	sectionCM.Name = sectionData.Name

+ 4 - 3
web/api/quality_api.go

@@ -232,8 +232,9 @@ func (c *QualityApi) GetSurvey() {
 	QualityData := c.ServiceQuality.GetSurvey(projectId, bidsectionId)
 
 	c.Ctx.JSON(iris.Map{
-		"code": 0,
-		"msg":  "",
-		"data": QualityData,
+		"code":         0,
+		"msg":          "",
+		"bidsectionId": sectionData.BidsectionId,
+		"data":         QualityData,
 	})
 }

+ 4 - 3
web/api/safe_api.go

@@ -233,8 +233,9 @@ func (c *SafeApi) GetSurvey() {
 	SafeData := c.ServiceSafe.GetSurvey(projectId, bidsectionId)
 
 	c.Ctx.JSON(iris.Map{
-		"code": 0,
-		"msg":  "",
-		"data": SafeData,
+		"code":         0,
+		"msg":          "",
+		"bidsectionId": sectionData.BidsectionId,
+		"data":         SafeData,
 	})
 }