TodoTask.swift 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488
  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. required override init() {
  89. }
  90. func copyToTodoTask() -> TodoTask? {
  91. if let json = self.toJSON() {
  92. return TodoTask.init(JSON: json)
  93. }else {
  94. return nil
  95. }
  96. }
  97. }
  98. class TodoTask:NSObject,Mappable {
  99. var id:String?
  100. var updateTime:String?
  101. var job:String?
  102. var title:String?
  103. var startTime:String?
  104. var work:String?
  105. var application:String?
  106. var applicationName:String?
  107. var process:String?
  108. var processName:String?
  109. var person:String?
  110. var identity:String?
  111. var department:String?
  112. var completed:Bool?
  113. var workCompleted:String?
  114. var company:String?
  115. var activity:String?
  116. var activityName:String?
  117. var activityType:String?
  118. var activityToken:String?
  119. var routeList:String?
  120. var routeNameList:String?
  121. private override init(){}
  122. required init?(map: Map) {
  123. }
  124. func mapping(map: Map) {
  125. id <- map["id"]
  126. updateTime <- map["updateTime"]
  127. job <- map["job"]
  128. title <- map["title"]
  129. startTime <- map["startTime"]
  130. work <- map["work"]
  131. application <- map["application"]
  132. applicationName <- map["applicationName"]
  133. process <- map["process"]
  134. processName <- map["processName"]
  135. person <- map["person"]
  136. identity <- map["identity"]
  137. department <- map["department"]
  138. completed <- map["completed"]
  139. workCompleted <- map["workCompleted"]
  140. company <- map["company"]
  141. activity <- map["activity"]
  142. activityName <- map["activityName"]
  143. activityType <- map["activityType"]
  144. activityToken <- map["activityToken"]
  145. routeList <- map["routeList"]
  146. routeNameList <- map["routeNameList"]
  147. }
  148. override var description: String {
  149. return "task:[\(id),\(title),\(job),\(work)]"
  150. }
  151. }
  152. /// 具体任务
  153. class Process:NSObject,Mappable{
  154. var id:String?
  155. var identity:String?
  156. var allowRapid:Bool?
  157. var company:String?
  158. var work:String?
  159. var startTimeMonth:String?
  160. var createTime:String?
  161. var person:String?
  162. var routeList:[String]?
  163. var routeNameList:[String]?
  164. var department:String?
  165. var startTime:String?
  166. var updateTime:String?
  167. required init?(map: Map) {
  168. }
  169. private override init(){}
  170. func mapping(map: Map) {
  171. id <- map["id"]
  172. identity <- map["identity"]
  173. allowRapid <- map["allowRapid"]
  174. company <- map["company"]
  175. work <- map["work"]
  176. startTimeMonth <- map["startTimeMonth"]
  177. createTime <- map["createTime"]
  178. person <- map["person"]
  179. routeList <- map["routeList"]
  180. routeNameList <- map["routeNameList"]
  181. department <- map["department"]
  182. startTime <- map["startTime"]
  183. updateTime <- map["updateTime"]
  184. }
  185. }
  186. /// 已办参考数据
  187. class TaskCompletedReference: NSObject,DataModel {
  188. @objc var taskCompleted:TaskCompletedData?
  189. @objc var workList:[WorkData] = []
  190. @objc var workCompletedList:[WorkData] = []
  191. @objc var workLogList:[ActivityTaskData] = []
  192. required override init() {
  193. }
  194. }
  195. /// 已办对象
  196. class TaskCompletedData: NSObject,DataModel {
  197. @objc var id:String?
  198. @objc var updateTime:String?
  199. @objc var job:String?
  200. @objc var title:String?
  201. @objc var startTime:String?
  202. @objc var work:String?
  203. @objc var task:String?
  204. @objc var application:String?
  205. @objc var applicationName:String?
  206. @objc var process:String?
  207. @objc var processName:String?
  208. @objc var person:String?
  209. @objc var identity:String?
  210. @objc var department:String?
  211. var completed:Bool?
  212. @objc var workCompleted:String?
  213. @objc var company:String?
  214. @objc var activity:String?
  215. @objc var activityName:String?
  216. @objc var activityType:String?
  217. @objc var activityToken:String?
  218. @objc var processingType:String?
  219. @objc var routeName:String?
  220. @objc var opinion:String?
  221. @objc var creatorPerson:String?
  222. @objc var creatorIdentity:String?
  223. required override init() {
  224. }
  225. }
  226. ///
  227. class WorkData: NSObject,DataModel {
  228. @objc var id:String?
  229. @objc var updateTime:String?
  230. @objc var job:String?
  231. @objc var title:String?
  232. @objc var startTime:String?
  233. @objc var work:String?
  234. @objc var application:String?
  235. @objc var applicationName:String?
  236. @objc var process:String?
  237. @objc var processName:String?
  238. @objc var person:String?
  239. @objc var identity:String?
  240. @objc var department:String?
  241. var completed:Bool?
  242. @objc var workCompleted:String?
  243. @objc var completedTime:String?
  244. @objc var company:String?
  245. @objc var activity:String?
  246. @objc var activityName:String?
  247. @objc var activityType:String?
  248. @objc var activityToken:String?
  249. @objc var routeList:String?
  250. @objc var routeNameList:String?
  251. required override init() {
  252. }
  253. }
  254. /// 活动任务
  255. ///
  256. /** fromActivityType 、 arrivedActivityType
  257. * 流程节点枚举类型
  258. * agent:脚本节点
  259. * begin:开始节点
  260. * cancel:取消节点
  261. * choice:选择活动节点
  262. * delay:定时活动节点
  263. * end:结束节点
  264. * embed:流程调用节点
  265. * invoke:服务调用节点
  266. * manual:人工节点
  267. * merge:合并活动节点
  268. * message:
  269. * parallel:并行活动节点
  270. * service:服务节点
  271. * split:拆分节点
  272. */
  273. ///
  274. class ActivityTaskData: NSObject,DataModel {
  275. @objc var job:String?
  276. @objc var work:String?
  277. @objc var fromActivity:String?
  278. @objc var fromActivityName:String?
  279. @objc var fromActivityToken:String?
  280. @objc var fromActivityType:String?
  281. @objc var fromTime:String?
  282. @objc var arrivedActivity:String?
  283. @objc var arrivedActivityName:String?
  284. @objc var arrivedActivityToken:String?
  285. @objc var arrivedActivityType:String?
  286. @objc var route:String?
  287. @objc var routeName:String?
  288. @objc var arrivedTime:String?
  289. var completed:Bool?
  290. var connected:Bool?
  291. var duration:Int64?
  292. @objc var createTime:String?
  293. var currentTaskIndex:Int?
  294. @objc var id:String?
  295. @objc var splitTokenList:[AnyObject]?
  296. var splitting:Int?
  297. @objc var taskCompletedList:[AnyObject]?
  298. @objc var taskList:[TodoTaskData]?
  299. @objc var updateTime:String?
  300. required override init() {
  301. }
  302. }
  303. /// 活动任务
  304. class ActivityTask:NSObject,Mappable {
  305. var fromActivity:String?
  306. var fromActivityName:String?
  307. var fromActivityToken:String?
  308. var fromActivityType:String?
  309. var fromTime:String?
  310. var arrivedActivity:String?
  311. var arrivedActivityName:String?
  312. var arrivedActivityToken:String?
  313. var arrivedActivityType:String?
  314. var route:String?
  315. var routeName:String?
  316. var arrivedTime:String?
  317. var completed:Bool?
  318. var connected:Bool?
  319. var duration:Int64?
  320. var createTime:String?
  321. var currentTaskIndex:Int?
  322. var id:String?
  323. var splitTokenList:[AnyObject]?
  324. var splitting:Int?
  325. var taskCompletedList:[AnyObject]?
  326. var taskList:[Process]?
  327. var updateTime:String?
  328. required init?(map: Map) {
  329. }
  330. private override init(){}
  331. func mapping(map: Map) {
  332. fromActivity <- map["fromActivity"]
  333. fromActivityName <- map["fromActivityName"]
  334. fromActivityToken <- map["fromActivityToken"]
  335. fromActivityType <- map["fromActivityType"]
  336. fromTime <- map["fromTime"]
  337. arrivedActivity <- map["arrivedActivity"]
  338. arrivedActivityName <- map["arrivedActivityName"]
  339. arrivedActivityToken <- map["arrivedActivityToken"]
  340. arrivedActivityType <- map["arrivedActivityType"]
  341. route <- map["route"]
  342. routeName <- map["routeName"]
  343. arrivedTime <- map["arrivedTime"]
  344. completed <- map["completed"]
  345. connected <- map["connected"]
  346. duration <- map["duration"]
  347. createTime <- map["createTime"]
  348. currentTaskIndex <- map["currentTaskIndex"]
  349. id <- map["id"]
  350. splitTokenList <- map["splitTokenList"]
  351. splitting <- map["splitting"]
  352. taskCompletedList <- map["taskCompletedList"]
  353. taskList <- map["taskList"]
  354. updateTime <- map["updateTime"]
  355. }
  356. }
  357. /**
  358. * todoTaskCell数据模型
  359. */
  360. struct TodoCellModel<T> {
  361. var title:String?
  362. var applicationName:String?
  363. var status:String?
  364. var time:String?
  365. var sourceObj:T?
  366. }
  367. struct TaskProcess {
  368. var taskDict:[String:AnyObject]?
  369. var workDict:[String:AnyObject]?
  370. var businessDataDict:[String:AnyObject]?
  371. var taskId:String?
  372. var workId:String?
  373. var processData:String?
  374. var decisonList:[String]?
  375. var decisionRoute:String?
  376. var decisionIdea:String?
  377. var opinion: String?
  378. init(){
  379. }
  380. }
  381. /**
  382. * 已办列表打开模型
  383. */
  384. class TodoedActionModel {
  385. // @property (nonatomic,copy) NSString *destText;
  386. // @property (nonatomic,copy) NSString *workType;
  387. // @property (nonatomic,copy) NSString *work_id;
  388. var destText:String?
  389. var workType:String?
  390. var workId:String?
  391. var workTitle:String?
  392. init(destText:String?,workType:String?,workId:String?, workTitle: String){
  393. self.destText = destText
  394. self.workType = workType
  395. self.workId = workId
  396. self.workTitle = workTitle
  397. }
  398. }
  399. /**
  400. * 处理过程日志显示模型
  401. */
  402. struct TodoedStatusModel {
  403. var activity:String?
  404. var identity:String?
  405. var status:String?
  406. var statusTime:String?
  407. }
  408. /**
  409. * 新版工作界面的底部操作按钮对象
  410. */
  411. struct WorkNewActionItem: HandyJSON{
  412. var id: String = ""
  413. var text: String = ""
  414. var action: String = "" //工作默认操作函数名称
  415. var control: String = "" // 工作默认操作类型
  416. var actionScript: String = "" //其他操作执行代码
  417. var title: String = ""
  418. var read: Bool = true
  419. }