|
@@ -154,40 +154,40 @@ func (this *OilContractReviewController) GetEntityList() {
|
|
|
where = where + " and r.CreateOn>='" + Year + "-01-01 00:00:00' and r.CreateOn<='" + Year + "-12-31 23:59:59' "
|
|
where = where + " and r.CreateOn>='" + Year + "-01-01 00:00:00' and r.CreateOn<='" + Year + "-12-31 23:59:59' "
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- //超级管理员和有查看所有数据权限的用户不加条件
|
|
|
|
|
- svcPerm := permission.GetPermissionService(utils.DBE)
|
|
|
|
|
- isauth := svcPerm.IsAuthorized(this.User.Id, "oil_contract.Review.AllRecord")
|
|
|
|
|
- if !isauth {
|
|
|
|
|
- // 是否查看本部门的
|
|
|
|
|
- if IsAll == "" {
|
|
|
|
|
- //根据工作流查找
|
|
|
|
|
- //集中评审相关人可看数据
|
|
|
|
|
- actisvc := workflow.GetActivitiService(utils.DBE)
|
|
|
|
|
- //找出待办任务===准入
|
|
|
|
|
- var certIdList string
|
|
|
|
|
- ids := actisvc.GetMyTasks(workflow.OIL_DAILY_CONTRACT_EVALUATION, this.User.Id)
|
|
|
|
|
- ids1 := actisvc.GetMyTasks(workflow.OIL_DAILY_CONTRACT_EVA_BY_BUSINESS, this.User.Id)
|
|
|
|
|
- ids += "," + ids1
|
|
|
|
|
- if len(strings.Trim(ids, ",")) > 0 {
|
|
|
|
|
- certIdList += strings.Trim(ids, ",") + ","
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // 是否查看本部门的
|
|
|
|
|
+ if IsAll == "" {
|
|
|
|
|
+ //根据工作流查找
|
|
|
|
|
+ //集中评审相关人可看数据
|
|
|
|
|
+ actisvc := workflow.GetActivitiService(utils.DBE)
|
|
|
|
|
+ //找出待办任务===准入
|
|
|
|
|
+ var certIdList string
|
|
|
|
|
+ ids := actisvc.GetMyTasks(workflow.OIL_DAILY_CONTRACT_EVALUATION, this.User.Id)
|
|
|
|
|
+ ids1 := actisvc.GetMyTasks(workflow.OIL_DAILY_CONTRACT_EVA_BY_BUSINESS, this.User.Id)
|
|
|
|
|
+ ids += "," + ids1
|
|
|
|
|
+ if len(strings.Trim(ids, ",")) > 0 {
|
|
|
|
|
+ certIdList += strings.Trim(ids, ",") + ","
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- certIdList = strings.Trim(certIdList, ",")
|
|
|
|
|
- certIdarr := strings.Split(certIdList, ",")
|
|
|
|
|
- for i, item := range certIdarr {
|
|
|
|
|
- idx := strings.Index(item, "-")
|
|
|
|
|
- if idx >= 0 {
|
|
|
|
|
- certIdarr[i] = strings.Split(item, "-")[0]
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ certIdList = strings.Trim(certIdList, ",")
|
|
|
|
|
+ certIdarr := strings.Split(certIdList, ",")
|
|
|
|
|
+ for i, item := range certIdarr {
|
|
|
|
|
+ idx := strings.Index(item, "-")
|
|
|
|
|
+ if idx >= 0 {
|
|
|
|
|
+ certIdarr[i] = strings.Split(item, "-")[0]
|
|
|
}
|
|
}
|
|
|
- certIdList = strings.Join(certIdarr, ",")
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ certIdList = strings.Join(certIdarr, ",")
|
|
|
|
|
|
|
|
- if certIdList != "" {
|
|
|
|
|
- where += " and ( r.Id in (" + certIdList + ")" + " or r.CreateUserId = '" + this.User.Id + "')"
|
|
|
|
|
- } else {
|
|
|
|
|
- where = where + " and r.CreateUserId = '" + this.User.Id + "'"
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if certIdList != "" {
|
|
|
|
|
+ where += " and ( r.Id in (" + certIdList + ")" + " or r.CreateUserId = '" + this.User.Id + "')"
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ where = where + " and r.CreateUserId = '" + this.User.Id + "'"
|
|
|
|
|
+ }
|
|
|
|
|
+ } else {
|
|
|
|
|
+ //超级管理员和有查看所有数据权限的用户不加条件
|
|
|
|
|
+ svcPerm := permission.GetPermissionService(utils.DBE)
|
|
|
|
|
+ isauth := svcPerm.IsAuthorized(this.User.Id, "oil_contract.Review.AllRecord")
|
|
|
|
|
+ if !isauth {
|
|
|
// 权限过滤 自己创建的评价 ,同二级部门创建的评价 ,企管法规处能看
|
|
// 权限过滤 自己创建的评价 ,同二级部门创建的评价 ,企管法规处能看
|
|
|
where = where + " and ( r.CreateUserId = '" + this.User.Id + "' "
|
|
where = where + " and ( r.CreateUserId = '" + this.User.Id + "' "
|
|
|
where = where + " or r.UnitId = '" + strconv.Itoa(this.User.UnitId) + "' "
|
|
where = where + " or r.UnitId = '" + strconv.Itoa(this.User.UnitId) + "' "
|