CongTruong.swift
1.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import Foundation
import GeneralUtils
class CongTruong: Mappable {
var id: Int?
var companyName: String?
var constructionName: String?
var noCaptured: Int?, noRemain: Int?
var shootItems: [ShootItem]?
var signboard: Int?
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;
}
// region: ========== Mappable
init() {}
required init?(map: Map) {}
func mapping(map: Map) {
id <- map["id"]
companyName <- map["companyName"]
constructionName <- map["constructionName"]
noCaptured <- map["noCaptured"]
noRemain <- map["noRemain"]
shootItems <- map["shootingItems"]
signboard <- map["signBoard"]
}
//endregion
}