Commit 816d96de authored by 管鹏飞's avatar 管鹏飞

行情调研增加备注字段 (在调研中的行情调研的创建者不存在的情况下,无法提交行情调研)Sandy

parent 7a5beac0
...@@ -73,6 +73,7 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) { ...@@ -73,6 +73,7 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
XFFHttp_GetProduct, XFFHttp_GetProduct,
XFFHttp_GetUser, XFFHttp_GetUser,
XFFHttp_SurveyFinish, XFFHttp_SurveyFinish,
//行情反馈图片 //行情反馈图片
XFFHttp_ResultChart, XFFHttp_ResultChart,
XFFHttp_GetResults, XFFHttp_GetResults,
...@@ -138,6 +139,9 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) { ...@@ -138,6 +139,9 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
XFFHttp_QueryHomepage, XFFHttp_QueryHomepage,
XFFHttp_QueryLowerOrgs, XFFHttp_QueryLowerOrgs,
//新增行情反馈
XFFHttp_SurveySaveResult,
}; };
static NSString * const ICRHTTPInterface[] = { static NSString * const ICRHTTPInterface[] = {
...@@ -256,6 +260,7 @@ static NSString * const ICRHTTPInterface[] = { ...@@ -256,6 +260,7 @@ static NSString * const ICRHTTPInterface[] = {
[XFFHttp_QueryHomepage] = @"salesdata/query", [XFFHttp_QueryHomepage] = @"salesdata/query",
[XFFHttp_QueryLowerOrgs] = @"organization/queryLowerOrgs", [XFFHttp_QueryLowerOrgs] = @"organization/queryLowerOrgs",
[XFFHttp_SurveySaveResult] = @"survey/save_result",
}; };
...@@ -2058,7 +2063,7 @@ acceptTypeJson:YES ...@@ -2058,7 +2063,7 @@ acceptTypeJson:YES
}; };
NSString *currentTime = [[NSDate date] httpParameterString]; NSString *currentTime = [[NSDate date] httpParameterString];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance]; ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveyFinish] stringByAppendingFormat:@"/?survey_uuid=%@&time=%@&operId=%@&operName=%@",surveyUuid,currentTime,userUtil.userId,userUtil.displayName]; NSString *urlStr = [[[self class] UrlForPluginHTTPAction:XFFHttp_SurveySaveResult] stringByAppendingFormat:@"/?survey_uuid=%@&time=%@&operId=%@&operName=%@",surveyUuid,currentTime,userUtil.userId,userUtil.displayName];
NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *encodeUrlStr = [urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
[self POST:encodeUrlStr [self POST:encodeUrlStr
parameters:dict parameters:dict
......
...@@ -26,4 +26,7 @@ ...@@ -26,4 +26,7 @@
+ (UIImage *)imageWithColor:(UIColor *)color andSize:(CGSize)size; + (UIImage *)imageWithColor:(UIColor *)color andSize:(CGSize)size;
+ (UIImage *)imageWithColor:(UIColor *)color andRect:(CGRect)rect; + (UIImage *)imageWithColor:(UIColor *)color andRect:(CGRect)rect;
- (UIImage *)greyScaleImage; - (UIImage *)greyScaleImage;
- (NSData *)scaledToSpaceMaxSize:(NSInteger)kb;
- (UIImage *)scaledToSize:(CGSize)newSize;
- (UIImage *)scaledToWidth:(NSInteger)newWidth;
@end @end
...@@ -183,4 +183,39 @@ typedef enum { ...@@ -183,4 +183,39 @@ typedef enum {
return resultUIImage; return resultUIImage;
} }
- (NSData *)scaledToSpaceMaxSize:(NSInteger)kb {
//压缩到100kb以内
CGFloat compression = 0.5f;
CGFloat maxCompression = 0.1f;
NSUInteger maxlength = kb * 100;
NSData *imgData = UIImageJPEGRepresentation(self, compression);
CLog(@"处理之前的大小--->%lukB",(unsigned long)imgData.length/1024);
while ([imgData length] > maxlength && compression > maxCompression) {
compression -= 0.1;
imgData = UIImageJPEGRepresentation(self, compression);
}
CLog(@"处理之后的大小--->%lukB",(unsigned long)imgData.length/1024);
return imgData;
}
- (UIImage *)scaledToSize:(CGSize)newSize {
UIGraphicsBeginImageContextWithOptions(newSize, YES, 0);
[self drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return scaledImage;
}
- (UIImage *)scaledToWidth:(NSInteger)newWidth {
CGSize newSize = CGSizeMake(newWidth, newWidth / self.size.width * self.size.height);
UIGraphicsBeginImageContextWithOptions(newSize, YES, 0);
[self drawInRect:CGRectMake(0, 0, newSize.width, newSize.height)];
UIImage *scaledImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return scaledImage;
}
@end @end
...@@ -23,10 +23,10 @@ ...@@ -23,10 +23,10 @@
#define ICR_IMAGE_BG_COLOR [UIColor colorWithW:242 a:1] #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:7280/cruiser-server/rest"
//********现场正式环境********* //********现场正式环境*********
......
...@@ -239,7 +239,7 @@ static HGPhWViewController *_instance = nil; ...@@ -239,7 +239,7 @@ static HGPhWViewController *_instance = nil;
// [self.allImgsMuArr addObject:imgData]; // [self.allImgsMuArr addObject:imgData];
[[JavenImages shareInstance] insertAImage:img]; [[JavenImages shareInstance] insertAImage:[img scaledToWidth:600]];
[self scrollViewContentHeight]; [self scrollViewContentHeight];
[picker DismissModalViewControllerAnimated:YES]; [picker DismissModalViewControllerAnimated:YES];
} }
...@@ -268,7 +268,7 @@ static HGPhWViewController *_instance = nil; ...@@ -268,7 +268,7 @@ static HGPhWViewController *_instance = nil;
CGImageRef ref = [[asset defaultRepresentation]fullResolutionImage]; CGImageRef ref = [[asset defaultRepresentation]fullResolutionImage];
UIImage *img = [[UIImage alloc]initWithCGImage:ref]; UIImage *img = [[UIImage alloc]initWithCGImage:ref];
[self.imgesMuArr addObject: img];//[UIImage imageNamed:@"AttachCamera"] [self.imgesMuArr addObject: [img scaledToWidth:600]];//[UIImage imageNamed:@"AttachCamera"]
} }
[[JavenImages shareInstance] insertImages:_imgesMuArr]; [[JavenImages shareInstance] insertImages:_imgesMuArr];
......
...@@ -9,8 +9,7 @@ ...@@ -9,8 +9,7 @@
// //
#import "ICRBaseViewController.h" #import "ICRBaseViewController.h"
#import "Survey.h"
@class Survey;
@interface WriteFeedbackViewController : ICRBaseViewController @interface WriteFeedbackViewController : ICRBaseViewController
@property (nonatomic,strong)Survey *survey; @property (nonatomic,strong)Survey *survey;
@property (nonatomic,strong)NSString *surveyUuid; @property (nonatomic,strong)NSString *surveyUuid;
......
...@@ -42,7 +42,8 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){ ...@@ -42,7 +42,8 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
kfeedbackCellPlace = 0, kfeedbackCellPlace = 0,
kfeedbackCellPrice, kfeedbackCellPrice,
kfeedbackCellCapacity, kfeedbackCellCapacity,
kfeedbackCellQulity kfeedbackCellQulity,
kfeedbackCellRemark
}; };
@end @end
...@@ -101,11 +102,12 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){ ...@@ -101,11 +102,12 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
self.surveyResult = [[SurveyResult alloc]init]; self.surveyResult = [[SurveyResult alloc]init];
self.surveyResult.unit = @"南汇8424西瓜调研情况"; self.surveyResult.unit = @"南汇8424西瓜调研情况";
self.surveyResult.place = @"150605000001"; self.surveyResult.place = @"150605000001";
self.surveyResult.price = @"南汇842[100213]"; self.surveyResult.price = @"26";
self.surveyResult.capacity = @"22222222222"; self.surveyResult.capacity = @"22222222222";
self.surveyResult.quality = @"费卡接口"; self.surveyResult.quality = @"费卡接口";
self.surveyResult.userName = @"张三"; self.surveyResult.userName = @"张三";
self.surveyResult.feedbackTime = @"2015-04-05 12:04:06"; self.surveyResult.feedbackTime = @"2015-04-05 12:04:06";
self.surveyResult.reMark = @"今天工作人员效率很高";
...@@ -259,7 +261,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){ ...@@ -259,7 +261,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
tip:nil tip:nil
autoCorrect:NO autoCorrect:NO
focus:NO focus:NO
text:nil]; text:_surveyResult.reMark];
[cellInfo addUserInfoValue:titleColor forKey:CInfoTitleColorKey]; [cellInfo addUserInfoValue:titleColor forKey:CInfoTitleColorKey];
cellInfo.fCellHeight = fCellHeight; cellInfo.fCellHeight = fCellHeight;
[secInfo addCell:cellInfo]; [secInfo addCell:cellInfo];
...@@ -336,7 +338,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){ ...@@ -336,7 +338,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
// NSData *imgData = UIImagePNGRepresentation(img); // NSData *imgData = UIImagePNGRepresentation(img);
// [self savePhotoToDB:imgData]; // [self savePhotoToDB:imgData];
[[JavenImages shareInstance] insertAImage:img]; [[JavenImages shareInstance] insertAImage:[img scaledToWidth:600]];
[self pushToHGphVC]; [self pushToHGphVC];
} }
...@@ -373,7 +375,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){ ...@@ -373,7 +375,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
CGImageRef ref = [[asset defaultRepresentation]fullResolutionImage]; CGImageRef ref = [[asset defaultRepresentation]fullResolutionImage];
UIImage *img = [[UIImage alloc]initWithCGImage:ref]; UIImage *img = [[UIImage alloc]initWithCGImage:ref];
[self.imgesMuArr addObject: img];//[UIImage imageNamed:@"AttachCamera"] [self.imgesMuArr addObject: [img scaledToWidth:600]];//[UIImage imageNamed:@"AttachCamera"]
} }
[[JavenImages shareInstance] insertImages:self.imgesMuArr]; [[JavenImages shareInstance] insertImages:self.imgesMuArr];
...@@ -420,7 +422,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){ ...@@ -420,7 +422,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
NSDictionary *paramDict = @{@"result":[self getSurveyResult],@"attachments":[self getAttachmentArray]}; NSDictionary *paramDict = @{@"result":[self getSurveyResult],@"attachments":[self getAttachmentArray]};
[[ICRHTTPController sharedController] surveySaveResultWithDict:paramDict surveyUuid:_surveyUuid success:^(id succ) { [[ICRHTTPController sharedController] surveySaveResultWithDict:paramDict surveyUuid:_aSurvey.uuid success:^(id succ) {
[IBTLoadingView hideHUDWithText:nil]; [IBTLoadingView hideHUDWithText:nil];
...@@ -453,10 +455,9 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){ ...@@ -453,10 +455,9 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
} else { } else {
for (int count = 0; count < [JavenImages shareInstance].imageArr.count; count ++) { for (int count = 0; count < [JavenImages shareInstance].imageArr.count; count ++) {
UIImage *image = [JavenImages shareInstance].imageArr[count]; UIImage *image = [JavenImages shareInstance].imageArr[count];
NSData *data = [image scaledToSpaceMaxSize:100];
NSData *data = UIImageJPEGRepresentation(image, 1); NSString *enCodeImageStr = [data base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
NSString *fileName = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding]; NSMutableDictionary *phontoMuDict = [NSMutableDictionary dictionaryWithObjects:@[@"",enCodeImageStr ] forKeys:@[@"fileName",@"content"]];
NSMutableDictionary *phontoMuDict = [NSMutableDictionary dictionaryWithObjects:@[@"",data ] forKeys:@[@"fileName",@"content"]];
[attachArr addObject:phontoMuDict]; [attachArr addObject:phontoMuDict];
} }
...@@ -468,14 +469,16 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){ ...@@ -468,14 +469,16 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
- (NSDictionary *)getSurveyResult{ - (NSDictionary *)getSurveyResult{
ICRUserUtil *userU = [ICRUserUtil sharedInstance]; ICRUserUtil *userU = [ICRUserUtil sharedInstance];
NSString *priceStr = [self getTextFieldTextWithRow:kfeedbackCellPrice];
NSDictionary *dict = @{@"userUuid":userU.userId, NSDictionary *dict = @{@"userUuid":userU.userId,
@"userCode":userU.userCode, @"userCode":userU.userCode,
@"userName":userU.userName, @"userName":userU.userName,
@"unit":@"", @"unit":@"",
@"price":[self getTextFieldTextWithRow:kfeedbackCellPrice], @"price":priceStr,
@"place":[self getTextFieldTextWithRow:kfeedbackCellPlace ], @"place":[self getTextFieldTextWithRow:kfeedbackCellPlace ],
@"capacity":[self getTextFieldTextWithRow:kfeedbackCellCapacity], @"capacity":[self getTextFieldTextWithRow:kfeedbackCellCapacity],
@"quality":[self getTextFieldTextWithRow:kfeedbackCellQulity ]}; @"quality":[self getTextFieldTextWithRow:kfeedbackCellQulity],
@"remark":[self getTextFieldTextWithRow:kfeedbackCellRemark]};
return dict; return dict;
} }
......
...@@ -20,5 +20,6 @@ ...@@ -20,5 +20,6 @@
@property (nonatomic,strong)NSString *quality;//质量情况 @property (nonatomic,strong)NSString *quality;//质量情况
@property (nonatomic,strong)NSString *feedbackTime;//反馈时间 @property (nonatomic,strong)NSString *feedbackTime;//反馈时间
@property (nonatomic,strong)NSArray *attachmnets;//附件列表 @property (nonatomic,strong)NSArray *attachmnets;//附件列表
@property (nonatomic, strong) NSString *reMark;//备注
@property (nonatomic,strong)NSData *imageData; @property (nonatomic,strong)NSData *imageData;
@end @end
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