Commit 1a7de5da authored by 陈俊俊's avatar 陈俊俊

no message

parent cca20747
...@@ -1317,7 +1317,7 @@ acceptTypeJson:YES ...@@ -1317,7 +1317,7 @@ acceptTypeJson:YES
NSDictionary *dict = data; NSDictionary *dict = data;
NSString *currentTime = [[NSDate date] httpParameterString]; NSString *currentTime = [[NSDate date] httpParameterString];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance]; ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveySave] stringByAppendingFormat:@"?time=%@&operator.id=%@&operator.operName=%@&enterprise=%@",currentTime,userUtil.userCode,userUtil.displayName,userUtil.orgId]; NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveySave] stringByAppendingFormat:@"?time=%@&operId=%@&operName=%@",currentTime,userUtil.userCode,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr [self POST:encodeUrlStr
parameters:dict parameters:dict
...@@ -1439,7 +1439,6 @@ acceptTypeJson:YES ...@@ -1439,7 +1439,6 @@ acceptTypeJson:YES
fail( error ); fail( error );
} }
}; };
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetUser] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", [[NSDate date] httpParameterString],@(page_number),@(page_size)]; NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_GetUser] stringByAppendingFormat:@"?start_date=%@&page_number=%@&page_size=%@", [[NSDate date] httpParameterString],@(page_number),@(page_size)];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr [self POST:encodeUrlStr
......
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x",
"filename" : "select_arrow_up_text.png"
},
{
"idiom" : "universal",
"scale" : "2x",
"filename" : "select_arrow_up_text@2x.png"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -12,4 +12,8 @@ ...@@ -12,4 +12,8 @@
//非标准单例 //非标准单例
+ (DataManager *)sharedDatabaseManager; + (DataManager *)sharedDatabaseManager;
- (void)createDB; - (void)createDB;
- (void)insertDataFromModel:(id)model;
- (void)deleteDataFromProduct;
- (void)insertDataFromUser:(id)model;
- (void)deleteDataFromUser;
@end @end
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "DataManager.h" #import "DataManager.h"
#import "FMDatabase.h" #import "FMDatabase.h"
#import "Product.h"
@implementation DataManager @implementation DataManager
{ {
FMDatabase *_database; FMDatabase *_database;
...@@ -54,7 +55,8 @@ ...@@ -54,7 +55,8 @@
return chatDBPath; return chatDBPath;
} }
- (void)creatTable{ - (void)creatTable{
NSArray *arr = @[@"CREATE TABLE IF NOT EXISTS kitchen(serial integer PRIMARY KEY AUTOINCREMENT,foreign_id Varchar(1024),type Varchar(1024),title Varchar(1024),create_time Varchar(1024),name Varchar(1024),image Varchar(1024))",@"CREATE TABLE IF NOT EXISTS menu(serial integer PRIMARY KEY AUTOINCREMENT,id Varchar(1024),sUrl Varchar(1024),title Varchar(1024),works Varchar(1024),favourite Varchar(1024),view Varchar(1024),url Varchar(1024))",@"CREATE TABLE IF NOT EXISTS fresh(serial integer PRIMARY KEY AUTOINCREMENT,id Varchar(1024),title Varchar(1024),url Varchar(1024),time Varchar(1024),desp Varchar(1024))"]; NSArray *arr = @[@"CREATE TABLE IF NOT EXISTS product(serial integer PRIMARY KEY AUTOINCREMENT,uuid Varchar(1024),code Varchar(1024),secondCode Varchar(1024),name Varchar(1024),qpc Varchar(1024),qpcStr Varchar(1024),measureUnit Varchar(1024),brandName Varchar(1024),manufactory Varchar(1024),isNew Varchar(1024),categoryUuid Varchar(1024),image Varchar(1024),create_time Varchar(1024),create_id Varchar(1024),create_operName Varchar(1024),lastModify_time Varchar(1024),lastModify_id Varchar(1024),lastModify_operName Varchar(1024),enabled Varchar(1024),barcode Varchar(1024),enterprise Varchar(1024),remark Varchar(1024),specification Varchar(1024),version Varchar(1024))",
@"CREATE TABLE IF NOT EXISTS user(serial integer PRIMARY KEY AUTOINCREMENT,uuid Varchar(1024),version Varchar(1024),create_time Varchar(1024),create_id Varchar(1024),create_operName Varchar(1024),lastModify_time Varchar(1024),lastModify_id Varchar(1024),lastModify_operName Varchar(1024),company Varchar(1024),login Varchar(1024),password Varchar(1024),mobile Varchar(1024),email Varchar(1024),enabled Varchar(1024),position Varchar(1024),address Varchar(1024),belongOrg Varchar(1024),remark Varchar(1024))",@"CREATE TABLE IF NOT EXISTS fresh(serial integer PRIMARY KEY AUTOINCREMENT,id Varchar(1024),title Varchar(1024),url Varchar(1024),time Varchar(1024),desp Varchar(1024))"];
//遍历数组创建表 //遍历数组创建表
for (NSString *sql in arr) { for (NSString *sql in arr) {
BOOL isSeccess = [_database executeUpdate:sql]; BOOL isSeccess = [_database executeUpdate:sql];
...@@ -63,5 +65,44 @@ ...@@ -63,5 +65,44 @@
} }
} }
} }
- (void)insertDataFromModel:(id)model{
Product *product = (Product *)model;
NSString *sql = @"insert into product (uuid,code,secondCode,name,qpc,qpcStr,measureUnit,brandName,manufactory,isNew,categoryUuid,image,create_time,create_id,create_operName,lastModify_time,lastModify_id,lastModify_operName,enabled,barcode,enterprise,remark,specification,version) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
//?对应的是对象地址类型
BOOL isSuccess = [_database executeUpdate:sql,product.uuid,product.code,product.secondCode,product.name,product.qpc,product.qpcStr,product.measureUnit,product.brandName,product.manufactory,product.isNew,product.categoryUuid,product.image,product.create_time,product.create_id,product.create_operName,product.lastModify_time,product.lastModify_id,product.lastModify_operName,product.enabled,product.barcode,product.enterprise,product.remark,product.specification,product.version];
if (!isSuccess) {
NSLog(@"insert error:%@",[_database lastErrorMessage]);
}
}
- (void)deleteDataFromProduct{
NSString *deleteSql = @"delete from product";
BOOL isSuccess = [_database executeUpdate:deleteSql];
if (!isSuccess) {
NSLog(@"delete Error:%@",[_database lastErrorMessage]);
}
}
- (void)insertDataFromUser:(id)model{
Product *product = (Product *)model;
NSString *sql = @"insert into product (uuid,code,secondCode,name,qpc,qpcStr,measureUnit,brandName,manufactory,isNew,categoryUuid,image,create_time,create_id,create_operName,lastModify_time,lastModify_id,lastModify_operName,enabled,barcode,enterprise,remark,specification,version) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
//?对应的是对象地址类型
BOOL isSuccess = [_database executeUpdate:sql,product.uuid,product.code,product.secondCode,product.name,product.qpc,product.qpcStr,product.measureUnit,product.brandName,product.manufactory,product.isNew,product.categoryUuid,product.image,product.create_time,product.create_id,product.create_operName,product.lastModify_time,product.lastModify_id,product.lastModify_operName,product.enabled,product.barcode,product.enterprise,product.remark,product.specification,product.version];
if (!isSuccess) {
NSLog(@"insert error:%@",[_database lastErrorMessage]);
}
}
- (void)deleteDataFromUser{
NSString *deleteSql = @"delete from product";
BOOL isSuccess = [_database executeUpdate:deleteSql];
if (!isSuccess) {
NSLog(@"delete Error:%@",[_database lastErrorMessage]);
}
}
@end @end
...@@ -148,7 +148,7 @@ typedef enum : NSUInteger { ...@@ -148,7 +148,7 @@ typedef enum : NSUInteger {
[IBTLoadingView hideHUDWithText:nil]; [IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data]; [IBTLoadingView showTips:data];
}; };
NSDictionary *dict = @{@"uuid":@"",@"billnumber":@"",@"title":self.surveyTitle,@"productUuid":self.productUuid,@"productCode":self.productCode,@"productName":self.productName,@"beginDate":self.beginDate,@"endDate":self.endDate,@"remark":self.remark,@"users":self.users}; NSDictionary *dict = @{@"billnumber":@"",@"title":self.surveyTitle,@"productUuid":self.productUuid,@"productCode":self.productCode,@"productName":self.productName,@"beginDate":self.beginDate,@"endDate":self.endDate,@"remark":self.remark,@"users":self.users};
[IBTLoadingView showProgressLabel:@"正在保存..."]; [IBTLoadingView showProgressLabel:@"正在保存..."];
[[ICRHTTPController sharedController] saveSurveyWithAuthenticode:dict success:succ failure:fail]; [[ICRHTTPController sharedController] saveSurveyWithAuthenticode:dict success:succ failure:fail];
......
...@@ -123,6 +123,7 @@ typedef enum : NSUInteger { ...@@ -123,6 +123,7 @@ typedef enum : NSUInteger {
#pragma mark -按钮事件 #pragma mark -按钮事件
- (void)sortClick:(UIButton *)btn{ - (void)sortClick:(UIButton *)btn{
_maskView.backgroundColor = RGBA(0, 0, 0, 0.5);
_maskView.hidden = NO; _maskView.hidden = NO;
if (btn.tag == SortTag) { if (btn.tag == SortTag) {
if(_boltView){ if(_boltView){
...@@ -134,7 +135,7 @@ typedef enum : NSUInteger { ...@@ -134,7 +135,7 @@ typedef enum : NSUInteger {
currentBtn = nil; currentBtn = nil;
self.navigationItem.rightBarButtonItem = nil; self.navigationItem.rightBarButtonItem = nil;
}else{ }else{
[btn setImage:[UIImage imageNamed:@"select_arrow_up"] forState:UIControlStateNormal]; [btn setImage:[UIImage imageNamed:@"select_arrow_up_text"] forState:UIControlStateNormal];
if (_sortView == nil) { if (_sortView == nil) {
_sortView = [[SortMaskView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 105)]; _sortView = [[SortMaskView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 105)];
_sortView.dataArr = [[NSMutableArray alloc]initWithObjects:@"默认排序",@"默认排序",@"默认排序" ,nil]; _sortView.dataArr = [[NSMutableArray alloc]initWithObjects:@"默认排序",@"默认排序",@"默认排序" ,nil];
...@@ -190,6 +191,7 @@ typedef enum : NSUInteger { ...@@ -190,6 +191,7 @@ typedef enum : NSUInteger {
CGRect sortFrame = _sortView.frame; CGRect sortFrame = _sortView.frame;
sortFrame.origin.y = -105; sortFrame.origin.y = -105;
_sortView.frame = sortFrame; _sortView.frame = sortFrame;
_maskView.backgroundColor = RGBA(0, 0, 0, 0);
}completion:^(BOOL finished) { }completion:^(BOOL finished) {
[_sortView removeFromSuperview]; [_sortView removeFromSuperview];
_sortView = nil; _sortView = nil;
...@@ -207,6 +209,7 @@ typedef enum : NSUInteger { ...@@ -207,6 +209,7 @@ typedef enum : NSUInteger {
CGRect sortFrame = _boltView.frame; CGRect sortFrame = _boltView.frame;
sortFrame.origin.y = -105; sortFrame.origin.y = -105;
_boltView.frame = sortFrame; _boltView.frame = sortFrame;
_maskView.backgroundColor = RGBA(0, 0, 0, 0);
}completion:^(BOOL finished) { }completion:^(BOOL finished) {
[_boltView removeFromSuperview]; [_boltView removeFromSuperview];
_boltView = nil; _boltView = nil;
......
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