Commit 174063ef authored by Sandy's avatar Sandy

Merge branch 'master' of https://git.oschina.net/gomore/total

parents 32ff642a b3681334
......@@ -14,6 +14,8 @@
2933CC571D213377000F8EE6 /* OrderDetailsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2933CC561D213377000F8EE6 /* OrderDetailsViewController.m */; };
2933CC5B1D213AF2000F8EE6 /* SelectOrderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2933CC5A1D213AF2000F8EE6 /* SelectOrderViewController.m */; };
2933CC5F1D213C41000F8EE6 /* SelectOrderTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2933CC5E1D213C41000F8EE6 /* SelectOrderTableViewCell.m */; };
293ADF491E23726D005C1AEB /* NSDictionary+Category.m in Sources */ = {isa = PBXBuildFile; fileRef = 293ADF481E23726D005C1AEB /* NSDictionary+Category.m */; };
293ADF4D1E2372E8005C1AEB /* QueryModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 293ADF4C1E2372E8005C1AEB /* QueryModel.m */; };
294137691D50A17900AA86C3 /* SubTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 294137681D50A17900AA86C3 /* SubTableViewCell.m */; };
294154321D1CFBDE00B3B761 /* total_objc_json_client.m in Sources */ = {isa = PBXBuildFile; fileRef = 294154311D1CFBDE00B3B761 /* total_objc_json_client.m */; };
294154361D1CFD3000B3B761 /* HttpRequestManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 294154351D1CFD3000B3B761 /* HttpRequestManager.m */; };
......@@ -348,6 +350,10 @@
2933CC5A1D213AF2000F8EE6 /* SelectOrderViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectOrderViewController.m; sourceTree = "<group>"; };
2933CC5D1D213C41000F8EE6 /* SelectOrderTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectOrderTableViewCell.h; sourceTree = "<group>"; };
2933CC5E1D213C41000F8EE6 /* SelectOrderTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SelectOrderTableViewCell.m; sourceTree = "<group>"; };
293ADF471E23726D005C1AEB /* NSDictionary+Category.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSDictionary+Category.h"; sourceTree = "<group>"; };
293ADF481E23726D005C1AEB /* NSDictionary+Category.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSDictionary+Category.m"; sourceTree = "<group>"; };
293ADF4B1E2372E8005C1AEB /* QueryModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QueryModel.h; sourceTree = "<group>"; };
293ADF4C1E2372E8005C1AEB /* QueryModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QueryModel.m; sourceTree = "<group>"; };
294137671D50A17900AA86C3 /* SubTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SubTableViewCell.h; sourceTree = "<group>"; };
294137681D50A17900AA86C3 /* SubTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SubTableViewCell.m; sourceTree = "<group>"; };
294154301D1CFBDE00B3B761 /* total_objc_json_client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = total_objc_json_client.h; sourceTree = "<group>"; };
......@@ -1034,6 +1040,15 @@
name = view;
sourceTree = "<group>";
};
293ADF4A1E2372D5005C1AEB /* Models */ = {
isa = PBXGroup;
children = (
293ADF4B1E2372E8005C1AEB /* QueryModel.h */,
293ADF4C1E2372E8005C1AEB /* QueryModel.m */,
);
name = Models;
sourceTree = "<group>";
};
2941542E1D1CFB3300B3B761 /* JSONModel */ = {
isa = PBXGroup;
children = (
......@@ -1264,6 +1279,7 @@
children = (
29F143B31D18E1C800083975 /* SeePriceViewController.h */,
29F143B41D18E1C800083975 /* SeePriceViewController.m */,
293ADF4A1E2372D5005C1AEB /* Models */,
29F143D21D18F10000083975 /* view */,
);
name = "SeePrice(查看油品价格)";
......@@ -1882,6 +1898,8 @@
isa = PBXGroup;
children = (
3506EDB01BA0194300897EBE /* NSData+EncodeAdditions.h */,
293ADF471E23726D005C1AEB /* NSDictionary+Category.h */,
293ADF481E23726D005C1AEB /* NSDictionary+Category.m */,
3506EDB11BA0194300897EBE /* NSData+EncodeAdditions.m */,
3506EDB21BA0194300897EBE /* NSDate+FormatterAdditions.h */,
3506EDB31BA0194300897EBE /* NSDate+FormatterAdditions.m */,
......@@ -2792,6 +2810,7 @@
3506EDD71BA0194300897EBE /* UIApplication+CheckFirstRun.m in Sources */,
35EB8E681BE32C2800411E45 /* GTOLicenceBoltView.m in Sources */,
35E3BB191BF087AE0081232D /* GTOAlertInfoPatrolPlanViewController.m in Sources */,
293ADF491E23726D005C1AEB /* NSDictionary+Category.m in Sources */,
29BE72341D4077BE001D60EE /* NoteTableViewCell.m in Sources */,
3506ED5C1BA0164E00897EBE /* IBTUITextField.m in Sources */,
35EB8E621BE3208500411E45 /* GTOLicence.m in Sources */,
......@@ -2805,6 +2824,7 @@
35B2E59F1BAC171F00AB8582 /* ICRPlaceholderTextView.m in Sources */,
35B2E58F1BAC140500AB8582 /* ICRAttachmentUnit.m in Sources */,
35D66A401BE75670004476F0 /* GTOLicenceResultTopCellContentView.m in Sources */,
293ADF4D1E2372E8005C1AEB /* QueryModel.m in Sources */,
3506ED4B1BA0164E00897EBE /* IBTTableViewUserInfo.m in Sources */,
35B2E5761BAC064600AB8582 /* GTOPatrolPlanInfoItemView.m in Sources */,
29603D831D1CD52B00951670 /* BookingTableViewCell.m in Sources */,
......@@ -3124,8 +3144,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_IDENTITY = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -3142,7 +3162,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomoe.total;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "c2d977b5-adac-45f6-bfbb-3a53616b54d7";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "total/total-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
......@@ -3157,8 +3177,8 @@
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
CODE_SIGN_IDENTITY = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer: 云霄 曹 (WM8ZU7YY98)";
DEVELOPMENT_TEAM = "";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
......@@ -3175,7 +3195,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomoe.total;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "c2d977b5-adac-45f6-bfbb-3a53616b54d7";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_OBJC_BRIDGING_HEADER = "total/total-Bridging-Header.h";
TARGETED_DEVICE_FAMILY = "1,2";
......
......@@ -556,6 +556,9 @@
#pragma mark -删除区
- (void)deleteSectionAction:(UIButton *)btn
{
if (self.tankNumber <= 1) {
[IBTLoadingView showTextOnly:@"默认保留一个油罐"];return;
}
NSInteger index = btn.tag;
UIAlertController *alertView = [UIAlertController alertControllerWithTitle:@"提示" message:@"请确认是否删除" preferredStyle:UIAlertControllerStyleAlert];
__weak typeof(self) weakSelf = self;
......@@ -1044,10 +1047,10 @@
[HttpRequestManager requestNetworkwithURL:string withRequestType:ZERO withParameter:[orderBill toDictionary] withSuccess:^(id returnValue) {
if ([returnValue[@"success"] isEqualToNumber:@1]) {
[IBTLoadingView hideHUDWithText:@"保存成功"];
if (!boolValue) {
block(returnValue[@"data"][@"uuid"]);return;
}
[IBTLoadingView hideHUDWithText:@"保存成功"];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
SeeObtainViewController *orderBill = [weakSelf.storyboard instantiateViewControllerWithIdentifier:@"SeeObtainViewController"];
orderBill.orderUUIDString = returnValue[@"data"][@"uuid"];
......
......@@ -368,7 +368,7 @@
//油站经营类型
order.operatingType = self.recordSelectGasStation[@"operatingType"];
//订单状态
order.state = boolValue?@"initial":@"submit";
order.state = @"initial";
//所属业主公司
UCN *company = [[UCN alloc]init];
company.code = user.orgCode;
......@@ -416,14 +416,7 @@
[IBTLoadingView hideHUDWithText:@"保存成功"];
saveSuccess(returnValue[@"data"],order);
if (!boolValue) return;//提交调用保存时不需要跳转到详情
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
OrderDetailsViewController *orderDetail = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailsViewController"];
orderDetail.orderUUIDString = returnValue[@"data"][@"uuid"];
orderDetail.oilTypeListDatasArray = self.oilTypeListDatasArray;
orderDetail.title = @"订油单详情";
orderDetail.boolValue = YES;
[weakSelf PushViewController:orderDetail animated:YES];
});
[weakSelf gotoOrderDetail:returnValue[@"data"][@"uuid"]];
} else {
[IBTLoadingView hideHUDWithText:returnValue[@"message"]];
}
......@@ -434,6 +427,18 @@
}];
}
#pragma mark -订单详情
- (void)gotoOrderDetail:(NSString *)uuid
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
OrderDetailsViewController *orderDetail = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailsViewController"];
orderDetail.orderUUIDString = uuid;
orderDetail.oilTypeListDatasArray = self.oilTypeListDatasArray;
orderDetail.title = @"订油单详情";
orderDetail.boolValue = YES;
[self PushViewController:orderDetail animated:YES];
});
}
#pragma mark -提交订油单
- (void)commitOilOrder
......@@ -470,6 +475,7 @@
} else {
[IBTLoadingView hideHUDWithText:returnValue[@"message"]];
[weakSelf gotoOrderDetail:dict[@"uuid"]];
}
} withFailed:^(NSError *failed) {
......
......@@ -129,7 +129,7 @@
//获取建仓单详情
if (self.isSaveDetails) {
[self getOrderDetailsDatas];
[self getOilPriceDatas];
[self getOilPriceDatas];
}
}
......@@ -270,6 +270,16 @@
{
TypeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"TypeTableViewCell" forIndexPath:indexPath];
cell.titleLabe.text = @"配送区域:";
//只有一个配送区域情况
if (self.distributionArray.count == 1) {
self.distributionDict = [self.distributionArray firstObject];
cell.contentLabe.text = self.distributionDict[@"name"];
}
//无配送区域情况
if (!self.distributionArray.count) {
cell.contentLabe.text = @"无";
}
cell.userInteractionEnabled = self.distributionArray.count > 1;
if (self.isSaveDetails) {
cell.contentLabe.text = self.orderDetails.deliveryArea.name;
}
......@@ -380,15 +390,20 @@
break;
case 1://配送区域
{
TypeTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
if (![ICRUserUtil sharedInstance].storeArray.count) {
[IBTLoadingView showTextOnly:@"当前用户没有所属油站,不能选择配送区域"];return;
}
PromptTableViewController *selectArea = [[PromptTableViewController alloc]init];
selectArea.title = @"选择配送区域";
NSMutableArray *tempArray = [NSMutableArray array];
for (NSDictionary *dict in self.distributionArray) {
[tempArray addObject:dict[@"name"]];
if (![tempArray containsObject:dict[@"name"]]) {
[tempArray addObject:dict[@"name"]];
}
}
selectArea.datasArray = tempArray;
//选择配送区后回调
[selectArea setSelectCellTitle:^(NSString *title,NSInteger cellindex) {
cell.contentLabe.text = title?title:@"请选择";
......@@ -466,8 +481,15 @@
#pragma mark -UITextField监听
- (void)changeTextfieldString:(UITextField *)textField
{
if (!self.oilPrice.records.count) {
[IBTLoadingView showTextOnly:@"油品价格异常"];
textField.text = nil;
return;
}
if (![self isPureInt:textField.text]) {
[IBTLoadingView showTextOnly:@"只支持整数、浮点数"];
textField.text = nil;
return;
}
//申请总额
NumberTableViewCell *numberCell = [self.createWarehouseTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:5 inSection:0]];
......@@ -501,6 +523,7 @@
}
TimeSelectTableViewCell *cell = [self.createWarehouseTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:2 inSection:0]];
DepotRequestBill *orderBill = [[DepotRequestBill alloc]init];
orderBill.version = self.orderDetails.version;
ICRUserUtil *user = [ICRUserUtil sharedInstance];
//状态
orderBill.state = @"initial";
......@@ -543,13 +566,13 @@
time.endDateTime = [NSString stringWithFormat:@"%@ 23:59:59",[cell.endTimeButton currentTitle]];
orderBill.deliveryTime = time;
//申请价格
orderBill.reqPrice = [NSNumber numberWithFloat:[[self.oilPrice.records firstObject][@"salePrice"] doubleValue]];
orderBill.reqPrice = [NSNumber numberWithDouble:[[self.oilPrice.records firstObject][@"salePrice"] doubleValue]];
NumberTableViewCell *numberCell = [self.createWarehouseTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:5 inSection:0]];
if ([orderBill.reqPrice isEqualToNumber:@0]) {
[IBTLoadingView showTextOnly:@"价格异常"];return;
}
//申请数量
orderBill.quantity = [NSNumber numberWithFloat:[numberCell.createNumberField.text doubleValue]];
orderBill.quantity = [NSNumber numberWithDouble:[numberCell.createNumberField.text doubleValue]];
if ([orderBill.quantity isEqualToNumber:@0]) {
[IBTLoadingView showTextOnly:@"数量异常"];return;
}
......@@ -563,18 +586,12 @@
[HttpRequestManager requestNetworkwithURL:string withRequestType:ZERO withParameter:[orderBill toDictionary] withSuccess:^(id returnValue) {
if ([returnValue[@"success"] isEqualToNumber:@1]) {
if (!isPushDetails) {
[IBTLoadingView hideHUDWithText:nil];
block(returnValue[@"data"],orderBill);return;
}
[IBTLoadingView hideHUDWithText:@"保存成功"];
block(returnValue[@"data"],orderBill);
if (!isPushDetails) return;//是否需要跳转太详情页
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NewRequestViewController *details = [weakSelf.storyboard instantiateViewControllerWithIdentifier:@"NewRequestViewController"];
details.orderUUID = returnValue[@"data"][@"uuid"];
details.isSaveDetails = YES;
details.title = @"修改建仓单";
details.oilTypeDict = weakSelf.oilTypeDict;
details.distributionDict = weakSelf.distributionDict;
[weakSelf PushViewController:details animated:YES];
});
[weakSelf saveOrderSuccess:returnValue[@"data"][@"uuid"]];
}
else {
[IBTLoadingView hideHUDWithText:returnValue[@"message"]];
......@@ -586,11 +603,24 @@
}];
}
#pragma mark -保存成功
- (void)saveOrderSuccess:(NSString *)uuidString
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NewRequestViewController *details = [self.storyboard instantiateViewControllerWithIdentifier:@"NewRequestViewController"];
details.orderUUID = uuidString;
details.isSaveDetails = YES;
details.title = @"建仓申请单明细";
details.oilTypeDict = self.oilTypeDict;
details.distributionDict = self.distributionDict;
[self PushViewController:details animated:YES];
});
}
#pragma mark -提交建仓单
- (void)commitOrder
{
__weak typeof(self) weakSelf = self;
[self saveOrderBill:NO returnSaveSateBlock:^(NSDictionary *dict, DepotRequestBill *orderbBill) {
[IBTLoadingView showProgressLabel:@"提交中..."];
......@@ -615,6 +645,7 @@
} else {
[IBTLoadingView hideHUDWithText:returnValue[@"message"]];
[weakSelf saveOrderSuccess:dict[@"uuid"]];
}
} withFailed:^(NSError *failed) {
[IBTLoadingView hideHUDWithText:nil];
......
......@@ -368,7 +368,7 @@
//油站经营类型
order.operatingType = self.orderDetails.operatingType;
//订单状态
order.state = boolValue?@"initial":@"submit";
order.state = @"initial";
order.version = self.orderDetails.version;
order.uuid = self.orderDetails.uuid;
order.billnumber = self.orderDetails.billnumber;
......@@ -415,17 +415,13 @@
NSDictionary *orderDict = [order toDictionary];
[HttpRequestManager requestNetworkwithURL:string withRequestType:ZERO withParameter:orderDict withSuccess:^(id returnValue) {
if ([returnValue[@"success"] isEqualToNumber:@1]) {
if (!boolValue) {
[IBTLoadingView hideHUDWithText:nil];
saveSuccess(returnValue[@"data"],order);return;
}
[IBTLoadingView hideHUDWithText:@"保存成功"];
saveSuccess(returnValue[@"data"],order);
if (!boolValue) return;//提交调用保存时不需要跳转到详情
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
OrderDetailsViewController *orderDetail = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailsViewController"];
orderDetail.orderUUIDString = returnValue[@"data"][@"uuid"];
orderDetail.oilTypeListDatasArray = self.oilTypeListDatasArray;
orderDetail.title = @"订油单详情";
orderDetail.boolValue = YES;
[weakSelf PushViewController:orderDetail animated:YES];
});
[weakSelf gotoOrderDetail:returnValue[@"data"][@"uuid"]];
}else
{
[IBTLoadingView hideHUDWithText:returnValue[@"message"]];
......@@ -436,6 +432,19 @@
}];
}
#pragma mark -订单详情
- (void)gotoOrderDetail:(NSString *)uuid
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
OrderDetailsViewController *orderDetail = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailsViewController"];
orderDetail.orderUUIDString = uuid;
orderDetail.oilTypeListDatasArray = self.oilTypeListDatasArray;
orderDetail.title = @"订油单详情";
orderDetail.boolValue = YES;
[self PushViewController:orderDetail animated:YES];
});
}
#pragma mark -提交订油单
- (void)commitOilOrder
......@@ -462,17 +471,11 @@
if ([returnValue[@"success"] isEqualToNumber:@1]) {
[IBTLoadingView hideHUDWithText:@"提交成功"];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
OrderDetailsViewController *orderDetail = [self.storyboard instantiateViewControllerWithIdentifier:@"OrderDetailsViewController"];
orderDetail.orderUUIDString = dict[@"uuid"];
orderDetail.oilTypeListDatasArray = self.oilTypeListDatasArray;
orderDetail.title = @"订油单详情";
orderDetail.boolValue = YES;
[weakSelf PushViewController:orderDetail animated:YES];
});
[weakSelf gotoOrderDetail:dict[@"uuid"]];
} else {
[IBTLoadingView hideHUDWithText:returnValue[@"message"]];
[weakSelf gotoOrderDetail:dict[@"uuid"]];
}
} withFailed:^(NSError *failed) {
......
//
// QueryModel.h
// total
//
// Created by 曹云霄 on 2017/1/9.
// Copyright © 2017年 Delevin. All rights reserved.
//
#import <JSONModel/JSONModel.h>
@class Orders,Condition;
@protocol Orders @end
@protocol Condition @end
@interface QueryModel : JSONModel
@property (nonatomic, strong) NSArray<Orders> *orders;
@property (nonatomic, assign) NSInteger pageNumber;
@property (nonatomic, assign) NSInteger pageSize;
@property (nonatomic, strong) NSArray<Condition> *conditions;
@end
@interface Orders : JSONModel
@property (nonatomic, copy) NSString *field;
@property (nonatomic, copy) NSString *direction;
@end
@interface Condition : JSONModel
@property (nonatomic, copy) NSString *operation;
@property (nonatomic, strong) NSArray<NSString *>*parameters;
@end
//
// QueryModel.m
// total
//
// Created by 曹云霄 on 2017/1/9.
// Copyright © 2017年 Delevin. All rights reserved.
//
#import "QueryModel.h"
@implementation QueryModel
+ (BOOL)propertyIsOptional:(NSString *)propertyName
{
return YES;
}
@end
@implementation Orders
+ (BOOL)propertyIsOptional:(NSString *)propertyName
{
return YES;
}
@end
@implementation Condition
+ (BOOL)propertyIsOptional:(NSString *)propertyName
{
return YES;
}
@end
......@@ -1003,22 +1003,16 @@
self.orderDetails.remark = self.userInputArray[ONE][9];
NSString *urlString = [NSString stringWithFormat:@"%@/receiveBill/save?operId=%@&operName=%@&time=%@",HTTP_REST_API_BASE_URL,user.f_user_uuid,user.f_user_name,[GTOCommonTools GetCurrenttime]];
NSString *string = [urlString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSLog(@"%@",[self.orderDetails toDictionary]);
[IBTLoadingView showProgressLabel:@"保存中..."];
[HttpRequestManager requestNetworkwithURL:string withRequestType:ZERO withParameter:[self.orderDetails toDictionary] withSuccess:^(id returnValue) {
if ([returnValue[@"success"] isEqualToNumber:@1]) {
[IBTLoadingView hideHUDWithText:@"保存成功"];
if (!boolValue) {
[IBTLoadingView hideHUDWithText:nil];
bolck(returnValue[@"data"][@"uuid"]);return;
}
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
SeeObtainViewController *orderBill = [weakSelf.storyboard instantiateViewControllerWithIdentifier:@"SeeObtainViewController"];
orderBill.orderUUIDString = returnValue[@"data"][@"uuid"];
orderBill.storeDict = self.storeDict;//油站
orderBill.isReturnRootVC = YES;
[weakSelf PushViewController:orderBill animated:YES];
});
[IBTLoadingView hideHUDWithText:@"保存成功"];
[weakSelf saveOrderSuccess:returnValue[@"data"][@"uuid"]];
} else {
[IBTLoadingView hideHUDWithText:returnValue[@"message"]];
}
......@@ -1053,6 +1047,7 @@
} else {
[IBTLoadingView hideHUDWithText:returnValue[@"message"]];
[weakSelf saveOrderSuccess:uuidString];
}
} withFailed:^(NSError *failed) {
......@@ -1063,6 +1058,18 @@
} isPushDetails:NO];
}
#pragma mark -保存收油单成功
- (void)saveOrderSuccess:(NSString *)uuidString
{
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
SeeObtainViewController *orderBill = [self.storyboard instantiateViewControllerWithIdentifier:@"SeeObtainViewController"];
orderBill.orderUUIDString = uuidString;
orderBill.storeDict = self.storeDict;//油站
orderBill.isReturnRootVC = YES;
[self PushViewController:orderBill animated:YES];
});
}
#pragma mark -返回提示信息
- (NSString *)returnPromptInformation:(NSInteger)index
......
......@@ -319,7 +319,7 @@ typedef enum : NSUInteger {
NewRequestViewController *details = [self.storyboard instantiateViewControllerWithIdentifier:@"NewRequestViewController"];
details.orderUUID = dict[@"uuid"];
details.isSaveDetails = YES;
details.title = @"修改建仓单";
details.title = @"建仓申请单明细";
details.oilTypeDict = dict[@"item"];
details.distributionDict = dict[@"deliveryArea"];
[self PushViewController:details animated:YES];
......
......@@ -13,6 +13,7 @@
#import "CustomSelectCityViewController.h"
#import "WYPopoverController.h"
#import "PromptTableViewController.h"
#import "QueryModel.h"
@interface SeePriceViewController ()<UITableViewDelegate,UITableViewDataSource>
......@@ -51,6 +52,11 @@
*/
@property (nonatomic,strong) NSDictionary *administrativeArea;
/**
* 查询油价
*/
@property (nonatomic,strong) QueryModel *queryModel;
@end
......@@ -108,37 +114,33 @@
self.seePriceTableview.delegate = self;
self.seePriceTableview.dataSource = self;
self.seePriceTableview.tableFooterView = [UIView new];
self.seePriceTableview.userInteractionEnabled = [ICRUserUtil sharedInstance].storeArray.count;
}
#pragma mark -获取配送区域数据、获取行政区域数据
- (void)netWorkRequest
{
[self.administrativeArray removeAllObjects];
[self.distributionArray removeAllObjects];
WS(weakSelf);
[IBTLoadingView showProgressLabel:@"正在加载..."];
dispatch_queue_t aQueue = dispatch_queue_create("顺序执行", DISPATCH_QUEUE_SERIAL);
//创建1个queue group
dispatch_group_t queueGroup = dispatch_group_create();
//任务1->获取配送区域
dispatch_group_async(queueGroup, aQueue, ^{
dispatch_suspend(aQueue);
if (![[ICRUserUtil sharedInstance].position isEqualToString:@"storer"]) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
[self.distributionArray removeAllObjects];
[self.administrativeArray removeAllObjects];
WS(weakSelf);
dispatch_group_t group = dispatch_group_create();
dispatch_group_enter(group);
//任务1->获取配送区域
[HttpRequestManager requestNetworkwithURL:[NSString stringWithFormat:@"%@%@",HTTP_REST_API_BASE_URL,DISTRIBUTION] withRequestType:ONE withParameter:nil withSuccess:^(id returnValue) {
dispatch_group_leave(group);
if ([returnValue[@"success"] isEqualToNumber:@1]) {
weakSelf.distributionArray = returnValue[@"data"];
}
dispatch_resume(aQueue);
} withFailed:^(NSError *failed) {
dispatch_resume(aQueue);
dispatch_group_leave(group);
[IBTLoadingView showTextOnly:failed.localizedDescription];
}];
});
//任务2->获取行政区域
dispatch_group_async(queueGroup, aQueue, ^{
dispatch_suspend(aQueue);
//任务2->获取行政区域
dispatch_group_enter(group);
[HttpRequestManager requestNetworkwithURL:[NSString stringWithFormat:@"%@%@",HTTP_REST_API_BASE_URL,ADMINISTRATIVE] withRequestType:ONE withParameter:nil withSuccess:^(id returnValue) {
dispatch_resume(aQueue);
[IBTLoadingView hideHUDWithText:nil];
dispatch_group_leave(group);
if ([returnValue[@"success"] isEqualToNumber:@1]) {
NSArray *array = returnValue[@"data"];
NSMutableArray *tempArray = [NSMutableArray array];
......@@ -148,43 +150,40 @@
weakSelf.administrativeArray = tempArray;
}
} withFailed:^(NSError *failed) {
dispatch_resume(aQueue);
[IBTLoadingView showTextOnly:failed.localizedDescription];
dispatch_group_leave(group);
[IBTLoadingView showTextOnly:failed.localizedDescription];
}];
});
//任务4->获取油价列表/默认加载全部
dispatch_group_async(queueGroup, aQueue, ^{
NSDictionary *queryDictionary = nil;
dispatch_group_notify(group, dispatch_get_main_queue(), ^{
[IBTLoadingView hideHUDWithText:nil];
[weakSelf.seePriceTableview reloadData];
});
};
//行政区域和配送区域都为一个时,加载数据
if (self.administrativeArray.count == 1 && self.distributionArray.count == 1) {
Condition *condition2 = [[Condition alloc] init];
condition2.operation = @"deliveryAreaUuidEquals";
condition2.parameters = @[self.distributionArray[0][@"uuid"]];
Condition *condition3 = [[Condition alloc] init];
condition3.operation = @"areaUuidEquals";
condition3.parameters = @[self.administrativeArray[0][@"uuid"]];
if ([[ICRUserUtil sharedInstance].position isEqualToString:@"storer"]) {
queryDictionary = @{@"pageSize" : @0,
@"orders" : @[@{@"field" : @"string",
@"direction" : @"asc"}],
@"conditions" : @[
@{@"operation":@"userId",
@"parameters":@[[ICRUserUtil sharedInstance].f_user_uuid]
}
],
@"pageNumber" : @0};
}else
{
queryDictionary = @{@"pageSize" : @0,
@"orders" : @[@{@"field" : @"string",
@"direction" : @"asc"}],
@"conditions" : @[
@{@"operation":[NSNull null],
@"parameters":[NSNull null]
}
],
@"pageNumber" : @0};
Condition *condition1 = [[Condition alloc] init];
condition1.operation = @"userId";
condition1.parameters = @[[ICRUserUtil sharedInstance].f_user_uuid];
self.queryModel.conditions = (NSArray<Condition> *)@[condition2,condition3,condition1];
}else {
self.queryModel.conditions = (NSArray<Condition> *)@[condition2,condition3];
}
[self getOilPriceDatas:queryDictionary];
});
[self getOilPriceDatas:[self.queryModel toDictionary]];
}
}
#pragma mark -获取油价数据
- (void)getOilPriceDatas:(NSDictionary *)dict
{
WS(weakSelf);
NSLog(@"%@",[dict JSONString]);
[HttpRequestManager requestNetworkwithURL:[NSString stringWithFormat:@"%@%@",HTTP_REST_API_BASE_URL,OILPRICE] withRequestType:ZERO withParameter:dict withSuccess:^(id returnValue) {
[IBTLoadingView hideHUDWithText:nil];
......@@ -217,6 +216,7 @@
}else {
SeePriceTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"SeePriceTableViewCell" forIndexPath:indexPath];
cell.arrowImageView.hidden = NO;
cell.backgroundColor = [UIColor whiteColor];
cell.distributionAreaContent.font = [UIFont systemFontOfSize:15];
cell.distributionAreaLabe.text = [self.titleArray objectAtIndex:indexPath.row];
if (indexPath.row != 0) {
......@@ -227,18 +227,21 @@
cell.backgroundColor = RGBA(251, 244, 228, 1);
cell.distributionAreaContent.text = [GTOCommonTools GetCurrenttime];
cell.distributionAreaContent.font = [UIFont systemFontOfSize:17];
}else{
cell.backgroundColor = [UIColor whiteColor];
}
//区分是否是油站经理调用
if (user.storeArray.count == 1 && [[ICRUserUtil sharedInstance].position isEqualToString:@"storer"]) {
if (self.distributionArray.count == 1 && [[ICRUserUtil sharedInstance].position isEqualToString:@"storer"]) {
if (indexPath.row == 0) {
cell.distributionAreaContent.text = user.storeArray[0][@"deliveryArea"][@"name"];
cell.distributionAreaContent.text = self.distributionArray[0][@"name"];
self.distributionArea = self.distributionArray[0];
cell.userInteractionEnabled = NO;
}
}
if (self.administrativeArray.count == 1 && [[ICRUserUtil sharedInstance].position isEqualToString:@"storer"]) {
if (indexPath.row == 1) {
cell.distributionAreaContent.text = [NSString stringWithFormat:@"[%@]%@",user.storeArray[0][@"area"][@"uuid"],user.storeArray[0][@"area"][@"name"]];
cell.distributionAreaContent.text = [NSString stringWithFormat:@"[%@]%@",self.administrativeArray[0][@"uuid"],self.administrativeArray[0][@"name"]];
self.administrativeArea = self.administrativeArray[0];
cell.userInteractionEnabled = NO;
}
cell.userInteractionEnabled = NO;
}
return cell;
}
......@@ -277,7 +280,6 @@
weakSelf.distributionArea = [weakSelf.distributionArray objectAtIndex:cellindex];
[weakSelf getQueryDictionary]?[IBTLoadingView showProgressLabel:@"查询中..."]:nil;
[weakSelf getQueryDictionary]?[weakSelf getOilPriceDatas:[weakSelf getQueryDictionary]]:nil;
[weakSelf dismissViewControllerAnimated:YES completion:nil];
}];
IBTUINavigationController *nav = [[IBTUINavigationController alloc]initWithRootViewController:selectArea];
dispatch_async(dispatch_get_main_queue(), ^{
......@@ -301,7 +303,6 @@
weakSelf.administrativeArea = [weakSelf.administrativeArray objectAtIndex:cellindex];
[weakSelf getQueryDictionary]?[IBTLoadingView showProgressLabel:@"查询中..."]:nil;
[weakSelf getQueryDictionary]?[weakSelf getOilPriceDatas:[weakSelf getQueryDictionary]]:nil;
[weakSelf dismissViewControllerAnimated:YES completion:nil];
}];
IBTUINavigationController *nav = [[IBTUINavigationController alloc]initWithRootViewController:selectArea];
dispatch_async(dispatch_get_main_queue(), ^{
......@@ -333,24 +334,38 @@
- (NSDictionary *)getQueryDictionary
{
if (self.distributionArea && self.administrativeArea) {
NSDictionary *queryDictionary = @{@"pageSize" : @999,
@"orders" : @[@{@"field" : @"uuid",
@"direction" : @"asc"}],
@"conditions" : @[
@{@"operation" : @"deliveryAreaUuidEquals",
@"parameters" : @[self.distributionArea[@"uuid"]]},
@{@"operation" : @"areaUuidEquals",
@"parameters" : @[self.administrativeArea[@"uuid"]]},
@{@"operation" : @"categoryEquals",
@"parameters" : @[@"salePrice"]},
],
@"pageNumber" : @0};
return queryDictionary;
Condition *condition2 = [[Condition alloc] init];
condition2.operation = @"deliveryAreaUuidEquals";
condition2.parameters = @[self.distributionArea[@"uuid"]];
Condition *condition3 = [[Condition alloc] init];
condition3.operation = @"areaUuidEquals";
condition3.parameters = @[self.administrativeArea[@"uuid"]];
if ([[ICRUserUtil sharedInstance].position isEqualToString:@"storer"]) {
Condition *condition1 = [[Condition alloc] init];
condition1.operation = @"userId";
condition1.parameters = @[[ICRUserUtil sharedInstance].f_user_uuid];
self.queryModel.conditions = (NSArray<Condition> *)@[condition2,condition3,condition1];
}else {
self.queryModel.conditions = (NSArray<Condition> *)@[condition2,condition3];
}
return [self.queryModel toDictionary];
}
return nil;
}
#pragma mark -lazy
- (QueryModel *)queryModel
{
if (!_queryModel) {
_queryModel = [[QueryModel alloc] init];
_queryModel.pageSize = 999;
_queryModel.pageNumber = 0;
}
return _queryModel;
}
......
......@@ -192,7 +192,7 @@
cell.establishWarehouseUnitLabe.text = self.orderDetails.org.name;
cell.establishName.text = self.orderDetails.createInfo.operator.operName;
cell.establishDate.text = self.orderDetails.createInfo.time;
if ([self.orderDetails.state isEqualToString:@"general"]) {
if ([self.orderDetails.type isEqualToString:@"general"]) {
cell.typeLabe.text = @"普通";
}
cell.distributionLabe.text = self.orderDetails.deliveryArea.name;
......@@ -324,8 +324,6 @@
options:WYPopoverAnimationOptionFadeWithScale];
}
#pragma mark -删除或者作废后返回此订单UUID
- (void)returnUUIDsingAfterDeleteOrCancel:(BOOL)isDelete
{
......
......@@ -93,6 +93,7 @@
#pragma mark -确定
- (void)completeButtonClick:(UIBarButtonItem *)item
{
[self dismissViewControllerAnimated:YES completion:nil];
if (self.selectTitle || self.currentTitle) {
if (self.selectCellTitle) {
self.selectCellTitle(self.selectTitle?self.selectTitle:self.currentTitle,self.indexpathSelect.row);
......
......@@ -15,11 +15,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.2.7</string>
<string>1.2.9</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.2.7</string>
<string>1.2.9</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
......
......@@ -35,6 +35,7 @@
#import "NSData+EncodeAdditions.h"
#import "UIScrollView+Content.h"
#import "GTOCommonTools.h"
#import "NSDictionary+Category.h"
......@@ -78,21 +79,17 @@
//#define HTTP_REST_API_BASE_URL @"http://218.244.151.129:7580/total-server/rest" //
//#define HTTP_LOCAL_BASE_URL @"http://218.244.151.129:7580"
////正式环境
//正式环境
//#define HTTP_REST_API_BASE_URL @"http://139.196.39.77:7080/total-server/rest"
//#define HTTP_LOCAL_BASE_URL @"http://139.196.39.77:7080"
//测试环境
//#define HTTP_REST_API_BASE_URL @"http://139.196.39.77:8180/total-server/rest"
//#define HTTP_LOCAL_BASE_URL @"http://139.196.39.77:8180"
//
//测试环境
//#define HTTP_REST_API_BASE_URL @"http://139.196.39.77:8080/total-server/rest"
#define HTTP_REST_API_BASE_URL @"http://139.196.39.77:8180/total-server/rest"
#define HTTP_LOCAL_BASE_URL @"http://139.196.39.77:8180"
//开发环境
#define HTTP_LOCAL_BASE_URL @"http://139.196.195.30:8093"
#define HTTP_REST_API_BASE_URL @"http://139.196.195.30:8093/total-server/rest"
//#define HTTP_LOCAL_BASE_URL @"http://139.196.195.30:8093"
//#define HTTP_REST_API_BASE_URL @"http://139.196.195.30:8093/total-server/rest"
#define HTTP_WEATHER_URL @"http://apis.baidu.com/heweather/weather/free"
......
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