| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- //
- // Log.m
- // IBOSS
- //
- // Created by guan hong hou on 15/10/30.
- // Copyright © 2015年 elongtian. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- #import "Log.h"
- #import "ImageModel.h"
- #import "ReplyInfo.h"
- #import "Sound.h"
- #import "DKMessage.h"
- #import "DateFormat.h"
- #import "ReplyFrame.h"
- @implementation Log
- -(void)ParseDic:(NSDictionary *)dic
- {
- if(dic!=nil){
- _recordId=[[dic objectForKey:@"RecordID"] integerValue];
- NSInteger recordStatus= [[dic objectForKey:@"RecordStatus"]integerValue];
- if(recordStatus==0){
- _recordStatus=@"(未点评)";
- }
- else{
- _recordStatus=@"(已点评)";
- }
- _recordSource=[[dic objectForKey:@"RecordSource"]integerValue];
- _location=[dic objectForKey:@"RecordLocation"];
- _userName=[dic objectForKey:@"UserName"];
- _content=[dic objectForKey:@"RecordContent"];
- _valueFlag=[[dic objectForKey:@"ValueFlag"]integerValue];
- _commentUserId=[[dic objectForKey:@"CommentUserID"]integerValue];
- _checker=[dic objectForKey:@"Checker"];
- _commentUserCode=[dic objectForKey:@"CommentUserCode"];
- NSString *logCreateTime=[dic objectForKey:@"CreateTime"];
-
- _createTime= [DateFormat dateFormatSplit:logCreateTime];
- _remarks=[dic objectForKey:@"Remarks"];
- _commentUpdateTime=[dic objectForKey:@"CheckUpdateTime"];
- _imageArray=[dic objectForKey:@"dailyRecordPhotos"];
- _replyJsonArray=[dic objectForKey:@"dailyRecordReplies"];
- _soundJsonArray=[dic objectForKey:@"dailyRecordSounds"];
- if(_imageArray!=nil&&[_imageArray count]>0){
- NSMutableArray *imgArr=[[NSMutableArray alloc]init];
- for(int i=0;i<[_imageArray count];i++){
- NSDictionary *imgDic= _imageArray[i];
- NSString *imgPath=[imgDic objectForKey:@"SourcePath"];
- ImageModel *img=[ImageModel new];
- img.imageName=imgPath;
- [imgArr addObject:img];
- }
- _imagePathArray=[imgArr copy];
- }
- if(_soundJsonArray!=nil){
- NSMutableArray *soundTempArray=[[NSMutableArray alloc] init];
- for(int i=0;i<[_soundJsonArray count];i++){
- NSDictionary *soundDic=_soundJsonArray[i];
- NSString *soundPath=[soundDic objectForKey:@"SoundPath"];
- NSString *soundTime=[soundDic objectForKey:@"SoundTime"];
- Sound *sound=[Sound new];
- sound.soundPath=soundPath;
- sound.duration=soundTime;
- [soundTempArray addObject:sound];
- }
- _soundArray=[soundTempArray copy];
- }
-
- if(_replyJsonArray!=nil&&_replyJsonArray.count>0){
- NSMutableArray *replyTempArray=[[NSMutableArray alloc] init];
- for(int i=0;i<[_replyJsonArray count];i++){
- NSDictionary *replyDic=_replyJsonArray[i];
- NSString *replyId=[replyDic objectForKey:@"ReplyID"];
- NSInteger createUserId=[[replyDic objectForKey:@"CreateUserID"]integerValue];
- NSInteger recordId=[[replyDic objectForKey:@"RecordID"]integerValue];
- NSInteger replierUserId=[[replyDic objectForKey:@"RepliedUserID"]integerValue];
- NSString *replyContent=[replyDic objectForKey:@"ReplyContent"];
- NSString *userName=[replyDic objectForKey:@"UserName"];
- NSString *repliedUserName=[replyDic objectForKey:@"RepliedUserName"];
- ReplyInfo *info=[ReplyInfo new];
- info.replyId=replyId;
- info.createUserId=createUserId;
- info.recordId=recordId;
- info.replyUserId=replierUserId;
- info.replyContent=replyContent;
- info.userName=userName;
- info.RepliedUserName=repliedUserName;
- ReplyFrame *replyFrame=[[ReplyFrame alloc]init];
- [replyFrame setReplyInfoFrame:info];
- [replyTempArray addObject:replyFrame];
-
- }
- _replyArray=[replyTempArray copy];
- }
-
- }
-
- }
- @end
|