Sfoglia il codice sorgente

专业科室评价接口修复

Yikoo 5 anni fa
parent
commit
c65becb38f

+ 0 - 2
src/dashoo.cn/backend/api/controllers/oilcontract/contractEvaluationItems.go

@@ -156,8 +156,6 @@ func (this *OilContractEvaluationItemsController) GetTreeList() {
 		if Type != "" {
 			where1 = where1 + " and Type = '" + Type + "'"
 		}
-
-
 		svc.GetPagingEntitiesWithOrderBytbl("", page.CurrentPage, page.Size, orderby, true, &list1, where1)
 		for _, v := range list1 {
 			var secTmp contractEvaluationItems.EvaluationItems

+ 31 - 2
src/dashoo.cn/backend/api/controllers/oilcontract/contractReview.go

@@ -255,7 +255,7 @@ func (this *OilContractReviewController) SaveEvaluationItemsBySec(){
 	json.Unmarshal(jsonBlob, &modeVO)
 	where := "ContentReviewId=" + id + " AND Category = 1 "
 	// 清除掉之前的
-	itemSvc.DeleteEntityBytbl(OilContractReviewName,where)
+	itemSvc.DeleteEntityBytbl(OilContractEvaluationItemsName,where)
 	var items []contractEvaluationItems.OilContractEvaluationItems
 	// 新增配置项
 	for i,v := range modeVO.Items{
@@ -264,6 +264,7 @@ func (this *OilContractReviewController) SaveEvaluationItemsBySec(){
 		temp.ContentReviewId,_ = strconv.Atoi(id)
 		temp.Type     = v.Type
 		temp.Category = 1
+		temp.ItemId = v.ItemId
 		temp.ParentId = v.ParentId
 		temp.SequenceNo = v.SequenceNo
 		temp.Content = v.Content
@@ -386,10 +387,38 @@ func (this *OilContractReviewController) UpdateEntity() {
 		temp.Content = v.Content
 		items = append(items, temp)
 	}
+
 	_, err2 := itemSvc.DBE.Insert(items)
 
+	where2 := "ContentReviewId=" + id + " AND Category = 1 "
+	// 清除掉之前的
+	itemSvc.DeleteEntityBytbl(OilContractEvaluationItemsName,where2)
 
-	if err == nil && err2 == nil {
+	var items2 []contractEvaluationItems.OilContractEvaluationItems
+	// 新增配置项
+	for i,v := range modeVO.Items{
+		fmt.Print(i)
+		var temp2 contractEvaluationItems.OilContractEvaluationItems
+		temp2.ContentReviewId ,_ = strconv.Atoi(id)
+		temp2.Type     = v.Type
+		temp2.ItemId   = v.ItemId
+		temp2.Category = 1
+		temp2.ParentId = v.ParentId
+		temp2.SequenceNo = v.SequenceNo
+		temp2.Content = v.Content
+		temp2.NormalScore = v.NormalScore
+		temp2.Score = v.Score
+		temp2.Value = v.Value
+		temp2.LevelCode = v.LevelCode
+		temp2.Remark = v.Remark
+		temp2.Content = v.Content
+		items2 = append(items2, temp2)
+	}
+
+	_, err3 := itemSvc.DBE.Insert(items2)
+
+
+	if err == nil && err2 == nil && err3 == nil{
 		errinfo.Message = "修改成功!"
 		errinfo.Code = 0
 		this.Data["json"] = &errinfo

+ 81 - 2
src/dashoo.cn/backend/api/controllers/oilcontract/contractSumScore.go

@@ -106,6 +106,8 @@ func (this *OilContractSumScoreController) GetEntityList() {
 		}
 	}
 
+	where = where + " and items.Category = '0' "
+
 
 	//超级管理员和有查看所有数据权限的用户不加条件
 	svcPerm := permission.GetPermissionService(utils.DBE)
@@ -458,7 +460,6 @@ func (this *OilContractSumScoreController) UpdateEntity() {
 	item.ModifiedOn   = time.Now()
 	item.ModifiedBy   = this.User.Realname
 	item.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
-
 	item.B1 = model.B1
 	item.B2 = model.B2
 	item.B3 = model.B3
@@ -510,7 +511,85 @@ func (this *OilContractSumScoreController) UpdateEntity() {
 	}
 	err2 := itemSvc.UpdateEntityBytbl(OilContractSumScoreItemsName,item.Id,&item,cols2)
 
-	if err == nil && err2 == nil {
+
+
+	var item3 contractSumScoreItems.OilContractSumScoreItems
+	where3 := " 1=1 AND SumScoreId= '" + utils.ToStr( model.Id) + "' AND Category = 1 "
+	itemSvc.GetEntityByWhere(OilContractSumScoreItemsName,where3,&item3)
+	item3.Category   = 1                       // 专业科室单位创建
+	item3.SumScore   = model.SumScore
+	item3.Content1   = model.Content1
+	item3.NormalSumScore1 = model.NormalSumScore1
+	item3.SumScore1  = model.SumScore1
+	item3.Content2   = model.Content2
+	item3.NormalSumScore2 = model.NormalSumScore2
+	item3.SumScore2  = model.SumScore2
+	item3.Content3   = model.Content3
+	item3.NormalSumScore3 = model.NormalSumScore3
+	item3.SumScore3  = model.SumScore3
+	item3.Content4   = model.Content4
+	item3.NormalSumScore4 = model.NormalSumScore4
+	item3.SumScore4  = model.SumScore4
+	item3.Content5   = model.Content5
+	item3.NormalSumScore5 = model.NormalSumScore5
+	item3.SumScore5  = model.SumScore5
+	item3.Note       = model.Note
+	item3.ModifiedOn   = time.Now()
+	item3.ModifiedBy   = this.User.Realname
+	item3.ModifiedUserId, _ = utils.StrTo(this.User.Id).Int()
+	item3.B1 = model.B1
+	item3.B2 = model.B2
+	item3.B3 = model.B3
+	item3.B4 = model.B4
+	item3.B5 = model.B5
+	item3.B6 = model.B6
+	item3.B7 = model.B7
+	item3.B8 = model.B8
+
+	cols3 := []string{
+		"Category",
+		"SumScore",
+		"Content1",
+		"Content2",
+		"Content3",
+		"Content4",
+		"Content5",
+		"Content6",
+		"Content7",
+		"Content8",
+		"NormalSumScore1",
+		"NormalSumScore2",
+		"NormalSumScore3",
+		"NormalSumScore4",
+		"NormalSumScore5",
+		"NormalSumScore6",
+		"NormalSumScore7",
+		"NormalSumScore8",
+		"SumScore1",
+		"SumScore2",
+		"SumScore3",
+		"SumScore4",
+		"SumScore5",
+		"SumScore6",
+		"SumScore7",
+		"SumScore8",
+		"Note",
+		"ModifiedOn",
+		"ModifiedBy",
+		"ModifiedUserId",
+		"B1",
+		"B2",
+		"B3",
+		"B4",
+		"B5",
+		"B6",
+		"B7",
+		"B8",
+	}
+	err3 := itemSvc.UpdateEntityBytbl(OilContractSumScoreItemsName,item3.Id,&item3,cols3)
+
+
+	if err == nil && err2 == nil && err3 == nil {
 		errinfo.Message = "修改成功!"
 		errinfo.Code = 0
 		this.Data["json"] = &errinfo