|
@@ -36,7 +36,17 @@ type OrganizeModel struct {
|
|
|
func (this *OrganizesController) List() {
|
|
func (this *OrganizesController) List() {
|
|
|
page := this.GetPageInfoForm()
|
|
page := this.GetPageInfoForm()
|
|
|
svc := organize.GetOrganizeService(utils.DBE)
|
|
svc := organize.GetOrganizeService(utils.DBE)
|
|
|
- topid := svc.GetMyUnitDepartmentId(this.User.DepartmentId)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ svcPerm := permission.GetPermissionService(utils.DBE)
|
|
|
|
|
+ isauth := svcPerm.IsAuthorized(this.User.Id, "oil_admin")
|
|
|
|
|
+ topid := ""
|
|
|
|
|
+ if isauth {
|
|
|
|
|
+ paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
|
|
+ topid = paramSvc.GetBaseparameterMessage("", "paramset", "HeadquartersID") // 总公司Id
|
|
|
|
|
+ } else {
|
|
|
|
|
+ topid = svc.GetMyUnitDepartmentId(this.User.DepartmentId)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
depids := svc.GetAllChildById(topid)
|
|
depids := svc.GetAllChildById(topid)
|
|
|
where := "( Createuserid=" + this.User.Id + " or id in (" + depids + "))"
|
|
where := "( Createuserid=" + this.User.Id + " or id in (" + depids + "))"
|
|
|
keyword := this.GetString("keyword")
|
|
keyword := this.GetString("keyword")
|
|
@@ -96,7 +106,16 @@ func (this *OrganizesController) Detailed() {
|
|
|
func (this *OrganizesController) Listbandparentname() {
|
|
func (this *OrganizesController) Listbandparentname() {
|
|
|
page := this.GetPageInfoForm()
|
|
page := this.GetPageInfoForm()
|
|
|
svc := organize.GetOrganizeService(utils.DBE)
|
|
svc := organize.GetOrganizeService(utils.DBE)
|
|
|
- topid := svc.GetMyUnitDepartmentId(this.User.DepartmentId)
|
|
|
|
|
|
|
+ svcPerm := permission.GetPermissionService(utils.DBE)
|
|
|
|
|
+ isauth := svcPerm.IsAuthorized(this.User.Id, "oil_admin")
|
|
|
|
|
+ topid := ""
|
|
|
|
|
+ if isauth {
|
|
|
|
|
+ paramSvc := baseparameter.GetBaseparameterService(utils.DBE)
|
|
|
|
|
+ topid = paramSvc.GetBaseparameterMessage("", "paramset", "HeadquartersID") // 总公司Id
|
|
|
|
|
+ } else {
|
|
|
|
|
+ topid = svc.GetMyUnitDepartmentId(this.User.DepartmentId)
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
depids := svc.GetAllChildById(topid)
|
|
depids := svc.GetAllChildById(topid)
|
|
|
where := "( a.Createuserid=" + this.User.Id + " or a.id in (" + depids + "))"
|
|
where := "( a.Createuserid=" + this.User.Id + " or a.id in (" + depids + "))"
|
|
|
keyword := this.GetString("keyword")
|
|
keyword := this.GetString("keyword")
|
|
@@ -376,10 +395,7 @@ func (this *OrganizesController) OrganizeParentList() {
|
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
|
// @router /listbydeptid [get]
|
|
// @router /listbydeptid [get]
|
|
|
func (this *OrganizesController) ListByDeptId() {
|
|
func (this *OrganizesController) ListByDeptId() {
|
|
|
- //ParentId := this.GetString("ParentId")
|
|
|
|
|
- //var user userRole.Base_User
|
|
|
|
|
svc := organize.GetOrganizeService(utils.DBE)
|
|
svc := organize.GetOrganizeService(utils.DBE)
|
|
|
- //unitId := svc.GetMyUnitDepartmentId(this.User.DepartmentId)
|
|
|
|
|
|
|
|
|
|
svcPerm := permission.GetPermissionService(utils.DBE)
|
|
svcPerm := permission.GetPermissionService(utils.DBE)
|
|
|
isauth := svcPerm.IsAuthorized(this.User.Id, "oil_admin")
|
|
isauth := svcPerm.IsAuthorized(this.User.Id, "oil_admin")
|
|
@@ -390,20 +406,9 @@ func (this *OrganizesController) ListByDeptId() {
|
|
|
} else {
|
|
} else {
|
|
|
unitId = svc.GetMyUnitDepartmentId(this.User.DepartmentId)
|
|
unitId = svc.GetMyUnitDepartmentId(this.User.DepartmentId)
|
|
|
}
|
|
}
|
|
|
- //svc.GetEntityById(this.User.Id, &user)
|
|
|
|
|
- //companyids := strings.Split(user.Superior, ",")
|
|
|
|
|
|
|
+
|
|
|
ids := svc.GetAllChildById(unitId)
|
|
ids := svc.GetAllChildById(unitId)
|
|
|
- //ids := ""
|
|
|
|
|
- //if ParentId != "" {
|
|
|
|
|
- // ids = svc.GetAllChildById("100000180")
|
|
|
|
|
- //} else {
|
|
|
|
|
- // has := svc.UserInRoleById(this.User.Id, "10000203")
|
|
|
|
|
- // if has {
|
|
|
|
|
- // ids = svc.GetAllChildById("100000054")
|
|
|
|
|
- // } else {
|
|
|
|
|
- // ids = svc.GetAllChildById(companyids[len(companyids)-1])
|
|
|
|
|
- // }
|
|
|
|
|
- //}
|
|
|
|
|
|
|
+
|
|
|
where := " Id in ( " + ids + " ) "
|
|
where := " Id in ( " + ids + " ) "
|
|
|
|
|
|
|
|
list := make([]organize.Base_Organize, 0)
|
|
list := make([]organize.Base_Organize, 0)
|