| | |
| | | PBNetworkModel *networkModel = [PBNetworkModel yy_modelWithJSON:str]; |
| | | if ([networkModel.Msg isEqualToString:@"Token已过期"]) { |
| | | [PBNoteCenter postNotificationName: PBNoteCenterDismissTabBarController object:nil]; |
| | | [PBNoteCenter postNotificationName:@"PBNoteCenterTokenExpired" object:nil]; |
| | | [self performSelector:@selector(toLogin) withObject:nil afterDelay:0.3f]; |
| | | |
| | | } |
| | | } |
| | | - (void)toLogin { |
| | | [PBNoteCenter postNotificationName:@"PBNoteCenterTokenExpired" object:nil]; |
| | | } |
| | | |
| | | #pragma mark =================================新接口======================================= |
| | | #pragma mark - 登录 |
| | | - (void)loginWithUserName:(NSString *)userName andPassword:(NSString *)password andCallBack:(void (^) (NSURLSessionDataTask *task,id response, NSError *error))callBack { |
| | |
| | | - (void)aEntryOrExitWithOrganizeId:(NSString *)organizeId andFillingUserId:(NSString *)fillingUserId andProgressParentId:(NSString *)progressParentId andProgressTreeId:(NSString *)progressTreeId andProgressProjectId:(NSString *)progressProjectId andAddress:(NSString *)address andType:(NSInteger)type andCallBack:(void (^) (NSURLResponse *response, id responseObject, NSError *error))callBack { |
| | | NSDictionary *dict = @{ |
| | | @"OrganizeId": organizeId, |
| | | @"FillingUserId": fillingUserId, |
| | | @"FillingId": fillingUserId, |
| | | @"ProgressParentId": progressParentId, |
| | | @"ProgressTreeId": progressTreeId, |
| | | @"ProgressProjectId": progressProjectId, |
| | | @"Address": address, |
| | | @"Token": Token, |
| | | @"Type": [NSNumber numberWithInteger:type] |
| | | }; |
| | | NSString *url = [NSString stringWithFormat:@"%@/api/Filling/FillingUserLog/EntryOrExit",BaseUrl]; |
| | | NSString *url = [NSString stringWithFormat:@"%@/api/Filling/FillingLog/UserEntryOrExit",BaseUrl]; |
| | | [[PBNetworkTools sharedTools] BodyRequestWithType:POST andCookie:NO andUrl:url andParams:dict andCallBack:callBack]; |
| | | } |
| | | #pragma mark - 获取现场车辆扫描信息 |
| | | - (void)GetCarInfoWithID:(NSString *)guid andCallBack:(void (^) (NSURLSessionDataTask *task,id response, NSError *error))callBack { |
| | | NSDictionary *dict = @{ |
| | | @"id":guid |
| | | }; |
| | | NSString *url = [NSString stringWithFormat:@"%@/api/Filling/FillingCar/GetCarInfo",BaseUrl]; |
| | | [[PBNetworkTools sharedTools] RequestWithType:GET andCookie:NO andUrl:url andParams:dict andCallBack:callBack]; |
| | | } |
| | | #pragma mark - 现场车辆填报 |
| | | - (void)CarEntryOrExitWithOrganizeId:(NSString *)organizeId andFillingId:(NSString *)fillingId andProgressParentId:(NSString *)progressParentId andProgressTreeId:(NSString *)progressTreeId andProgressProjectId:(NSString *)progressProjectId andAddress:(NSString *)address andType:(NSInteger)type andCallBack:(void (^) (NSURLResponse *response, id responseObject, NSError *error))callBack { |
| | | NSDictionary *dict = @{ |
| | | @"OrganizeId": organizeId, |
| | | @"FillingId": fillingId, |
| | | @"ProgressParentId": progressParentId, |
| | | @"ProgressTreeId": progressTreeId, |
| | | @"ProgressProjectId": progressProjectId, |
| | | @"Address": address, |
| | | @"Type": [NSNumber numberWithInteger:type] |
| | | }; |
| | | NSString *url = [NSString stringWithFormat:@"%@/api/Filling/FillingLog/CarEntryOrExit",BaseUrl]; |
| | | [[PBNetworkTools sharedTools] BodyRequestWithType:POST andCookie:NO andUrl:url andParams:dict andCallBack:callBack]; |
| | | } |
| | | #pragma mark - 获取现场人员列表 |