Commit e8accc1b authored by 曹云霄's avatar 曹云霄

修改油价接口

parent a3842d2c
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:testNew.xcodeproj">
</FileRef>
</Workspace>
//
// AppDelegate.swift
// testNew
//
// Created by 曹云霄 on 2016/9/30.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(_ application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
func applicationDidEnterBackground(_ application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(_ application: UIApplication) {
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(_ application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(_ application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11134" systemVersion="15F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11106"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
//
// ViewController.swift
// testNew
//
// Created by 曹云霄 on 2016/9/30.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
......@@ -3123,8 +3123,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)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -3140,7 +3140,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomoe.total;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "c2d977b5-adac-45f6-bfbb-3a53616b54d7";
SWIFT_OBJC_BRIDGING_HEADER = "total/total-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
TARGETED_DEVICE_FAMILY = 1;
......@@ -3154,8 +3154,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)";
ENABLE_BITCODE = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
......@@ -3171,7 +3171,7 @@
);
PRODUCT_BUNDLE_IDENTIFIER = com.gomoe.total;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE = "";
PROVISIONING_PROFILE = "c2d977b5-adac-45f6-bfbb-3a53616b54d7";
SWIFT_OBJC_BRIDGING_HEADER = "total/total-Bridging-Header.h";
TARGETED_DEVICE_FAMILY = 1;
USER_HEADER_SEARCH_PATHS = "$(PODS_ROOT)/**";
......
......@@ -208,6 +208,7 @@
#pragma mark -获取选择油站下油罐信息
- (void)getUserTankDatas:(NSDictionary *)dict
{
WS(weakSelf);
QueryDefinition2 *condtion = [[QueryDefinition2 alloc]init];
//油站
QueryCondition *query = [[QueryCondition alloc]init];
......@@ -223,7 +224,7 @@
[HttpRequestManager requestNetworkwithURL:[NSString stringWithFormat:@"%@/mdata/gasTank/queryDefinition",HTTP_REST_API_BASE_URL] withRequestType:ZERO withParameter:[condtion toDictionary] withSuccess:^(id returnValue) {
if ([returnValue[@"success"] isEqualToNumber:@1]) {
self.tankResult = [[QueryResult alloc]initWithDictionary:returnValue[@"data"] error:nil];
weakSelf.tankResult = [[QueryResult alloc]initWithDictionary:returnValue[@"data"] error:nil];
} else {
[IBTLoadingView showTextOnly:returnValue[@"message"]];
}
......@@ -236,7 +237,7 @@
#pragma mark -通过UUID获取收油单详情
- (void)getOrderBillDetails
{
__weak typeof(self) weakSelf = self;
WS(weakSelf);
[IBTLoadingView showProgressLabel:@"加载中..."];
[HttpRequestManager requestNetworkwithURL:[NSString stringWithFormat:@"%@/receiveBill/get/%@",HTTP_REST_API_BASE_URL,self.orderUUIDString] withRequestType:ONE withParameter:nil withSuccess:^(id returnValue) {
......@@ -247,16 +248,16 @@
weakSelf.orderStateBoolValue = YES;
}
//加入数据源
self.userInputArray[ONE][ZERO] = weakSelf.orderDetails.truckNo?weakSelf.orderDetails.truckNo:@"";//车牌号
self.userInputArray[ONE][ONE] = weakSelf.orderDetails.carter?weakSelf.orderDetails.carter:@"";//司机
self.userInputArray[ONE][2] = weakSelf.orderDetails.realReceiveTime?weakSelf.orderDetails.realReceiveTime:@"请选择";//实际到油时间
self.userInputArray[ONE][3] = weakSelf.orderDetails.receiveBusinessDate?[[weakSelf.orderDetails.receiveBusinessDate componentsSeparatedByString:@" "] firstObject]:@"请选择";//到油营业时间
self.userInputArray[ONE][4] = weakSelf.orderDetails.serviceNumber;//班次号
self.userInputArray[ONE][5] = [NSString stringWithFormat:@"%.6lf",[weakSelf.orderDetails.realMeasure doubleValue]];//发油公斤数
self.userInputArray[ONE][6] = [NSString stringWithFormat:@"%.6lf",[weakSelf.orderDetails.pickFuelDensity doubleValue]];//发油密度
self.userInputArray[ONE][7] = [NSString stringWithFormat:@"%.6lf",[weakSelf.orderDetails.pickFuelDensityCapacity doubleValue]];//发油升数
self.userInputArray[ONE][8] = [NSString stringWithFormat:@"%.6lf",[weakSelf.orderDetails.wasterCapacity doubleValue]];//损耗升数
self.userInputArray[ONE][9] = weakSelf.orderDetails.remark?weakSelf.orderDetails.remark:@"";//备注;
weakSelf.userInputArray[ONE][ZERO] = weakSelf.orderDetails.truckNo?weakSelf.orderDetails.truckNo:@"";//车牌号
weakSelf.userInputArray[ONE][ONE] = weakSelf.orderDetails.carter?weakSelf.orderDetails.carter:@"";//司机
weakSelf.userInputArray[ONE][2] = weakSelf.orderDetails.realReceiveTime?weakSelf.orderDetails.realReceiveTime:@"请选择";//实际到油时间
weakSelf.userInputArray[ONE][3] = weakSelf.orderDetails.receiveBusinessDate?[[weakSelf.orderDetails.receiveBusinessDate componentsSeparatedByString:@" "] firstObject]:@"请选择";//到油营业时间
weakSelf.userInputArray[ONE][4] = weakSelf.orderDetails.serviceNumber;//班次号
weakSelf.userInputArray[ONE][5] = [NSString stringWithFormat:@"%.6lf",[weakSelf.orderDetails.realMeasure doubleValue]];//发油公斤数
weakSelf.userInputArray[ONE][6] = [NSString stringWithFormat:@"%.6lf",[weakSelf.orderDetails.pickFuelDensity doubleValue]];//发油密度
weakSelf.userInputArray[ONE][7] = [NSString stringWithFormat:@"%.6lf",[weakSelf.orderDetails.pickFuelDensityCapacity doubleValue]];//发油升数
weakSelf.userInputArray[ONE][8] = [NSString stringWithFormat:@"%.6lf",[weakSelf.orderDetails.wasterCapacity doubleValue]];//损耗升数
weakSelf.userInputArray[ONE][9] = weakSelf.orderDetails.remark?weakSelf.orderDetails.remark:@"";//备注;
//默认数据源个数
for (int i=0; i<weakSelf.orderDetails.tankDtls.count; i++) {
NSInteger index = weakSelf.orderStateBoolValue?1:2;//区分收油单状态
......@@ -266,7 +267,7 @@
for (int i=0; i<6; i++) {
[weakSelf.userInputArray[weakSelf.userInputArray.count-2] addObject:@""];
}
if (self.orderStateBoolValue) {//区分收油单状态
if (weakSelf.orderStateBoolValue) {//区分收油单状态
[weakSelf.imageAndTitleArray addObject:weakSelf.oilDatasArray[0]];
} else {
[weakSelf.imageAndTitleArray addObjectsFromArray:weakSelf.oilDatasArray];
......@@ -288,7 +289,6 @@
weakSelf.userInputArray[index][5] = [NSString stringWithFormat:@"%.6lf",[details.measureRealDelivery.quality doubleValue]];
}];
[weakSelf OilOrderDetailsHeaderAndFootView];
__weak typeof(self) weakSelf = self;
[weakSelf getDistributionOrderDetails:returnValue[@"data"][@"pickingBillNumber"] completeBlock:^(PickingBill *orderBill) {
weakSelf.userInputArray[ZERO][ZERO] = orderBill?orderBill:@"";
[weakSelf.seeObtainTableView reloadData];
......
......@@ -92,7 +92,7 @@
#pragma mark -获取配送区域数据、获取行政区域数据
- (void)netWorkRequest
{
__weak typeof(self) weakSelf = self;
WS(weakSelf);
[IBTLoadingView showProgressLabel:@"正在加载..."];
dispatch_queue_t aQueue = dispatch_queue_create("顺序执行", DISPATCH_QUEUE_SERIAL);
//创建1个queue group
......@@ -144,27 +144,44 @@
});
//任务4->获取油价列表/默认加载全部
dispatch_group_async(queueGroup, aQueue, ^{
NSDictionary *queryDictionary = @{@"pageSize" : @0,
@"orders" : @[@{@"field" : @"string",
@"direction" : @"asc"}],
@"conditions" : @[@{
@"operation" : [NSNull null],
@"parameters" : [NSNull null]}],
@"pageNumber" : @0};
[self getOilPriceDatas:queryDictionary];
NSDictionary *queryDictionary = nil;
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};
}
[self getOilPriceDatas:queryDictionary];
});
}
#pragma mark -获取油价数据
- (void)getOilPriceDatas:(NSDictionary *)dict
{
WS(weakSelf);
[HttpRequestManager requestNetworkwithURL:[NSString stringWithFormat:@"%@%@",HTTP_REST_API_BASE_URL,OILPRICE] withRequestType:ZERO withParameter:dict withSuccess:^(id returnValue) {
[IBTLoadingView hideHUDWithText:nil];
if ([returnValue[@"success"] isEqualToNumber:@1]) {
QueryResult *oilPrice = [[QueryResult alloc]initWithDictionary:returnValue[@"data"] error:nil];
self.oilPriceObjec = oilPrice;
[self.seePriceTableview reloadData];
weakSelf.oilPriceObjec = oilPrice;
[weakSelf.seePriceTableview reloadData];
}else {
[IBTLoadingView showTextOnly:returnValue[@"message"]];
}
......@@ -203,6 +220,16 @@
{
cell.backgroundColor = [UIColor whiteColor];
}
//区分是否是油站经理调用
if (self.oilListDatas.count == 1 && [[ICRUserUtil sharedInstance].position isEqualToString:@"storer"]) {
if (indexPath.row == 0) {
cell.distributionAreaContent.text = self.oilListDatas[0][@"deliveryArea"][@"name"];
}
if (indexPath.row == 1) {
cell.distributionAreaContent.text = [NSString stringWithFormat:@"[%@]%@",self.oilListDatas[0][@"area"][@"uuid"],self.oilListDatas[0][@"area"][@"name"]];
}
cell.userInteractionEnabled = NO;
}
return cell;
}
return nil;
......@@ -224,7 +251,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SeePriceTableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
__weak typeof(self) weakSelf = self;
WS(weakSelf);
if (indexPath.row == 0) {
PromptTableViewController *selectArea = [[PromptTableViewController alloc]init];
selectArea.title = @"选择配送区域";
......@@ -243,7 +270,7 @@
}];
IBTUINavigationController *nav = [[IBTUINavigationController alloc]initWithRootViewController:selectArea];
dispatch_async(dispatch_get_main_queue(), ^{
[self presentViewController:nav animated:YES completion:nil];
[weakSelf presentViewController:nav animated:YES completion:nil];
});
}
if (indexPath.row == 1) {
......
......@@ -67,6 +67,7 @@
//选中的颜色
#define BASESELECT_COLOR RGBA(255, 127, 0, 1)
#define GXF_CONTENT_COLOR HexColor(@"444444")
#define WS(weakSelf) __weak __typeof(&*self)weakSelf = self
......
......@@ -479,6 +479,7 @@ acceptTypeJson:(BOOL)bAcceptJson
userUtil.f_enterprise_name = dictResult[ @"enterprise_name" ];
userUtil.f_enterprise_uuid = dictResult[ @"enterprise_uuid" ];
userUtil.f_permissions = dictResult[ @"permissions" ];
userUtil.position = dictResult[@"position"];
userUtil.hasAffichePermission = [GTOCommonTools hasPermissionWithPermissionId:500601] || [GTOCommonTools hasPermissionWithPermissionId:500602];
userUtil.hasProjectPatrolPermission = [GTOCommonTools hasPermissionWithPermissionId:500101] || [GTOCommonTools hasPermissionWithPermissionId:500102];
userUtil.hasHSEPatrolPermission = [GTOCommonTools hasPermissionWithPermissionId:500201] || [GTOCommonTools hasPermissionWithPermissionId:500202];
......
......@@ -67,7 +67,7 @@
/**
* 油价
*/
#define OILPRICE @"/fuelPrice/query"
#define OILPRICE @"/fuelPrice/filterQuery"
/**
* 行政区域
......
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