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

Merge branch 'DEV_20150805_001' of http://121.42.32.57/root/xffruit into DEV_20150805_001

parents c7441546 11b01a25
......@@ -3437,7 +3437,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.xffruit;
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "5747a061-d994-4f1f-8eac-4b028fb34d89";
PROVISIONING_PROFILE = "3a32e5a9-395f-425a-b1b0-c221be8d15d8";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Debug;
......@@ -3462,7 +3462,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomore.xffruit;
PRODUCT_NAME = XFFruit;
PROVISIONING_PROFILE = "5747a061-d994-4f1f-8eac-4b028fb34d89";
PROVISIONING_PROFILE = "3a32e5a9-395f-425a-b1b0-c221be8d15d8";
USER_HEADER_SEARCH_PATHS = "${SRCROOT}/**";
};
name = Release;
......
......@@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.1.0</string>
<string>1.2.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.1.0</string>
<string>1.2.1</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
......
......@@ -26,13 +26,13 @@
//#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: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"
#define HTTP_REST_REPORT_BASE_URL @"http://122.224.171.126:7380"
// HTTP
//#define HTTP_REST_API_BASE_URL @"http://115.28.191.44:8080/IPatrol/rest"
//10月23 122.224.171.126:7280
......
......@@ -35,6 +35,8 @@
+ (NSDate *)convertToDateFrom:(NSString *)dateString;
+ (NSString *)stringFromDate:(NSDate*)aDate;
+ (NSString *)stringFromDateWithFormat:(NSDate*)aDate format:(NSString *)format;
+ (NSDate *)dateFromStringWithFormat:(NSString*)aStr format:(NSString *)format;
+ (NSString*)dictionaryToJson:(id)dic;
+ (NSString *)checkString:(NSString *)str;
+ (NSString *)checkNull: (id)data;
......@@ -48,6 +50,7 @@
+ (UIButton *)buttonWithTitle:(NSString *)title Image:(UIImage *)image frame:(CGRect)frame fontSize:(float)fontSize fontColor:(UIColor *)color;
+ (UIButton *)buttonWithImage:(UIImage *)image frame:(CGRect)frame;
+ (NSString *)getWeekFromDate;
+ (NSString *)getWeekFromDateWithDate: (NSDate *)date;
+ (NSInteger)getWeeks:(NSInteger)year;
+ (NSString*)weekdayStringFromDate:(NSDate*)inputDate;
+(NSString *)countNumAndChangeformat:(NSString *)num;
......
......@@ -192,7 +192,12 @@
NSString *dateString = [formatter stringFromDate:aDate];
return dateString;
}
+ (NSDate *)dateFromStringWithFormat:(NSString*)aStr format:(NSString *)format {
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:format];
NSDate *date = [formatter dateFromString:aStr];
return date;
}
+ (NSString*)dictionaryToJson:(id)dic
{
......@@ -332,6 +337,24 @@
return yearWeek;
}
+ (NSString *)getWeekFromDateWithDate: (NSDate *)date{
NSString *yearWeek = @"";
NSCalendar *greCalendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *dateComponents = [greCalendar components:NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit | NSWeekCalendarUnit | NSWeekdayCalendarUnit | NSWeekOfMonthCalendarUnit | NSWeekOfYearCalendarUnit fromDate:date];
NSString *yearStr = [IBTCommon stringFromDateWithFormat:date format:@"yyyy-MM-dd"];
NSString *year = [yearStr substringToIndex:4];
NSString *month = [yearStr substringWithRange:NSMakeRange(5,2)];
if (dateComponents.weekOfYear == 1 && [month isEqualToString:@"12"]) {
yearWeek = [NSString stringWithFormat:@"%ld-%ld", [year integerValue]+1
,(long)dateComponents.weekOfYear];
}else{
yearWeek = [NSString stringWithFormat:@"%ld-%ld", (long)[year integerValue]
,(long)dateComponents.weekOfYear];
}
return yearWeek;
}
+ (NSInteger)getWeeks:(NSInteger)year{
NSInteger weeks = 0;
NSString *dateStr = [NSString stringWithFormat:@"%ld-12-31 00:00:00",(long)year];
......
......@@ -141,17 +141,27 @@
}
#pragma mark- 请求webView
- (void)loadWebViewFromServer{
ICRUserUtil *userU = [ICRUserUtil sharedInstance];
#warning 测试
NSString *passgerUrl = [NSString stringWithFormat:@"%@/%@?enterprise=%@&dateScopeType=%@&dateScope=%@&orgUuid=%@",HTTP_REST_API_BASE_URL,PassengerWebUrl,[ICRUserUtil sharedInstance].orgId,self.dayType,self.scopeType,self.compass.orgUuid];
NSString *passgerUrl = [NSString stringWithFormat:@"%@/%@?enterprise=%@&dateScopeType=%@&dateScope=%@&orgUuid=%@",HTTP_REST_REPORT_BASE_URL,PassengerWebUrl,userU.orgId,self.dayType,self.compass.dataScope,self.compass.orgUuid];
[self.rpassgerWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:passgerUrl]]];
NSString *priceUrl = [NSString stringWithFormat:@"%@/%@?enterprise=%@&dateScopeType=%@&dateScope=%@&orgUuid=%@",HTTP_REST_API_BASE_URL,PriceWebUrl,[ICRUserUtil sharedInstance].orgId,self.dayType,self.scopeType,self.compass.orgUuid];
// NSString *priceUrl = [NSString stringWithFormat:@"%@/%@?enterprise=%@&dateScopeType=%@&dateScope=%@&orgUuid=%@",HTTP_REST_REPORT_BASE_URL,PriceWebUrl,[ICRUserUtil sharedInstance].orgId,self.dayType,self.scopeType,self.compass.orgUuid];
// [self.rpriceWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:priceUrl]]];
//
// NSString *grossUrl = [NSString stringWithFormat:@"%@/%@?enterprise=%@&dateScopeType=%@&dateScope=%@&orgUuid=%@",HTTP_REST_REPORT_BASE_URL,GrossWebUrl,[ICRUserUtil sharedInstance].orgId,self.dayType,self.scopeType,self.compass.orgUuid];
// [self.rgrossWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:grossUrl]]];
//
// NSString *saleUrl = [NSString stringWithFormat:@"%@/%@?enterprise=%@&dateScopeType=%@&dateScope=%@&orgUuid=%@",HTTP_REST_REPORT_BASE_URL,SaleWebUrl,[ICRUserUtil sharedInstance].orgId,self.dayType,self.scopeType,self.compass.orgUuid];
// [self.rwebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:saleUrl]]];
NSString *priceUrl = [NSString stringWithFormat:@"%@/%@?enterprise=%@&dateScopeType=%@&dateScope=%@&orgUuid=%@",HTTP_REST_REPORT_BASE_URL,PriceWebUrl,userU.orgId,self.dayType,self.compass.dataScope,self.compass.orgUuid];
[self.rpriceWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:priceUrl]]];
NSString *grossUrl = [NSString stringWithFormat:@"%@/%@?enterprise=%@&dateScopeType=%@&dateScope=%@&orgUuid=%@",HTTP_REST_API_BASE_URL,GrossWebUrl,[ICRUserUtil sharedInstance].orgId,self.dayType,self.scopeType,self.compass.orgUuid];
NSString *grossUrl = [NSString stringWithFormat:@"%@/%@?enterprise=%@&dateScopeType=%@&dateScope=%@&orgUuid=%@",HTTP_REST_REPORT_BASE_URL,GrossWebUrl,[ICRUserUtil sharedInstance].orgId,self.dayType,self.compass.dataScope,self.compass.orgUuid];
[self.rgrossWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:grossUrl]]];
NSString *saleUrl = [NSString stringWithFormat:@"%@/%@?enterprise=%@&dateScopeType=%@&dateScope=%@&orgUuid=%@",HTTP_REST_API_BASE_URL,SaleWebUrl,[ICRUserUtil sharedInstance].orgId,self.dayType,self.scopeType,self.compass.orgUuid];
NSString *saleUrl = [NSString stringWithFormat:@"%@/%@?enterprise=%@&dateScopeType=%@&dateScope=%@&orgUuid=%@",HTTP_REST_REPORT_BASE_URL,SaleWebUrl,[ICRUserUtil sharedInstance].orgId,self.dayType,self.compass.dataScope,self.compass.orgUuid];
[self.rwebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:saleUrl]]];
}
......
......@@ -44,7 +44,8 @@
@property (nonatomic,assign)NSInteger storeCount;
@property (nonatomic,strong)NSIndexPath *currentIndex;
@property (nonatomic,strong)NSMutableArray *selectArr;
@property (nonatomic, assign) BOOL isSegOne;
@end
......@@ -67,7 +68,6 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.isSegOne = NO;
//布局
#if 1
self.dataArr = [NSMutableArray array];
......@@ -122,13 +122,13 @@
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
NSString *strDate;
if (self.scopeType) {
strDate = _scopeType;
} else {
strDate = [[NSDate date] localYMDString];
NSDate *date ;
if (!_selectDay) {
self.selectDay = [[NSDate date]localYMDString];
}
[[ICRHTTPController sharedController] getWeekbydayWithStringDate:strDate success:succ failure:fail];
date = [IBTCommon dateFromStringWithFormat:_selectDay format:@"yyyy-MM-dd" ];
[[ICRHTTPController sharedController] getWeekbydayWithStringDate:[date localYMDString] success:succ failure:fail];
}
#pragma mark - 获取上部数据
......@@ -352,30 +352,39 @@
#pragma mark - segViewDelegate
- (void)customSegOneClick:(NSString *)title{
NSDate *date ;
if (!_selectDay) {
self.selectDay = [[NSDate date]localYMDString];
//
}
date = [IBTCommon dateFromStringWithFormat:_selectDay format:@"yyyy-MM-dd" ];
// NSString *strDate = [_selectDay substringToIndex:_selectDay.length - 3];
//日周年切换
NSString *dayType = @"";
if ([title isEqualToString:SaleWeek]) {
dayType = @"week";
self.dayType = dayType;
self.orgScope = nil;
[self getWeekbydayFromServer];
// self.scopeType = [IBTCommon getWeekFromDate];
return;
}
if ([title isEqualToString:SaleDay]) {
dayType = @"day";
self.scopeType = [IBTCommon stringFromDateWithFormat:[NSDate date] format:@"yyyy-MM-dd"];
self.scopeType = _selectDay;//[IBTCommon stringFromDateWithFormat:[NSDate date] format:@"yyyy-MM-dd"];
// }else if ([title isEqualToString:SaleWeek]) {
// dayType = @"week";
// self.scopeType = [IBTCommon getWeekFromDate];
// self.scopeType = [IBTCommon getWeekFromDateWithDate:date];
}else if ([title isEqualToString:SaleMonth]) {
dayType = @"month";
self.scopeType = [IBTCommon stringFromDateWithFormat:[NSDate date] format:@"yyyy-MM"];
// date = [IBTCommon dateFromStringWithFormat:strDate format:@"yyyy-MM" ];
self.scopeType = [IBTCommon stringFromDateWithFormat:date format:@"yyyy-MM"];
} else {
return;
}
CLog(@"-------%@",self.scopeType);
self.dayType = dayType;
self.orgScope = nil;
self.isSegOne = YES;
[self getDataFromServer];
......
......@@ -205,6 +205,8 @@
com.orgUuid = orgs.uuid;
com.orgName = orgs.name;
com.orgCode = orgs.code;
com.dataScope = [[NSDate date] localYMDString];
com.dataScopeType = @"day";
rvc.compass = com;
[self PushViewController:rvc animated:YES];
}
......
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