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
Nov 27, 2015
by
Achilles
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
VK-5 客流饼状图页面出现重复多个图
parent
a0ac7d24
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) {
...
@@ -25,13 +25,7 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
// Restful API
// 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
-
(
void
)
doChangePassword
:(
NSString
*
)
nsPassword
...
@@ -39,30 +33,11 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
...
@@ -39,30 +33,11 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success
:(
void
(
^
)(
id
data
))
succ
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
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
// Board
/* 公告列表(读)
/* 公告列表(读)
...
@@ -88,61 +63,6 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
...
@@ -88,61 +63,6 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success
:(
void
(
^
)(
id
data
))
succ
success
:(
void
(
^
)(
id
data
))
succ
failure
:(
void
(
^
)(
id
data
))
fail
;
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
// Attachment
/* 添加附件(读)*/
/* 添加附件(读)*/
-
(
void
)
doAddAttachment
:(
id
)
data
-
(
void
)
doAddAttachment
:(
id
)
data
...
@@ -172,12 +92,6 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
...
@@ -172,12 +92,6 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success
:(
void
(
^
)(
id
))
succ
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
failure
:(
void
(
^
)(
id
))
fail
;
// Version
/* 查询版本(读)*/
-
(
void
)
doFetchVersionWithCurrent
:(
NSString
*
)
currentVersion
success
:(
void
(
^
)(
id
))
succ
failure
:(
void
(
^
)(
id
))
fail
;
@end
@end
...
...
vanke/3rd/HTTPController/ICRHTTPController.m
View file @
9501a5a6
...
@@ -16,6 +16,10 @@
...
@@ -16,6 +16,10 @@
#import "IBTModel.h"
#import "IBTModel.h"
#import "ICRAttachment.h"
#import "ICRAttachment.h"
#import "ICRAnnouncement.h"
#import "ICRAnnouncement.h"
#import "ICRUtilsMacro.h"
#import "IBTCommon.h"
#import "VankeCommonModel.h"
#import "ICRDataBaseController.h"
//#import "ICRStoreResult.h"
//#import "ICRStoreResult.h"
#define MAX_CONCURRENCY_UPLOAD 1
#define MAX_CONCURRENCY_UPLOAD 1
...
@@ -83,8 +87,8 @@ static NSString * const ICRHTTPInterface[] = {
...
@@ -83,8 +87,8 @@ static NSString * const ICRHTTPInterface[] = {
[
kICRHTTP_BoardQuery
]
=
@"affiche/download"
,
[
kICRHTTP_BoardQuery
]
=
@"affiche/download"
,
[
kICRHTTP_ReadBoard
]
=
@"board/read"
,
[
kICRHTTP_ReadBoard
]
=
@"board/read"
,
// Patrol
// Patrol
[
kICRHTTP_PatrolQuery
]
=
@"patrol/plan/download"
,
[
kICRHTTP_PatrolQuery
]
=
@"patrol/plan/download"
,
...
@@ -198,36 +202,39 @@ static NSString * const ICRAttachmentTypeValue[] = {
...
@@ -198,36 +202,39 @@ static NSString * const ICRAttachmentTypeValue[] = {
acceptTypeJson
:
(
BOOL
)
bAcceptJson
acceptTypeJson
:
(
BOOL
)
bAcceptJson
failure
:
(
void
(
^
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
))
fail
failure
:
(
void
(
^
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
))
fail
{
{
// AFJSONRequestSerializer *requestSerializer = [AFJSONRequestSerializer serializer];
AFJSONRequestSerializer
*
requestSerializer
=
[
AFJSONRequestSerializer
serializer
];
// ICRUserUtil *user = [ICRUserUtil sharedInstance];
// User *model = [[VankeCommonModel sharedInstance] currentUser];
// if (bIsNeedToken) {
// if ([user.token length] > 0) {
// ICRUserUtil *user = [ICRUserUtil sharedInstance];
// if (!requestSerializer.HTTPRequestHeaders[ @"token" ]) {
// if (bIsNeedToken) {
// [requestSerializer setValue:user.token forHTTPHeaderField:@"token"];
// 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];
// else {
// fail(nil, error);
// 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"];
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
:
@"application/json;charset=utf-8"
forHTTPHeaderField
:
@"Content-Type"
];
// {
//请求头添加enterprise参数
// [requestSerializer setValue:user.orgId forHTTPHeaderField:@"enterprise"];
// }
Enterpirse
*
ent
=
[[
VankeCommonModel
sharedInstance
]
currentEnt
];
//// [requestSerializer setValue:user.authorization forHTTPHeaderField:@"Authorization"];
if
(
ent
.
uuid
!=
NULL
)
//
{
// return requestSerializer;
[
requestSerializer
setValue
:
ent
.
uuid
forHTTPHeaderField
:
@"enterprise"
];
return
nil
;
}
// [requestSerializer setValue:user.authorization forHTTPHeaderField:@"Authorization"];
return
requestSerializer
;
}
}
-
(
void
)
GET
:
(
NSString
*
)
urlStr
-
(
void
)
GET
:
(
NSString
*
)
urlStr
...
@@ -252,8 +259,8 @@ acceptTypeJson:(BOOL)bAcceptJson
...
@@ -252,8 +259,8 @@ acceptTypeJson:(BOOL)bAcceptJson
manager
.
requestSerializer
=
requestSerializer
;
manager
.
requestSerializer
=
requestSerializer
;
NSLog
(
@"headers=======>>>>>>>>>%@"
,[
manager
.
requestSerializer
HTTPRequestHeaders
]);
NSLog
(
@"headers=======>>>>>>>>>%@"
,[
manager
.
requestSerializer
HTTPRequestHeaders
]);
// The request add in operation
// The request add in operation
// The request add in operation
// The request add in operation
[
manager
GET
:
urlStr
[
manager
GET
:
urlStr
parameters
:
parameters
parameters
:
parameters
...
@@ -280,8 +287,8 @@ acceptTypeJson:(BOOL)bAcceptJson
...
@@ -280,8 +287,8 @@ acceptTypeJson:(BOOL)bAcceptJson
};
};
AFHTTPRequestOperationManager
*
manager
=
[
AFHTTPRequestOperationManager
manager
];
AFHTTPRequestOperationManager
*
manager
=
[
AFHTTPRequestOperationManager
manager
];
manager
.
requestSerializer
=
requestSerializer
;
manager
.
requestSerializer
=
requestSerializer
;
[
manager
POST
:
urlStr
[
manager
POST
:
urlStr
parameters
:
parameters
parameters
:
parameters
success
:
success
success
:
success
failure
:
failure
];
failure
:
failure
];
...
@@ -307,7 +314,7 @@ acceptTypeJson:(BOOL)bAcceptJson
...
@@ -307,7 +314,7 @@ acceptTypeJson:(BOOL)bAcceptJson
AFHTTPRequestOperationManager
*
manager
=
[
AFHTTPRequestOperationManager
manager
];
AFHTTPRequestOperationManager
*
manager
=
[
AFHTTPRequestOperationManager
manager
];
manager
.
requestSerializer
=
requestSerializer
;
manager
.
requestSerializer
=
requestSerializer
;
// The request add in operation
// The request add in operation
[
manager
PATCH
:
urlStr
[
manager
PATCH
:
urlStr
...
@@ -344,260 +351,50 @@ acceptTypeJson:(BOOL)bAcceptJson
...
@@ -344,260 +351,50 @@ acceptTypeJson:(BOOL)bAcceptJson
failure
:
failure
];
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
-
(
void
)
doChangePassword
:
(
NSString
*
)
nsPassword
newPassword
:
(
NSString
*
)
nsNewPassword
newPassword
:
(
NSString
*
)
nsNewPassword
success
:
(
void
(
^
)(
id
data
))
succ
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
failure
:
(
void
(
^
)(
id
data
))
fail
{
{
// if (!nsPassword || !nsNewPassword) {
// if (!nsPassword || !nsNewPassword) {
// if (fail) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// }
// return;
// return;
// }
// }
//
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// NSLog(@"%@", responseObject);
// NSLog(@"%@", responseObject);
// if (succ) {
// if (succ) {
// succ( responseObject );
// succ( responseObject );
// }
// }
// };
// };
//
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// NSLog(@"%@", error);
// NSLog(@"%@", error);
// if (fail) {
// if (fail) {
// fail( error );
// fail( error );
// }
// }
// };
// };
////http://.../cruiser-server/rest/user/change_password/{user_uuid}?time={time}&operator.id={operatorId}&operator.operName={operatorName}&enterprise={enterprise}
////http://.../cruiser-server/rest/user/change_password/{user_uuid}?time={time}&operator.id={operatorId}&operator.operName={operatorName}&enterprise={enterprise}
//// 请求参数:
//// 请求参数:
//
//
// NSDictionary *dictParametes =
// NSDictionary *dictParametes =
// @{ @"oldPassword" : nsPassword,
// @{ @"oldPassword" : nsPassword,
// @"newPassword" : nsNewPassword,
// @"newPassword" : nsNewPassword,
// };
// };
//
//
// NSString *currentTime = [[NSDate date] httpParameterString];
// NSString *currentTime = [[NSDate date] httpParameterString];
// ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
// 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 *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编码,否则不合法
// NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];//对url进行utf-8编码,否则不合法
// CLog(@"%@",encodeUrlStr);
// CLog(@"%@",encodeUrlStr);
// [self POST:encodeUrlStr
// [self POST:encodeUrlStr
// parameters:dictParametes
// parameters:dictParametes
// needToken:NO
// needToken:NO
//acceptTypeJson:YES
//acceptTypeJson:YES
// success:success
// success:success
// failure:failure];
// 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];
}
}
#pragma mark - Board
#pragma mark - Board
...
@@ -609,535 +406,184 @@ acceptTypeJson:(BOOL)bAcceptJson
...
@@ -609,535 +406,184 @@ acceptTypeJson:(BOOL)bAcceptJson
success
:
(
void
(
^
)(
id
data
))
succ
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
failure
:
(
void
(
^
)(
id
data
))
fail
{
{
//
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
void
(
^
success
)(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
=
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
// C
Log(@"%@", responseObject);
NS
Log
(
@"%@"
,
responseObject
);
//
//
if (IsDictObject(responseObject)) {
if
(
IsDictObject
(
responseObject
))
{
//
void (^complete)(void) = ^(void){
void
(
^
complete
)(
void
)
=
^
(
void
){
//
if (succ) {
if
(
succ
)
{
//
[IBTCommon runOnMainThreadWithoutDeadlocking:^{
[
IBTCommon
runOnMainThreadWithoutDeadlocking
:
^
{
//
succ( responseObject );
succ
(
responseObject
);
//
}];
}];
//
}
}
//
};
};
//
//
void(^dataHandle)(id<IBTDatabaseObject>) = ^(id<IBTDatabaseObject> model) {
void
(
^
dataHandle
)(
id
<
IBTDatabaseObject
>
)
=
^
(
id
<
IBTDatabaseObject
>
model
)
{
//
ICRAnnouncement *ann = model;
ICRAnnouncement
*
ann
=
model
;
//
ann.priority = eType;
ann
.
priority
=
eType
;
//
};
};
//
//
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
ICRDataBaseController
*
dbCtrl
=
[
ICRDataBaseController
sharedController
];
//
[dbCtrl storageEntities:responseObject[ @"data" ][ @"records" ]
[
dbCtrl
storageEntities
:
responseObject
[
@"data"
][
@"records"
]
//
objectClass:NSClassFromString( @"ICRAnnouncement" )
objectClass
:
NSClassFromString
(
@"ICRAnnouncement"
)
//
deleteLocal:bDeleteLocal
deleteLocal
:
bDeleteLocal
//
handleData:dataHandle
handleData
:
dataHandle
//
complete:complete
complete
:
complete
//
fail:fail];
fail
:
fail
];
//
}
}
//
else {
else
{
//
if (fail) {
if
(
fail
)
{
//
fail( nil );
fail
(
nil
);
//
}
}
//
}
}
//
};
};
//
//
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
void
(
^
failure
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
=
^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
// C
Log(@"%@", error);
NS
Log
(
@"%@"
,
error
);
//
if (fail) {
if
(
fail
)
{
//
fail( error );
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
*
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];
NSString
*
encodeUrlStr
=
[
urlStr
stringByAddingPercentEscapesUsingEncoding
:
NSUTF8StringEncoding
];
//
NSLog(@"%@",encodeUrlStr);
NSLog
(
@"%@"
,
encodeUrlStr
);
//
[self POST:encodeUrlStr
[
self
POST
:
encodeUrlStr
//
parameters:nil
parameters
:
nil
//
needToken:NO
needToken
:
NO
//
acceptTypeJson:YES
acceptTypeJson
:
YES
//
success:success
success
:
success
//
failure:failure];
failure
:
failure
];
}
}
-
(
void
)
doGetBoardWithID
:
(
NSNumber
*
)
boardID
-
(
void
)
doGetBoardWithID
:
(
NSNumber
*
)
boardID
success
:
(
void
(
^
)(
id
data
))
succ
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
failure
:
(
void
(
^
)(
id
data
))
fail
{
{
//
if (!boardID) {
if
(
!
boardID
)
{
//
if (fail) {
if
(
fail
)
{
//
fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
fail
(
[[
self
class
]
ErrorWithMsg
:
ERROR_PARAMETER
code
:
0
]
);
//
}
}
//
return;
return
;
//
}
}
//
//
void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
void
(
^
success
)(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
=
^
(
AFHTTPRequestOperation
*
operation
,
id
responseObject
)
{
// C
Log(@"%@", responseObject);
NS
Log
(
@"%@"
,
responseObject
);
//
if (IsDictObject(responseObject)) {
if
(
IsDictObject
(
responseObject
))
{
//
void (^complete)(void) = ^(void){
void
(
^
complete
)(
void
)
=
^
(
void
){
//
if (succ) {
if
(
succ
)
{
//
[IBTCommon runOnMainThreadWithoutDeadlocking:^{
[
IBTCommon
runOnMainThreadWithoutDeadlocking
:
^
{
//
succ( responseObject );
succ
(
responseObject
);
//
}];
}];
//
}
}
//
};
};
//
//
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
ICRDataBaseController
*
dbCtrl
=
[
ICRDataBaseController
sharedController
];
//
[dbCtrl storageEntity:responseObject[ @"data" ]
[
dbCtrl
storageEntity
:
responseObject
[
@"data"
]
//
objectClass:NSClassFromString( @"ICRAnnouncement" )
objectClass
:
NSClassFromString
(
@"ICRAnnouncement"
)
//
handleData:NULL
handleData
:
NULL
//
complete:complete
complete
:
complete
//
fail:fail];
fail
:
fail
];
//
//
};
};
//
};
};
//
//
void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
void
(
^
failure
)(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
=
^
(
AFHTTPRequestOperation
*
operation
,
NSError
*
error
)
{
// C
Log(@"%@", error);
NS
Log
(
@"%@"
,
error
);
//
if (fail) {
if
(
fail
)
{
//
fail( error );
fail
(
error
);
//
}
}
//
};
};
//
//
// http://.../cruiser-server/rest/affiche/download/{affiche_uuid}
// http://.../cruiser-server/rest/affiche/download/{affiche_uuid}
//// http://218.244.151.129:8280/cruiser-server/rest/affiche/download/5a7417014eb34067014eb4fea404003e
// http://218.244.151.129:8280/cruiser-server/rest/affiche/download/5a7417014eb34067014eb4fea404003e
//
//
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_BoardQuery] stringByAppendingFormat:@"/%@", boardID];
NSString
*
urlStr
=
[[[
self
class
]
UrlForPluginHTTPAction
:
kICRHTTP_BoardQuery
]
stringByAppendingFormat
:
@"/%@"
,
boardID
];
//
NSLog(@"%@",urlStr);
NSLog
(
@"%@"
,
urlStr
);
//
[self GET:urlStr
[
self
GET
:
urlStr
//
parameters:nil
parameters
:
nil
//
needToken:NO
needToken
:
NO
//
acceptTypeJson:YES
acceptTypeJson
:
YES
//
success:success
success
:
success
//
failure:failure];
failure
:
failure
];
}
}
-
(
void
)
doReadBoardWithID
:
(
NSNumber
*
)
boardID
-
(
void
)
doReadBoardWithID
:
(
NSNumber
*
)
boardID
success
:
(
void
(
^
)(
id
data
))
succ
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
failure
:
(
void
(
^
)(
id
data
))
fail
{
{
// if (!boardID) {
// if (!boardID) {
// if (fail) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// }
// return;
// return;
// }
// }
//
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// CLog(@"%@", responseObject);
// if (succ) {
// if (succ) {
// succ( responseObject );
// succ( responseObject );
// }
// }
// };
// };
//
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// CLog(@"%@", error);
// if (fail) {
// if (fail) {
// fail( error );
// fail( error );
// }
// }
// };
// };
//
//
// NSDictionary *dictParametes =
// NSDictionary *dictParametes =
// @{ @"readTime" : [[NSDate date] httpParameterString],
// @{ @"readTime" : [[NSDate date] httpParameterString],
// };
// };
//
//
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_ReadBoard] stringByAppendingFormat:@"/%@", boardID];
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_ReadBoard] stringByAppendingFormat:@"/%@", boardID];
// [self POST:urlStr
// [self POST:urlStr
// parameters:dictParametes
// parameters:dictParametes
// needToken:YES
// needToken:YES
//acceptTypeJson:YES
//acceptTypeJson:YES
// success:success
// success:success
// failure:failure];
// 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
#pragma mark - Attachment
-
(
void
)
doAddAttachment
:
(
id
)
data
-
(
void
)
doAddAttachment
:
(
id
)
data
success
:
(
void
(
^
)(
id
data
))
succ
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
failure
:
(
void
(
^
)(
id
data
))
fail
{
{
// if (!data) {
// if (!data) {
// if (fail) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// }
// return;
// return;
// }
// }
//
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// CLog(@"%@", responseObject);
// if (succ) {
// if (succ) {
// succ( responseObject );
// succ( responseObject );
// }
// }
// };
// };
//
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// CLog(@"%@", error);
// if (fail) {
// if (fail) {
// fail( error );
// fail( error );
// }
// }
// };
// };
//
//
// NSDictionary *dictParametes = data;
// NSDictionary *dictParametes = data;
// NSLog(@"%@",data);
// NSLog(@"%@",data);
//
//
// NSString *urlStr = [[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentAdd];
// NSString *urlStr = [[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentAdd];
// NSLog(@"%@",urlStr);
// NSLog(@"%@",urlStr);
// [self POST:urlStr
// [self POST:urlStr
// parameters:dictParametes
// parameters:dictParametes
// needToken:NO
// needToken:NO
//acceptTypeJson:YES
//acceptTypeJson:YES
// success:success
// success:success
// failure:failure];
// failure:failure];
}
}
-
(
void
)
doGetAttachmentListWithType
:
(
ICRAttachmentType
)
eType
-
(
void
)
doGetAttachmentListWithType
:
(
ICRAttachmentType
)
eType
...
@@ -1145,95 +591,95 @@ acceptTypeJson:(BOOL)bAcceptJson
...
@@ -1145,95 +591,95 @@ acceptTypeJson:(BOOL)bAcceptJson
success
:
(
void
(
^
)(
id
data
))
succ
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
;
failure
:
(
void
(
^
)(
id
data
))
fail
;
{
{
// if (eType >= kAttachmentTypeCount || !objID) {
// if (eType >= kAttachmentTypeCount || !objID) {
// if (fail) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// }
// return;
// return;
// }
// }
//
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// CLog(@"%@", responseObject);
//
//
// if (IsDictObject(responseObject)) {
// if (IsDictObject(responseObject)) {
// void (^complete)(void) = ^(void){
// void (^complete)(void) = ^(void){
// if (succ) {
// if (succ) {
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// [IBTCommon runOnMainThreadWithoutDeadlocking:^{
// succ( responseObject );
// succ( responseObject );
// }];
// }];
// }
// }
// };
// };
//
//
// void(^dataHandle)(id<IBTDatabaseObject>) = ^(id<IBTDatabaseObject> model) {
// void(^dataHandle)(id<IBTDatabaseObject>) = ^(id<IBTDatabaseObject> model) {
// ICRAttachment *att = model;
// ICRAttachment *att = model;
// att.objectId = objID;
// att.objectId = objID;
// };
// };
//
//
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
// [dbCtrl storageEntities:responseObject[ @"result" ]
// [dbCtrl storageEntities:responseObject[ @"result" ]
// objectClass:NSClassFromString( @"ICRAttachment" )
// objectClass:NSClassFromString( @"ICRAttachment" )
// deleteLocal:NO
// deleteLocal:NO
// handleData:dataHandle
// handleData:dataHandle
// complete:complete
// complete:complete
// fail:fail];
// fail:fail];
// }
// }
// else {
// else {
// if (fail) {
// if (fail) {
// fail( nil );
// fail( nil );
// }
// }
// }
// }
// };
// };
//
//
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// CLog(@"%@", error);
// if (fail) {
// if (fail) {
// fail( error );
// fail( error );
// }
// }
// };
// };
// NSDictionary *dictParametes =
// NSDictionary *dictParametes =
// @{ @"type" : ICRAttachmentTypeValue[ eType ],
// @{ @"type" : ICRAttachmentTypeValue[ eType ],
// @"objectId" : objID
// @"objectId" : objID
// };
// };
//
//
// NSString *urlStr = [[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentList];
// NSString *urlStr = [[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentList];
// [self POST:urlStr
// [self POST:urlStr
// parameters:dictParametes
// parameters:dictParametes
// needToken:YES
// needToken:YES
//acceptTypeJson:YES
//acceptTypeJson:YES
// success:success
// success:success
// failure:failure];
// failure:failure];
}
}
-
(
void
)
doDownloadAttachmentWithID
:
(
NSNumber
*
)
attachmentID
-
(
void
)
doDownloadAttachmentWithID
:
(
NSNumber
*
)
attachmentID
success
:
(
void
(
^
)(
id
data
))
succ
success
:
(
void
(
^
)(
id
data
))
succ
failure
:
(
void
(
^
)(
id
data
))
fail
failure
:
(
void
(
^
)(
id
data
))
fail
{
{
// if (!attachmentID) {
// if (!attachmentID) {
// if (fail) {
// if (fail) {
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// fail( [[self class] ErrorWithMsg:ERROR_PARAMETER code:0] );
// }
// }
// return;
// return;
// }
// }
//
//
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// void (^success)(AFHTTPRequestOperation *operation, id responseObject) = ^(AFHTTPRequestOperation *operation, id responseObject) {
// CLog(@"%@", responseObject);
// CLog(@"%@", responseObject);
// if (succ) {
// if (succ) {
// succ( responseObject );
// succ( responseObject );
// }
// }
// };
// };
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// void (^failure)(AFHTTPRequestOperation *operation, NSError *error) = ^(AFHTTPRequestOperation *operation, NSError *error) {
// CLog(@"%@", error);
// CLog(@"%@", error);
// if (fail) {
// if (fail) {
// fail( error );
// fail( error );
// }
// }
// };
// };
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentDownload] stringByAppendingFormat:@"/%@",attachmentID];
// NSString *urlStr = [[[self class] UrlForPluginHTTPAction:kICRHTTP_AttachmentDownload] stringByAppendingFormat:@"/%@",attachmentID];
// [self GET:urlStr
// [self GET:urlStr
// parameters:nil
// parameters:nil
// needToken:YES
// needToken:YES
//acceptTypeJson:YES
//acceptTypeJson:YES
// success:success
// success:success
// failure:failure];
// failure:failure];
}
}
-
(
void
)
doAddDirectAttachment
:
(
id
)
data
-
(
void
)
doAddDirectAttachment
:
(
id
)
data
...
@@ -1259,38 +705,4 @@ acceptTypeJson:(BOOL)bAcceptJson
...
@@ -1259,38 +705,4 @@ acceptTypeJson:(BOOL)bAcceptJson
// TODO
// 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
@end
vanke/view_iPhone/templates/affairs/VankeAffairsBoard_iPhone.m
View file @
9501a5a6
...
@@ -93,8 +93,8 @@ ON_DID_DISAPPEAR( signal )
...
@@ -93,8 +93,8 @@ ON_DID_DISAPPEAR( signal )
ON_SIGNAL3
(
VankeAffairsBoard_iPhone
,
btnNotice
,
signal
)
{
ON_SIGNAL3
(
VankeAffairsBoard_iPhone
,
btnNotice
,
signal
)
{
[[
VankeAppBoard_iPhone
sharedInstance
]
hideMenu
];
[[
VankeAppBoard_iPhone
sharedInstance
]
hideMenu
];
//
VankeNoticeListBoard_iPhone *board = [VankeNoticeListBoard_iPhone board];
VankeNoticeListBoard_iPhone
*
board
=
[
VankeNoticeListBoard_iPhone
board
];
ICRAnnouncementViewController
*
board
=
[
ICRAnnouncementViewController
board
];
//
ICRAnnouncementViewController *board = [ICRAnnouncementViewController board];
[
self
.
stack
pushBoard
:
board
animated
:
YES
];
[
self
.
stack
pushBoard
:
board
animated
:
YES
];
}
}
...
...
vanke/view_iPhone/templates/announcement/ICRAnnouncementViewController.m
View file @
9501a5a6
...
@@ -35,14 +35,28 @@ static NSString *MyTableViewCell = @"IBTTableViewCell";
...
@@ -35,14 +35,28 @@ static NSString *MyTableViewCell = @"IBTTableViewCell";
#pragma mark - Life Cycle
#pragma mark - Life Cycle
-
(
void
)
viewDidLoad
{
//- (void)viewDidLoad {
[
super
viewDidLoad
];
// [super viewDidLoad];
// Do any additional setup after loading the view.
// // Do any additional setup after loading the view.
//
self
.
title
=
[
IBTCommon
localizableString
:
@"Announcement"
];
// self.title = [IBTCommon localizableString:@"Announcement"];
//
[
self
initSegmentConatinerFromOriginY
:
0
];
// [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
initTableView
];
[
self
fetchDataMore
:
NO
type
:
kICRAnnouncementTypeUnread
];
}
}
-
(
void
)
didReceiveMemoryWarning
{
-
(
void
)
didReceiveMemoryWarning
{
...
...
vanke/view_iPhone/templates/floor-detail/VankeBusinessChartCell_iPhone.m
View file @
9501a5a6
...
@@ -58,9 +58,18 @@ SUPPORT_RESOURCE_LOADING( YES )
...
@@ -58,9 +58,18 @@ SUPPORT_RESOURCE_LOADING( YES )
chartPieChart
.
descriptionTextFont
=
[
UIFont
fontWithName
:
@"微软雅黑"
size
:
12
.
0
];
chartPieChart
.
descriptionTextFont
=
[
UIFont
fontWithName
:
@"微软雅黑"
size
:
12
.
0
];
chartPieChart
.
descriptionTextShadowColor
=
[
UIColor
clearColor
];
chartPieChart
.
descriptionTextShadowColor
=
[
UIColor
clearColor
];
chartPieChart
.
showAbsoluteValues
=
NO
;
chartPieChart
.
showAbsoluteValues
=
NO
;
chartPieChart
.
showOnlyValues
=
NO
;
chartPieChart
.
showOnlyValues
=
YES
;
[
chartPieChart
strokeChart
];
[
chartPieChart
strokeChart
];
[
self
.
chartView
addSubview
:
chartPieChart
];
[
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
{
-
(
NSArray
*
)
getChartItems
{
...
@@ -80,7 +89,7 @@ SUPPORT_RESOURCE_LOADING( YES )
...
@@ -80,7 +89,7 @@ SUPPORT_RESOURCE_LOADING( YES )
}
}
-
(
void
)
initChartColors
{
-
(
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
@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