Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
红
红星美凯龙管理在线APP IOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
红星美凯龙管理在线APP IOS
Commits
f8c90bc0
Commit
f8c90bc0
authored
Dec 11, 2015
by
admin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
问题与知识的筛选接口完成
parent
26922a4d
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
135 additions
and
62 deletions
+135
-62
UserInterfaceState.xcuserstate
...userdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
Constant.h
redstar/Classes/Macro/Constant.h
+2
-0
Url.h
redstar/Classes/Macro/Url.h
+4
-0
MoreScreenView.m
...dule/Function/Question/QuestionList/View/MoreScreenView.m
+0
-1
CategoryTableView.h
...n/Question/QuestionList/View/SubViews/CategoryTableView.h
+2
-2
CategoryTableView.m
...n/Question/QuestionList/View/SubViews/CategoryTableView.m
+42
-14
GroupTableView.h
...tion/Question/QuestionList/View/SubViews/GroupTableView.h
+1
-1
GroupTableView.m
...tion/Question/QuestionList/View/SubViews/GroupTableView.m
+15
-5
QuestionViewController.m
...tion/QuestionList/ViewController/QuestionViewController.m
+40
-35
InspectListViewController.m
...ct/InspectList/ViewController/InspectListViewController.m
+3
-4
HttpClient.h
redstar/Classes/Tools/HttpClient/HttpClient.h
+5
-0
HttpClient.m
redstar/Classes/Tools/HttpClient/HttpClient.m
+21
-0
No files found.
redstar.xcworkspace/xcuserdata/admin.xcuserdatad/UserInterfaceState.xcuserstate
View file @
f8c90bc0
No preview for this file type
redstar/Classes/Macro/Constant.h
View file @
f8c90bc0
...
...
@@ -140,6 +140,8 @@
#define kRefreshInspectPointNotification @"refreshInspectPoint"
#define kRefreshQuestionNotification @"refershQuestionList"
#define kQuestionGroupNotification @"questionGroup"
#define kTAxisBtnTag 500232
...
...
redstar/Classes/Macro/Url.h
View file @
f8c90bc0
...
...
@@ -74,5 +74,9 @@
// 抽查评分
#define kGradeCheckResultURL @"redstar-server/rest/spotcheck/grade?time="
// 获取问题专业组
#define kQuestionGroupURL @"redstar-server/rest/question/queryGroup"
// 获取问题分类
#define kQuestionCategoryURL @"redstar-server/rest/question/queryCategory?groupUuid="
#endif
/* Url_h */
redstar/Classes/Module/Function/Question/QuestionList/View/MoreScreenView.m
View file @
f8c90bc0
...
...
@@ -51,7 +51,6 @@
GroupItems
*
scopeItem
=
[[
GroupItems
alloc
]
initWithTitle
:
@"问题范围"
view
:
_scopeTableView
];
self
.
groupTableView
=
[[
GroupTableView
alloc
]
init
];
_groupTableView
.
groupDeleagte
=
self
.
categoryTableView
;
GroupItems
*
groupItem
=
[[
GroupItems
alloc
]
initWithTitle
:
@"问题分组"
view
:
_groupTableView
];
self
.
categoryTableView
=
[[
CategoryTableView
alloc
]
init
];
...
...
redstar/Classes/Module/Function/Question/QuestionList/View/SubViews/CategoryTableView.h
View file @
f8c90bc0
...
...
@@ -11,11 +11,11 @@
@protocol
CategoryTableViewDelegate
<
NSObject
>
-
(
void
)
categoryTableViewClick
:
(
NS
Integer
)
row
;
-
(
void
)
categoryTableViewClick
:
(
NS
String
*
)
categoryName
GroupTitle
:
(
NSString
*
)
groupTitle
;
@end
@interface
CategoryTableView
:
UITableView
<
GroupTableViewDelegate
>
@interface
CategoryTableView
:
UITableView
@property
(
nonatomic
,
assign
)
id
<
CategoryTableViewDelegate
>
categroyDeleagte
;
@end
redstar/Classes/Module/Function/Question/QuestionList/View/SubViews/CategoryTableView.m
View file @
f8c90bc0
...
...
@@ -7,8 +7,12 @@
//
#import "CategoryTableView.h"
#import "HttpClient.h"
@interface
CategoryTableView
()
<
UITableViewDelegate
,
UITableViewDataSource
>
@property
(
nonatomic
,
strong
)
NSMutableArray
*
titleArray
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
categoryArray
;
@end
@implementation
CategoryTableView
...
...
@@ -35,27 +39,49 @@
{
self
.
delegate
=
self
;
self
.
dataSource
=
self
;
self
.
titleArray
=
[
NSMutableArray
arrayWithObjects
:
@"基础环境"
,
@"人员"
,
@"停车场"
,
@"卫生间"
,
@"物料标识"
,
nil
];
self
.
titleArray
=
[
NSMutableArray
array
];
self
.
categoryArray
=
[
NSMutableArray
array
];
NSInteger
selectedIndex
=
0
;
NSIndexPath
*
selectedIndexPath
=
[
NSIndexPath
indexPathForRow
:
selectedIndex
inSection
:
0
];
[
self
selectRowAtIndexPath
:
selectedIndexPath
animated
:
NO
scrollPosition
:
UITableViewScrollPositionNone
];
//注册通知
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
reloadCurrentTableView
:
)
name
:
kQuestionGroupNotification
object
:
nil
];
}
//- (void)groupTableViewClick:(NSInteger)row
//{
// if (row == 0) {
// [self reloadData];
// } else {
// self.titleArray = [NSMutableArray arrayWithObjects:@"211",@"322", nil];
// [self reloadData];
//
// }
//}
-
(
void
)
reloadCurrentTableView
:
(
NSNotification
*
)
notification
{
NSString
*
url
=
[
NSString
stringWithFormat
:
@"%@%@%@"
,
kRedStarURL
,
kQuestionCategoryURL
,
notification
.
userInfo
[
@"groupName"
]];
HttpClient
*
http
=
[[
HttpClient
alloc
]
initWithUrl
:
url
];
[
http
getQuestionCategoryWithCompletion
:
^
(
id
response
,
NSError
*
error
)
{
NSLog
(
@"分类categaory response= %@"
,
response
);
if
(
response
[
@"success"
])
{
NSDictionary
*
dictData
=
response
[
@"data"
];
NSArray
*
array
=
dictData
[
@"records"
];
NSMutableArray
*
groupArray
=
[
NSMutableArray
array
];
NSMutableArray
*
categoryArray
=
[
NSMutableArray
array
];
for
(
NSDictionary
*
dict
in
array
)
{
NSString
*
category
=
[
NSString
stringWithFormat
:
@"%@"
,
dict
[
@"name"
]];
NSString
*
group
=
[
NSString
stringWithFormat
:
@"%@"
,
dict
[
@"groupName"
]];
[
categoryArray
addObject
:
category
];
[
groupArray
addObject
:
group
];
}
_titleArray
=
categoryArray
;
_categoryArray
=
categoryArray
;
[
self
reloadData
];
}
}];
}
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
name
:
kQuestionGroupNotification
object
:
nil
];
}
#pragma mark - TableView Delegate/DataSource
#pragma mark - TableView Delegate/DataSource
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
_titleArray
.
count
;
...
...
@@ -78,8 +104,10 @@
// cell点击事件
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
_categroyDeleagte
)
{
[
_categroyDeleagte
categoryTableViewClick
:
indexPath
.
row
];
NSString
*
cateName
=
_categoryArray
[
indexPath
.
row
];
NSString
*
group
=
_titleArray
[
indexPath
.
row
];
if
(
_categroyDeleagte
&&
[
_categroyDeleagte
respondsToSelector
:
@selector
(
categoryTableViewClick
:
GroupTitle
:
)])
{
[
_categroyDeleagte
categoryTableViewClick
:
cateName
GroupTitle
:
group
];
}
}
...
...
redstar/Classes/Module/Function/Question/QuestionList/View/SubViews/GroupTableView.h
View file @
f8c90bc0
...
...
@@ -9,7 +9,7 @@
#import <UIKit/UIKit.h>
@protocol
GroupTableViewDelegate
<
NSObject
>
-
(
void
)
groupTableViewClick
:
(
NS
Integer
)
row
;
-
(
void
)
groupTableViewClick
:
(
NS
String
*
)
groupName
;
@end
@interface
GroupTableView
:
UITableView
...
...
redstar/Classes/Module/Function/Question/QuestionList/View/SubViews/GroupTableView.m
View file @
f8c90bc0
...
...
@@ -7,6 +7,8 @@
//
#import "GroupTableView.h"
#import "HttpClient.h"
@interface
GroupTableView
()
<
UITableViewDelegate
,
UITableViewDataSource
>
@property
(
nonatomic
,
strong
)
NSMutableArray
*
titleArray
;
@end
...
...
@@ -33,16 +35,20 @@
-
(
void
)
setup
{
self
.
titleArray
=
[
NSMutableArray
arrayWithObjects
:
@"全部"
,
@"服务"
,
@"环境企划"
,
@"环境物业"
,
nil
];
self
.
delegate
=
self
;
self
.
dataSource
=
self
;
NSInteger
selectedIndex
=
0
;
NSIndexPath
*
selectedIndexPath
=
[
NSIndexPath
indexPathForRow
:
selectedIndex
inSection
:
0
];
[
self
selectRowAtIndexPath
:
selectedIndexPath
animated
:
NO
scrollPosition
:
UITableViewScrollPositionNone
];
NSMutableArray
*
array
=
[[
NSUserDefaults
standardUserDefaults
]
objectForKey
:
@"groupTitle"
];
self
.
titleArray
=
[
NSMutableArray
arrayWithArray
:
array
];
self
.
delegate
=
self
;
self
.
dataSource
=
self
;
}
#pragma mark - TableView Delegate/DataSource
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
...
...
@@ -67,8 +73,12 @@
// cell点击事件
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
(
_groupDeleagte
)
{
[
_groupDeleagte
groupTableViewClick
:
indexPath
.
row
];
NSString
*
title
=
[
NSString
stringWithFormat
:
@"%@"
,
_titleArray
[
indexPath
.
row
]];
NSDictionary
*
dict
=
[[
NSDictionary
alloc
]
initWithObjectsAndKeys
:
title
,
@"groupName"
,
nil
];
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
kQuestionGroupNotification
object
:
self
userInfo
:
dict
];
if
(
_groupDeleagte
&&
[
_groupDeleagte
respondsToSelector
:
@selector
(
groupTableViewClick
:)])
{
[
_groupDeleagte
groupTableViewClick
:
title
];
}
}
...
...
redstar/Classes/Module/Function/Question/QuestionList/ViewController/QuestionViewController.m
View file @
f8c90bc0
...
...
@@ -46,8 +46,11 @@
@property
(
nonatomic
,
assign
)
NSInteger
page
;
@property
(
nonatomic
,
assign
)
NSInteger
scopeRow
;
@property
(
nonatomic
,
assign
)
NSInteger
groupRow
;
@property
(
nonatomic
,
assign
)
NSInteger
categoryRow
;
// 分组
@property
(
nonatomic
,
copy
)
NSString
*
groupName
;
// 分类
@property
(
nonatomic
,
copy
)
NSString
*
groupTitle
;
@property
(
nonatomic
,
copy
)
NSString
*
categoryName
;
@property
(
nonatomic
,
assign
)
NSInteger
stateRow
;
@property
(
nonatomic
,
assign
)
NSInteger
timeRow
;
...
...
@@ -71,7 +74,6 @@
[
self
setupNav
];
// [self requestQuestionList];
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
requestQuestionList
)
...
...
@@ -79,6 +81,8 @@
object
:
nil
];
_page
=
0
;
//[self requestGroupTitle];
}
-
(
void
)
dealloc
...
...
@@ -97,14 +101,29 @@
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
}
#pragma mark - Private Methods
//- (void)requestGroupTitle
//{
// NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQuestionGroupURL];
// HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
// // 请求问题列表
// [httpClient getQuestionGroupWithCompletion:^(id response, NSError *error) {
// NSLog(@"请求问题专业分组 res = %@", response);
// NSLog(@"请求问题专业分组 error = %@", error);
// if (response[@"success"]) {
// NSDictionary *dataDict = response[@"data"];
// NSArray *array = dataDict[@"records"];
// NSMutableArray *titleArray = [NSMutableArray array];
// for (NSDictionary *dict in array) {
// NSString *name = dict[@"name"];
// [titleArray addObject:name];
// }
// NSLog(@"titleArray 2222= %@", titleArray);
// [[NSUserDefaults standardUserDefaults] setObject:titleArray forKey:@"groupTitle"];
// }
//
// }];
//}
-
(
void
)
requestQuestionList
{
...
...
@@ -363,8 +382,8 @@
if
(
!
_screenView
)
{
_screenView
=
[[
MoreScreenView
alloc
]
init
];
_screenView
.
backgroundColor
=
[
UIColor
whiteColor
];
_screenView
.
scopeTableView
.
scopeDeleagte
=
self
;
_screenView
.
groupTableView
.
groupDeleagte
=
self
;
_screenView
.
scopeTableView
.
scopeDeleagte
=
self
;
_screenView
.
categoryTableView
.
categroyDeleagte
=
self
;
_screenView
.
stateTableView
.
stateDeleagte
=
self
;
_screenView
.
timeTableView
.
timeDeleagte
=
self
;
...
...
@@ -455,30 +474,15 @@
@"direction"
:
@"asc"
}];
[
parameters
setObject
:
array
forKey
:
@"queryOrders"
];
}
else
if
(
_screenView
.
groupTabBar
.
selectNumber
==
1
)
{
if
(
_groupRow
==
0
)
{
}
else
if
(
_groupRow
==
1
)
{
[
parameters
setObject
:
@"服务"
forKey
:
@"group"
];
}
else
if
(
_groupRow
==
2
)
{
[
parameters
setObject
:
@"环境企划"
forKey
:
@"group"
];
}
else
{
[
parameters
setObject
:
@"环境物业"
forKey
:
@"group"
];
}
// 分组
[
parameters
setObject
:
_groupName
forKey
:
@"group"
];
NSArray
*
array
=
@[@{
@"field"
:
@"group"
,
@"direction"
:
@"asc"
}];
[
parameters
setObject
:
array
forKey
:
@"queryOrders"
];
}
else
if
(
_screenView
.
groupTabBar
.
selectNumber
==
2
)
{
if
(
_categoryRow
==
0
)
{
[
parameters
setObject
:
@"基础环境"
forKey
:
@"category"
];
}
else
if
(
_categoryRow
==
1
)
{
[
parameters
setObject
:
@"人员"
forKey
:
@"category"
];
}
else
if
(
_categoryRow
==
2
)
{
[
parameters
setObject
:
@"停车场"
forKey
:
@"category"
];
}
else
if
(
_categoryRow
==
3
)
{
[
parameters
setObject
:
@"卫生间"
forKey
:
@"category"
];
}
else
{
[
parameters
setObject
:
@"物料标识"
forKey
:
@"category"
];
}
[
parameters
setObject
:
_groupTitle
forKey
:
@"group"
];
[
parameters
setObject
:
_categoryName
forKey
:
@"category"
];
NSArray
*
array
=
@[@{
@"field"
:
@"category"
,
@"direction"
:
@"asc"
}];
[
parameters
setObject
:
array
forKey
:
@"queryOrders"
];
...
...
@@ -607,14 +611,15 @@
_scopeRow
=
row
;
}
-
(
void
)
groupTableViewClick
:
(
NS
Integer
)
row
-
(
void
)
groupTableViewClick
:
(
NS
String
*
)
groupName
{
_group
Row
=
row
;
_group
Name
=
groupName
;
}
-
(
void
)
categoryTableViewClick
:
(
NS
Integer
)
row
-
(
void
)
categoryTableViewClick
:
(
NS
String
*
)
categoryName
GroupTitle
:
(
NSString
*
)
groupTitle
{
_categoryRow
=
row
;
_categoryName
=
categoryName
;
_groupTitle
=
groupTitle
;
}
-
(
void
)
stateTableViewClick
:
(
NSInteger
)
row
...
...
redstar/Classes/Module/Function/WordOfMouth/Inspect/InspectList/ViewController/InspectListViewController.m
View file @
f8c90bc0
...
...
@@ -484,15 +484,15 @@
[
parameters
setObject
:
weekStr
forKey
:
@"beginDateFrom"
];
[
parameters
setObject
:
todayStr
forKey
:
@"endDateTo"
];
NSLog
(
@"onwek = %@"
,
parameters
);
}
else
if
(
_timeSelectNum
==
1
)
{
NSDate
*
oneMonth
=
[
self
getPriousorLaterDateFromDate
:
today
withMonth
:
-
1
];
NSString
*
oneMonthStr
=
[
dateFormatter
stringFromDate
:
oneMonth
];
NSLog
(
@"oneMonth = %@"
,
oneMonthStr
);
[
parameters
setObject
:
oneMonthStr
forKey
:
@"beginDateFrom"
];
[
parameters
setObject
:
todayStr
forKey
:
@"endDateTo"
];
NSLog
(
@"oneMonth = %@"
,
parameters
);
}
else
if
(
_timeSelectNum
==
2
)
{
NSDate
*
threeMonth
=
[
self
getPriousorLaterDateFromDate
:
today
withMonth
:
-
3
];
NSString
*
threeMonthStr
=
[
dateFormatter
stringFromDate
:
threeMonth
];
...
...
@@ -514,11 +514,10 @@
NSArray
*
array
=
@[@{
@"field"
:
@"lastModifyInfo"
,
@"direction"
:
@"asc"
}];
[
parameters
setObject
:
array
forKey
:
@"queryOrders"
];
NSLog
(
@"parameters = %@"
,
parameters
);
}
NSLog
(
@"parameters = %@"
,
parameters
);
...
...
redstar/Classes/Tools/HttpClient/HttpClient.h
View file @
f8c90bc0
...
...
@@ -83,4 +83,9 @@ typedef void (^completionBlock) (id response, NSError *error);
// 抽查评分
-
(
void
)
gradeCheckResultWithParameters
:(
id
)
parameters
completion
:(
completionBlock
)
completion
;
// 获取问题专业组
-
(
void
)
getQuestionGroupWithCompletion
:(
completionBlock
)
completion
;
// 获取问题专业组
-
(
void
)
getQuestionCategoryWithCompletion
:(
completionBlock
)
completion
;
@end
redstar/Classes/Tools/HttpClient/HttpClient.m
View file @
f8c90bc0
...
...
@@ -302,4 +302,25 @@
}];
}
// 获取问题专业组
-
(
void
)
getQuestionGroupWithCompletion
:
(
completionBlock
)
completion
{
[
self
getParameters
:
nil
completion
:
^
(
id
response
,
NSError
*
error
)
{
if
(
completion
)
{
completion
(
response
,
error
);
}
}];
}
// 获取问题专业组
-
(
void
)
getQuestionCategoryWithCompletion
:
(
completionBlock
)
completion
{
[
self
getParameters
:
nil
completion
:
^
(
id
response
,
NSError
*
error
)
{
if
(
completion
)
{
completion
(
response
,
error
);
}
}];
}
@end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment