Ver Fonte

企管法规处可查看所有工单;最后一条审批通过改合同状态

baichengfei há 5 anos atrás
pai
commit
fb07f2bc62

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

@@ -2,6 +2,7 @@ package oilcontract
 
 import (
 	"dashoo.cn/backend/api/business/auditsetting"
+	"dashoo.cn/backend/api/business/oilcontract/contract"
 	"dashoo.cn/backend/api/business/oilcontract/contractReview"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"dashoo.cn/backend/api/business/workflow"
@@ -182,11 +183,22 @@ func (this *OilContractDailyListenerController) WorkflowEndAudit() {
 	cols := []string{
 		"Id",
 		"Status",
-		"ApplyTime",
 	}
 	//进入此步骤,记录在数据库中
 	contractReviewEntity.Status = suppliercert.STORE_STATUS                  //审核完成
 	srv.UpdateEntityByIdCols(dailyId, contractReviewEntity, cols)
+	// 如果是最后一条 改状态
+	if contractReviewEntity.IsFinal == 1 {
+		col := []string{
+			"Id",
+			"Status",
+		}
+		var contractEntity contract.OilContract
+		sr := contract.GetOilContractService(utils.DBE)
+		sr.GetEntityById(contractReviewEntity.ContractId, &contractEntity)
+		contractEntity.Status = 3
+		sr.UpdateEntityByIdCols(contractReviewEntity.ContractId, &contractEntity, col)
+	}
 
 	this.Data["json"] = 1
 	this.ServeJSON()

+ 3 - 0
src/dashoo.cn/backend/api/controllers/oilcontract/contractEvaluationOrder.go

@@ -28,6 +28,9 @@ func (this *OilContractEvaluationOrderController) GetEntityList() {
 	//获取分页信息
 	page := this.GetPageInfoForm()
 	where := " UnitId = " + strconv.Itoa(this.User.UnitId)  + " "
+	if this.User.Unit == "企管法规处(内控与风险管理处)" {
+		where = " 1=1 "
+	}
 	orderby := "Id"
 	asc := false
 	Order := this.GetString("Order")