|
|
@@ -3,13 +3,16 @@ package samplesinfo
|
|
|
import (
|
|
|
"encoding/json"
|
|
|
"fmt"
|
|
|
+ "strconv"
|
|
|
"strings"
|
|
|
"time"
|
|
|
|
|
|
"dashoo.cn/backend/api/business/approveinfo"
|
|
|
"dashoo.cn/backend/api/business/samplesubpackage"
|
|
|
. "dashoo.cn/backend/api/controllers"
|
|
|
+ "dashoo.cn/business2/organize"
|
|
|
"dashoo.cn/business2/permission"
|
|
|
+ "dashoo.cn/business2/userRole"
|
|
|
"github.com/astaxie/beego"
|
|
|
|
|
|
// "dashoo.cn/backend/api/business/currboxcapacity"
|
|
|
@@ -68,11 +71,32 @@ func (this *SamplesinputController) List() {
|
|
|
//设备权限
|
|
|
svcPermission := permission.GetPermissionService(utils.DBE)
|
|
|
eids := svcPermission.GetEquipmentIdById(utils.ToStr(this.User.Id))
|
|
|
+
|
|
|
+ userSvc := userRole.GetUserService(utils.DBE)
|
|
|
+ organizeSvc := organize.GetOrganizeService(utils.DBE)
|
|
|
+ departList := organizeSvc.GetChildByTopId(this.User.DepartmentId)
|
|
|
+ //取出当前部门及下级部门的所有用户列表
|
|
|
+ var subUserList []userRole.Base_User
|
|
|
+ whereUser := " 1=1 "
|
|
|
+ whereUser += " and DepartmentId in (" + departList + ")"
|
|
|
+ userSvc.GetEntities(&subUserList, whereUser)
|
|
|
+ var userIds string
|
|
|
+
|
|
|
+ for _, tmpUser := range subUserList {
|
|
|
+ userIds += strconv.Itoa(tmpUser.Id) + ","
|
|
|
+ }
|
|
|
+ userIds = strings.Trim(userIds, ",")
|
|
|
+
|
|
|
if eids != "" {
|
|
|
- where = where + " and (f.CreateUserId= " + utils.ToStr(this.User.Id) + " or a.EquipmentId in (" + eids + "))"
|
|
|
+ where = where + " and (f.CreateUserId in (" + userIds + ")" + " or a.EquipmentId in (" + eids + "))"
|
|
|
} else {
|
|
|
- where = where + "and f.CreateUserId= " + utils.ToStr(this.User.Id)
|
|
|
+ where = where + "and f.CreateUserId in (" + userIds + ")"
|
|
|
}
|
|
|
+ // if eids != "" {
|
|
|
+ // where = where + " and (f.CreateUserId= " + utils.ToStr(this.User.Id) + " or a.EquipmentId in (" + eids + "))"
|
|
|
+ // } else {
|
|
|
+ // where = where + "and f.CreateUserId= " + utils.ToStr(this.User.Id)
|
|
|
+ // }
|
|
|
|
|
|
sampleCode := this.GetString("SampleCode")
|
|
|
if sampleCode != "" {
|