Commit a5276e21 authored by 陈俊俊's avatar 陈俊俊

获取后台数据分页

parent f6c441e0
......@@ -223,24 +223,28 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//2.下载用户信息
- (void)getUserWithPage_number:(NSUInteger)page_number
- (void)getUserWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//3.供应商
- (void)getVendorWithPage_number:(NSUInteger)page_number
- (void)getVendorWithStartDate:(NSString *)stateDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//4.仓库
- (void)getWarehouseWithPage_number:(NSUInteger)page_number
- (void)getWarehouseWithStartDate:(NSString *)stateDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//5.科目账款
- (void)getAccounttitleWithPage_number:(NSUInteger)page_number
- (void)getAccounttitleWithStartDate:(NSString *)stateDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
......@@ -315,7 +319,8 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success:(void (^)(id))succ
failure:(void (^)(id))fail;
- (void)getProductUnitWithPage_number:(NSUInteger)page_number
- (void)getProductUnitWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail;
......
......@@ -1567,7 +1567,8 @@ acceptTypeJson:YES
}
- (void)getUserWithPage_number:(NSUInteger)page_number
- (void)getUserWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
......@@ -1602,8 +1603,7 @@ acceptTypeJson:YES
fail( error );
}
};
NSString *dateStr = @"2015-01-01";
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetUser] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", dateStr,@(page_number),@(page_size)];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetUser] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", startDate,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:NULL
......@@ -1754,33 +1754,85 @@ acceptTypeJson:YES
}
//供应商
-(void)getVendorWithPage_number:(NSUInteger)page_number
-(void)getVendorWithStartDate:(NSString *)stateDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
[self p_getDownloadWithICRHTTPAction:XFFHttp_GetVendor ClassName:@"Vendor" Page_number:page_number page_size:page_size success:succ failure:fail];
[self p_downloadWithStartDate:stateDate ICRHTTPAction:XFFHttp_GetVendor ClassName:@"Vendor" Page_number:page_number page_size:page_size success:succ failure:fail];
}
//仓库
-(void)getWarehouseWithPage_number:(NSUInteger)page_number
-(void)getWarehouseWithStartDate:(NSString *)stateDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
[self p_getDownloadWithICRHTTPAction:XFFHttp_GetWarehouse ClassName:@"Warehouse" Page_number:page_number page_size:page_size success:succ failure:fail];
[self p_downloadWithStartDate:stateDate ICRHTTPAction:XFFHttp_GetWarehouse ClassName:@"Warehouse" Page_number:page_number page_size:page_size success:succ failure:fail];
}
//科目
- (void)getAccounttitleWithPage_number:(NSUInteger)page_number
- (void)getAccounttitleWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
[self p_getDownloadWithICRHTTPAction:XFFHttp_GetAccounttitle ClassName:GXF_BASECLASS_ACCOUNTTITLE Page_number:page_number page_size:page_size success:succ failure:fail];
[self p_downloadWithStartDate:startDate ICRHTTPAction:XFFHttp_GetAccounttitle ClassName:GXF_BASECLASS_ACCOUNTTITLE Page_number:page_number page_size:page_size success:succ failure:fail];
}
- (void)p_downloadWithStartDate:(NSString *)startDate
ICRHTTPAction: (NSUInteger)urlAction
ClassName: (NSString *)class_Name
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))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( class_Name ) ///
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:urlAction] stringByAppendingFormat:@"?startDate=%@&pageNumber=%@&pageSize=%@", startDate,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self GET:encodeUrlStr
parameters:NULL
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
- (void)getProductunitWithPage_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
......@@ -2634,7 +2686,8 @@ acceptTypeJson:YES
}
- (void)getProductUnitWithPage_number:(NSUInteger)page_number
- (void)getProductUnitWithStartDate:(NSString *)startDate
Page_number:(NSUInteger)page_number
page_size:(NSUInteger)page_size
success:(void (^)(id))succ
failure:(void (^)(id))fail{
......@@ -2669,8 +2722,7 @@ acceptTypeJson:YES
fail( error );
}
};
NSString *dateStr = @"2015-05-01";
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetProductunit] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", dateStr,@(page_number),@(page_size)];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetProductunit] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", startDate,@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:NULL
......
......@@ -28,7 +28,7 @@ typedef void(^ChoseBaseInfo)(NSArray *baseInfos);
@property (nonatomic,assign)BOOL isFirst;
@property (nonatomic,strong)NSString *selectStr;
@property (nonatomic,assign)NSInteger currentPage;
@property (nonatomic,strong)NSString *startDate;
- (void)endRefreshing;
- (void)getBaseDataFromServer;
......
......@@ -78,6 +78,41 @@
}
- (void)getLastModifiedTime{
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * sql = [NSString stringWithFormat:@"select * from %@ order by lastModify_time desc limit 1",self.tableStr];
return [db executeQuery:sql];
};
__weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (fetchedObjects.count > 0) {
NSString *startDate = @"";
if ([self.tableStr isEqualToString:GXF_BASECLASS_PRODUCT]) {
Product *product = fetchedObjects[0];
startDate = product.lastModify_time;
}else if ([self.tableStr isEqualToString:GXF_BASECLASS_USER]) {
User *user = fetchedObjects[0];
startDate = user.lastModify_time;
}else if ([self.tableStr isEqualToString:GXF_BASECLASS_PRODUCTUNIT]) {
GXFProductUnit *productUnit = fetchedObjects[0];
startDate = productUnit.lastModify_time;
}else if ([self.tableStr isEqualToString:GXF_BASECLASS_VENDOR]) {
Vendor *vendor= fetchedObjects[0];
startDate = vendor.lastModify_time;
}else if ([self.tableStr isEqualToString:GXF_BASECLASS_WAREHOUSE]) {
Warehouse *warehouse= fetchedObjects[0];
startDate = warehouse.lastModify_time;
}else if ([self.tableStr isEqualToString:GXF_BASECLASS_ACCOUNTTITLE]) {
Accounttitle *accounttitle= fetchedObjects[0];
startDate = accounttitle.lastModify_time;
}
[strongSelf getBaseDataFromServerWithStartDate:startDate];
}
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl runFetchForClass:NSClassFromString(self.tableStr)
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
}
......@@ -213,12 +248,8 @@
self.isFirst = NO;
[GXF_NSUSERFEFTAULTS setObject:[NSDate date] forKey:self.tableView.header.lastUpdatedTimeKey];
[GXF_NSUSERFEFTAULTS synchronize];
if ([tableStr isEqualToString:GXF_BASECLASS_PRODUCT]) {
NSString *befortDate = @"2014-01-01";
[self getBaseDataFromServerWithStartDate:befortDate];
}else{
[self getBaseDataFromServer];
}
}else{
[strongSelf.dataArr removeAllObjects];
if (!self.tableView.header.lastUpdatedTime) {
......
......@@ -23,14 +23,14 @@
#define ICR_IMAGE_BG_COLOR [UIColor colorWithW:242 a:1]
//********阿里云内部测试环境********
#define HTTP_REST_API_BASE_URL @"http://218.244.151.129:7580/cruiser-server/rest"
//#define HTTP_REST_API_BASE_URL @"http://218.244.151.129:7580/cruiser-server/rest"
//********现场测试环境********
//#define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7280/cruiser-server/rest"
//********现场正式环境*********
// #define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7380/cruiser-server/rest"
#define HTTP_REST_API_BASE_URL @"http://122.224.171.126:7380/cruiser-server/rest"
// HTTP
......@@ -46,7 +46,12 @@
#import "ICRDataBaseController.h"
#import "NSData+EncodeAdditions.h"
#import "UIScrollView+Content.h"
#import "Product.h"
#import "User.h"
#import "GXFProductUnit.h"
#import "Vendor.h"
#import "Warehouse.h"
#import "Accounttitle.h"
......
......@@ -17,25 +17,52 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.currentPage = 0;
self.tableStr = GXF_BASECLASS_ACCOUNTTITLE;
self.title = @"费用类型";
self.tableView.header.lastUpdatedTimeKey = ChooseAccountTitleUpdateDate;
[self fetchDataList:@"" tableStr:GXF_BASECLASS_ACCOUNTTITLE];
}
- (void)getBaseDataFromServer{
- (void)getBaseDataFromServerWithStartDate:(NSString *)startDate{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_ACCOUNTTITLE];
//请求成功之后
strongSelf.startDate = startDate;
[strongSelf getLastDateFromServer:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
[self endRefreshing];
};
if (self.currentPage == 0) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getAccounttitleWithPage_number:0 page_size:1000 success:succ failure:fail];
}
[[ICRHTTPController sharedController] getAccounttitleWithStartDate:startDate
Page_number:self.currentPage page_size:100 success:succ failure:fail];
}
- (void)getLastDateFromServer:(id)data
{
if (data) {
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
if (pageCount <= self.currentPage) {
[self endRefreshing];
[IBTLoadingView hideHUDWithText:nil];
[self fetchDataList:@"" tableStr:GXF_BASECLASS_ACCOUNTTITLE];
}else{
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
......
......@@ -16,26 +16,56 @@
@implementation ChooseProductUnitViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.currentPage = 0;
self.tableStr = GXF_BASECLASS_PRODUCTUNIT;
//记录更新时间
self.tableView.header.lastUpdatedTimeKey = ChooseProductUnitUpdateDate;
self.title = @"选择包装单位";
[self fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCTUNIT];
}
- (void)getBaseDataFromServer{
- (void)getBaseDataFromServerWithStartDate:(NSString *)startDate{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCTUNIT];
//请求成功之后
strongSelf.startDate = startDate;
[strongSelf getLastDateFromServer:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
[self endRefreshing];
};
if (self.currentPage == 0) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getProductUnitWithPage_number:0 page_size:1000 success:succ failure:fail];
}
[[ICRHTTPController sharedController] getProductUnitWithStartDate:startDate
Page_number:self.currentPage page_size:100 success:succ failure:fail];
}
- (void)getLastDateFromServer:(id)data
{
if (data) {
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
if (pageCount <= self.currentPage) {
[self endRefreshing];
[IBTLoadingView hideHUDWithText:nil];
[self fetchDataList:@"" tableStr:GXF_BASECLASS_PRODUCTUNIT];
}else{
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
......
......@@ -11,7 +11,7 @@
#define TableHeight 50
@interface ChooseProductViewController ()
@property (nonatomic,strong)NSString *startDate;
@end
@implementation ChooseProductViewController
......@@ -57,28 +57,13 @@
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
}
}
- (void)getLastModifiedTime{
ICRDatabaseFetchBlock fetchBlk = ^FMResultSet *(FMDatabase *db) {
NSString * sql = [NSString stringWithFormat:@"select * from %@ order by lastModify_time desc limit 1",GXF_BASECLASS_PRODUCT];
return [db executeQuery:sql];
};
__weak typeof(self)weakSelf = self;
ICRDatabaseFetchResultsBlock fetchResultsBlk = ^(NSArray *fetchedObjects) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (fetchedObjects.count > 0) {
Product *product = fetchedObjects[0];
[strongSelf getBaseDataFromServerWithStartDate:product.lastModify_time];
}
};
ICRDataBaseController *dbCtrl = [ICRDataBaseController sharedController];
[dbCtrl runFetchForClass:NSClassFromString(GXF_BASECLASS_PRODUCT)
fetchBlock:fetchBlk
fetchResultsBlock:fetchResultsBlk];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
......
......@@ -20,31 +20,55 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.currentPage = 0;
self.tableStr = GXF_BASECLASS_VENDOR;
//记录更新时间
self.tableView.header.lastUpdatedTimeKey = ChooseVendorUpdateDate;
self.title = @"选择供应商";
[self fetchDataList:@"" tableStr:GXF_BASECLASS_VENDOR];
}
- (void)getBaseDataFromServer{
- (void)getBaseDataFromServerWithStartDate:(NSString *)startDate{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_VENDOR];
}else{
[IBTLoadingView showTips:data];
}
//请求成功之后
strongSelf.startDate = startDate;
[strongSelf getLastDateFromServer:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
[self endRefreshing];
};
if (self.currentPage == 0) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:1000 success:succ failure:fail];
}
[[ICRHTTPController sharedController] getVendorWithStartDate:startDate
Page_number:self.currentPage page_size:100 success:succ failure:fail];
}
- (void)getLastDateFromServer:(id)data
{
if (data) {
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
if (pageCount <= self.currentPage) {
[self endRefreshing];
[IBTLoadingView hideHUDWithText:nil];
[self fetchDataList:@"" tableStr:GXF_BASECLASS_VENDOR];
}else{
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
}
}
#pragma mark - 协议方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
......
......@@ -17,33 +17,51 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.currentPage = 0;
self.tableStr = GXF_BASECLASS_WAREHOUSE;
//记录更新时间
self.tableView.header.lastUpdatedTimeKey = ChooseWarehouseUpdateDate;
self.title = @"选择仓库";
[self fetchDataList:@"" tableStr:GXF_BASECLASS_WAREHOUSE];
}
- (void)getBaseDataFromServer{
-(void)getBaseDataFromServerWithStartDate:(NSString *)startDate{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
[self endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_WAREHOUSE];
}else{
[IBTLoadingView showTips:data];
}
//请求成功之后
strongSelf.startDate = startDate;
[strongSelf getLastDateFromServer:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
[self endRefreshing];
};
if (self.currentPage == 0) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getWarehouseWithPage_number:0 page_size:1000 success:succ failure:fail];
}
[[ICRHTTPController sharedController] getWarehouseWithStartDate:startDate Page_number:self.currentPage page_size:100 success:succ failure:fail];
}
- (void)getLastDateFromServer:(id)data
{
if (data) {
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
if (pageCount <= self.currentPage) {
[self endRefreshing];
[IBTLoadingView hideHUDWithText:nil];
[self fetchDataList:@"" tableStr:GXF_BASECLASS_WAREHOUSE];
}else{
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
}
}
#pragma mark - 协议方法
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
......
......@@ -20,27 +20,53 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.currentPage = 0;
self.tableStr = GXF_BASECLASS_USER;
self.tableView.header.lastUpdatedTimeKey = ChoosePersonUpdateDate;
self.title = @"选择人员";
[self fetchDataList:@"" tableStr:GXF_BASECLASS_USER];
}
- (void)getBaseDataFromServer{
- (void)getBaseDataFromServerWithStartDate:(NSString *)startDate{
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf endRefreshing];
[strongSelf fetchDataList:@"" tableStr:GXF_BASECLASS_USER];
//请求成功之后
strongSelf.startDate = startDate;
[strongSelf getLastDateFromServer:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
[self endRefreshing];
};
if (self.currentPage == 0) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getUserWithPage_number:0 page_size:1000 success:succ failure:fail];
}
[[ICRHTTPController sharedController] getUserWithStartDate:startDate
Page_number:self.currentPage page_size:100 success:succ failure:fail];
}
- (void)getLastDateFromServer:(id)data
{
if (data) {
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
if (pageCount <= self.currentPage) {
[self endRefreshing];
[IBTLoadingView hideHUDWithText:nil];
[self fetchDataList:@"" tableStr:GXF_BASECLASS_USER];
}else{
self.currentPage++;
[self getBaseDataFromServerWithStartDate:self.startDate];
}
}else{
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
}
}
#pragma mark -成功
- (void)sureClick{
if (self.isMoreChose) {
......
......@@ -14,9 +14,12 @@
@property (nonatomic, assign) BOOL enabled;//是否启用
@property (nonatomic, strong) NSString *create_time; //创建时间
@property (nonatomic, copy) NSString *create_id;//创建人代码
@property (nonatomic, copy) NSString *crete_operName;//创建人名称
@property (nonatomic, strong) NSString *lastModified_time;//最后修改时间
@property (nonatomic, copy) NSString *lastModified_id;//最后修改人代码
@property (nonatomic, copy) NSString *lastModified_operName;//最后修改人名称
@property (nonatomic, copy) NSString *create_operName;//创建人名称
@property (nonatomic, strong) NSString *lastModify_time;//最后修改时间
@property (nonatomic, copy) NSString *lastModify_id;//最后修改人代码
@property (nonatomic, copy) NSString *lastModify_operName;//最后修改人名称
@property (nonatomic, assign) NSInteger priority;//新增字段优先级
@end
......@@ -89,10 +89,10 @@
[[ICRHTTPController sharedController] getProductWithStartDate:@"2014-01-01" Page_number:0 page_size:100 success:succ failure:fail];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"VendorTitle"]]) {
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:100 success:succ failure:fail];
[[ICRHTTPController sharedController] getVendorWithStartDate:@"2014-01-01" Page_number:0 page_size:100 success:succ failure:fail];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"WarehouseTitle"]]) {
[[ICRHTTPController sharedController] getWarehouseWithPage_number:0 page_size:100 success:succ failure:fail];
[[ICRHTTPController sharedController] getWarehouseWithStartDate:@"2014-01-01" Page_number:0 page_size:100 success:succ failure:fail];
} else if ([self.title isEqualToString:[IBTCommon localizableString:@"ProductUnitTitle"]]) {
[[ICRHTTPController sharedController]getProductunitWithPage_number:pageNumber page_size:pageSize success:succ failure:fail];
......
......@@ -78,7 +78,7 @@
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getVendorWithPage_number:0 page_size:100 success:succ failure:fail];
[[ICRHTTPController sharedController] getVendorWithStartDate:@"2014-01-01" Page_number:0 page_size:100 success:succ failure:fail];
}
......
......@@ -78,7 +78,7 @@
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
[[ICRHTTPController sharedController] getWarehouseWithPage_number:0 page_size:100 success:succ failure:fail];
[[ICRHTTPController sharedController] getWarehouseWithStartDate:@"2014-01-01" Page_number:0 page_size:100 success:succ failure:fail];
}
......
......@@ -101,9 +101,9 @@
// self.m_containerView.m_passwordTextF.text = @"aaa";
//@"http://218.244.151.129:7580/cruiser-server/rest"
self.m_containerView.m_cCodeTextF.text = @"211534962";
self.m_containerView.m_userNameTextF.text = @"admin";
self.m_containerView.m_passwordTextF.text = @"thoradmin";
// self.m_containerView.m_cCodeTextF.text = @"211534962";
// self.m_containerView.m_userNameTextF.text = @"admin";
// self.m_containerView.m_passwordTextF.text = @"thoradmin";
//@"http://122.224.171.126:7280/cruiser-server/rest"
......@@ -113,9 +113,9 @@
// self.m_containerView.m_cCodeTextF.text = @"211534968";
// self.m_containerView.m_userNameTextF.text = @"admin";
// self.m_containerView.m_passwordTextF.text = @"thoradmin";
self.m_containerView.m_cCodeTextF.text = @"211534968";
self.m_containerView.m_userNameTextF.text = @"admin";
self.m_containerView.m_passwordTextF.text = @"thoradmin";
[self.m_containerView checkLoginEnable];
#else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment