Blame view

App/model/CongTruong.swift 1.22 KB
d774f0637   Trịnh Văn Quân   fisrt comit
1
  import Foundation
defd9642e   Trịnh Văn Quân   version 1.2
2
  import GeneralUtils
d774f0637   Trịnh Văn Quân   fisrt comit
3

defd9642e   Trịnh Văn Quân   version 1.2
4
5
6
7
8
  class CongTruong: Mappable {
      var id: Int?
      var companyName: String?
      var constructionName: String?
      var noCaptured: Int?, noRemain: Int?
1341bf603   Trịnh Văn Quân   version 1.1
9
      var shootItems: [ShootItem]?
defd9642e   Trịnh Văn Quân   version 1.2
10
      var signboard: Int?
1341bf603   Trịnh Văn Quân   version 1.1
11

fbd62afcf   Trịnh Văn Quân   version 1.2.2
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
      func getShootItemsName(isWillshoot: Bool) -> String? {
          guard let shootItems = shootItems else { return nil }
          var result = "";
          for item in shootItems {
              if (isWillshoot && item.willShoot != nil && item.willShoot! > 0) || !isWillshoot {
                  if let name = item.name {
                      if result.length > 0 { result = result + ", " }
                      result = result + name;
                  }
                  if result.length > 100 {
                      return result;
                  }
              }
          }
          return result;
      }
defd9642e   Trịnh Văn Quân   version 1.2
28
29
30
      // region: ========== Mappable
      init() {}
      required init?(map: Map) {}
1341bf603   Trịnh Văn Quân   version 1.1
31

defd9642e   Trịnh Văn Quân   version 1.2
32
      func mapping(map: Map) {
fbd62afcf   Trịnh Văn Quân   version 1.2.2
33
          id <- map["id"]
defd9642e   Trịnh Văn Quân   version 1.2
34
35
36
37
38
          companyName <- map["companyName"]
          constructionName <- map["constructionName"]
          noCaptured <- map["noCaptured"]
          noRemain <- map["noRemain"]
          shootItems <- map["shootingItems"]
fbd62afcf   Trịnh Văn Quân   version 1.2.2
39
          signboard <- map["signBoard"]
defd9642e   Trịnh Văn Quân   version 1.2
40
41
      }
      //endregion
d774f0637   Trịnh Văn Quân   fisrt comit
42
  }