TodoTask.swift 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. //
  2. // TodoTask.swift
  3. // O2Platform
  4. //
  5. // Created by 刘振兴 on 16/7/27.
  6. // Copyright © 2016年 zoneland. All rights reserved.
  7. //
  8. import Foundation
  9. import ObjectMapper
  10. import HandyJSON
  11. struct PageSize{
  12. var id:String="0"
  13. var count:String = "20"
  14. init(){
  15. }
  16. init(id:String,count:String){
  17. self.id = id
  18. self.count = count
  19. }
  20. mutating func nextPage(_ id:String,count:String="20"){
  21. self.id = id
  22. self.count = count
  23. }
  24. func toDictionary()->Dictionary<String,String>{
  25. return ["##id##":self.id,"##count##":self.count]
  26. }
  27. }
  28. class WorkControl: NSObject, Mappable {
  29. var allowVisit:Bool?
  30. var allowProcessing:Bool?
  31. var allowReadProcessing:Bool?
  32. var allowSave:Bool?
  33. var allowRetract:Bool?
  34. var allowDelete:Bool?
  35. private override init(){}
  36. required init?(map: Map) {
  37. }
  38. func mapping(map: Map) {
  39. allowVisit <- map["allowVisit"]
  40. allowProcessing <- map["allowProcessing"]
  41. allowReadProcessing <- map["allowReadProcessing"]
  42. allowSave <- map["allowSave"]
  43. allowRetract <- map["allowRetract"]
  44. allowDelete <- map["allowDelete"]
  45. }
  46. }
  47. class StartProcessData: NSObject,DataModel {
  48. var currentTaskIndex: Int?
  49. @objc var createTime:String?
  50. @objc var updateTime:String?
  51. @objc var id:String?
  52. var completed:Bool?
  53. @objc var fromActivity:String?
  54. @objc var fromActivityType:String?
  55. @objc var fromActivityName:String?
  56. @objc var fromActivityToken:String?
  57. @objc var fromTime:String?
  58. var connected:Bool?
  59. var splitting:Bool?
  60. @objc var splitTokenList:[String]?
  61. @objc var taskList: [TodoTaskData]?
  62. required override init() {
  63. }
  64. }
  65. class TodoTaskData: NSObject,DataModel {
  66. @objc var id:String?
  67. @objc var updateTime:String?
  68. @objc var job:String?
  69. @objc var title:String?
  70. @objc var startTime:String?
  71. @objc var work:String?
  72. @objc var application:String?
  73. @objc var applicationName:String?
  74. @objc var process:String?
  75. @objc var processName:String?
  76. @objc var person:String?
  77. @objc var identity:String?
  78. @objc var department:String?
  79. var completed:Bool?
  80. @objc var workCompleted:String?
  81. @objc var company:String?
  82. @objc var activity:String?
  83. @objc var activityName:String?
  84. @objc var activityType:String?
  85. @objc var activityToken:String?
  86. @objc var routeList:String?
  87. @objc var routeNameList:String?
  88. override var description: String {
  89. return "task:[\(id),\(title),\(job),\(work)]"
  90. }
  91. required override init() {
  92. }
  93. func copyToTodoTask() -> TodoTask? {
  94. if let json = self.toJSON() {
  95. return TodoTask.init(JSON: json)
  96. }else {
  97. return nil
  98. }
  99. }
  100. }
  101. class TodoTask:NSObject,Mappable {
  102. var id:String?
  103. var updateTime:String?
  104. var job:String?
  105. var title:String?
  106. var startTime:String?
  107. var work:String?
  108. var application:String?
  109. var applicationName:String?
  110. var process:String?
  111. var processName:String?
  112. var person:String?
  113. var identity:String?
  114. var department:String?
  115. var completed:Bool?
  116. var workCompleted:String?
  117. var company:String?
  118. var activity:String?
  119. var activityName:String?
  120. var activityType:String?
  121. var activityToken:String?
  122. var routeList:String?
  123. var routeNameList:String?
  124. private override init(){}
  125. required init?(map: Map) {
  126. }
  127. func mapping(map: Map) {
  128. id <- map["id"]
  129. updateTime <- map["updateTime"]
  130. job <- map["job"]
  131. title <- map["title"]
  132. startTime <- map["startTime"]
  133. work <- map["work"]
  134. application <- map["application"]
  135. applicationName <- map["applicationName"]
  136. process <- map["process"]
  137. processName <- map["processName"]
  138. person <- map["person"]
  139. identity <- map["identity"]
  140. department <- map["department"]
  141. completed <- map["completed"]
  142. workCompleted <- map["workCompleted"]
  143. company <- map["company"]
  144. activity <- map["activity"]
  145. activityName <- map["activityName"]
  146. activityType <- map["activityType"]
  147. activityToken <- map["activityToken"]
  148. routeList <- map["routeList"]
  149. routeNameList <- map["routeNameList"]
  150. }
  151. override var description: String {
  152. return "task:[\(id),\(title),\(job),\(work)]"
  153. }
  154. }
  155. /// 具体任务
  156. class Process:NSObject,Mappable{
  157. var id:String?
  158. var identity:String?
  159. var allowRapid:Bool?
  160. var company:String?
  161. var work:String?
  162. var startTimeMonth:String?
  163. var createTime:String?
  164. var person:String?
  165. var routeList:[String]?
  166. var routeNameList:[String]?
  167. var department:String?
  168. var startTime:String?
  169. var updateTime:String?
  170. required init?(map: Map) {
  171. }
  172. private override init(){}
  173. func mapping(map: Map) {
  174. id <- map["id"]
  175. identity <- map["identity"]
  176. allowRapid <- map["allowRapid"]
  177. company <- map["company"]
  178. work <- map["work"]
  179. startTimeMonth <- map["startTimeMonth"]
  180. createTime <- map["createTime"]
  181. person <- map["person"]
  182. routeList <- map["routeList"]
  183. routeNameList <- map["routeNameList"]
  184. department <- map["department"]
  185. startTime <- map["startTime"]
  186. updateTime <- map["updateTime"]
  187. }
  188. }
  189. /// 活动任务
  190. class ActivityTask:NSObject,Mappable {
  191. var fromActivity:String?
  192. var fromActivityName:String?
  193. var fromActivityToken:String?
  194. var fromActivityType:String?
  195. var fromTime:String?
  196. var arrivedActivity:String?
  197. var arrivedActivityName:String?
  198. var arrivedActivityToken:String?
  199. var arrivedActivityType:String?
  200. var route:String?
  201. var routeName:String?
  202. var arrivedTime:String?
  203. var completed:Bool?
  204. var connected:Bool?
  205. var duration:Int64?
  206. var createTime:String?
  207. var currentTaskIndex:Int?
  208. var id:String?
  209. var splitTokenList:[AnyObject]?
  210. var splitting:Int?
  211. var taskCompletedList:[AnyObject]?
  212. var taskList:[Process]?
  213. var updateTime:String?
  214. required init?(map: Map) {
  215. }
  216. private override init(){}
  217. func mapping(map: Map) {
  218. fromActivity <- map["fromActivity"]
  219. fromActivityName <- map["fromActivityName"]
  220. fromActivityToken <- map["fromActivityToken"]
  221. fromActivityType <- map["fromActivityType"]
  222. fromTime <- map["fromTime"]
  223. arrivedActivity <- map["arrivedActivity"]
  224. arrivedActivityName <- map["arrivedActivityName"]
  225. arrivedActivityToken <- map["arrivedActivityToken"]
  226. arrivedActivityType <- map["arrivedActivityType"]
  227. route <- map["route"]
  228. routeName <- map["routeName"]
  229. arrivedTime <- map["arrivedTime"]
  230. completed <- map["completed"]
  231. connected <- map["connected"]
  232. duration <- map["duration"]
  233. createTime <- map["createTime"]
  234. currentTaskIndex <- map["currentTaskIndex"]
  235. id <- map["id"]
  236. splitTokenList <- map["splitTokenList"]
  237. splitting <- map["splitting"]
  238. taskCompletedList <- map["taskCompletedList"]
  239. taskList <- map["taskList"]
  240. updateTime <- map["updateTime"]
  241. }
  242. }
  243. /**
  244. * todoTaskCell数据模型
  245. */
  246. struct TodoCellModel<T> {
  247. var title:String?
  248. var applicationName:String?
  249. var status:String?
  250. var time:String?
  251. var sourceObj:T?
  252. }
  253. struct TaskProcess {
  254. var taskDict:[String:AnyObject]?
  255. var workDict:[String:AnyObject]?
  256. var businessDataDict:[String:AnyObject]?
  257. var taskId:String?
  258. var workId:String?
  259. var processData:String?
  260. var decisonList:[String]?
  261. var decisionRoute:String?
  262. var decisionIdea:String?
  263. var opinion: String?
  264. init(){
  265. }
  266. }
  267. /**
  268. * 已办列表打开模型
  269. */
  270. class TodoedActionModel {
  271. // @property (nonatomic,copy) NSString *destText;
  272. // @property (nonatomic,copy) NSString *workType;
  273. // @property (nonatomic,copy) NSString *work_id;
  274. var destText:String?
  275. var workType:String?
  276. var workId:String?
  277. init(destText:String?,workType:String?,workId:String?){
  278. self.destText = destText
  279. self.workType = workType
  280. self.workId = workId
  281. }
  282. }
  283. /**
  284. * 处理过程日志显示模型
  285. */
  286. struct TodoedStatusModel {
  287. var activity:String?
  288. var identity:String?
  289. var status:String?
  290. var statusTime:String?
  291. }
  292. /**
  293. * 新版工作界面的底部操作按钮对象
  294. */
  295. struct WorkNewActionItem: HandyJSON{
  296. var id: String = ""
  297. var text: String = ""
  298. var action: String = "" //工作默认操作函数名称
  299. var control: String = "" // 工作默认操作类型
  300. var actionScript: String = "" //其他操作执行代码
  301. var title: String = ""
  302. var read: Bool = true
  303. }