Commit f8c36318 authored by freecui's avatar freecui

企业版本的app更新

parent f3261261
......@@ -32,10 +32,65 @@
[self setupBMKMapMgr];
_m_appViewControllerMgr = [ICRAppViewControllerManager getAppViewControllerManager];
#pragma 版本更新
[self enterpriseUpdate];
[self.window makeKeyAndVisible];
return YES;
}
#pragma mark enterprise alertView 企业版提示
- (void)enterpriseUpdate{
NSString *currentVersion = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
NSComparisonResult comResult = [self p_compareVersions: currentVersion betweenVersion2:@"后台返回的app版本"];//_versionModel.ClientVersion];
if (comResult == NSOrderedAscending) {
//299企业版的更新 @"有新的版本可供下载"
UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"新版本" message: @"" delegate:self cancelButtonTitle:@"下次再说"otherButtonTitles: @"去下载", nil];//_versionModel.UpgradeRemark
// alertV.tag = alertVEnterprise;
// [alertV show];
}else{
[IBTLoadingView showProgressLabel:@"暂无新版本"];
}
}
- (void) alertView:(UIAlertView *)alertView
clickedButtonAtIndex:(NSInteger)buttonIndex {
if (buttonIndex == 1) {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"app下载的url"]];
}
}
//比较版本号
- (NSComparisonResult)p_compareVersions: (NSString *)version1 betweenVersion2: (NSString *)version2{
NSComparisonResult result = NSOrderedSame;
if ([version2 isEqualToString:@""]) {
result = NSOrderedDescending;
return result ;
}
NSMutableArray *a = (NSMutableArray *)[version1 componentsSeparatedByString:@"."];
NSMutableArray *b = (NSMutableArray *)[version2 componentsSeparatedByString:@"."];
while (a.count < b.count) {[ a addObject:@"0"];}
while (b.count < a.count) {[ b addObject:@"0"];}
for(int i = 0; i < a.count; ++i){
if ([[a objectAtIndex:i] integerValue] < [[b objectAtIndex:i] integerValue]) {
result = NSOrderedAscending;
break;
}else if ([[b objectAtIndex:i] integerValue] < [[a objectAtIndex:i] integerValue]){
result = NSOrderedDescending;
break;
}
}
return result;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
......
......@@ -252,7 +252,14 @@ typedef NS_ENUM(NSUInteger, ICRAttachmentType) {
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//7.4 7.4 结束加工单(写)
- (void)finishProcessWithAuthenticode:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//7.5 作废加工单
- (void)abortProcessWithAuthenticode:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail;
//1·保存采购通知单
- (void)savePurchaseNoticeWithData:(id)data
success:(void (^)(id))succ
......
......@@ -86,6 +86,9 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
//加工单
XFFHttp_QueryProcess,
XFFHttp_GetProcess,
XFFHttp_SaveProcess,
XFFHttp_FinishProcess,
XFFHttp_AbortProcess,
//采购通知单
XFFHttp_savePurchaseNotice,
XFFHttp_getPurchaseNoticeList,
......@@ -169,6 +172,9 @@ static NSString * const ICRHTTPInterface[] = {
//加工单
[XFFHttp_QueryProcess ] = @"process/query",
[XFFHttp_GetProcess ] = @"process/get",
[XFFHttp_SaveProcess] = @"process/save",
[XFFHttp_FinishProcess] = @"process/finish",
[XFFHttp_AbortProcess] = @"process/abort",
//采购通知单
[XFFHttp_savePurchaseNotice] = @"purchase/notice/save",
[XFFHttp_getPurchaseNoticeList] = @"purchase/notice/query",
......@@ -1766,6 +1772,44 @@ acceptTypeJson:YES
}
//加工单
- (void)p_postFunctionWithAction: (NSUInteger)http_action
authenticode: (id)data
success: (void(^)(id))succ
failure: (void(^)(id))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 *dict = data;
NSString *currentTime = [[NSDate date] httpParameterString];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:http_action] stringByAppendingFormat:@"?time=%@&operId=%@&operName=%@",currentTime,userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:dict
needToken:NO
acceptTypeJson:YES
success:success
failure:failure];
}
//7.1 保存加工单(写)
- (void)saveProcessWithAuthenticode:(id)data success:(void (^)(id))succ failure:(void (^)(id))fail
{
......@@ -1791,7 +1835,7 @@ acceptTypeJson:YES
NSDictionary *dict = data;
NSString *currentTime = [[NSDate date] httpParameterString];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveySave] stringByAppendingFormat:@"?time=%@&operId=%@&operName=%@",currentTime,userUtil.userCode,userUtil.displayName];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SaveProcess] stringByAppendingFormat:@"?time=%@&operId=%@&operName=%@",currentTime,userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr
parameters:dict
......@@ -1821,14 +1865,9 @@ acceptTypeJson:YES
NSDictionary *dict = data;
NSString *urlStr = [[self class] UrlForPluginHTTPAction:XFFHttp_QueryProcess ];
[self POST:urlStr parameters:dict needToken:NO acceptTypeJson:YES success:success failure:failure];
// [self GET:urlStr
// parameters:dict
// needToken:NO
//acceptTypeJson:YES
// success:success
// failure:failure];
}
//7.3 加工单明细(读) [已实现]
}
//7.3 加工单明细(读)
- (void)getResultWithProcessUuid:(NSString *)processUuid
success:(void (^)(id))succ
failure:(void (^)(id))fail {
......@@ -1867,7 +1906,18 @@ acceptTypeJson:YES
}
//7.4 7.4 结束加工单(写)
- (void)finishProcessWithAuthenticode:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail {
[self p_postFunctionWithAction:XFFHttp_FinishProcess authenticode:data success:succ failure:fail];
}
//7.5 作废加工单
- (void)abortProcessWithAuthenticode:(id)data
success:(void (^)(id))succ
failure:(void (^)(id))fail {
}
//添加采购单
- (void)savePurchaseWithData:(id)data
......
......@@ -445,7 +445,10 @@
value = [value httpParameterString];
}
if (value) {
// if (value) {
if (!value) {
value = [NSNull null];
}
if ([arrCustomKeys containsObject:key] ||
[arrLocalKeys containsObject:key]) {
continue;
......@@ -455,7 +458,7 @@
[mDict addEntriesFromDictionary:@{key: value}];
}
}
}
// }
free(properties);
return mDict;
......
......@@ -424,6 +424,8 @@ typedef enum : NSUInteger {
if([bill.state isEqualToString:PROCESS_STATE_PROCESSINF]){
GXFNewProcessViewController *newProcessVC = [[GXFNewProcessViewController alloc]initWithProcessUuid:bill.uuid];
[self PushViewController:newProcessVC animated:YES];
} else {
GXFSeeProcessViewController *seeProcessVC = [[GXFSeeProcessViewController alloc]initWithProcessUuid:bill.uuid];
......
......@@ -10,5 +10,5 @@
@interface GXFNewProcessViewController : UIViewController
- (instancetype)initWithProcessUuid: (NSString *)processUuid;
@end
......@@ -168,6 +168,7 @@
_d_processProduct.productUuid = product.uuid;
_d_processProduct.productCode = product.code;
_d_processProduct.productName = product.name;
_d_processProduct.qpcStr = @"";//product.qpcStr;
}
};
[self PushViewController:vc animated:YES];
......@@ -250,7 +251,7 @@
// self.d_processProduct.productName = textField.text;
break;
case 2:
self.d_processProduct.unit = textField.text;
self.d_processProduct.unit = @"筐";//textField.text;
break;
case 3:
self.d_processProduct.qpc = [NSNumber numberWithFloat:[textField.text floatValue]];
......@@ -280,7 +281,7 @@
- (void)bottomViewRightButtonClicked:(UIButton *)rightBtn {
self.d_hasSaved = YES;
[self.c_bottomV.f_rightBtn setBackgroundColor:GXF_GRAY_COLOR];
self.d_processProduct.unit = @"筐";
if (_d_isEdited) {
[[NSNotificationCenter defaultCenter] postNotificationName:KNOTIFICATION_editProduct object:_d_processProduct];
} 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