正在显示
1 个修改的文件
包含
19 行增加
和
16 行删除
@@ -24,25 +24,28 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin | @@ -24,25 +24,28 @@ func (noticeSettingService *NoticeSettingService) NoticeSettingList(noticeSettin | ||
24 | creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( | 24 | creationUserGateway := allied_creation_user.NewHttplibAlliedCreationUser( |
25 | noticeSettingListQuery.Operator, | 25 | noticeSettingListQuery.Operator, |
26 | ) | 26 | ) |
27 | - orgResult, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{ | ||
28 | - Offset: 1, | ||
29 | - Limit: 20, | ||
30 | - CompanyId: int(noticeSettingListQuery.Operator.CompanyId), | ||
31 | - IsOrg: 1, | ||
32 | - DepName: noticeSettingListQuery.OrgName, | ||
33 | - }) | ||
34 | - if err != nil { | 27 | + var orgIds []int |
28 | + if len(noticeSettingListQuery.OrgName) > 0 { | ||
29 | + orgResult, err := creationUserGateway.OrgSearch(allied_creation_user.ReqOrgSearch{ | ||
30 | + Offset: 1, | ||
31 | + Limit: 20, | ||
32 | + CompanyId: int(noticeSettingListQuery.Operator.CompanyId), | ||
33 | + IsOrg: 1, | ||
34 | + DepName: noticeSettingListQuery.OrgName, | ||
35 | + }) | ||
35 | if err != nil { | 36 | if err != nil { |
36 | - return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | 37 | + if err != nil { |
38 | + return 0, nil, application.ThrowError(application.BUSINESS_ERROR, err.Error()) | ||
39 | + } | ||
40 | + } | ||
41 | + if len(orgResult.Orgs) == 0 { | ||
42 | + return 0, []dto.NoticeSettingItem{}, nil | ||
43 | + } | ||
44 | + for _, v := range orgResult.Orgs { | ||
45 | + orgIds = append(orgIds, v.OrgID) | ||
37 | } | 46 | } |
38 | } | 47 | } |
39 | - if len(orgResult.Orgs) == 0 { | ||
40 | - return 0, []dto.NoticeSettingItem{}, nil | ||
41 | - } | ||
42 | - var orgIds []int | ||
43 | - for _, v := range orgResult.Orgs { | ||
44 | - orgIds = append(orgIds, v.OrgID) | ||
45 | - } | 48 | + |
46 | result, err := creationBasicGateway.NoticeSettingSearch(allied_creation_basic.ReqNoticeSettingSearch{ | 49 | result, err := creationBasicGateway.NoticeSettingSearch(allied_creation_basic.ReqNoticeSettingSearch{ |
47 | PageIndex: noticeSettingListQuery.PageNumber, | 50 | PageIndex: noticeSettingListQuery.PageNumber, |
48 | PageSize: noticeSettingListQuery.PageSize, | 51 | PageSize: noticeSettingListQuery.PageSize, |
-
请 注册 或 登录 后发表评论