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

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

parent 7a5beac0
No related merge requests found
......@@ -73,6 +73,7 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
XFFHttp_GetProduct,
XFFHttp_GetUser,
XFFHttp_SurveyFinish,
//行情反馈图片
XFFHttp_ResultChart,
XFFHttp_GetResults,
......@@ -138,6 +139,9 @@ typedef NS_ENUM(NSUInteger, ICRHTTPAction) {
XFFHttp_QueryHomepage,
XFFHttp_QueryLowerOrgs,
//新增行情反馈
XFFHttp_SurveySaveResult,
};
static NSString * const ICRHTTPInterface[] = {
......@@ -256,6 +260,7 @@ static NSString * const ICRHTTPInterface[] = {
[XFFHttp_QueryHomepage] = @"salesdata/query",
[XFFHttp_QueryLowerOrgs] = @"organization/queryLowerOrgs",
[XFFHttp_SurveySaveResult] = @"survey/save_result",
};
......@@ -2058,7 +2063,7 @@ acceptTypeJson:YES
};
NSString *currentTime = [[NSDate date] httpParameterString];
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];
[self POST:encodeUrlStr
parameters:dict
......
......@@ -26,4 +26,7 @@
+ (UIImage *)imageWithColor:(UIColor *)color andSize:(CGSize)size;
+ (UIImage *)imageWithColor:(UIColor *)color andRect:(CGRect)rect;
- (UIImage *)greyScaleImage;
- (NSData *)scaledToSpaceMaxSize:(NSInteger)kb;
- (UIImage *)scaledToSize:(CGSize)newSize;
- (UIImage *)scaledToWidth:(NSInteger)newWidth;
@end
......@@ -183,4 +183,39 @@ typedef enum {
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
......@@ -23,10 +23,10 @@
#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;
// [self.allImgsMuArr addObject:imgData];
[[JavenImages shareInstance] insertAImage:img];
[[JavenImages shareInstance] insertAImage:[img scaledToWidth:600]];
[self scrollViewContentHeight];
[picker DismissModalViewControllerAnimated:YES];
}
......@@ -268,7 +268,7 @@ static HGPhWViewController *_instance = nil;
CGImageRef ref = [[asset defaultRepresentation]fullResolutionImage];
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];
......
......@@ -9,8 +9,7 @@
//
#import "ICRBaseViewController.h"
@class Survey;
#import "Survey.h"
@interface WriteFeedbackViewController : ICRBaseViewController
@property (nonatomic,strong)Survey *survey;
@property (nonatomic,strong)NSString *surveyUuid;
......
......@@ -42,7 +42,8 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
kfeedbackCellPlace = 0,
kfeedbackCellPrice,
kfeedbackCellCapacity,
kfeedbackCellQulity
kfeedbackCellQulity,
kfeedbackCellRemark
};
@end
......@@ -101,11 +102,12 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
self.surveyResult = [[SurveyResult alloc]init];
self.surveyResult.unit = @"南汇8424西瓜调研情况";
self.surveyResult.place = @"150605000001";
self.surveyResult.price = @"南汇842[100213]";
self.surveyResult.price = @"26";
self.surveyResult.capacity = @"22222222222";
self.surveyResult.quality = @"费卡接口";
self.surveyResult.userName = @"张三";
self.surveyResult.feedbackTime = @"2015-04-05 12:04:06";
self.surveyResult.reMark = @"今天工作人员效率很高";
......@@ -259,7 +261,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
tip:nil
autoCorrect:NO
focus:NO
text:nil];
text:_surveyResult.reMark];
[cellInfo addUserInfoValue:titleColor forKey:CInfoTitleColorKey];
cellInfo.fCellHeight = fCellHeight;
[secInfo addCell:cellInfo];
......@@ -336,7 +338,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
// NSData *imgData = UIImagePNGRepresentation(img);
// [self savePhotoToDB:imgData];
[[JavenImages shareInstance] insertAImage:img];
[[JavenImages shareInstance] insertAImage:[img scaledToWidth:600]];
[self pushToHGphVC];
}
......@@ -373,7 +375,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
CGImageRef ref = [[asset defaultRepresentation]fullResolutionImage];
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];
......@@ -420,7 +422,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
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];
......@@ -453,10 +455,9 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
} else {
for (int count = 0; count < [JavenImages shareInstance].imageArr.count; count ++) {
UIImage *image = [JavenImages shareInstance].imageArr[count];
NSData *data = UIImageJPEGRepresentation(image, 1);
NSString *fileName = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
NSMutableDictionary *phontoMuDict = [NSMutableDictionary dictionaryWithObjects:@[@"",data ] forKeys:@[@"fileName",@"content"]];
NSData *data = [image scaledToSpaceMaxSize:100];
NSString *enCodeImageStr = [data base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
NSMutableDictionary *phontoMuDict = [NSMutableDictionary dictionaryWithObjects:@[@"",enCodeImageStr ] forKeys:@[@"fileName",@"content"]];
[attachArr addObject:phontoMuDict];
}
......@@ -468,14 +469,16 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
- (NSDictionary *)getSurveyResult{
ICRUserUtil *userU = [ICRUserUtil sharedInstance];
NSString *priceStr = [self getTextFieldTextWithRow:kfeedbackCellPrice];
NSDictionary *dict = @{@"userUuid":userU.userId,
@"userCode":userU.userCode,
@"userName":userU.userName,
@"unit":@"",
@"price":[self getTextFieldTextWithRow:kfeedbackCellPrice],
@"price":priceStr,
@"place":[self getTextFieldTextWithRow:kfeedbackCellPlace ],
@"capacity":[self getTextFieldTextWithRow:kfeedbackCellCapacity],
@"quality":[self getTextFieldTextWithRow:kfeedbackCellQulity ]};
@"quality":[self getTextFieldTextWithRow:kfeedbackCellQulity],
@"remark":[self getTextFieldTextWithRow:kfeedbackCellRemark]};
return dict;
}
......
......@@ -20,5 +20,6 @@
@property (nonatomic,strong)NSString *quality;//质量情况
@property (nonatomic,strong)NSString *feedbackTime;//反馈时间
@property (nonatomic,strong)NSArray *attachmnets;//附件列表
@property (nonatomic, strong) NSString *reMark;//备注
@property (nonatomic,strong)NSData *imageData;
@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