2
3
Эх сурвалжийг харах

后端:只能查看自己部门下的工单

baichengfei 5 жил өмнө
parent
commit
8ddb4cbeae

+ 2 - 2
src/dashoo.cn/backend/api/business/oilcontract/contractEvaluationOrder/contractEvaluationOrder.go

@@ -8,8 +8,8 @@ type OilContractEvaluationOrder struct {
 	Id             int       `json:"Id" xorm:"not null pk autoincr INT(11) 'Id'"`
 	ContractId     int       `json:"ContractId" xorm:"not null comment('合同表Id') INT(11) 'ContractId'"`
 	ReviewId       int       `json:"ReviewId" xorm:"comment('日常评价审批id') INT(11) 'ReviewId'"`
-	UnitId         int       `json:"AuditId" xorm:"comment('审核工单接收部门id') INT(11) 'AuditId'"`
-	UnitBy         string    `json:"AuditBy" xorm:"comment('接收部门') VARCHAR(50) 'AuditBy'"`
+	UnitId         int       `json:"AuditId" xorm:"comment('审核工单接收部门id') INT(11) 'UnitId'"`
+	UnitBy         string    `json:"AuditBy" xorm:"comment('接收部门') VARCHAR(50) 'UnitBy'"`
 	IsConfirm      int       `json:"IsConfirm" xorm:"default 0 comment('是否确认 0未确认,1已确认') INT(11) 'IsConfirm'"`
 	CreateOn       time.Time `json:"CreateOn" xorm:"DATETIME 'CreateOn'"`
 	CreateUserId   int       `json:"CreateUserId" xorm:"INT(11) 'CreateUserId'"`

+ 1 - 0
src/dashoo.cn/backend/api/controllers/base.go

@@ -411,6 +411,7 @@ func (this *BaseController) Prepare() {
 		this.User.Description = usermodel.Description
 		this.User.DepartmentId = usermodel.Departmentid
 		this.User.IsCompanyUser = usermodel.IsCompanyUser
+		this.User.UnitId = usermodel.UnitId
 		this.User.Unit = usermodel.Unit
 		//		this.User.Superior = usermodel.Superior
 		this.User.Roles = utils.ToStr(usermodel.Roleid)

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

@@ -27,7 +27,7 @@ func (this *OilContractEvaluationOrderController) GetEntityList() {
 
 	//获取分页信息
 	page := this.GetPageInfoForm()
-	where := " 1=1 "
+	where := " UnitId = " + strconv.Itoa(this.User.UnitId)  + " "
 	orderby := "Id"
 	asc := false
 	Order := this.GetString("Order")