Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
万
万科
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
张杰
万科
Commits
9501a5a6
Commit
9501a5a6
authored
9 years ago
by
Achilles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VK-5 客流饼状图页面出现重复多个图
parent
a0ac7d24
master
HEAD
dev
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
362 additions
and
1013 deletions
+362
-1013
ICRHTTPController.h
vanke/3rd/HTTPController/ICRHTTPController.h
+4
-90
ICRHTTPController.m
vanke/3rd/HTTPController/ICRHTTPController.m
+324
-912
VankeAffairsBoard_iPhone.m
.../view_iPhone/templates/affairs/VankeAffairsBoard_iPhone.m
+2
-2
ICRAnnouncementViewController.m
...ne/templates/announcement/ICRAnnouncementViewController.m
+21
-7
VankeBusinessChartCell_iPhone.m
...ne/templates/floor-detail/VankeBusinessChartCell_iPhone.m
+11
-2
No files found.
vanke/3rd/HTTPController/ICRHTTPController.h
View file @
9501a5a6
...
...
@@ -25,13 +25,7 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
// Restful API
// User
/* 用户登录验证(读)*/
-
(
void
)
doLoginWithUserName
:(
NSString
*
)
userName
password
:(
NSString
*
)
password
registerCode
:(
NSString
*
)
registerCode
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
/* 密码修改(写)*/
-
(
void
)
doChangePassword
:(
NSString
*
)
nsPassword
...
...
@@ -39,30 +33,11 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
// Data
/* 门店基本资料(读)
返回最后修改日期从某时刻开始的该用户可见的门店
*/
-
(
void
)
doGetStoreListFromUpdateTime
:(
NSTimeInterval
)
updateTime
position
:(
NSUInteger
)
uiPosition
size
:(
NSUInteger
)
uiSize
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
/* 组织架构基本资料(读)
获得本人所属组织
*/
-
(
void
)
doGetCurrentOrgWithSuccess
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
/* 任务类别基本资料
获得本人所属组织的工单类别信息,提任务单时需要用
*/
-
(
void
)
doGetPersonListFromUpdateTime
:(
NSString
*
)
updateTime
position
:(
NSUInteger
)
uiPosition
size
:(
NSUInteger
)
uiSize
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
// Board
/* 公告列表(读)
...
...
@@ -88,61 +63,6 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
// Patrol
/* 巡店计划列表(读)
获得发布给自己的巡店计划
*/
-
(
void
)
doGetMyPatrolFromUpdateTime
:(
NSString
*
)
updateTime
position
:(
NSUInteger
)
uiPosition
size
:(
NSUInteger
)
uiSize
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
/* 下载某个门店结果(读)*/
-
(
void
)
doGetStoreResultWithPlanID
:(
NSString
*
)
planID
storeID
:(
NSString
*
)
storeID
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
/* 巡店计划处理结果(写)*/
-
(
void
)
doAnswerPatrolPlanWithID
:(
NSNumber
*
)
planID
infoData
:(
id
)
data
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
/* 巡店计划某个问题处理结果
需要先调用接口|doAnswerPlanWithID:postData:success:failure:|,得到门店报告id
*/
-
(
void
)
doAnswerOnePatrolResultWithID
:(
NSNumber
*
)
resultID
infoData
:(
id
)
data
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
/* 任务列表(读)*/
-
(
void
)
doGetTaskListFromUpdateTime
:(
NSString
*
)
updateTime
position
:(
NSUInteger
)
uiPosition
size
:(
NSUInteger
)
uiSize
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
/* 新增任务(写)*/
-
(
void
)
doCreateNewTaskWithInfo
:(
id
)
data
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
/* 任务处理结果(写)*/
-
(
void
)
doUpdateTaskResultID
:(
NSString
*
)
resultID
resultText
:(
NSString
*
)
resultStr
processDate
:(
NSTimeInterval
)
processDate
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
// Signup
/* 签到信息提交(写)*/
-
(
void
)
doSignupWithInfo
:(
id
)
data
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
// Attachment
/* 添加附件(读)*/
-
(
void
)
doAddAttachment
:(
id
)
data
...
...
@@ -172,12 +92,6 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
// Version
/* 查询版本(读)*/
-
(
void
)
doFetchVersionWithCurrent
:(
NSString
*
)
currentVersion
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
@end
...
...
This diff is collapsed.
Click to expand it.
vanke/3rd/HTTPController/ICRHTTPController.m
View file @
9501a5a6
...
...
@@ -16,6 +16,10 @@
#import "IBTModel.h"
#import "ICRAttachment.h"
#import "ICRAnnouncement.h"
#import "ICRUtilsMacro.h"
#import "IBTCommon.h"
#import "VankeCommonModel.h"
#import "ICRDataBaseController.h"
//#import "ICRStoreResult.h"
#define MAX_CONCURRENCY_UPLOAD 1
...
...
@@ -83,8 +87,8 @@ static NSString * const ICRHTTPInterface[] = {
[
kICRHTTP_BoardQuery
]
=
@"affiche/download"
,
[
kICRHTTP_ReadBoard
]
=
@"board/read"
,
// Patrol
[
kICRHTTP_PatrolQuery
]
=
@"patrol/plan/download"
,
...
...
@@ -198,36 +202,39 @@ static NSString * const ICRAttachmentTypeValue[] = {
acceptTypeJson
:
(
BOOL
)
bAcceptJson
failure
:
(
void
(
^
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
))
fail
{
// AFJSONRequestSerializer *requestSerializer = [AFJSONRequestSerializer serializer];
// ICRUserUtil *user = [ICRUserUtil sharedInstance];
// if (bIsNeedToken) {
// if ([user.token length] > 0) {
// if (!requestSerializer.HTTPRequestHeaders[ @"token" ]) {
// [requestSerializer setValue:user.token forHTTPHeaderField:@"token"];
// }
// }
// else {
// NSDictionary *userInfo = @{ NSLocalizedFailureReasonErrorKey : @"The authorization must not be nil." };
// NSError *error = [[NSError alloc] initWithDomain:ICRHTTPErrorDomain code:0 userInfo:userInfo];
// fail(nil, error);
// }
// }
//
// if (bAcceptJson) {
// if (!requestSerializer.HTTPRequestHeaders[ @"Accept" ]) {
// [requestSerializer setValue:@"application/json" forHTTPHeaderField:@"Accept"];
// }
// }
// [requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField: @"Content-Type"];
// //请求头添加enterprise参数
// if(user.orgId != NULL)
// {
// [requestSerializer setValue:user.orgId forHTTPHeaderField:@"enterprise"];
// }
//// [requestSerializer setValue:user.authorization forHTTPHeaderField:@"Authorization"];
//
// return requestSerializer;
return
nil
;
AFJSONRequestSerializer
*
requestSerializer
=
[
AFJSONRequestSerializer
serializer
];
// User *model = [[VankeCommonModel sharedInstance] currentUser];
// ICRUserUtil *user = [ICRUserUtil sharedInstance];
// if (bIsNeedToken) {
// if ([model.token length] > 0) {
// if (!requestSerializer.HTTPRequestHeaders[ @"token" ]) {
// [requestSerializer setValue:user.token forHTTPHeaderField:@"token"];
// }
// }
// else {
// NSDictionary *userInfo = @{ NSLocalizedFailureReasonErrorKey : @"The authorization must not be nil." };
// NSError *error = [[NSError alloc] initWithDomain:ICRHTTPErrorDomain code:0 userInfo:userInfo];
// fail(nil, error);
// }
// }
if
(
bAcceptJson
)
{
if
(
!
requestSerializer
.
HTTPRequestHeaders
[
@"Accept"
])
{
[
requestSerializer
setValue
:
@"application/json"
forHTTPHeaderField
:
@"Accept"
];
}
}
[
requestSerializer
setValue
:
@"application/json;charset=utf-8"
forHTTPHeaderField
:
@"Content-Type"
];
//请求头添加enterprise参数
Enterpirse
*
ent
=
[[
VankeCommonModel
sharedInstance
]
currentEnt
];
if
(
ent
.
uuid
!=
NULL
)
{
[
requestSerializer
setValue
:
ent
.
uuid
forHTTPHeaderField
:
@"enterprise"
];
}
// [requestSerializer setValue:user.authorization forHTTPHeaderField:@"Authorization"];
return
requestSerializer
;
}
-
(
void
)
GET
:
(
NSString
*
)
urlStr
...
...
@@ -252,8 +259,8 @@ acceptTypeJson:(BOOL)bAcceptJson
manager
.
requestSerializer
=
requestSerializer
;
NSLog
(
@"headers=======>>>>>>>>>%@"
,[
manager
.
requestSerializer
HTTPRequestHeaders
]);
// The request add in operation
// The request add in operation
[
manager
GET
:
urlStr
parameters
:
parameters
...
...
@@ -280,8 +287,8 @@ acceptTypeJson:(BOOL)bAcceptJson
};
AFHTTPRequestOperationManager
*
manager
=
[
AFHTTPRequestOperationManager
manager
];
manager
.
requestSerializer
=
requestSerializer
;
[
manager
POST
:
urlStr
manager
.
requestSerializer
=
requestSerializer
;
[
manager
POST
:
urlStr
parameters
:
parameters
success
:
success
failure
:
failure
];
...
...
@@ -307,7 +314,7 @@ acceptTypeJson:(BOOL)bAcceptJson
AFHTTPRequestOperationManager
*
manager
=
[
AFHTTPRequestOperationManager
manager
];
manager
.
requestSerializer
=
requestSerializer
;
// The request add in operation
[
manager
PATCH
:
urlStr
...
...
@@ -344,260 +351,50 @@ acceptTypeJson:(BOOL)bAcceptJson
failure
:
failure
];
}
#pragma mark - User
-
(
void
)
doLoginWithUserName
:
(
NSString
*
)
nsUserName
password
:
(
NSString
*
)
nsPassword
registerCode
:
(
NSString
*
)
nsRegisterCode
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// if (!nsUserName || !nsPassword || !nsRegisterCode) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@",responseObject);
//
// id dictResult = responseObject[ @"data" ];
// if (dictResult) {
//
// ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
// userUtil.userName = nsUserName;
// userUtil.password = nsPassword;
// userUtil.registerCode = nsRegisterCode;
// userUtil.displayName = dictResult[ @"user" ][@"name"];
// userUtil.userCode =dictResult[ @"user" ][@"code"];
// userUtil.userId = dictResult[ @"user" ][@"uuid"];
// userUtil.orgCode = dictResult[ @"enterprise" ][@"code"];
// userUtil.orgName = dictResult[ @"enterprise" ][@"name"];
// userUtil.orgId = dictResult[ @"enterprise" ][@"uuid"];
// [userUtil saveArchive];
// if (succ) {
// succ( dictResult );
// }
// }
// else {
// if (fail) {
// fail( nil );
// }
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@",error);
// if (fail) {
// fail( error );
// }
// };
//
// NSDictionary *dictParametes =
// @{ @"password" : nsPassword,
// @"authenticode" : nsRegisterCode,
// };
//
// NSLog(@"%@",dictParametes);
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_UserLogin] stringByAppendingFormat:@"/%@", nsUserName];
// [self POST:urlStr
// parameters:dictParametes
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
// ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
// userUtil.userName = nsUserName;
// userUtil.password = nsPassword;
// userUtil.registerCode = nsRegisterCode;
// userUtil.displayName = @"测试";
// userUtil.userCode =@"test";
// userUtil.userId = @"test";
// userUtil.orgCode = @"test";
// userUtil.orgName = @"test";
// userUtil.orgId = @"test";
// [userUtil saveArchive];
// if (succ) {
// succ( nil );
// }
}
-
(
void
)
doChangePassword
:
(
NSString
*
)
nsPassword
newPassword
:
(
NSString
*
)
nsNewPassword
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// if (!nsPassword || !nsNewPassword) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// NSLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// NSLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
////http://.../cruiser-server/rest/user/change_password/{user_uuid}?time={time}&operator.id={operatorId}&operator.operName={operatorName}&enterprise={enterprise}
//// 请求参数:
//
// NSDictionary *dictParametes =
// @{ @"oldPassword" : nsPassword,
// @"newPassword" : nsNewPassword,
// };
//
// NSString *currentTime = [[NSDate date] httpParameterString];
// ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_UserResetPassword] stringByAppendingFormat:@"/%@?time=%@&operator.id=%@&operator.operName=%@&enterprise=%@",userUtil.userId,currentTime,userUtil.userCode,userUtil.displayName,userUtil.orgId];
// NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];//对url进行utf-8编码,否则不合法
// CLog(@"%@",encodeUrlStr);
// [self POST:encodeUrlStr
// parameters:dictParametes
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
#pragma mark - Data
-
(
void
)
doGetStoreListFromUpdateTime
:
(
NSTimeInterval
)
updateTime
position
:
(
NSUInteger
)
uiPosition
size
:
(
NSUInteger
)
uiSize
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
//
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// }];
// }
// };
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
// objectClass:NSClassFromString( @"ICRStore" )
// deleteLocal:YES
// handleData:NULL
// complete:complete
// fail:fail];
// }
// else {
// if (fail) {
// fail( nil );
// }
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_StoreQuery] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", [[NSDate dateWithTimeIntervalSince1970:updateTime] httpParameterString],@(uiPosition),@(uiSize)];
// NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// [self POST:encodeUrlStr
// parameters:NULL
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
doGetCurrentOrgWithSuccess
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSString *urlStr = [[self class] UrlForPluginHTTPAction:kICRHTTP_StoreQuery];
// [self GET:urlStr
// parameters:nil
// needToken:YES
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
doGetPersonListFromUpdateTime
:
(
NSString
*
)
updateTime
position
:
(
NSUInteger
)
uiPosition
size
:
(
NSUInteger
)
uiSize
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// }];
// }
// };
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
// objectClass:NSClassFromString( @"ICRPerson" )
// deleteLocal:YES
// handleData:NULL
// complete:complete
// fail:fail];
// }
// else {
// if (fail) {
// fail( nil );
// }
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
// //http://.../cruiser-server/rest/user/download?start_date=? &page_number=?&page_size=?
//
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_PersonQuery] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@",updateTime ? : [[NSDate dateWithTimeIntervalSince1970:0] httpParameterString],@( uiPosition ),@( uiSize )];
// NSString * encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// NSLog(@"=======>>>>>>>>>>>>>>>%@",encodeUrlStr);
// [self POST:encodeUrlStr
// parameters:NULL
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
// if (!nsPassword || !nsNewPassword) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// NSLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// NSLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
////http://.../cruiser-server/rest/user/change_password/{user_uuid}?time={time}&operator.id={operatorId}&operator.operName={operatorName}&enterprise={enterprise}
//// 请求参数:
//
// NSDictionary *dictParametes =
// @{ @"oldPassword" : nsPassword,
// @"newPassword" : nsNewPassword,
// };
//
// NSString *currentTime = [[NSDate date] httpParameterString];
// ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_UserResetPassword] stringByAppendingFormat:@"/%@?time=%@&operator.id=%@&operator.operName=%@&enterprise=%@",userUtil.userId,currentTime,userUtil.userCode,userUtil.displayName,userUtil.orgId];
// NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];//对url进行utf-8编码,否则不合法
// CLog(@"%@",encodeUrlStr);
// [self POST:encodeUrlStr
// parameters:dictParametes
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
#pragma mark - Board
...
...
@@ -609,535 +406,184 @@ acceptTypeJson:(BOOL)bAcceptJson
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
//
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// C
Log(@"%@", responseObject);
//
//
if (IsDictObject(responseObject)) {
//
void (^complete)(void) = ^(void){
//
if (succ) {
//
[IBTCommon runOnMainThreadWithoutDeadlocking:^{
//
succ( responseObject );
//
}];
//
}
//
};
//
//
void(^dataHandle)(id<IBTDatabaseObject>) = ^(id<IBTDatabaseObject> model) {
//
ICRAnnouncement *ann = model;
//
ann.priority = eType;
//
};
//
//
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
//
[dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
//
objectClass:NSClassFromString( @"ICRAnnouncement" )
//
deleteLocal:bDeleteLocal
//
handleData:dataHandle
//
complete:complete
//
fail:fail];
//
}
//
else {
//
if (fail) {
//
fail( nil );
//
}
//
}
//
};
//
//
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// C
Log(@"%@", error);
//
if (fail) {
//
fail( error );
//
}
//
};
//
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_BoardQuery] stringByAppendingFormat:@"/%@?start_date=%@&page_number=%@&page_size=%@",[[ICRUserUtil sharedInstance] userId]
,updateTime ? : [[NSDate dateWithTimeIntervalSince1970:0] httpParameterString],@( uiPosition ),@( uiSize )];
//
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
//
NSLog(@"%@",encodeUrlStr);
//
[self POST:encodeUrlStr
//
parameters:nil
//
needToken:NO
//
acceptTypeJson:YES
//
success:success
//
failure:failure];
void
(
^
success
)(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
=
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
NS
Log
(
@"%@"
,
responseObject
);
if
(
IsDictObject
(
responseObject
))
{
void
(
^
complete
)(
void
)
=
^
(
void
){
if
(
succ
)
{
[
IBTCommon
runOnMainThreadWithoutDeadlocking
:
^
{
succ
(
responseObject
);
}];
}
};
void
(
^
dataHandle
)(
id
<
IBTDatabaseObject
>
)
=
^
(
id
<
IBTDatabaseObject
>
model
)
{
ICRAnnouncement
*
ann
=
model
;
ann
.
priority
=
eType
;
};
ICRDataBaseController
*
dbCtrl
=
[
ICRDataBaseController
sharedController
];
[
dbCtrl
storageEntities
:
responseObject
[
@"data"
][
@"records"
]
objectClass
:
NSClassFromString
(
@"ICRAnnouncement"
)
deleteLocal
:
bDeleteLocal
handleData
:
dataHandle
complete
:
complete
fail
:
fail
];
}
else
{
if
(
fail
)
{
fail
(
nil
);
}
}
};
void
(
^
failure
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
=
^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
NS
Log
(
@"%@"
,
error
);
if
(
fail
)
{
fail
(
error
);
}
};
NSString
*
urlStr
=
[[[
self
class
]
UrlForPluginHTTPAction
:
kICRHTTP_BoardQuery
]
stringByAppendingFormat
:
@"/%@?start_date=%@&page_number=%@&page_size=%@"
,[[
VankeCommonModel
sharedInstance
]
currentUser
].
uuid
,
updateTime
?
:
[[
NSDate
dateWithTimeIntervalSince1970
:
0
]
httpParameterString
],
@
(
uiPosition
),
@
(
uiSize
)];
NSString
*
encodeUrlStr
=
[
urlStr
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
NSLog
(
@"%@"
,
encodeUrlStr
);
[
self
POST
:
encodeUrlStr
parameters
:
nil
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
-
(
void
)
doGetBoardWithID
:
(
NSNumber
*
)
boardID
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
//
if (!boardID) {
//
if (fail) {
//
fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
//
}
//
return;
//
}
//
//
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// C
Log(@"%@", responseObject);
//
if (IsDictObject(responseObject)) {
//
void (^complete)(void) = ^(void){
//
if (succ) {
//
[IBTCommon runOnMainThreadWithoutDeadlocking:^{
//
succ( responseObject );
//
}];
//
}
//
};
//
//
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
//
[dbCtrl storageEntity:responseObject[ @"data" ]
//
objectClass:NSClassFromString( @"ICRAnnouncement" )
//
handleData:NULL
//
complete:complete
//
fail:fail];
//
//
};
//
};
//
//
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// C
Log(@"%@", error);
//
if (fail) {
//
fail( error );
//
}
//
};
//
//
// http://.../cruiser-server/rest/affiche/download/{affiche_uuid}
//// http://218.244.151.129:8280/cruiser-server/rest/affiche/download/5a7417014eb34067014eb4fea404003e
//
//
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_BoardQuery] stringByAppendingFormat:@"/%@", boardID];
//
NSLog(@"%@",urlStr);
//
[self GET:urlStr
//
parameters:nil
//
needToken:NO
//
acceptTypeJson:YES
//
success:success
//
failure:failure];
if
(
!
boardID
)
{
if
(
fail
)
{
fail
(
[[
self
class
]
ErrorWithMsg
:
ERROR_PARAMETER
code
:
0
]
);
}
return
;
}
void
(
^
success
)(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
=
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
NS
Log
(
@"%@"
,
responseObject
);
if
(
IsDictObject
(
responseObject
))
{
void
(
^
complete
)(
void
)
=
^
(
void
){
if
(
succ
)
{
[
IBTCommon
runOnMainThreadWithoutDeadlocking
:
^
{
succ
(
responseObject
);
}];
}
};
ICRDataBaseController
*
dbCtrl
=
[
ICRDataBaseController
sharedController
];
[
dbCtrl
storageEntity
:
responseObject
[
@"data"
]
objectClass
:
NSClassFromString
(
@"ICRAnnouncement"
)
handleData
:
NULL
complete
:
complete
fail
:
fail
];
};
};
void
(
^
failure
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
=
^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
NS
Log
(
@"%@"
,
error
);
if
(
fail
)
{
fail
(
error
);
}
};
// http://.../cruiser-server/rest/affiche/download/{affiche_uuid}
// http://218.244.151.129:8280/cruiser-server/rest/affiche/download/5a7417014eb34067014eb4fea404003e
NSString
*
urlStr
=
[[[
self
class
]
UrlForPluginHTTPAction
:
kICRHTTP_BoardQuery
]
stringByAppendingFormat
:
@"/%@"
,
boardID
];
NSLog
(
@"%@"
,
urlStr
);
[
self
GET
:
urlStr
parameters
:
nil
needToken
:
NO
acceptTypeJson
:
YES
success
:
success
failure
:
failure
];
}
-
(
void
)
doReadBoardWithID
:
(
NSNumber
*
)
boardID
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// if (!boardID) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSDictionary *dictParametes =
// @{ @"readTime" : [[NSDate date] httpParameterString],
// };
//
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_ReadBoard] stringByAppendingFormat:@"/%@", boardID];
// [self POST:urlStr
// parameters:dictParametes
// needToken:YES
//acceptTypeJson:YES
// success:success
// failure:failure];
// if (!boardID) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSDictionary *dictParametes =
// @{ @"readTime" : [[NSDate date] httpParameterString],
// };
//
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_ReadBoard] stringByAppendingFormat:@"/%@", boardID];
// [self POST:urlStr
// parameters:dictParametes
// needToken:YES
//acceptTypeJson:YES
// success:success
// failure:failure];
}
#pragma mark - Patrol
-
(
void
)
doGetMyPatrolFromUpdateTime
:
(
NSString
*
)
updateTime
position
:
(
NSUInteger
)
uiPosition
size
:
(
NSUInteger
)
uiSize
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
//
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// }];
// }
// };
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
// objectClass:NSClassFromString( @"ICRPatrolPlan" )
// deleteLocal:YES
// handleData:NULL
// complete:complete
// fail:fail];
// };
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction: kICRHTTP_PatrolQuery]
// stringByAppendingFormat:@"/%@?&start_date=%@&page_number=%@&page_size=%@",[[ICRUserUtil sharedInstance] userId],updateTime ? : [[NSDate dateWithTimeIntervalSince1970:0] httpParameterString],@( uiPosition ),@( uiSize )];
//
// NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// NSLog(@"%@",encodeUrlStr);
// [self POST:encodeUrlStr
// parameters:nil
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
doGetStoreResultWithPlanID
:
(
NSString
*
)
planID
storeID
:
(
NSString
*
)
storeID
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// if (!planID || !storeID) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
//
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// }];
// }
// };
//
// void(^dataHandle)(id<IBTDatabaseObject>) = ^(id<IBTDatabaseObject> model) {
// ICRStoreResult *sR = model;
// sR.uuid = planID;
// };
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntity:responseObject[ @"data" ]
// objectClass:NSClassFromString( @"ICRStoreResult" )
// handleData:dataHandle
// complete:complete fail:fail];
// };
//
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
//// 请求URL:http://.../cruiser-server/rest/patrol/plan/get_store_result/{plan_uuid}?store_uuid
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_AnswerStoreResult] stringByAppendingFormat:@"/%@?store_uuid=%@", planID, storeID];
// NSLog(@"%@",urlStr);
// [self GET:urlStr
// parameters:nil
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
doAnswerPatrolPlanWithID
:
(
NSString
*
)
planID
infoData
:
(
id
)
data
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// if (!planID || !data) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSDictionary *dictParametes = data;
// NSLog(@"data===>>>%@",data);
//
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_PatrolAnswer] stringByAppendingFormat:@"/%@", planID];
// NSLog(@"%@",urlStr);
// [self POST:urlStr
// parameters:dictParametes
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
doAnswerOnePatrolResultWithID
:
(
NSNumber
*
)
resultID
infoData
:
(
id
)
data
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// if (!resultID || !data) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSDictionary *dictParametes = data;
//
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_PatrolOneAnswer] stringByAppendingFormat:@"/%@", resultID];
// [self POST:urlStr
// parameters:dictParametes
// needToken:YES
//acceptTypeJson:YES
// success:success
// failure:failure];
}
#pragma mark - Task
-
(
void
)
doGetTaskListFromUpdateTime
:
(
NSString
*
)
updateTime
position
:
(
NSUInteger
)
uiPosition
size
:
(
NSUInteger
)
uiSize
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
//
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// }];
// }
// };
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
// objectClass:NSClassFromString( @"ICRTask" )
// updateNil:NO
// deleteLocal:YES
// handleData:NULL
// complete:complete
// fail:fail];
// }
// else {
// if (fail) {
// fail( nil );
// }
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_MyTaskQuery] stringByAppendingFormat:@"?processor=%@&start_date=%@&page_number=%@&page_size=%@",[[ICRUserUtil sharedInstance] userCode],updateTime ? : [[NSDate dateWithTimeIntervalSince1970:0] httpParameterString],@( uiPosition ),@( uiSize )];
// NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
// NSLog(@"%@",encodeUrlStr);
// [self POST:encodeUrlStr
// parameters:NULL
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
doCreateNewTaskWithInfo
:
(
id
)
data
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// if (!data) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSDictionary *dictParametes = data;
// NSLog(@"------%@",dictParametes);
//
// NSString *urlStr = [[self class] UrlForPluginHTTPAction:kICRHTTP_TaskNew];
// [self POST:urlStr
// parameters:dictParametes
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
doUpdateTaskResultID
:
(
NSString
*
)
resultID
resultText
:
(
NSString
*
)
resultStr
processDate
:
(
NSTimeInterval
)
processDate
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// if (!resultStr) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSDictionary *dictParametes =
// @{ @"result" : resultStr
// };
//
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_TaskResult] stringByAppendingFormat:@"/%@/process", resultID];
// [self POST:urlStr
// parameters:dictParametes
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
doSignupWithInfo
:
(
id
)
data
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// if (!data) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSDictionary *dictParametes = data;
// NSLog(@"%@",dictParametes);
//
// NSString *urlStr = [[self class] UrlForPluginHTTPAction:kICRHTTP_SignUp];
// NSLog(@"%@",urlStr);
// [self POST:urlStr
// parameters:dictParametes
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
#pragma mark - Attachment
-
(
void
)
doAddAttachment
:
(
id
)
data
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// if (!data) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSDictionary *dictParametes = data;
// NSLog(@"%@",data);
//
// NSString *urlStr = [[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentAdd];
// NSLog(@"%@",urlStr);
// [self POST:urlStr
// parameters:dictParametes
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
// if (!data) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
//
// NSDictionary *dictParametes = data;
// NSLog(@"%@",data);
//
// NSString *urlStr = [[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentAdd];
// NSLog(@"%@",urlStr);
// [self POST:urlStr
// parameters:dictParametes
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
doGetAttachmentListWithType
:
(
ICRAttachmentType
)
eType
...
...
@@ -1145,95 +591,95 @@ acceptTypeJson:(BOOL)bAcceptJson
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
;
{
// if (eType >= kAttachmentTypeCount || !objID) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
//
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// }];
// }
// };
//
// void(^dataHandle)(id<IBTDatabaseObject>) = ^(id<IBTDatabaseObject> model) {
// ICRAttachment *att = model;
// att.objectId = objID;
// };
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntities:responseObject[ @"result" ]
// objectClass:NSClassFromString( @"ICRAttachment" )
// deleteLocal:NO
// handleData:dataHandle
// complete:complete
// fail:fail];
// }
// else {
// if (fail) {
// fail( nil );
// }
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
// NSDictionary *dictParametes =
// @{ @"type" : ICRAttachmentTypeValue[ eType ],
// @"objectId" : objID
// };
//
// NSString *urlStr = [[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentList];
// [self POST:urlStr
// parameters:dictParametes
// needToken:YES
//acceptTypeJson:YES
// success:success
// failure:failure];
// if (eType >= kAttachmentTypeCount || !objID) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
//
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// }];
// }
// };
//
// void(^dataHandle)(id<IBTDatabaseObject>) = ^(id<IBTDatabaseObject> model) {
// ICRAttachment *att = model;
// att.objectId = objID;
// };
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntities:responseObject[ @"result" ]
// objectClass:NSClassFromString( @"ICRAttachment" )
// deleteLocal:NO
// handleData:dataHandle
// complete:complete
// fail:fail];
// }
// else {
// if (fail) {
// fail( nil );
// }
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
// NSDictionary *dictParametes =
// @{ @"type" : ICRAttachmentTypeValue[ eType ],
// @"objectId" : objID
// };
//
// NSString *urlStr = [[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentList];
// [self POST:urlStr
// parameters:dictParametes
// needToken:YES
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
doDownloadAttachmentWithID
:
(
NSNumber
*
)
attachmentID
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
{
// if (!attachmentID) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentDownload] stringByAppendingFormat:@"/%@",attachmentID];
// [self GET:urlStr
// parameters:nil
// needToken:YES
//acceptTypeJson:YES
// success:success
// failure:failure];
// if (!attachmentID) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentDownload] stringByAppendingFormat:@"/%@",attachmentID];
// [self GET:urlStr
// parameters:nil
// needToken:YES
//acceptTypeJson:YES
// success:success
// failure:failure];
}
-
(
void
)
doAddDirectAttachment
:
(
id
)
data
...
...
@@ -1259,38 +705,4 @@ acceptTypeJson:(BOOL)bAcceptJson
// TODO
}
#pragma mark - Version
-
(
void
)
doFetchVersionWithCurrent
:
(
NSString
*
)
currentVersion
success
:
(
void
(
^
)(
id
))
succ
failure
:
(
void
(
^
)(
id
))
fail
{
// if (!currentVersion) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// return;
// }
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// if (succ) {
// succ( responseObject );
// }
// };
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// if (fail) {
// fail( error );
// }
// };
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_VersionFetch] stringByAppendingFormat:@"/%@",currentVersion];
// [self GET:urlStr
// parameters:nil
// needToken:YES
//acceptTypeJson:YES
// success:success
// failure:failure];
}
@end
This diff is collapsed.
Click to expand it.
vanke/view_iPhone/templates/affairs/VankeAffairsBoard_iPhone.m
View file @
9501a5a6
...
...
@@ -93,8 +93,8 @@ ON_DID_DISAPPEAR( signal )
ON_SIGNAL3
(
VankeAffairsBoard_iPhone
,
btnNotice
,
signal
)
{
[[
VankeAppBoard_iPhone
sharedInstance
]
hideMenu
];
//
VankeNoticeListBoard_iPhone *board = [VankeNoticeListBoard_iPhone board];
ICRAnnouncementViewController
*
board
=
[
ICRAnnouncementViewController
board
];
VankeNoticeListBoard_iPhone
*
board
=
[
VankeNoticeListBoard_iPhone
board
];
//
ICRAnnouncementViewController *board = [ICRAnnouncementViewController board];
[
self
.
stack
pushBoard
:
board
animated
:
YES
];
}
...
...
This diff is collapsed.
Click to expand it.
vanke/view_iPhone/templates/announcement/ICRAnnouncementViewController.m
View file @
9501a5a6
...
...
@@ -35,14 +35,28 @@ static NSString *MyTableViewCell = @"IBTTableViewCell";
#pragma mark - Life Cycle
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
self
.
title
=
[
IBTCommon
localizableString
:
@"Announcement"
];
[
self
initSegmentConatinerFromOriginY
:
0
];
//- (void)viewDidLoad {
// [super viewDidLoad];
// // Do any additional setup after loading the view.
//
// self.title = [IBTCommon localizableString:@"Announcement"];
//
// [self initSegmentConatinerFromOriginY:0];
// [self initTableView];
//
//}
ON_CREATE_VIEWS
(
signal
)
{
self
.
navigationBarShown
=
YES
;
self
.
navigationBarTitle
=
[
IBTCommon
localizableString
:
@"Announcement"
];
}
ON_DID_APPEAR
(
signal
)
{
[
self
initSegmentConatinerFromOriginY
:
64
];
[
self
initTableView
];
[
self
fetchDataMore
:
NO
type
:
kICRAnnouncementTypeUnread
];
}
-
(
void
)
didReceiveMemoryWarning
{
...
...
This diff is collapsed.
Click to expand it.
vanke/view_iPhone/templates/floor-detail/VankeBusinessChartCell_iPhone.m
View file @
9501a5a6
...
...
@@ -58,9 +58,18 @@ SUPPORT_RESOURCE_LOADING( YES )
chartPieChart
.
descriptionTextFont
=
[
UIFont
fontWithName
:
@"微软雅黑"
size
:
12
.
0
];
chartPieChart
.
descriptionTextShadowColor
=
[
UIColor
clearColor
];
chartPieChart
.
showAbsoluteValues
=
NO
;
chartPieChart
.
showOnlyValues
=
NO
;
chartPieChart
.
showOnlyValues
=
YES
;
[
chartPieChart
strokeChart
];
[
self
.
chartView
addSubview
:
chartPieChart
];
//Build the legend
chartPieChart
.
legendStyle
=
PNLegendItemStyleStacked
;
// chartPieChart.legendFont = 12.0;
UIView
*
legend
=
[
chartPieChart
getLegendWithMaxWidth
:
200
];
//Move legend to the desired position and add to view
[
legend
setFrame
:
CGRectMake
(
10
,
0
,
legend
.
frame
.
size
.
width
,
legend
.
frame
.
size
.
height
)];
[
self
.
chartView
addSubview
:
legend
];
}
-
(
NSArray
*
)
getChartItems
{
...
...
@@ -80,7 +89,7 @@ SUPPORT_RESOURCE_LOADING( YES )
}
-
(
void
)
initChartColors
{
chartColors
=
@[
PNYellow
,
PNBlue
,
PNTwitterColor
,
PN
LightBlue
,
PNPinkDark
,
PNGreen
,
PNTitleColor
,
PNLightGreen
,
PNFreshGreen
,
PNDeepGreen
,
PNRed
,
PNMauve
,
PNBrown
,
PNStarYellow
,
PNDarkBlue
,
PNDeepGrey
,
PNPinkGrey
,
PNLightGrey
,
PNCleanGrey
,
PNDarkYellow
,
PNCloudWhit
e
,
PNBlack
,
PNiOSGreenColor
];
chartColors
=
@[
PNYellow
,
PNBlue
,
PNTwitterColor
,
PN
PinkDark
,
PNGreen
,
PNTitleColor
,
PNLightGreen
,
PNFreshGreen
,
PNDeepGreen
,
PNRed
,
PNMauve
,
PNBrown
,
PNStarYellow
,
PNDarkBlue
,
PNDeepGrey
,
PNPinkGrey
,
PNLightGrey
,
PNCleanGrey
,
PNDarkYellow
,
PNCloudWhite
,
PNLightBlu
e
,
PNBlack
,
PNiOSGreenColor
];
}
@end
...
...
This diff is collapsed.
Click to expand it.
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