Explorar el Código

增项列表查看

huahaiyan hace 6 años
padre
commit
f285d9e969

+ 13 - 0
src/dashoo.cn/backend/api/controllers/oilsupplier/suppliercertappend.go

@@ -4,6 +4,7 @@ import (
 	"dashoo.cn/backend/api/business/auditsetting"
 	"dashoo.cn/backend/api/business/oilsupplier/suppliercert"
 	"dashoo.cn/backend/api/business/workflow"
+	"dashoo.cn/business2/permission"
 	"dashoo.cn/business2/userRole"
 	"encoding/json"
 	"strconv"
@@ -86,6 +87,18 @@ func (this *OilSupplierCertAppendController) GetList() {
 			where = where + " and CreateOn>='" + minDate + "' and CreateOn<='" + maxDate + "'"
 		}
 	}
+	//企业用户必须加创建人条件
+	if this.User.IsCompanyUser == 1 {
+		where = where + " and a.CreateUserId = '" + this.User.Id + "'"
+	} else {
+		//超级管理员和有查看所有数据权限的用户不加条件
+		svcPerm := permission.GetPermissionService(utils.DBE)
+		isauth := svcPerm.IsAuthorized(this.User.Id, "oil_supplier.marketAccess.AllRecord")
+		if !svcPerm.IsAdmin(this.User.Id) && !isauth {
+			where = where + " and a.CreateUserId = '" + this.User.Id + "'"
+		}
+
+	}
 
 	svc := suppliercertappend.GetOilSupplierCertAppendService(utils.DBE)
 	var list []suppliercertappend.OilSupplierCertAppend