|
|
@@ -375,23 +375,25 @@ func (this *OrganizesController) OrganizeParentList() {
|
|
|
// @Success 200 {object} business.device.DeviceChannels
|
|
|
// @router /listbydeptid [get]
|
|
|
func (this *OrganizesController) ListByDeptId() {
|
|
|
- ParentId := this.GetString("ParentId")
|
|
|
- var user userRole.Base_User
|
|
|
+ //ParentId := this.GetString("ParentId")
|
|
|
+ //var user userRole.Base_User
|
|
|
svc := organize.GetOrganizeService(utils.DBE)
|
|
|
- svc.GetEntityById(this.User.Id, &user)
|
|
|
- companyids := strings.Split(user.Superior, ",")
|
|
|
-
|
|
|
- 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])
|
|
|
- }
|
|
|
- }
|
|
|
+ unitId := svc.GetMyUnitDepartmentId(this.User.DepartmentId)
|
|
|
+
|
|
|
+ //svc.GetEntityById(this.User.Id, &user)
|
|
|
+ //companyids := strings.Split(user.Superior, ",")
|
|
|
+ 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 + " ) and AccCode='" + this.User.AccCode + "'"
|
|
|
|
|
|
list := make([]organize.Base_Organize, 0)
|