Jelajahi Sumber

9-27bug修复

Yikoo 5 tahun lalu
induk
melakukan
3b40ebc5d1

+ 39 - 18
src/dashoo.cn/backend/api/controllers/oilcontract/contractReview.go

@@ -174,31 +174,52 @@ func (this *OilContractReviewController) AddEntity() {
 	reviewMode.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
 	_, err := svc.InsertEntityBytbl(OilContractReviewName, &reviewMode)
 
-	var items []contractEvaluationItems.OilContractEvaluationItems
+	var items2 []contractEvaluationItems.OilContractEvaluationItems
+	var items3 []contractEvaluationItems.OilContractEvaluationItems
+
 	// 新增配置项
 	for i,v := range modeVO.Items{
 		fmt.Print(i)
-		var temp contractEvaluationItems.OilContractEvaluationItems
-		temp.ContentReviewId = reviewMode.Id
-		temp.Type     = v.Category
-		temp.Category = 0
-		temp.ItemId = v.Id
-		temp.ParentId = v.ParentId
-		temp.SequenceNo = v.SequenceNo
-		temp.Content = v.Content
-		temp.NormalScore = v.NormalScore
-		temp.Score = v.Score
-		temp.Value = v.Value
-		temp.LevelCode = v.LevelCode
-		temp.Remark = v.Remark
-		temp.Content = v.Content
-		items = append(items, temp)
+		var temp2 contractEvaluationItems.OilContractEvaluationItems
+		temp2.ContentReviewId = reviewMode.Id
+		temp2.Type     = v.Category
+		temp2.Category = 0
+		temp2.ItemId = v.Id
+		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)
+
+		var temp3 contractEvaluationItems.OilContractEvaluationItems
+		temp3.ContentReviewId = reviewMode.Id
+		temp3.Type     = v.Category
+		temp3.Category = 1
+		temp3.ItemId = v.Id
+		temp3.ParentId = v.ParentId
+		temp3.SequenceNo = v.SequenceNo
+		temp3.Content = v.Content
+		temp3.NormalScore = v.NormalScore
+		temp3.Score = v.Score
+		temp3.Value = v.Value
+		temp3.LevelCode = v.LevelCode
+		temp3.Remark = v.Remark
+		temp3.Content = v.Content
+		items3 = append(items3, temp3)
+
 	}
-	_, err2 := itemSvc.DBE.Insert(items)
+	_, err2 := itemSvc.DBE.Insert(items2)
 
+	// 专业处室评价默认二级
+	_, err3 := itemSvc.DBE.Insert(items3)
 
 	var errinfo ErrorDataInfo
-	if err == nil && err2 == nil{
+	if err == nil && err2 == nil && err3 == nil{
 		//新增
 		errinfo.Message = "添加成功!"
 		errinfo.Code = 0

+ 46 - 3
src/dashoo.cn/backend/api/controllers/oilcontract/contractSumScore.go

@@ -325,7 +325,6 @@ func (this *OilContractSumScoreController) AddEntity() {
 	item.CreateOn   = time.Now()
 	item.CreateBy   = this.User.Realname
 	item.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
-
 	item.B1 = model.B1
 	item.B2 = model.B2
 	item.B3 = model.B3
@@ -335,10 +334,54 @@ func (this *OilContractSumScoreController) AddEntity() {
 	item.B7 = model.B7
 	item.B8 = model.B8
 
+	var item2 contractSumScoreItems.OilContractSumScoreItems
+	item2.SumScoreId = entity.Id
+	item2.Category   = 0                      // 二级单位创建
+	item2.SumScore   = model.SumScore
+	item2.Content1   = model.Content1
+	item2.NormalSumScore1 = model.NormalSumScore1
+	item2.SumScore1  = model.SumScore1
+	item2.Content2   = model.Content2
+	item2.NormalSumScore2 = model.NormalSumScore2
+	item2.SumScore2  = model.SumScore2
+	item2.Content3   = model.Content3
+	item2.NormalSumScore3 = model.NormalSumScore3
+	item2.SumScore3  = model.SumScore3
+	item2.Content4   = model.Content4
+	item2.NormalSumScore4 = model.NormalSumScore4
+	item2.SumScore4  = model.SumScore4
+	item2.Content5   = model.Content5
+	item2.NormalSumScore5 = model.NormalSumScore5
+	item2.SumScore5  = model.SumScore5
+	item2.Content6   = model.Content6
+	item2.NormalSumScore6 = model.NormalSumScore6
+	item2.SumScore6  = model.SumScore6
+	item2.Content7   = model.Content7
+	item2.NormalSumScore7 = model.NormalSumScore7
+	item2.SumScore7  = model.SumScore7
+	item2.Content8   = model.Content8
+	item2.NormalSumScore8 = model.NormalSumScore8
+	item2.SumScore8  = model.SumScore8
+	item2.Conclusion = model.Conclusion
+	item2.Note       = model.Note
+	item2.CreateOn   = time.Now()
+	item2.CreateBy   = this.User.Realname
+	item2.CreateUserId, _ = utils.StrTo(this.User.Id).Int()
+	item2.B1 = model.B1
+	item2.B2 = model.B2
+	item2.B3 = model.B3
+	item2.B4 = model.B4
+	item2.B5 = model.B5
+	item2.B6 = model.B6
+	item2.B7 = model.B7
+	item2.B8 = model.B8
+
 	itemSvc := contractSumScoreItems.GetOilContractSumScoreItemsService(utils.DBE)
-	itemSvc.InsertEntityBytbl(OilContractSumScoreItemsName, &item)
+	_, err2 := itemSvc.InsertEntityBytbl(OilContractSumScoreItemsName, &item)
+	_, err3 := itemSvc.InsertEntityBytbl(OilContractSumScoreItemsName, &item2)
+
 	var errinfo ErrorDataInfo
-	if err == nil {
+	if err == nil && err2 == nil && err3 == nil {
 		//新增
 		errinfo.Message = "添加成功!"
 		errinfo.Code = 0

+ 1 - 1
src/dashoo.cn/backend/api/controllers/oilcontract/evaluationItems.go

@@ -172,7 +172,7 @@ func (this *OilEvaluationItemsController) GetOneEntityList() {
 	if Type != "0" {
 		where += " AND Type = " + Type
 	}
-	if Category != "" {
+	if Category != "0" {
 		where += " AND Category = " + Category
 	}
 	svc := evaluationItems.GetOilEvaluationItemsService(utils.DBE)