Compare commits
2 Commits
354d11bcc0
...
ac7791c0aa
| Author | SHA1 | Date | |
|---|---|---|---|
| ac7791c0aa | |||
| b1affc64cb |
@ -1158,7 +1158,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 121;
|
||||
CURRENT_PROJECT_VERSION = 122;
|
||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = AutoCat;
|
||||
@ -1186,7 +1186,7 @@
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
|
||||
CODE_SIGN_STYLE = Automatic;
|
||||
CURRENT_PROJECT_VERSION = 121;
|
||||
CURRENT_PROJECT_VERSION = 122;
|
||||
DEVELOPMENT_TEAM = 46DTTB8X4S;
|
||||
INFOPLIST_FILE = AutoCat/Info.plist;
|
||||
INFOPLIST_KEY_CFBundleDisplayName = AutoCat;
|
||||
|
||||
@ -14,16 +14,6 @@
|
||||
symbolName = "UITableViewAlertForLayoutOutsideViewHierarchy"
|
||||
moduleName = "">
|
||||
<Locations>
|
||||
<Location
|
||||
uuid = "676638C8-1CC5-4C04-98B0-1C0D6CB28B76 - 620169ab4c7c265a"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "UITableViewAlertForLayoutOutsideViewHierarchy"
|
||||
moduleName = "UIKitCore"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
offsetFromSymbolStart = "0">
|
||||
</Location>
|
||||
</Locations>
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
@ -41,53 +31,6 @@
|
||||
endingLineNumber = "37"
|
||||
landmarkName = "configurePickerStyle(_:_:)"
|
||||
landmarkType = "7">
|
||||
<Locations>
|
||||
<Location
|
||||
uuid = "2786565A-9610-4232-920E-0763816C4DBF - f20dc4504decd67d"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "Eureka.DatePickerRowProtocol.configurePickerStyle(Eureka.DatePickerCell, __C.UIDatePickerMode) -> ()"
|
||||
moduleName = "AutoCat"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/selim/Library/Developer/Xcode/DerivedData/AutoCat-fhilwnlnsrpirleiajogdcyhyyey/SourcePackages/checkouts/Eureka/Source/Rows/DateInlineRow.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "37"
|
||||
endingLineNumber = "37"
|
||||
offsetFromSymbolStart = "260">
|
||||
</Location>
|
||||
<Location
|
||||
uuid = "2786565A-9610-4232-920E-0763816C4DBF - f20dc4504decd67d"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "Eureka.DatePickerRowProtocol.configurePickerStyle(Eureka.DatePickerCell, __C.UIDatePickerMode) -> ()"
|
||||
moduleName = "AutoCat"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/selim/Library/Developer/Xcode/DerivedData/AutoCat-fhilwnlnsrpirleiajogdcyhyyey/SourcePackages/checkouts/Eureka/Source/Rows/DateInlineRow.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "37"
|
||||
endingLineNumber = "37"
|
||||
offsetFromSymbolStart = "256">
|
||||
</Location>
|
||||
<Location
|
||||
uuid = "2786565A-9610-4232-920E-0763816C4DBF - f20dc4504decd67d"
|
||||
shouldBeEnabled = "Yes"
|
||||
ignoreCount = "0"
|
||||
continueAfterRunningActions = "No"
|
||||
symbolName = "Eureka.DatePickerRowProtocol.configurePickerStyle(Eureka.DatePickerCell, __C.UIDatePickerMode) -> ()"
|
||||
moduleName = "AutoCat"
|
||||
usesParentBreakpointCondition = "Yes"
|
||||
urlString = "file:///Users/selim/Library/Developer/Xcode/DerivedData/AutoCat-fhilwnlnsrpirleiajogdcyhyyey/SourcePackages/checkouts/Eureka/Source/Rows/DateInlineRow.swift"
|
||||
startingColumnNumber = "9223372036854775807"
|
||||
endingColumnNumber = "9223372036854775807"
|
||||
startingLineNumber = "37"
|
||||
endingLineNumber = "37"
|
||||
offsetFromSymbolStart = "112">
|
||||
</Location>
|
||||
</Locations>
|
||||
</BreakpointContent>
|
||||
</BreakpointProxy>
|
||||
</Breakpoints>
|
||||
|
||||
@ -6,6 +6,8 @@ import Eureka
|
||||
import AutoCatCore
|
||||
import SwiftEntryKit
|
||||
import MobileCoreServices
|
||||
import PKHUD
|
||||
import RxSwift
|
||||
|
||||
class ReportController: FormViewController, MediaBrowserViewControllerDataSource, MediaBrowserViewControllerDelegate, UIActivityItemSource {
|
||||
|
||||
@ -42,6 +44,8 @@ class ReportController: FormViewController, MediaBrowserViewControllerDataSource
|
||||
}
|
||||
}
|
||||
|
||||
let bag = DisposeBag()
|
||||
|
||||
// MARK: - Lifecycle
|
||||
|
||||
override func viewDidLoad() {
|
||||
@ -154,6 +158,11 @@ class ReportController: FormViewController, MediaBrowserViewControllerDataSource
|
||||
<<< SourceStatusRow("DebugNomerogram") { $0.title = NSLocalizedString("Nomerogram", comment: "") }
|
||||
}
|
||||
|
||||
form +++ Section("")
|
||||
<<< ButtonRow("CheckGB") { $0.title = NSLocalizedString("Check GB", comment: "") }.onCellSelection { cell, row in
|
||||
self.checkGB()
|
||||
}
|
||||
|
||||
setupCopyBehaviour()
|
||||
}
|
||||
|
||||
@ -270,6 +279,29 @@ class ReportController: FormViewController, MediaBrowserViewControllerDataSource
|
||||
self.updateReport()
|
||||
}
|
||||
|
||||
func checkGB() {
|
||||
guard let vehicle = self.vehicle else { return }
|
||||
|
||||
HUD.show(.progress)
|
||||
Api.checkVehicleGb(by: vehicle.getNumber()).observe(on: MainScheduler.instance).subscribe(onSuccess: { newVehicle in
|
||||
if let realm = vehicle.realm, !vehicle.isFrozen {
|
||||
try? realm.write {
|
||||
realm.add(newVehicle, update: .all)
|
||||
}
|
||||
} else {
|
||||
self.vehicle?.vin1 = newVehicle.vin1
|
||||
self.vehicle?.color = newVehicle.color
|
||||
self.vehicle?.sts = newVehicle.sts
|
||||
}
|
||||
self.updateReport()
|
||||
self.form.allSections.forEach { $0.reload() }
|
||||
HUD.hide()
|
||||
}, onFailure: { error in
|
||||
HUD.hide()
|
||||
self.show(error: error)
|
||||
}).disposed(by: self.bag)
|
||||
}
|
||||
|
||||
// MARK: - MediaBrowserViewControllerDataSource & MediaBrowserViewControllerDelegate
|
||||
|
||||
func numberOfItems(in mediaBrowser: MediaBrowserViewController) -> Int {
|
||||
|
||||
@ -70,6 +70,9 @@
|
||||
/* No comment provided by engineer. */
|
||||
"Check date" = "Дата проверки";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Check GB" = "Получить данные из бота ГБ";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Check number" = "Проверить номер";
|
||||
|
||||
@ -94,6 +97,9 @@
|
||||
/* No comment provided by engineer. */
|
||||
"Copy" = "Копировать";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Copy link to report" = "Копировать ссылку на отчет";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Copy to pasteboard" = "Копировать в буфер обмена";
|
||||
|
||||
@ -403,5 +409,3 @@
|
||||
/* No comment provided by engineer. */
|
||||
"ZIP (or OKTMO) code" = "Индекс (или ОКТМО)";
|
||||
|
||||
/* No comment provided by engineer. */
|
||||
"Copy link to report" = "Копировать ссылку на отчет";
|
||||
|
||||
@ -304,4 +304,8 @@ public class Api {
|
||||
public static func remove(note id: String) -> Single<Vehicle> {
|
||||
return self.makeBodyRequest(api: "notes", body: ["noteId": id], method: "DELETE")
|
||||
}
|
||||
|
||||
public static func checkVehicleGb(by number: String) -> Single<Vehicle> {
|
||||
return self.makeBodyRequest(api: "vehicles/checkGbTg", body: ["number": number])
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user