Compare commits

..

3 Commits

Author SHA1 Message Date
ddisfriend
8d7ab063c1 车辆监控手机号可以为空 2026-03-09 10:51:31 +08:00
ddisfriend
350affe84e 优化 2026-03-09 10:41:23 +08:00
ddisfriend
c8828c7f57 调度app新增未开票批次提醒 2026-03-04 15:50:27 +08:00
15 changed files with 137 additions and 9 deletions

View File

@@ -68,6 +68,7 @@
797484782DA67515003EEB47 /* NewTraningViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 797484772DA67515003EEB47 /* NewTraningViewModel.swift */; };
79B966382AB0651C00308A8D /* VehicleLogoutView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79B966372AB0651C00308A8D /* VehicleLogoutView.swift */; };
79BF24412E9CEFB300FA5F1E /* OnlineVehiclesEntryView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79BF24402E9CEFB300FA5F1E /* OnlineVehiclesEntryView.swift */; };
79C95CD22F58101E00230593 /* GongdanpiciTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79C95CD12F58101E00230593 /* GongdanpiciTool.swift */; };
79CB07CC2AA8465A00154B61 /* UserPermission.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79CB07CB2AA8465A00154B61 /* UserPermission.swift */; };
79CE24AA2EF52EAF007FCF90 /* IdentityAlertView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79CE24A92EF52EAF007FCF90 /* IdentityAlertView.swift */; };
79CECC122A89BD1A00B95D8B /* MessageCenterController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79CECC112A89BD1A00B95D8B /* MessageCenterController.swift */; };
@@ -207,6 +208,7 @@
797484772DA67515003EEB47 /* NewTraningViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewTraningViewModel.swift; sourceTree = "<group>"; };
79B966372AB0651C00308A8D /* VehicleLogoutView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VehicleLogoutView.swift; sourceTree = "<group>"; };
79BF24402E9CEFB300FA5F1E /* OnlineVehiclesEntryView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnlineVehiclesEntryView.swift; sourceTree = "<group>"; };
79C95CD12F58101E00230593 /* GongdanpiciTool.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GongdanpiciTool.swift; sourceTree = "<group>"; };
79CB07CB2AA8465A00154B61 /* UserPermission.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UserPermission.swift; sourceTree = "<group>"; };
79CE24A92EF52EAF007FCF90 /* IdentityAlertView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IdentityAlertView.swift; sourceTree = "<group>"; };
79CECC112A89BD1A00B95D8B /* MessageCenterController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MessageCenterController.swift; sourceTree = "<group>"; };
@@ -330,6 +332,7 @@
792EE0962AA74E5800A212AB /* PushNotiCommonTool.swift */,
79BF24402E9CEFB300FA5F1E /* OnlineVehiclesEntryView.swift */,
79CE24A92EF52EAF007FCF90 /* IdentityAlertView.swift */,
79C95CD12F58101E00230593 /* GongdanpiciTool.swift */,
);
path = View;
sourceTree = "<group>";
@@ -1186,6 +1189,7 @@
791887892A7CE79E007EA0C1 /* LoginController.swift in Sources */,
791887A42A80CA30007EA0C1 /* ResponseModel.swift in Sources */,
7938A8452E40A5F10017508A /* VehicleMonitoringVideoDetailController.swift in Sources */,
79C95CD22F58101E00230593 /* GongdanpiciTool.swift in Sources */,
794FBB0D2A8F040D00D57BB8 /* HistoryController.swift in Sources */,
7918878D2A8081D4007EA0C1 /* ActionStrings.swift in Sources */,
791887972A80C6CD007EA0C1 /* LocalizedStrings.swift in Sources */,

View File

