浏览代码

合同状态修改

Yikoo 5 年之前
父节点
当前提交
1ca6d7b724

+ 29 - 29
src/dashoo.cn/backend/api/controllers/oilcontract/contract.go

@@ -262,35 +262,35 @@ func (this *OilContractController) GetDictList() {
 // @Description get user by token
 // @Success 200 {object} map[string]interface{}
 // @router /finish/:id [get]
-func (this *OilContractController) Finish(){
-	id := this.Ctx.Input.Param(":id")
-	var errinfo ErrorInfo
-	if id == "" {
-		errinfo.Message = "操作失败!请求信息不完整"
-		errinfo.Code = -2
-		this.Data["json"] = &errinfo
-		this.ServeJSON()
-		return
-	}
-	var model contract.OilContract
-	svc := contract.GetOilContractService(utils.DBE)
-	model.Status = 2
-	cols := []string{
-		"Status",
-	}
-	err := svc.UpdateEntityBytbl(OilContractName, id, &model, cols)
-	if err == nil {
-		errinfo.Message = "修改成功!"
-		errinfo.Code = 0
-		this.Data["json"] = &errinfo
-		this.ServeJSON()
-	} else {
-		errinfo.Message = "修改失败!" + utils.AlertProcess(err.Error())
-		errinfo.Code = -1
-		this.Data["json"] = &errinfo
-		this.ServeJSON()
-	}
-}
+//func (this *OilContractController) Finish(){
+//	id := this.Ctx.Input.Param(":id")
+//	var errinfo ErrorInfo
+//	if id == "" {
+//		errinfo.Message = "操作失败!请求信息不完整"
+//		errinfo.Code = -2
+//		this.Data["json"] = &errinfo
+//		this.ServeJSON()
+//		return
+//	}
+//	var model contract.OilContract
+//	svc := contract.GetOilContractService(utils.DBE)
+//	model.Status = 2
+//	cols := []string{
+//		"Status",
+//	}
+//	err := svc.UpdateEntityBytbl(OilContractName, id, &model, cols)
+//	if err == nil {
+//		errinfo.Message = "修改成功!"
+//		errinfo.Code = 0
+//		this.Data["json"] = &errinfo
+//		this.ServeJSON()
+//	} else {
+//		errinfo.Message = "修改失败!" + utils.AlertProcess(err.Error())
+//		errinfo.Code = -1
+//		this.Data["json"] = &errinfo
+//		this.ServeJSON()
+//	}
+//}
 
 // @Title 获取实体
 // @Description 获取实体

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

@@ -150,6 +150,14 @@ func (this *OilContractEvaluationItemsController) GetTreeList() {
 
 		var list1 []contractEvaluationItems.OilContractEvaluationItems
 		where1 := "ContentReviewId ='" + Id +"' AND ParentId = " + strconv.Itoa(value.ItemId)
+		if Category != "" {
+			where1 = where1 + " and Category = '" + Category + "'"
+		}
+		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

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

@@ -253,7 +253,7 @@ func (this *OilContractReviewController) SaveEvaluationItemsBySec(){
 	itemSvc := contractEvaluationItems.GetOilContractEvaluationItemsService(utils.DBE)
 	var jsonBlob = this.Ctx.Input.RequestBody
 	json.Unmarshal(jsonBlob, &modeVO)
-	where := "ContentReviewId=" + id
+	where := "ContentReviewId=" + id + " AND Category = 1 "
 	// 清除掉之前的
 	itemSvc.DeleteEntityBytbl(OilContractReviewName,where)
 	var items []contractEvaluationItems.OilContractEvaluationItems
@@ -362,7 +362,7 @@ func (this *OilContractReviewController) UpdateEntity() {
 	err := svc.UpdateEntityBytbl(OilContractReviewName, id, &reviewMode, cols)
 
 
-	where := "ContentReviewId=" + id
+	where := "ContentReviewId=" + id + " AND Category = 0 "
 	// 清除掉之前的
 	itemSvc.DeleteEntityBytbl(OilContractEvaluationItemsName,where)