Explorar el Código

三级单位检测地点

yuedefeng hace 6 años
padre
commit
2983cc37f4

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

@@ -327,6 +327,8 @@ func (this *BaseController) Prepare() {
 		this.User.Roles = utils.ToStr(usermodel.Roleid)
 		this.User.UnitId = usermodel.UnitId
 		this.User.Uint = usermodel.Unit
+		this.User.UintThirdId = usermodel.UnitThirdId
+		this.User.UintThird = usermodel.UnitThird
 		beego.Debug("User:", this.User)
 	}
 

+ 8 - 0
src/dashoo.cn/backend/api/controllers/lims/Limscustomerposition.go

@@ -109,6 +109,10 @@ func (this *LimsCustomerpositionController) GetEntityList() {
 	if ModifiedBy != "" {
 		where = where + " and ModifiedBy like '%" + ModifiedBy + "%'"
 	}
+	
+	if this.User.UintThirdId > 0 {
+		where = where + " and ThrUnitId = '" + strconv.Itoa(this.User.UintThirdId) + "'"
+	}
 
 	if CreateOn != "" {
 		dates := strings.Split(CreateOn, ",")
@@ -145,6 +149,10 @@ func (this *LimsCustomerpositionController) CustomerpositionTree() {
 		where = where + " and CustomerId = '" + CustomerId + "'"
 	}
 
+	if this.User.UintThirdId > 0 {
+		where = where + " and ThrUnitId = '" + strconv.Itoa(this.User.UintThirdId) + "'"
+	}
+
 	svc.GetEntitysByOrderbyWhere(this.User.AccCode+LimsCustomerpositionName, where, "SortCode, Id asc", &list)
 	var datainfo DataInfo
 	datainfo.Items = list

+ 2 - 0
src/dashoo.cn/backend/api/models/token.go

@@ -47,6 +47,8 @@ type UserInfo struct {
 	Superior      string
 	Uint          string
 	UnitId        int
+	UintThird     string
+	UintThirdId   int
 }
 
 // 建立JWT Token