소스 검색

修改完bug提交

王宇昕 5 년 전
부모
커밋
ebfb539033

+ 6 - 16
src/dashoo.cn/backend/api/controllers/oilcontract/contractEvaluationOrder.go

@@ -224,6 +224,8 @@ func (this *OilContractEvaluationOrderController) UpdateEntity() {
 	}
 
 	var model contractEvaluationOrder.OilContractEvaluationOrder
+	var jsonBlob = this.Ctx.Input.RequestBody
+	json.Unmarshal(jsonBlob, &model)
 	var model1 contractEvaluationOrder.OilContractEvaluationOrder
 	svc := contractEvaluationOrder.GetOilContractEvaluationOrderService(utils.DBE)
 	svc.GetEntityByIdBytbl(OilContractEvaluationOrderName, id, &model1)
@@ -231,26 +233,14 @@ func (this *OilContractEvaluationOrderController) UpdateEntity() {
 		panic("操作失败!不能再次确认")
 	}
 
-	// 获取最后一条评价
-	where := " IsFinal = 1 and ContractId = " + strconv.Itoa(model1.ContractId)
-	var contractRev []contractReview.OilContractReview
+	// 获取评价
+	var contractRev contractReview.OilContractReview
 	contractSvc := contractReview.GetOilContractReviewService(utils.DBE)
-	contractSvc.GetEntitysByOrderbyWhere(OilContractReviewName, where, "Id Desc", &contractRev)
-	if len(contractRev) <= 0 {
-		panic("操作失败!找不到评价")
-	}
-	var ReviewId int
-	for _, value := range contractRev {
-		if value.Status != "8" {
+	contractSvc.GetEntityByIdBytbl(OilContractReviewName, model.ReviewId, &contractRev)
+	if contractRev.Status != "8" {
 			panic("操作失败!审核未结束不能确认")
 		}
-		ReviewId = value.Id
-		break
-	}
 
-	var jsonBlob = this.Ctx.Input.RequestBody
-	json.Unmarshal(jsonBlob, &model)
-	model.ReviewId = ReviewId
 	model.IsConfirm = 1
 	model.ModifiedOn = time.Now()
 	model.ModifiedBy = this.User.Realname

+ 9 - 5
src/dashoo.cn/backend/api/controllers/oilcontract/contractReview.go

@@ -45,11 +45,12 @@ func (this *OilContractReviewController) GetEntityList() {
 	}
 	Id := this.GetString("Id")
 	ContractClass := this.GetString("ContractClass")
-	WorkflowId := this.GetString("WorkflowId")
-	BusinessKey := this.GetString("BusinessKey")
-	ProcessKey := this.GetString("ProcessKey")
-	BackRemark := this.GetString("BackRemark")
-	CreateOn := this.GetString("CreateOn")
+	ContractId    := this.GetString("ContractId")
+	WorkflowId    := this.GetString("WorkflowId")
+	BusinessKey   := this.GetString("BusinessKey")
+	ProcessKey    := this.GetString("ProcessKey")
+	BackRemark    := this.GetString("BackRemark")
+	CreateOn      := this.GetString("CreateOn")
 
 	if Id != "" {
 		where = where + " and r.Id like '%" + Id + "%'"
@@ -59,6 +60,9 @@ func (this *OilContractReviewController) GetEntityList() {
 		where = where + " and c.ContractClass = '" + ContractClass + "'"
 	}
 
+	if ContractId != "" {
+		where = where + " and r.ContractId = '" + ContractId + "'"
+	}
 
 	if WorkflowId != "" {
 		where = where + " and r.WorkflowId like '%" + WorkflowId + "%'"

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

@@ -292,7 +292,7 @@ func (this *OilEvaluationItemsController) AddEntity() {
 		var Score float64
 		Score,_ = strconv.ParseFloat(model1.NormalScore, 64)
 		Sum,_ := strconv.ParseFloat(model.NormalScore,  64)
-		if  ScoreSum + Sum  != Score {
+		if  ScoreSum + Sum  > Score {
 			panic("二级分数和应等于所属一级!")
 		}
 	} else {