Commit e0abf551 authored by 哈南's avatar 哈南

no message

parent 252f9315
...@@ -150,7 +150,9 @@ ...@@ -150,7 +150,9 @@
29F6B9042008B5B400EE4630 /* DepartmentResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B9032008B5B300EE4630 /* DepartmentResultModel.swift */; }; 29F6B9042008B5B400EE4630 /* DepartmentResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B9032008B5B300EE4630 /* DepartmentResultModel.swift */; };
29F6B908200C4F1500EE4630 /* BillCompletedRequestModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B907200C4F1500EE4630 /* BillCompletedRequestModel.swift */; }; 29F6B908200C4F1500EE4630 /* BillCompletedRequestModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B907200C4F1500EE4630 /* BillCompletedRequestModel.swift */; };
29F6B90A200C54CD00EE4630 /* RepairOrderCompletedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B909200C54CD00EE4630 /* RepairOrderCompletedViewController.swift */; }; 29F6B90A200C54CD00EE4630 /* RepairOrderCompletedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 29F6B909200C54CD00EE4630 /* RepairOrderCompletedViewController.swift */; };
3429FE55214001AC0084BDF9 /* HomeLinDanController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3429FE54214001AC0084BDF9 /* HomeLinDanController.swift */; };
345FC5AA2108549D00291E41 /* IFSPersonFilterController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345FC5A92108549D00291E41 /* IFSPersonFilterController.swift */; }; 345FC5AA2108549D00291E41 /* IFSPersonFilterController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345FC5A92108549D00291E41 /* IFSPersonFilterController.swift */; };
348741D2214274FD008113A2 /* SBSkipTool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 348741D1214274FD008113A2 /* SBSkipTool.swift */; };
34CB3FAC210978A500E41667 /* TreeFliteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34CB3FAB210978A500E41667 /* TreeFliteViewController.swift */; }; 34CB3FAC210978A500E41667 /* TreeFliteViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34CB3FAB210978A500E41667 /* TreeFliteViewController.swift */; };
34CB3FAF21097B0400E41667 /* TreeFliteLocationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34CB3FAD21097B0400E41667 /* TreeFliteLocationCell.swift */; }; 34CB3FAF21097B0400E41667 /* TreeFliteLocationCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 34CB3FAD21097B0400E41667 /* TreeFliteLocationCell.swift */; };
34CB3FB021097B0400E41667 /* TreeFliteLocationCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34CB3FAE21097B0400E41667 /* TreeFliteLocationCell.xib */; }; 34CB3FB021097B0400E41667 /* TreeFliteLocationCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 34CB3FAE21097B0400E41667 /* TreeFliteLocationCell.xib */; };
...@@ -317,7 +319,9 @@ ...@@ -317,7 +319,9 @@
29F6B9032008B5B300EE4630 /* DepartmentResultModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DepartmentResultModel.swift; sourceTree = "<group>"; }; 29F6B9032008B5B300EE4630 /* DepartmentResultModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DepartmentResultModel.swift; sourceTree = "<group>"; };
29F6B907200C4F1500EE4630 /* BillCompletedRequestModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BillCompletedRequestModel.swift; sourceTree = "<group>"; }; 29F6B907200C4F1500EE4630 /* BillCompletedRequestModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BillCompletedRequestModel.swift; sourceTree = "<group>"; };
29F6B909200C54CD00EE4630 /* RepairOrderCompletedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepairOrderCompletedViewController.swift; sourceTree = "<group>"; }; 29F6B909200C54CD00EE4630 /* RepairOrderCompletedViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RepairOrderCompletedViewController.swift; sourceTree = "<group>"; };
3429FE54214001AC0084BDF9 /* HomeLinDanController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeLinDanController.swift; sourceTree = "<group>"; };
345FC5A92108549D00291E41 /* IFSPersonFilterController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IFSPersonFilterController.swift; sourceTree = "<group>"; }; 345FC5A92108549D00291E41 /* IFSPersonFilterController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IFSPersonFilterController.swift; sourceTree = "<group>"; };
348741D1214274FD008113A2 /* SBSkipTool.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SBSkipTool.swift; sourceTree = "<group>"; };
34CB3FAB210978A500E41667 /* TreeFliteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreeFliteViewController.swift; sourceTree = "<group>"; }; 34CB3FAB210978A500E41667 /* TreeFliteViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreeFliteViewController.swift; sourceTree = "<group>"; };
34CB3FAD21097B0400E41667 /* TreeFliteLocationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreeFliteLocationCell.swift; sourceTree = "<group>"; }; 34CB3FAD21097B0400E41667 /* TreeFliteLocationCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TreeFliteLocationCell.swift; sourceTree = "<group>"; };
34CB3FAE21097B0400E41667 /* TreeFliteLocationCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TreeFliteLocationCell.xib; sourceTree = "<group>"; }; 34CB3FAE21097B0400E41667 /* TreeFliteLocationCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TreeFliteLocationCell.xib; sourceTree = "<group>"; };
...@@ -774,6 +778,7 @@ ...@@ -774,6 +778,7 @@
296FE43B1FFB2D1D00810820 /* HomeViewController.swift */, 296FE43B1FFB2D1D00810820 /* HomeViewController.swift */,
296FE4491FFB5C9600810820 /* HomeContentViewController.swift */, 296FE4491FFB5C9600810820 /* HomeContentViewController.swift */,
296FE44B1FFB5CAB00810820 /* HomeTableViewController.swift */, 296FE44B1FFB5CAB00810820 /* HomeTableViewController.swift */,
3429FE54214001AC0084BDF9 /* HomeLinDanController.swift */,
); );
path = Controller; path = Controller;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -915,6 +920,7 @@ ...@@ -915,6 +920,7 @@
29EA0BD21FEA3156005A6170 /* Expand */ = { 29EA0BD21FEA3156005A6170 /* Expand */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
348741D0214274F6008113A2 /* Tool */,
29EA0BD31FEA3156005A6170 /* Base */, 29EA0BD31FEA3156005A6170 /* Base */,
29EA0BDA1FEA3156005A6170 /* Category */, 29EA0BDA1FEA3156005A6170 /* Category */,
29EA0BDD1FEA3156005A6170 /* Const */, 29EA0BDD1FEA3156005A6170 /* Const */,
...@@ -1018,6 +1024,14 @@ ...@@ -1018,6 +1024,14 @@
path = WebView; path = WebView;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
348741D0214274F6008113A2 /* Tool */ = {
isa = PBXGroup;
children = (
348741D1214274FD008113A2 /* SBSkipTool.swift */,
);
path = Tool;
sourceTree = "<group>";
};
34CB3FB12109957800E41667 /* Tool */ = { 34CB3FB12109957800E41667 /* Tool */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -1242,6 +1256,7 @@ ...@@ -1242,6 +1256,7 @@
29F6B9002008A34700EE4630 /* RepairOrderDetailBgController.swift in Sources */, 29F6B9002008A34700EE4630 /* RepairOrderDetailBgController.swift in Sources */,
29EA0C0D1FEA3156005A6170 /* Color+Extension.swift in Sources */, 29EA0C0D1FEA3156005A6170 /* Color+Extension.swift in Sources */,
29D5307F1FFF626500851F00 /* RepairOrderAddTableViewController.swift in Sources */, 29D5307F1FFF626500851F00 /* RepairOrderAddTableViewController.swift in Sources */,
348741D2214274FD008113A2 /* SBSkipTool.swift in Sources */,
29EA0C061FEA3156005A6170 /* BaseViewModel.swift in Sources */, 29EA0C061FEA3156005A6170 /* BaseViewModel.swift in Sources */,
29DA418620046E86002762A2 /* AboutUsTableViewController.swift in Sources */, 29DA418620046E86002762A2 /* AboutUsTableViewController.swift in Sources */,
29EA0BFF1FEA3156005A6170 /* TabBarViewController.swift in Sources */, 29EA0BFF1FEA3156005A6170 /* TabBarViewController.swift in Sources */,
...@@ -1271,6 +1286,7 @@ ...@@ -1271,6 +1286,7 @@
296DAD7C2006F63B00615A2D /* ProjectSponsorsModel.swift in Sources */, 296DAD7C2006F63B00615A2D /* ProjectSponsorsModel.swift in Sources */,
29D5307E1FFF626500851F00 /* FunctionViewModel.swift in Sources */, 29D5307E1FFF626500851F00 /* FunctionViewModel.swift in Sources */,
29DA417020035610002762A2 /* RepairOrderEditSonOrderViewController.swift in Sources */, 29DA417020035610002762A2 /* RepairOrderEditSonOrderViewController.swift in Sources */,
3429FE55214001AC0084BDF9 /* HomeLinDanController.swift in Sources */,
29D530831FFF626500851F00 /* RepairOrderTableViewCell.swift in Sources */, 29D530831FFF626500851F00 /* RepairOrderTableViewCell.swift in Sources */,
34D514292109683600E0B577 /* TreeLocationModel.swift in Sources */, 34D514292109683600E0B577 /* TreeLocationModel.swift in Sources */,
29EA0C111FEA3156005A6170 /* UIImage+Extension.swift in Sources */, 29EA0C111FEA3156005A6170 /* UIImage+Extension.swift in Sources */,
......
...@@ -21,21 +21,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -21,21 +21,18 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
} }
func applicationWillResignActive(_ application: UIApplication) { 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) { 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) { 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) { 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.
UIApplication.shared.applicationIconBadgeNumber = 0 UIApplication.shared.applicationIconBadgeNumber = 0
JPUSHService.resetBadge() JPUSHService.resetBadge()
} }
...@@ -45,6 +42,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -45,6 +42,9 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
} }
func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) {
let nsdataStr = NSData.init(data: deviceToken)
let device = nsdataStr.description.replacingOccurrences(of: "<", with: "").replacingOccurrences(of: ">", with: "").replacingOccurrences(of: " ", with: "")
print(device)
//注册 DeviceToken //注册 DeviceToken
JPUSHService.registerDeviceToken(deviceToken) JPUSHService.registerDeviceToken(deviceToken)
} }
...@@ -54,12 +54,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate { ...@@ -54,12 +54,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
NSLog("did Fail To Register For Remote Notifications With Error: \(error)") NSLog("did Fail To Register For Remote Notifications With Error: \(error)")
} }
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) { // func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
JPUSHService.handleRemoteNotification(userInfo) // JPUSHService.handleRemoteNotification(userInfo)
completionHandler(UIBackgroundFetchResult.newData) // completionHandler(UIBackgroundFetchResult.newData)
} // }
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) { // func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
JPUSHService.handleRemoteNotification(userInfo) // JPUSHService.handleRemoteNotification(userInfo)
} // }
} }
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved. // Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
// //
import Foundation import Foundation
var NRIsTouch: Bool = false
extension AppDelegate:JPUSHRegisterDelegate{ extension AppDelegate:JPUSHRegisterDelegate{
@available(iOS 10.0, *) @available(iOS 10.0, *)
func jpushNotificationCenter(_ center: UNUserNotificationCenter!, willPresent notification: UNNotification!, withCompletionHandler completionHandler: ((Int) -> Void)!) { func jpushNotificationCenter(_ center: UNUserNotificationCenter!, willPresent notification: UNNotification!, withCompletionHandler completionHandler: ((Int) -> Void)!) {
...@@ -20,19 +21,37 @@ extension AppDelegate:JPUSHRegisterDelegate{ ...@@ -20,19 +21,37 @@ extension AppDelegate:JPUSHRegisterDelegate{
@available(iOS 10.0, *) @available(iOS 10.0, *)
func jpushNotificationCenter(_ center: UNUserNotificationCenter!, didReceive response: UNNotificationResponse!, withCompletionHandler completionHandler: (() -> Void)!) { func jpushNotificationCenter(_ center: UNUserNotificationCenter!, didReceive response: UNNotificationResponse!, withCompletionHandler completionHandler: (() -> Void)!) {
let userInfo = response.notification.request.content.userInfo let userInfo = response.notification.request.content.userInfo
NRIsTouch = true
SBSkipTool.share.skipViewController(parameters: userInfo)
if response.notification.request.trigger is UNPushNotificationTrigger { if response.notification.request.trigger is UNPushNotificationTrigger {
JPUSHService.handleRemoteNotification(userInfo) JPUSHService.handleRemoteNotification(userInfo)
} }
// 系统要求执行这个方法 // 系统要求执行这个方法
completionHandler() completionHandler()
} }
@objc func networkDidReceiveMessage(notification:Notification){
guard notification.userInfo != nil else {
return
}
let userInfo = notification.userInfo!["extras"]
// SBSkipTool.share.skipViewController(parameters: userInfo as? [AnyHashable : Any])
}
func registerPush(launchOptions: [UIApplicationLaunchOptionsKey: Any]?){ func registerPush(launchOptions: [UIApplicationLaunchOptionsKey: Any]?){
NotificationCenter.default.addObserver(self, selector: #selector(networkDidReceiveMessage(notification:)), name: NSNotification.Name.jpfNetworkDidReceiveMessage, object: nil)
let entity = JPUSHRegisterEntity() let entity = JPUSHRegisterEntity()
entity.types = Int(JPAuthorizationOptions.alert.rawValue|JPAuthorizationOptions.badge.rawValue|JPAuthorizationOptions.sound.rawValue) entity.types = Int(JPAuthorizationOptions.alert.rawValue|JPAuthorizationOptions.badge.rawValue|JPAuthorizationOptions.sound.rawValue)
JPUSHService.register(forRemoteNotificationConfig: entity, delegate: self) JPUSHService.register(forRemoteNotificationConfig: entity, delegate: self)
JPUSHService.setup(withOption: launchOptions, appKey: "6554c0463b6a9ff2262f4d3d", channel: "App Store", apsForProduction: false) JPUSHService.setup(withOption: launchOptions, appKey: "6554c0463b6a9ff2262f4d3d", channel: "App Store", apsForProduction: false)
} }
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) {
SBSkipTool.share.skipViewController(parameters: userInfo)
JPUSHService.handleRemoteNotification(userInfo)
}
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any], fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
JPUSHService.handleRemoteNotification(userInfo)
completionHandler(UIBackgroundFetchResult.newData)
SBSkipTool.share.skipViewController(parameters: userInfo)
}
} }
...@@ -20,3 +20,6 @@ public let UPDATE_REPAIRORDER_ADD_LIST: String = "UPDATE_REPAIRORDER_ADD_LIST" ...@@ -20,3 +20,6 @@ public let UPDATE_REPAIRORDER_ADD_LIST: String = "UPDATE_REPAIRORDER_ADD_LIST"
/// 更新新建工单列表 /// 更新新建工单列表
public let UPDATE_RECEIVE_ORDER_LIST: String = "UPDATE_RECEIVE_ORDER_LIST" public let UPDATE_RECEIVE_ORDER_LIST: String = "UPDATE_RECEIVE_ORDER_LIST"
/// 更新代办消息
public let UPDATE_TODO_LIST: String = "UPDATE_TODO_LIST"
...@@ -20,20 +20,20 @@ import Foundation ...@@ -20,20 +20,20 @@ import Foundation
//public let BaseUrl: String="http://183.221.125.236:7080/ifs-server/rest/" //public let BaseUrl: String="http://183.221.125.236:7080/ifs-server/rest/"
//public let BaseAttachmentUrl: String="http://183.221.125.236:7080" //public let BaseAttachmentUrl: String="http://183.221.125.236:7080"
////重庆IFS正式环境 ////重庆IFS正式环境
public let BaseUrl: String="http://222.180.250.18:7090/ifs-server/rest/" //public let BaseUrl: String="http://222.180.250.18:7090/ifs-server/rest/"
public let BaseAttachmentUrl: String="http://222.180.250.18:7090" //public let BaseAttachmentUrl: String="http://222.180.250.18:7090"
//正式环境 //正式环境
//public let BaseUrl: String = "http://222.180.250.18:7090/ifs-server/rest" //public let BaseUrl: String = "http://222.180.250.18:7090/ifs-server/rest"
//public let BaseAttachmentUrl: String = "http://222.180.250.18:7090" //public let BaseAttachmentUrl: String = "http://222.180.250.18:7090"
//测试环境 //测试环境
//public let BaseUrl: String = "http://183.221.125.236:7080/ifs-server/rest" //public let BaseUrl: String="http://222.180.250.18:7080/ifs-server/rest/"
//public let BaseAttachmentUrl: String = "http://183.221.125.236:7080" //public let BaseAttachmentUrl: String="http://222.180.250.18:7080"
//外网开发环境 //外网开发环境
//public let BaseUrl: String = "http://dev.gomoretech.com/ifs-server/rest" public let BaseUrl: String = "http://dev.gomoretech.com/ifs-server/rest/"
//public let BaseAttachmentUrl: String = "http://dev.gomoretech.com" public let BaseAttachmentUrl: String = "http://dev.gomoretech.com"
/// 登录 /// 登录
public let loginUrl: String = "/user/login/%@" public let loginUrl: String = "/user/login/%@"
...@@ -113,6 +113,8 @@ public let submitMessageRemind: String = "/work/submitMessageRemind/%@/%@" ...@@ -113,6 +113,8 @@ public let submitMessageRemind: String = "/work/submitMessageRemind/%@/%@"
public let drawMessageRemind: String = "/work/drawMessageRemind/%@/%@" public let drawMessageRemind: String = "/work/drawMessageRemind/%@/%@"
///查询树状位置信息 ///查询树状位置信息
public let queryTreeLocationPath: String = "/information/position/getPositionTree?storeId=%@" public let queryTreeLocationPath: String = "/information/position/getPositionTree?storeId=%@"
///查询用户电话
public let queryMobile: String = "/ifsUserOrganization/query/getUserId/%@"
......
...@@ -86,6 +86,8 @@ public enum Service { ...@@ -86,6 +86,8 @@ public enum Service {
case ChildOrderComplete(String,String) case ChildOrderComplete(String,String)
// MARK: - 查询树状型位置信息 // MARK: - 查询树状型位置信息
case queryTreeLocation(String) case queryTreeLocation(String)
// MARK: - 查询用户电话
case queryUserMobile(String)
} }
extension Service: TargetType { extension Service: TargetType {
...@@ -182,6 +184,9 @@ extension Service: TargetType { ...@@ -182,6 +184,9 @@ extension Service: TargetType {
case .queryTreeLocation(let uuid): case .queryTreeLocation(let uuid):
let path = String(format: queryTreeLocationPath, uuid) let path = String(format: queryTreeLocationPath, uuid)
return path.urlEncoded() return path.urlEncoded()
case .queryUserMobile(let uuid):
let path = String(format: queryMobile, uuid)
return path.urlEncoded()
} }
} }
...@@ -223,6 +228,7 @@ extension Service: TargetType { ...@@ -223,6 +228,7 @@ extension Service: TargetType {
.QueryPrority(), .QueryPrority(),
.queryTreeLocation(_), .queryTreeLocation(_),
.ChildOrderComplete(_, _), .ChildOrderComplete(_, _),
.queryUserMobile(_),
.CompleteMessageRemind(_,_): .CompleteMessageRemind(_,_):
return .get return .get
} }
...@@ -264,6 +270,7 @@ extension Service: TargetType { ...@@ -264,6 +270,7 @@ extension Service: TargetType {
.Queryfloorlayer(_), .Queryfloorlayer(_),
.QueryInitiator(_), .QueryInitiator(_),
.queryTreeLocation(_), .queryTreeLocation(_),
.queryUserMobile(_),
.CompleteMessageRemind(_,_), .CompleteMessageRemind(_,_),
.ChildOrderComplete(_, _), .ChildOrderComplete(_, _),
.QueryPrority(): .QueryPrority():
......
//
// SBSkipTool.swift
// LanStoreBusiness
//
// Created by 飞迪1 on 2018/7/20.
// Copyright © 2018年 勾芒. All rights reserved.
//
import SwiftyJSON
import Foundation
class SBSkipTool {
static let share = SBSkipTool()
func skipViewController(parameters:[AnyHashable : Any]?){
if parameters == nil{
return
}
let sourceType:String = (parameters?["sourceType"] as? String) ?? ""
let uuid:String = (parameters?["id"] as? String) ?? ""
let state:String = (parameters?["workBillState"] as? String) ?? ""
switch sourceType {
case "workExecute":
self.toBillVC(state: state, uuid: uuid)
// let childBillVc = RepairOrderEditSonOrderViewController.instantiateViewController(.Function) as! RepairOrderEditSonOrderViewController
// childBillVc.billModel = BillDetailExecute(fromJson:"")
// childBillVc.billModel.uuid = uuid
// zj_getCurrentVC()?.pushVC(childBillVc)
case "workBill":
if uuid != ""{
let detailBgController = UIStoryboard(name: "Function", bundle: nil).instantiateViewController(withIdentifier: RepairOrderDetailBgController.name()) as! RepairOrderDetailBgController
detailBgController.billModel = RepairOrderRecord(fromJson: JSON(rawValue: ""))
detailBgController.billModel.uuid = uuid
zj_getCurrentVC()?.pushVC(detailBgController)
}
default:
break
}
}
func toBillVC(state:String,uuid:String){
switch state {
case "submit":
let lindanVC = HomeLinDanController.instantiateViewController(.Function) as! HomeLinDanController
lindanVC.model = TodoData(fromJson: JSON(rawValue: ""))
lindanVC.model.entityUuid = uuid
zj_getCurrentVC()?.pushVC(lindanVC)
case "drew":
let childBillVc = RepairOrderEditSonOrderViewController.instantiateViewController(.Function) as! RepairOrderEditSonOrderViewController
childBillVc.billModel = BillDetailExecute(fromJson: JSON(rawValue: ""))
childBillVc.billModel.uuid = uuid
zj_getCurrentVC()?.pushVC(childBillVc)
case "done":
let childBillVc = RepairOrderChildBillDetailViewController.instantiateViewController(.Function) as! RepairOrderChildBillDetailViewController
childBillVc.billModel = BillDetailExecute(fromJson: JSON(rawValue: ""))
childBillVc.billModel.uuid = uuid
zj_getCurrentVC()?.pushVC(childBillVc)
default:
break
}
}
}
func zj_getCurrentVC() -> UIViewController? {
if let vc = kWindow.rootViewController {
var currentVC = vc
if let presentedVC = currentVC.presentedViewController {
currentVC = presentedVC
}
if currentVC.isKind(of: UITabBarController.self) {
currentVC = (currentVC as! UITabBarController).selectedViewController!
}
if currentVC.isKind(of: UINavigationController.self) {
currentVC = (currentVC as! UINavigationController).visibleViewController!
}
return currentVC
}else{
return nil
}
}
...@@ -62,7 +62,8 @@ class RepairOrderAddTableViewController: BaseTableViewController { ...@@ -62,7 +62,8 @@ class RepairOrderAddTableViewController: BaseTableViewController {
attachmentVc.delegate = self attachmentVc.delegate = self
return attachmentVc return attachmentVc
}() }()
//接口请求电话
var getMobile = ""
/// RepairOrderAddViewModel /// RepairOrderAddViewModel
/// 新建工单ViewModel /// 新建工单ViewModel
lazy final var repairOrderAddViewModel: RepairOrderAddViewModel = { lazy final var repairOrderAddViewModel: RepairOrderAddViewModel = {
...@@ -76,8 +77,25 @@ class RepairOrderAddTableViewController: BaseTableViewController { ...@@ -76,8 +77,25 @@ class RepairOrderAddTableViewController: BaseTableViewController {
uiConfigAction() uiConfigAction()
setupPhotoAttachmentVc() setupPhotoAttachmentVc()
bindingRxAction() bindingRxAction()
getUserMobile()
}
//设置初始值
func getUserMobile(){
originatorTimeLabel.text = Date().toString(format: "yyyy-MM-dd HH:mm:ss")
self.repairOrderAddViewModel.saveOrderModel.requestTime = Date().toString(format: "yyyy-MM-dd HH:mm:ss")
self.originatorTimeLabel.textColor = kBlackColor
Network.request(target: Service.queryUserMobile(kUser().userCode), success: {[weak self] (respone) in
print(respone)
if respone["data"] != nil{
let personDic = respone["data"].dictionaryValue
self?.phoneNumberText.text = personDic["mobile"]?.stringValue
self?.repairOrderAddViewModel.saveOrderModel.reporterPhone = self?.phoneNumberText.text
}
}) { (error) in
}
} }
// MARK: - UI // MARK: - UI
fileprivate func uiConfigAction() { fileprivate func uiConfigAction() {
describeTextView.placeholder = "工单描述" describeTextView.placeholder = "工单描述"
......
...@@ -94,7 +94,7 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController { ...@@ -94,7 +94,7 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
// MARK: - UI // MARK: - UI
fileprivate func uiConfigAction() { fileprivate func uiConfigAction() {
title = String(format: "%@工单详情", billModel.dept.name) // title = String(format: "%@工单详情", billModel.dept.name)
tableView.register(UINib(nibName: RepairOrderDetailSectionView.name(), bundle: nil), forHeaderFooterViewReuseIdentifier: RepairOrderDetailSectionView.name()) tableView.register(UINib(nibName: RepairOrderDetailSectionView.name(), bundle: nil), forHeaderFooterViewReuseIdentifier: RepairOrderDetailSectionView.name())
tableView.register(UINib(nibName: MaintainBeforAttachmentTableViewCell.name(), bundle: nil), forCellReuseIdentifier: MaintainBeforAttachmentTableViewCell.name()) tableView.register(UINib(nibName: MaintainBeforAttachmentTableViewCell.name(), bundle: nil), forCellReuseIdentifier: MaintainBeforAttachmentTableViewCell.name())
tableView.register(UINib(nibName: MaintainAfterAttachmentTableViewCell.name(), bundle: nil), forCellReuseIdentifier: MaintainAfterAttachmentTableViewCell.name()) tableView.register(UINib(nibName: MaintainAfterAttachmentTableViewCell.name(), bundle: nil), forCellReuseIdentifier: MaintainAfterAttachmentTableViewCell.name())
...@@ -108,11 +108,14 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController { ...@@ -108,11 +108,14 @@ class RepairOrderChildBillDetailViewController: BaseTableViewController {
childBillViewModel.queryChildBillDetailAction(billModel.uuid).subscribe {[weak self] (event) in childBillViewModel.queryChildBillDetailAction(billModel.uuid).subscribe {[weak self] (event) in
self?.childBillViewModel.childBillDetailAssignment(self!) self?.childBillViewModel.childBillDetailAssignment(self!)
self?.childBillViewModel.billDetailStataDispose(self!) self?.childBillViewModel.billDetailStataDispose(self!)
self?.updateUI()
self?.disposeAttachment() self?.disposeAttachment()
self?.tableView.reloadData() self?.tableView.reloadData()
}.disposed(by: disposeBag) }.disposed(by: disposeBag)
} }
func updateUI(){
self.navigationItem.title = String(format: "完成%@工单", self.childBillViewModel.childBillDetailData.dept.name)
}
// MARK: - 获取图片附件通过entity uuid // MARK: - 获取图片附件通过entity uuid
fileprivate func disposeAttachment() { fileprivate func disposeAttachment() {
if !childBillViewModel.childBillDetailData.beginAttachmentId.isEmpty { if !childBillViewModel.childBillDetailData.beginAttachmentId.isEmpty {
......
...@@ -116,7 +116,7 @@ class RepairOrderDetailViewController: BaseTableViewController { ...@@ -116,7 +116,7 @@ class RepairOrderDetailViewController: BaseTableViewController {
tableView.register(UINib(nibName: RepairOrderAttachmentTableViewCell.name(), bundle: nil), forCellReuseIdentifier: RepairOrderAttachmentTableViewCell.name()) tableView.register(UINib(nibName: RepairOrderAttachmentTableViewCell.name(), bundle: nil), forCellReuseIdentifier: RepairOrderAttachmentTableViewCell.name())
tableView.register(UINib(nibName: RepairOrderSubOrderTableViewCell.name(), bundle: nil), forCellReuseIdentifier: RepairOrderSubOrderTableViewCell.name()) tableView.register(UINib(nibName: RepairOrderSubOrderTableViewCell.name(), bundle: nil), forCellReuseIdentifier: RepairOrderSubOrderTableViewCell.name())
addChildViewController(attachmentVc) addChildViewController(attachmentVc)
orderDetailViewModel.billDetailModel = BillDetailData(billModel.state) orderDetailViewModel.billDetailModel = BillDetailData("")
} }
// MARK: - 获取tableView显示内容高度 // MARK: - 获取tableView显示内容高度
...@@ -153,7 +153,6 @@ class RepairOrderDetailViewController: BaseTableViewController { ...@@ -153,7 +153,6 @@ class RepairOrderDetailViewController: BaseTableViewController {
self?.tableView.reloadData() self?.tableView.reloadData()
}.disposed(by: disposeBag) }.disposed(by: disposeBag)
} }
// MARK: - 悬浮框状态判断 // MARK: - 悬浮框状态判断
fileprivate func suspendViewStateAction() { fileprivate func suspendViewStateAction() {
for i in 0..<orderDetailViewModel.billDetailModel.executes.count { for i in 0..<orderDetailViewModel.billDetailModel.executes.count {
......
...@@ -81,7 +81,7 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController { ...@@ -81,7 +81,7 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
// MARK: - UI // MARK: - UI
fileprivate func uiConfigAction() { fileprivate func uiConfigAction() {
describeTextView.placeholder = "描述" describeTextView.placeholder = "描述"
title = String(format: "完成%@工单", billModel.dept.name) // title = String(format: "完成%@工单", billModel.dept.name)
describeTextView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0) describeTextView.textContainerInset = UIEdgeInsetsMake(0, 0, 0, 0)
tableView.register(UINib(nibName: CostOrBorrowTableViewCell.name(), bundle: nil), forCellReuseIdentifier: CostOrBorrowTableViewCell.name()) tableView.register(UINib(nibName: CostOrBorrowTableViewCell.name(), bundle: nil), forCellReuseIdentifier: CostOrBorrowTableViewCell.name())
} }
...@@ -116,7 +116,7 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController { ...@@ -116,7 +116,7 @@ class RepairOrderEditSonOrderViewController: BaseTableViewController {
}.disposed(by: disposeBag) }.disposed(by: disposeBag)
} }
func updateUI(){ func updateUI(){
self.navigationItem.title = String(format: "完成%@工单", self.childBillViewModel.childBillDetailData.dept.name)
if self.childBillViewModel.childBillDetailData.isEditable && PermissionsManager.saveChildPermissions() { if self.childBillViewModel.childBillDetailData.isEditable && PermissionsManager.saveChildPermissions() {
navigationItem.rightBarButtonItem = createButtonItem("保存", nil, self, #selector(RepairOrderEditSonOrderViewController.saveButtonClickAction)) navigationItem.rightBarButtonItem = createButtonItem("保存", nil, self, #selector(RepairOrderEditSonOrderViewController.saveButtonClickAction))
} }
......
...@@ -25,6 +25,7 @@ class RepairOrderAddViewModel: BaseViewModel { ...@@ -25,6 +25,7 @@ class RepairOrderAddViewModel: BaseViewModel {
var saveOrderModel = SaveRepairOrderModel() var saveOrderModel = SaveRepairOrderModel()
return saveOrderModel return saveOrderModel
}() }()
} }
extension RepairOrderAddViewModel { extension RepairOrderAddViewModel {
...@@ -58,10 +59,10 @@ extension RepairOrderAddViewModel { ...@@ -58,10 +59,10 @@ extension RepairOrderAddViewModel {
ShowMessage("请选择项目") ShowMessage("请选择项目")
return false return false
} }
// guard saveOrderModel.source != nil else { guard saveOrderModel.source != nil else {
// ShowMessage("请选择工单来源") ShowMessage("请选择工单来源")
// return false return false
// } }
// guard saveOrderModel.serviceType != nil else { // guard saveOrderModel.serviceType != nil else {
// ShowMessage("请选择工单服务类型") // ShowMessage("请选择工单服务类型")
// return false // return false
...@@ -293,12 +294,13 @@ extension RepairOrderAddViewModel { ...@@ -293,12 +294,13 @@ extension RepairOrderAddViewModel {
}).disposed(by: disposeBag) }).disposed(by: disposeBag)
break break
case IndexPath(row: 7, section: 0): case IndexPath(row: 7, section: 0):
let defaultDate = controller.originatorTimeLabel.text == "工单接报时间" ? NSDate().httpParameterString() : controller.originatorTimeLabel.text // let defaultDate = controller.originatorTimeLabel.text == "工单接报时间" ? NSDate().httpParameterString() : controller.originatorTimeLabel.text
let defaultDate = controller.originatorTimeLabel.text
var date: Date? var date: Date?
if saveOrderModel.requestTime != nil { if saveOrderModel.requestTime != nil {
date = Date(fromString: saveOrderModel.requestTime, format: "yyyy-MM-dd HH:mm:ss")! date = Date(fromString: saveOrderModel.requestTime, format: "yyyy-MM-dd HH:mm:ss")!
} }
YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: Date(), maximumDate: date, defaultDate: defaultDate, commit: {[weak self] (time) in YXPickerManager.share().showDatePickerView(kMainColor, datePickerModel: UIDatePickerMode.dateAndTime, minimumDate: Date(), maximumDate: nil, defaultDate: defaultDate, commit: {[weak self] (time) in
controller.originatorTimeLabel.text = time controller.originatorTimeLabel.text = time
controller.originatorTimeLabel.textColor = kBlackColor controller.originatorTimeLabel.textColor = kBlackColor
self?.saveOrderModel.receiveTime = time self?.saveOrderModel.receiveTime = time
......
...@@ -30,10 +30,14 @@ class TodoViewController: BaseTableViewPullController { ...@@ -30,10 +30,14 @@ class TodoViewController: BaseTableViewPullController {
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
addNot()
tableViewAnimationHeight() tableViewAnimationHeight()
} }
func addNot(){
NotificationCenter.default.rx.notification(Notification.Name(rawValue: UPDATE_TODO_LIST)).subscribe(onNext: {[weak self] (notice) in
self?.loadDataWhenDraw()
}).disposed(by: disposeBag)
}
// MARK: - 加载数据 // MARK: - 加载数据
override func loadWebDataSource() { override func loadWebDataSource() {
todoViewModel.queryTodoAction(.ALL).subscribe {[weak self] (event) in todoViewModel.queryTodoAction(.ALL).subscribe {[weak self] (event) in
...@@ -83,18 +87,21 @@ class TodoViewController: BaseTableViewPullController { ...@@ -83,18 +87,21 @@ class TodoViewController: BaseTableViewPullController {
ShowMessage("当前用户对此工单没有领取权限!") ShowMessage("当前用户对此工单没有领取权限!")
return return
} }
ShowAlertView(hint, "请确认是否领单?", [cancel,sure], .alert, {[weak self] (index) in let lindanVC = HomeLinDanController.instantiateViewController(.Function) as! HomeLinDanController
if index == kZERO { return } lindanVC.model = model
self?.orderDetailViewModel.getChildBillAction(model.entityUuid).subscribe(onNext: { () in pushVC(lindanVC)
self?.loadDataWhenDraw() // ShowAlertView(hint, "请确认是否领单?", [cancel,sure], .alert, {[weak self] (index) in
ShowMessage("领取成功") // if index == kZERO { return }
Network.request(target: Service.ChildOrderComplete(model.entityUuid, "drew"), success: { (json) in // self?.orderDetailViewModel.getChildBillAction(model.entityUuid).subscribe(onNext: { () in
// self?.loadDataWhenDraw()
}, failure: { (error) in // ShowMessage("领取成功")
// Network.request(target: Service.ChildOrderComplete(model.entityUuid, "drew"), success: { (json) in
}) //
}).disposed(by: self!.disposeBag) // }, failure: { (error) in
}) //
// })
// }).disposed(by: self!.disposeBag)
// })
break break
case TODO_STATE.DREW: case TODO_STATE.DREW:
// if !PermissionsManager.saveChildPermissions() { // if !PermissionsManager.saveChildPermissions() {
......
//
// HomeLinDanController.swift
// IFS
//
// Created by Tiank on 2018/9/5.
// Copyright © 2018年 上海勾芒信息科技有限公司. All rights reserved.
//
import UIKit
import RxSwift
import RxCocoa
import SwiftyJSON
class HomeLinDanController: UIViewController {
/// RxSwift自动释放
let disposeBag = DisposeBag()
var model:TodoData!
/// 工单详情ViewModel
lazy final var orderDetailViewModel: RepairOrderDetailViewModel = {
var orderDetailViewModel = RepairOrderDetailViewModel()
return orderDetailViewModel
}()
@IBOutlet weak var orderNumLabel: UILabel!
@IBOutlet weak var timeLabel: UILabel!
/// 子工单详情ViewModel
lazy final var childBillViewModel: ReparirChildBillViewModel = {
var childBillViewModel = ReparirChildBillViewModel()
return childBillViewModel
}()
override func viewDidLoad() {
super.viewDidLoad()
}
func requestDetail(){
childBillViewModel.queryChildBillDetailAction(self.model.entityUuid).subscribe {[weak self] (event) in
self?.updateUI()
}.disposed(by: disposeBag)
}
func updateUI(){
orderNumLabel.text = self.childBillViewModel.childBillDetailData.executeNo
timeLabel.text = self.childBillViewModel.childBillDetailData.createTime
}
@IBAction func linDanAction(_ sender: UIButton) {
ShowAlertView(hint, "请确认是否领单?", [cancel,sure], .alert, {[weak self] (index) in
if index == kZERO { return }
self?.orderDetailViewModel.getChildBillAction(self?.model.entityUuid ?? "").subscribe(onNext: {[weak self] () in
self?.requestMessage()
self?.goDetail()
}).disposed(by: self!.disposeBag)
})
// self.orderDetailViewModel.getChildBillAction(model.entityUuid).subscribe(onNext: {[weak self] () in
// self?.requestMessage()
// self?.goDetail()
// }).disposed(by: self.disposeBag)
}
func goDetail(){
NotificationCenter.default.post(name: Notification.Name(rawValue: UPDATE_TODO_LIST), object: nil)
let childBillVc = RepairOrderEditSonOrderViewController.instantiateViewController(.Function) as! RepairOrderEditSonOrderViewController
childBillVc.billModel = BillDetailExecute(fromJson: JSON(model.toDictionary()))
childBillVc.billModel.uuid = model.entityUuid
pushVC(childBillVc)
self.navigationController?.viewControllers = (self.navigationController?.viewControllers.filter({ (vc) -> Bool in
return vc != self
}))!
}
func requestMessage(){
Network.request(target: Service.ChildOrderComplete(self.model.entityUuid, "drew"), success: { (json) in
}, failure: { (error) in
})
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
/*
// MARK: - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
// Get the new view controller using segue.destinationViewController.
// Pass the selected object to the new view controller.
}
*/
}
...@@ -36,8 +36,13 @@ class HomeTableViewController: BaseTableViewPullController { ...@@ -36,8 +36,13 @@ class HomeTableViewController: BaseTableViewPullController {
if todoState == TODO_STATE.DREW{ if todoState == TODO_STATE.DREW{
NotificationCenter.default.addObserver(self, selector: #selector(loadWebDataSource), name: Notification.Name(UPDATE_RECEIVE_ORDER_LIST), object: nil) NotificationCenter.default.addObserver(self, selector: #selector(loadWebDataSource), name: Notification.Name(UPDATE_RECEIVE_ORDER_LIST), object: nil)
} }
addNot()
}
func addNot(){
NotificationCenter.default.rx.notification(Notification.Name(rawValue: UPDATE_TODO_LIST)).subscribe(onNext: {[weak self] (notice) in
self?.loadWebDataSource()
}).disposed(by: disposeBag)
} }
// MARK: - 获取数据 // MARK: - 获取数据
@objc override func loadWebDataSource() { @objc override func loadWebDataSource() {
if !PermissionsManager.todoViewPermissions() { if !PermissionsManager.todoViewPermissions() {
...@@ -86,19 +91,9 @@ class HomeTableViewController: BaseTableViewPullController { ...@@ -86,19 +91,9 @@ class HomeTableViewController: BaseTableViewPullController {
ShowMessage("当前用户对此工单没有领取权限!") ShowMessage("当前用户对此工单没有领取权限!")
return return
} }
ShowAlertView(hint, "请确认是否领单?", [cancel,sure], .alert, {[weak self] (index) in let lindanVC = HomeLinDanController.instantiateViewController(.Function) as! HomeLinDanController
if index == kZERO { return } lindanVC.model = model
self?.orderDetailViewModel.getChildBillAction(model.entityUuid).subscribe(onNext: { () in pushVC(lindanVC)
self?.loadWebDataSource()
Network.request(target: Service.ChildOrderComplete(model.entityUuid, "drew"), success: { (json) in
self?.loadWebDataSource()
}, failure: { (error) in
self?.loadWebDataSource()
})
ShowMessage("领取成功")
}).disposed(by: self!.disposeBag)
})
break break
case TODO_STATE.DREW: case TODO_STATE.DREW:
......
...@@ -17,9 +17,9 @@ ...@@ -17,9 +17,9 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>1.1.0</string> <string>1.1.3</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>1.0.7</string> <string>1.1.3</string>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
......
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