@@ -7,6 +7,7 @@
import Foundation
import DDControlsKit_Private
import DDLogKit_Private
open class ZDViewController : DDViewController {
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) {
@@ -24,4 +25,8 @@ open class ZDViewController : DDViewController {
open func reloadData() {
}
deinit {
DDLog(message: "=================\(type(of: self))销毁了=================")
}
}

View File

@@ -173,7 +173,10 @@ open class WebViewTool : NSObject {
if let vc {
let tabVc = UIApplication.shared.dd_keyWindow.rootViewController as? MainTabBarController
let nav = tabVc?.selectedViewController as? UINavigationController
nav?.pushViewController(vc, animated: true)
if let top = nav?.topViewController, top.isMember(of: type(of: vc)) {
return
}
nav?.pushViewController(vc, animated: true)
}
}

View File

@@ -89,11 +89,17 @@ open class UserData {
public var regId : String?
func showGongdanpiciAlert() {
GongdanpiciTool.default.selectCountBySupplierId()
}
func clear() {
setToken(token: nil)
setRefreshToken(token: nil)
setSupplierType(supplierType: nil)
setUserId(userId: nil)
setSupplierId(supplierId: nil)
GongdanpiciTool.default.refreshCount()
}
}

View File

@@ -91,4 +91,6 @@ open class ApiList {
public let onlineReminder = "/supplierAppV2/dispatchApp/alarm/onlineReminder"
public let vehicleMonitorInfo = "/supplierAppV2/dispatchApp/order/vehicleMonitorInfo"
public let selectCountBySupplierId = "/order/taskInvoiceBatch/selectCountBySupplierId"
}

View File

@@ -291,3 +291,9 @@ public struct JudgeIfNeedConfirmParameters : Encodable {
public struct GiveUpParameters : Encodable {
var supplierId : Int?
}
public struct SelectCountBySupplierIdPrameters : Encodable {
var supplierId : Int?
var remindApp : Int?
var userId : Int?
}

View File

@@ -188,4 +188,8 @@ open class RequestList {
func vehicleMonitorInfo<P:Encodable>(parameters:P) -> Single<ResponseModel<VehicleMonitorInfoDataModel>?> {
return DDAF.post(urlString: HOST+API.vehicleMonitorInfo,parameters: parameters,encoding: JSONParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<VehicleMonitorInfoDataModel>.self)
}
func selectCountBySupplierId<P:Encodable>(parameters:P) -> Single<ResponseModel<Int>?> {
return DDAF.get(urlString: HOST+API.selectCountBySupplierId,parameters: parameters,encoding: URLEncodedFormParameterEncoder.default,headers: [tokenHeader()],responseType: ResponseModel<Int>.self)
}
}

View File

@@ -177,7 +177,7 @@ public class VehicleMonitorListDataModel : Decodable {
var vehicleName : String?
var driverId : Int
var driverName : String?
var driverPhone : String
var driverPhone : String?
var vehicleType : String?
var terminalType : String?
var vehicleStatus : VehicleStatusModel?
@@ -370,7 +370,7 @@ public class AppPushRecordListDataModel : Decodable {
public class ConfigByCodeDataModel : Decodable {
var bannerConfig : [ConfigByCodeBannerModel]?
var supplierAppIsUserNewReport : String?
var supplierAppIsUserNewReport : Bool?
public class ConfigByCodeBannerModel : Decodable {
var linkUrl : String?
var bannerIcon : String?

View File

@@ -121,6 +121,10 @@ class Initial : NSObject {
MCOUNT.newestMessage()
}
func initGongdanpici() {
UserData.default.showGongdanpiciAlert()
}
// MARK: <RootViewController>
func initRootViewController(){
if USER.isLogin == true {
@@ -145,6 +149,7 @@ class Initial : NSObject {
self?.initAppUpdate()
self?.initRefreshToken()
self?.initNewestMessage()
self?.initGongdanpici()
}
}

View File

@@ -47,6 +47,11 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate {
NewTraining.default.newTrainingRelay.accept(nil)
}
// app
if USER.isLogin == true, appIsAlive == true {
UserData.default.showGongdanpiciAlert()
}
// app
appIsAlive = true
}

View File

@@ -49,10 +49,10 @@ extension MineController {
return RQ.thisWeekNumber()
})
.flatMapLatest { numberModel in
return Single.zip(RQ.generalInfo(),RQ.getNeedConfirmPersonInfo(prameters: NeedConfirmPersonInfoParameters(supplierId: UserData.default.supplierId)),Single.just(numberModel))
return Single.zip(RQ.generalInfo(),RQ.getNeedConfirmPersonInfo(prameters: NeedConfirmPersonInfoParameters(supplierId: UserData.default.supplierId)),RQ.selectCountBySupplierId(parameters: SelectCountBySupplierIdPrameters(supplierId: UserData.default.supplierId,remindApp: 0,userId: UserData.default.userId)),Single.just(numberModel))
}
.observe(on: MainScheduler.instance)
.subscribe(onNext: {[weak self] response,needConfirmPersonInfoModel,numberModel in
.subscribe(onNext: {[weak self] response,needConfirmPersonInfoModel,selectCountModel,numberModel in
self?.mineView.scrollView.mj_header?.endRefreshing()
if response?.success == true {
self?.mineView.carInfoView.descLabel.text = String(response?.data?.vehicleCount ?? 0)+""
@@ -84,6 +84,17 @@ extension MineController {
}else{
self?.view.dd_makeToast(numberModel?.msg)
}
if selectCountModel?.success == true {
if let count = selectCountModel?.data, count > 0 {
self?.mineView.gongdanpici.contentView.isHidden = false
self?.mineView.gongdanpici.contentLabel.text = "\(count)"
}else{
self?.mineView.gongdanpici.contentView.isHidden = true
}
}else{
self?.view.dd_makeToast(selectCountModel?.msg)
}
})
.disposed(by: disposeBag)

View File

@@ -0,0 +1,69 @@
//
// GongdanpiciTool.swift
// OrderScheduling
//
// Created by on 2026/3/4.
//
import Foundation
import RxSwift
import PopupDialog
class GongdanpiciTool : NSObject {
public static let `default` = GongdanpiciTool()
private let disposeBag = DisposeBag()
func selectCountBySupplierId() {
guard let supplierId = UserData.default.supplierId else {
return
}
RQ.selectCountBySupplierId(parameters: SelectCountBySupplierIdPrameters(supplierId: supplierId,remindApp: 1,userId: UserData.default.userId))
.observe(on: MainScheduler.instance)
.subscribe(onSuccess: { selectCountModel in
if selectCountModel?.success == true {
if let count = selectCountModel?.data, count > 0 {
let popup = PopupDialog(title: nil, message: "工单批次中有\(count)条【未生成财务批次】数据,请及时开票。",buttonAlignment: .horizontal,transitionStyle: .zoomIn,tapGestureDismissal: false,
panGestureDismissal: false,
hideStatusBar: false){
}
let vc = popup.viewController as! PopupDialogDefaultViewController
vc.titleColor = UIColor(red: 0/255.0, green: 0/255.0, blue: 0/255.0, alpha: 1.0)
vc.messageColor = UIColor(red: 0.13, green: 0.19, blue: 0.33, alpha: 1)
vc.titleFont = UIFont.boldSystemFont(ofSize: 16)
vc.messageFont = UIFont.systemFont(ofSize: 16)
vc.titleText = "提示"
vc.titleFont = UIFont.boldSystemFont(ofSize: 18)
let buttonOne = CancelButton(title: "稍后处理") {
}
buttonOne.titleFont = UIFont.boldSystemFont(ofSize: 16)
buttonOne.titleColor = UIColor(red: 0/255.0, green: 0/255.0, blue: 0/255.0, alpha: 0.7)
let buttonTwo = DefaultButton(title: "去处理", dismissOnTap: true) {
if let supplierId = UserData.default.supplierId {
WEBTOOL.open(name: .invoicingNotify, appending: "&supplierId=\(supplierId)")
}
}
buttonTwo.titleFont = UIFont.boldSystemFont(ofSize: 16)
buttonTwo.titleColor = UIColor(red: 29/255.0, green: 100/255.0, blue: 210/255.0, alpha: 0.7)
popup.addButtons([buttonOne, buttonTwo])
let tabBarVc = UIApplication.shared.dd_keyWindow.rootViewController as? UITabBarController
let nav = tabBarVc?.selectedViewController as? UINavigationController
nav?.topViewController?.present(popup, animated: true)
}
}else{
let tabBarVc = UIApplication.shared.dd_keyWindow.rootViewController as? UITabBarController
let nav = tabBarVc?.selectedViewController as? UINavigationController
nav?.topViewController?.view.dd_makeToast(selectCountModel?.msg)
}
})
.disposed(by: disposeBag)
}
func refreshCount() {
UserDefaults.standard.set(0, forKey: "selectCountBySupplierId")
}
}

View File

@@ -143,7 +143,7 @@ extension RescueController {
.observe(on: MainScheduler.instance)
.subscribe(onNext: {[weak self] response in
if response?.success == true {
WEBTOOL.supplierAppIsUserNewReport = (response?.data?.supplierAppIsUserNewReport == "true")
WEBTOOL.supplierAppIsUserNewReport = (response?.data?.supplierAppIsUserNewReport == true)
}else{
self?.view.dd_makeToast(response?.msg)
}

View File

@@ -213,7 +213,11 @@ extension VehicleMonitoringController {
.observe(on: MainScheduler.instance)
.subscribe(onNext: {[weak self] _ in
if let model = self?.selectedModel {
URLLINKS.openUrl(type: .phone, appending: model.driverPhone)
guard let driverPhone = model.driverPhone else {
self?.view.dd_makeToast("空号")
return
}
URLLINKS.openUrl(type: .phone, appending: driverPhone)
}
})
.disposed(by: disposeBag)

View File

@@ -98,8 +98,12 @@ extension VehicleMonitoringListController : UITableViewDelegate,UITableViewDataS
cell?.callButton.rx.tap
.observe(on: MainScheduler.instance)
.subscribe(onNext: { _ in
URLLINKS.openUrl(type: .phone, appending: model.driverPhone)
.subscribe(onNext: {[weak self] _ in
guard let driverPhone = model.driverPhone else {
self?.view.dd_makeToast("空号")
return
}
URLLINKS.openUrl(type: .phone, appending: driverPhone)
})
.disposed(by: cell!.disposeBag)
return cell!