Commit fbd62afcf9e1b280386f763532544a4561864e66

Authored by Trịnh Văn Quân
1 parent 454c1bb6f2
Exists in master

version 1.2.2

Showing 30 changed files with 690 additions and 195 deletions Side-by-side Diff

... ... @@ -46,37 +46,6 @@
46 46 </MavenGeneralSettings>
47 47 </option>
48 48 </component>
49   - <component name="ProjectInspectionProfilesVisibleTreeState">
50   - <entry key="Project Default">
51   - <profile-state>
52   - <expanded-state>
53   - <State>
54   - <id />
55   - </State>
56   - <State>
57   - <id>Objective-C</id>
58   - </State>
59   - <State>
60   - <id>RELAX NG</id>
61   - </State>
62   - <State>
63   - <id>Spelling</id>
64   - </State>
65   - <State>
66   - <id>Swift</id>
67   - </State>
68   - <State>
69   - <id>TypeScript</id>
70   - </State>
71   - </expanded-state>
72   - <selected-state>
73   - <State>
74   - <id>Objective-C</id>
75   - </State>
76   - </selected-state>
77   - </profile-state>
78   - </entry>
79   - </component>
80 49 <component name="masterDetails">
81 50 <states>
82 51 <state key="ProjectJDKs.UI">
App/Base.lproj/Main.storyboard
... ... @@ -61,7 +61,7 @@
61 61 <constraint firstAttribute="height" constant="35" id="4Gb-CM-qPm"/>
62 62 </constraints>
63 63 <state key="normal">
64   - <string key="title">不明
  64 + <string key="title">ID発行
65 65 </string>
66 66 <color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
67 67 </state>
... ... @@ -155,7 +155,7 @@
155 155 </constraints>
156 156 </view>
157 157 <stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="5" translatesAutoresizingMaskIntoConstraints="NO" id="he4-g9-p0U">
158   - <rect key="frame" x="36" y="70" width="303" height="466"/>
  158 + <rect key="frame" x="36" y="70" width="303" height="400.5"/>
159 159 <subviews>
160 160 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zox-26-aQq">
161 161 <rect key="frame" x="0.0" y="0.0" width="303" height="20.5"/>
162 162  
163 163  
164 164  
... ... @@ -213,32 +213,15 @@
213 213 <nil key="textColor"/>
214 214 <nil key="highlightedColor"/>
215 215 </label>
216   - <textField opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" contentHorizontalAlignment="left" contentVerticalAlignment="center" borderStyle="bezel" textAlignment="natural" minimumFontSize="17" translatesAutoresizingMaskIntoConstraints="NO" id="ue1-C8-9xt">
217   - <rect key="frame" x="0.0" y="190.5" width="303" height="35"/>
218   - <constraints>
219   - <constraint firstAttribute="height" constant="35" id="nKh-De-wK4"/>
220   - </constraints>
221   - <nil key="textColor"/>
222   - <fontDescription key="fontDescription" type="system" pointSize="14"/>
223   - <textInputTraits key="textInputTraits" returnKeyType="done"/>
224   - </textField>
225 216 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="gNw-Cn-qPA" userLabel="separate">
226   - <rect key="frame" x="0.0" y="230.5" width="303" height="12"/>
  217 + <rect key="frame" x="0.0" y="190.5" width="303" height="12"/>
227 218 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
228 219 <constraints>
229 220 <constraint firstAttribute="height" constant="12" id="U8a-Uu-IJr"/>
230 221 </constraints>
231 222 </view>
232   - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ebe-8H-4x9">
233   - <rect key="frame" x="0.0" y="247.5" width="303" height="20.5"/>
234   - <string key="text">お問い合わせ内容
235   -</string>
236   - <fontDescription key="fontDescription" type="system" pointSize="17"/>
237   - <nil key="textColor"/>
238   - <nil key="highlightedColor"/>
239   - </label>
240 223 <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="3qx-KL-LJG" customClass="UITextViewCustom" customModule="GeneralUtils">
241   - <rect key="frame" x="0.0" y="273" width="303" height="130"/>
  224 + <rect key="frame" x="0.0" y="207.5" width="303" height="130"/>
242 225 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
243 226 <constraints>
244 227 <constraint firstAttribute="height" constant="130" id="HuO-Md-RJZ"/>
245 228  
... ... @@ -258,14 +241,14 @@
258 241 </userDefinedRuntimeAttributes>
259 242 </textView>
260 243 <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="od0-tY-zto" userLabel="separate">
261   - <rect key="frame" x="0.0" y="408" width="303" height="18"/>
  244 + <rect key="frame" x="0.0" y="342.5" width="303" height="18"/>
262 245 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
263 246 <constraints>
264 247 <constraint firstAttribute="height" constant="18" id="ifn-5y-uBd"/>
265 248 </constraints>
266 249 </view>
267 250 <stackView opaque="NO" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="cNO-NU-9qx">
268   - <rect key="frame" x="0.0" y="431" width="303" height="35"/>
  251 + <rect key="frame" x="0.0" y="365.5" width="303" height="35"/>
269 252 <subviews>
270 253 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="MVS-dH-l4Z" customClass="UIButtonCustomGradientBg" customModule="GeneralUtils">
271 254 <rect key="frame" x="0.0" y="0.0" width="110" height="35"/>
272 255  
... ... @@ -341,10 +324,10 @@
341 324 </constraints>
342 325 </view>
343 326 <connections>
344   - <outlet property="edtAdress" destination="ue1-C8-9xt" id="Png-ZT-Xii"/>
345   - <outlet property="edtContent" destination="3qx-KL-LJG" id="ELj-Xn-lEf"/>
  327 + <outlet property="edtAdress" destination="3qx-KL-LJG" id="pmY-Wd-aDS"/>
346 328 <outlet property="edtPhone" destination="gHc-DM-bhU" id="59c-Hb-sne"/>
347 329 <outlet property="edtTenCty" destination="sgh-62-zsd" id="E0B-nZ-gb4"/>
  330 + <outlet property="vTopLogo" destination="Air-Xv-R4i" id="82m-w9-OEi"/>
348 331 </connections>
349 332 </viewController>
350 333 <placeholder placeholderIdentifier="IBFirstResponder" id="v3F-wF-d4Y" userLabel="First Responder" sceneMemberID="firstResponder"/>
351 334  
352 335  
... ... @@ -371,14 +354,12 @@
371 354 </constraints>
372 355 </view>
373 356 <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="FaF-Ew-VNM" customClass="UIButtonCustomGradientBg" customModule="GeneralUtils">
374   - <rect key="frame" x="16" y="593" width="110" height="35"/>
  357 + <rect key="frame" x="107.5" y="593" width="160" height="35"/>
375 358 <constraints>
376 359 <constraint firstAttribute="height" constant="35" id="A0l-ZP-ZIG"/>
377   - <constraint firstAttribute="width" constant="110" id="Zc5-Uz-Lud"/>
  360 + <constraint firstAttribute="width" constant="160" id="yJx-rc-Ynt"/>
378 361 </constraints>
379   - <state key="normal">
380   - <string key="title">トップに戻る
381   -</string>
  362 + <state key="normal" title="利用を開始する。">
382 363 <color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
383 364 </state>
384 365 <userDefinedRuntimeAttributes>
... ... @@ -397,11 +378,14 @@
397 378 <action selector="btnBackToTopClick:" destination="WB6-Ic-cSK" eventType="touchUpInside" id="xKG-FK-n6a"/>
398 379 </connections>
399 380 </button>
400   - <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ol6-EF-aDg">
401   - <rect key="frame" x="100" y="282" width="174" height="21"/>
402   - <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
403   - <string key="text">お問い合わせ ご回答
404   -</string>
  381 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="あなたのIDは" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ol6-EF-aDg">
  382 + <rect key="frame" x="136" y="150" width="103.5" height="21"/>
  383 + <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="17"/>
  384 + <nil key="textColor"/>
  385 + <nil key="highlightedColor"/>
  386 + </label>
  387 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1230" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7sC-Ve-cWy">
  388 + <rect key="frame" x="168" y="205" width="39" height="21"/>
405 389 <fontDescription key="fontDescription" type="system" pointSize="17"/>
406 390 <nil key="textColor"/>
407 391 <nil key="highlightedColor"/>
408 392  
409 393  
410 394  
411 395  
... ... @@ -409,17 +393,25 @@
409 393 </subviews>
410 394 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
411 395 <constraints>
  396 + <constraint firstItem="ol6-EF-aDg" firstAttribute="centerX" secondItem="trI-A6-CWw" secondAttribute="centerX" id="0x0-uB-cY5"/>
  397 + <constraint firstItem="FaF-Ew-VNM" firstAttribute="centerX" secondItem="trI-A6-CWw" secondAttribute="centerX" id="4WW-Lm-25C"/>
  398 + <constraint firstItem="7sC-Ve-cWy" firstAttribute="centerX" secondItem="trI-A6-CWw" secondAttribute="centerX" id="4a0-l0-Bb9"/>
412 399 <constraint firstItem="qiG-ht-Uf8" firstAttribute="top" secondItem="trI-A6-CWw" secondAttribute="top" id="9fX-XA-RWq"/>
413 400 <constraint firstItem="qiG-ht-Uf8" firstAttribute="leading" secondItem="trI-A6-CWw" secondAttribute="leading" id="Ikf-KP-tr6"/>
414   - <constraint firstItem="FaF-Ew-VNM" firstAttribute="leading" secondItem="trI-A6-CWw" secondAttribute="leadingMargin" id="f3e-Kc-WXv"/>
  401 + <constraint firstItem="7sC-Ve-cWy" firstAttribute="top" secondItem="ol6-EF-aDg" secondAttribute="bottom" constant="34" id="XMk-Iv-UeY"/>
415 402 <constraint firstAttribute="trailing" secondItem="qiG-ht-Uf8" secondAttribute="trailing" id="kHC-oY-4J1"/>
416 403 <constraint firstItem="ILD-Ch-AFl" firstAttribute="top" secondItem="FaF-Ew-VNM" secondAttribute="bottom" constant="39" id="lrB-bd-EWc"/>
  404 + <constraint firstItem="ol6-EF-aDg" firstAttribute="top" secondItem="qiG-ht-Uf8" secondAttribute="bottom" constant="100" id="zZA-FY-RnN"/>
417 405 </constraints>
418 406 </view>
  407 + <connections>
  408 + <outlet property="tvId" destination="7sC-Ve-cWy" id="amd-of-Tri"/>
  409 + <outlet property="vTopLogo" destination="qiG-ht-Uf8" id="EMQ-9z-0t3"/>
  410 + </connections>
419 411 </viewController>
420 412 <placeholder placeholderIdentifier="IBFirstResponder" id="UIt-fK-wYI" userLabel="First Responder" sceneMemberID="firstResponder"/>
421 413 </objects>
422   - <point key="canvasLocation" x="1007" y="15"/>
  414 + <point key="canvasLocation" x="1005.6" y="14.842578710644679"/>
423 415 </scene>
424 416 <!--Splash Controller-->
425 417 <scene sceneID="LPb-05-isG">
... ... @@ -1080,6 +1072,7 @@
1080 1072 </constraints>
1081 1073 </view>
1082 1074 <connections>
  1075 + <outlet property="btnNext" destination="J0s-KI-W0f" id="6YL-JK-yJ9"/>
1083 1076 <outlet property="edtTitle" destination="SdT-qW-FtA" id="qlt-h9-VSe"/>
1084 1077 <outlet property="tableView" destination="DJO-7p-DBK" id="RmP-xv-fXR"/>
1085 1078 <outlet property="topMargin" destination="Ij5-29-ivK" id="B3y-R5-Bn0"/>
... ... @@ -1179,7 +1172,7 @@
1179 1172 </userDefinedRuntimeAttribute>
1180 1173 </userDefinedRuntimeAttributes>
1181 1174 <connections>
1182   - <action selector="btnRightClick:" destination="QOd-um-P0o" eventType="touchUpInside" id="HX6-cd-vVa"/>
  1175 + <action selector="btnRightClick:" destination="QOd-um-P0o" eventType="touchUpInside" id="W5K-tp-YPY"/>
1183 1176 </connections>
1184 1177 </button>
1185 1178 </subviews>
... ... @@ -1202,6 +1195,7 @@
1202 1195 </constraints>
1203 1196 </view>
1204 1197 <connections>
  1198 + <outlet property="btnNext" destination="wpH-Xv-iF5" id="B8j-IW-UbQ"/>
1205 1199 <outlet property="tableView" destination="jNm-go-B5H" id="DDY-du-cbs"/>
1206 1200 <outlet property="topMargin" destination="1II-tM-K03" id="nyq-4r-ZSc"/>
1207 1201 <outlet property="vTopLogo" destination="X6q-MT-ndn" id="1bU-E2-wut"/>
... ... @@ -1782,6 +1776,9 @@
1782 1776 </label>
1783 1777 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="cty" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AfF-k7-iZ5">
1784 1778 <rect key="frame" x="288" y="0.0" width="24" height="40"/>
  1779 + <constraints>
  1780 + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="100" id="xJh-Ho-SeF"/>
  1781 + </constraints>
1785 1782 <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
1786 1783 <color key="textColor" red="0.16078431372549018" green="0.39215686274509803" blue="0.90588235294117647" alpha="1" colorSpace="calibratedRGB"/>
1787 1784 <nil key="highlightedColor"/>
... ... @@ -1821,6 +1818,9 @@
1821 1818 </label>
1822 1819 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ctruong" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="uBu-xb-dCc">
1823 1820 <rect key="frame" x="252" y="0.0" width="60" height="40"/>
  1821 + <constraints>
  1822 + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="100" id="XIf-rt-epT"/>
  1823 + </constraints>
1824 1824 <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
1825 1825 <color key="textColor" red="0.16078431369999999" green="0.3921568627" blue="0.90588235289999997" alpha="1" colorSpace="calibratedRGB"/>
1826 1826 <nil key="highlightedColor"/>
... ... @@ -1859,6 +1859,9 @@
1859 1859 </label>
1860 1860 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="chup" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mV8-2Y-tik">
1861 1861 <rect key="frame" x="274" y="0.0" width="38" height="40"/>
  1862 + <constraints>
  1863 + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="100" id="Nn0-5m-ecR"/>
  1864 + </constraints>
1862 1865 <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
1863 1866 <color key="textColor" red="0.16078431369999999" green="0.3921568627" blue="0.90588235289999997" alpha="1" colorSpace="calibratedRGB"/>
1864 1867 <nil key="highlightedColor"/>
... ... @@ -1897,6 +1900,9 @@
1897 1900 </label>
1898 1901 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="252" verticalHuggingPriority="251" text="se chup" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2uv-My-eRf">
1899 1902 <rect key="frame" x="252.5" y="0.0" width="59.5" height="40"/>
  1903 + <constraints>
  1904 + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="100" id="3BG-UW-mpa"/>
  1905 + </constraints>
1900 1906 <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
1901 1907 <color key="textColor" red="0.16078431369999999" green="0.3921568627" blue="0.90588235289999997" alpha="1" colorSpace="calibratedRGB"/>
1902 1908 <nil key="highlightedColor"/>
... ... @@ -1935,6 +1941,9 @@
1935 1941 </label>
1936 1942 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="ON" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="LsA-0L-mbU">
1937 1943 <rect key="frame" x="287.5" y="0.0" width="24.5" height="40"/>
  1944 + <constraints>
  1945 + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="100" id="bh9-WV-1SL"/>
  1946 + </constraints>
1938 1947 <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
1939 1948 <color key="textColor" red="0.16078431369999999" green="0.3921568627" blue="0.90588235289999997" alpha="1" colorSpace="calibratedRGB"/>
1940 1949 <nil key="highlightedColor"/>
... ... @@ -1973,6 +1982,9 @@
1973 1982 </label>
1974 1983 <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Zod-hg-4Iv">
1975 1984 <rect key="frame" x="230" y="0.0" width="82" height="40"/>
  1985 + <constraints>
  1986 + <constraint firstAttribute="width" relation="lessThanOrEqual" constant="100" id="i7C-GJ-h5n"/>
  1987 + </constraints>
1976 1988 <string key="text">リスト消去
1977 1989 </string>
1978 1990 <fontDescription key="fontDescription" type="system" weight="semibold" pointSize="16"/>
... ... @@ -2014,6 +2026,9 @@
2014 2026 <color key="value" white="0.33333333333333331" alpha="1" colorSpace="calibratedWhite"/>
2015 2027 </userDefinedRuntimeAttribute>
2016 2028 </userDefinedRuntimeAttributes>
  2029 + <connections>
  2030 + <outletCollection property="gestureRecognizers" destination="Bwq-SD-LaA" appends="YES" id="mNJ-5m-W8V"/>
  2031 + </connections>
2017 2032 </view>
2018 2033 </subviews>
2019 2034 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
... ... @@ -2033,6 +2048,11 @@
2033 2048 </connections>
2034 2049 </viewController>
2035 2050 <placeholder placeholderIdentifier="IBFirstResponder" id="FBh-aj-ACu" userLabel="First Responder" sceneMemberID="firstResponder"/>
  2051 + <tapGestureRecognizer id="Bwq-SD-LaA" userLabel="bgWhite">
  2052 + <connections>
  2053 + <action selector="whiteClick:" destination="yZt-Wk-WwO" id="bfe-tc-JJw"/>
  2054 + </connections>
  2055 + </tapGestureRecognizer>
2036 2056 <tapGestureRecognizer id="9JU-WE-W5s" userLabel="delete">
2037 2057 <connections>
2038 2058 <action selector="deleteClick:" destination="yZt-Wk-WwO" id="i0B-TB-HOY"/>
... ... @@ -2201,7 +2221,7 @@
2201 2221 <nil key="textColor"/>
2202 2222 <nil key="highlightedColor"/>
2203 2223 </label>
2204   - <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ozm-WD-JTO">
  2224 + <button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ozm-WD-JTO">
2205 2225 <rect key="frame" x="253" y="0.0" width="30" height="24"/>
2206 2226 <constraints>
2207 2227 <constraint firstAttribute="width" constant="30" id="zXd-nh-N5a"/>
... ... @@ -2262,6 +2282,33 @@
2262 2282 <tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="7sn-LX-TPS" customClass="UITableViewLoadDataFromUIThread" customModule="GeneralUtils">
2263 2283 <rect key="frame" x="30" y="123.5" width="315" height="344.5"/>
2264 2284 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
  2285 + <prototypes>
  2286 + <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CellPerson" id="nHp-pE-xAT" customClass="CellPerson" customModule="App" customModuleProvider="target">
  2287 + <rect key="frame" x="0.0" y="28" width="315" height="44"/>
  2288 + <autoresizingMask key="autoresizingMask"/>
  2289 + <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="nHp-pE-xAT" id="ONP-wK-o5X">
  2290 + <rect key="frame" x="0.0" y="0.0" width="315" height="43"/>
  2291 + <autoresizingMask key="autoresizingMask"/>
  2292 + <subviews>
  2293 + <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6eU-CX-rj2">
  2294 + <rect key="frame" x="10" y="10" width="295" height="23"/>
  2295 + <fontDescription key="fontDescription" type="system" pointSize="17"/>
  2296 + <nil key="textColor"/>
  2297 + <nil key="highlightedColor"/>
  2298 + </label>
  2299 + </subviews>
  2300 + <constraints>
  2301 + <constraint firstItem="6eU-CX-rj2" firstAttribute="leading" secondItem="ONP-wK-o5X" secondAttribute="leading" constant="10" id="beA-qD-ojc"/>
  2302 + <constraint firstAttribute="bottom" secondItem="6eU-CX-rj2" secondAttribute="bottom" constant="10" id="ojS-Ly-c34"/>
  2303 + <constraint firstAttribute="trailing" secondItem="6eU-CX-rj2" secondAttribute="trailing" constant="10" id="qjZ-5m-p4F"/>
  2304 + <constraint firstItem="6eU-CX-rj2" firstAttribute="top" secondItem="ONP-wK-o5X" secondAttribute="top" constant="10" id="r75-k7-Tzn"/>
  2305 + </constraints>
  2306 + </tableViewCellContentView>
  2307 + <connections>
  2308 + <outlet property="tvTitle" destination="6eU-CX-rj2" id="Iwr-ve-YrS"/>
  2309 + </connections>
  2310 + </tableViewCell>
  2311 + </prototypes>
2265 2312 </tableView>
2266 2313 </subviews>
2267 2314 <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
... ... @@ -2384,7 +2431,7 @@
2384 2431 <constraint firstAttribute="height" constant="40" id="asa-jY-XvL"/>
2385 2432 <constraint firstAttribute="width" constant="110" id="dI5-02-rUJ"/>
2386 2433 </constraints>
2387   - <state key="normal" title="Change">
  2434 + <state key="normal" title="変化する">
2388 2435 <color key="titleColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
2389 2436 </state>
2390 2437 <userDefinedRuntimeAttributes>
App/addPerson/CellPerson.swift
  1 +import Foundation
  2 +import UIKit
  3 +import GeneralUtils
  4 +
  5 +class CellPerson: BaseTableViewCellUI {
  6 + @IBOutlet weak var tvTitle: UILabel!
  7 +
  8 + var person: Person!
  9 +
  10 + override func awakeFromNib() {
  11 + super.awakeFromNib()
  12 + self.selectionStyle = .none
  13 + }
  14 +
  15 + override func configCellWithData(baseObj: Any, index: Int) {
  16 + super.configCellWithData(baseObj: baseObj, index: index)
  17 + person = baseObj as! Person
  18 +
  19 + tvTitle.text = person.getName();
  20 + }
  21 +}
App/addPerson/VCAddPerson.swift
1 1 import UIKit
  2 +import GeneralUtils
  3 +import Alamofire
2 4  
3 5 class VCAddPerson: UIViewController {
4 6 @IBOutlet weak var edtTitle: UITextField!
5 7 @IBOutlet weak var topMargin: NSLayoutConstraint!
6 8 @IBOutlet weak var vTopLogo: VTopLogo!
  9 + weak var tableView: UITableViewLoadDataFromUIThread?
7 10  
8   - static func openController(_ viewController: UIViewController) {
  11 + static func openController(_ viewController: UIViewController, tableView: UITableViewLoadDataFromUIThread) {
9 12 let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
10 13 let vcOpen = storyboard.instantiateViewController(withIdentifier: "VCAddPerson") as! VCAddPerson
  14 + vcOpen.tableView = tableView;
11 15 viewController.present(vcOpen, animated: true, completion: nil)
12 16 }
13 17  
14 18 override func viewDidLoad() {
15 19 super.viewDidLoad()
16   - vTopLogo.leftBtnClick = {self.dismiss(animated: true)}
  20 + vTopLogo.leftBtnClick = { self.dismiss(animated: true) }
17 21 }
18   -
19   -
  22 +
  23 +
20 24 @IBAction func btnLeftClick(_ sender: Any) {
21 25 dismiss(animated: true)
22 26 }
23 27  
24 28 @IBAction func btnRightClick(_ sender: Any) {
  29 + if let id = edtTitle.text, id.length > 0{
  30 + let parameters: Parameters = [
  31 + "id_create": getIDWork(),
  32 + "id": id,
  33 + ]
  34 +
  35 + NetWorkUtils.excutePostTypeRawJSONEncoding(parameters: parameters, url: Constants.PathManager.ROOT_SERVER + "api/worker/add_id",
  36 + isShowProgress: true, vc: self, responseStringParam: { response in
  37 + guard let value = response.value else {
  38 + CommonUtils.showToastLong(text: LocalizedString("Has_Error_occurred"))
  39 + return
  40 + }
  41 + let json = JSON.parse(value)
  42 + if let isSuccess = json["iSuccess"].bool, isSuccess{
  43 + CommonUtils.showToastLong(text: LocalizedString("successful"))
  44 + self.edtTitle.text = nil
  45 + let person = Person();
  46 + person.id = id;
  47 + self.tableView?.itemsData.append(person)
  48 + self.tableView?.reloadDataTableView()
  49 + return
  50 + } else {
  51 + if let message = json["message"].string {
  52 + CommonUtils.showToastLong(text: message);
  53 + } else {
  54 + CommonUtils.showToastLong(text: LocalizedString("Has_Error_occurred"))
  55 + }
  56 + }
  57 + })
  58 + } else {
  59 + CommonUtils.showToastLong(text: LocalizedString("khong_de_trong"))
  60 + }
25 61 }
26 62  
27 63 @IBAction func edtActionTrigerClick(_ sender: Any) {
... ... @@ -33,7 +69,7 @@
33 69 super.viewDidDisappear(animated)
34 70 }
35 71  
36   - override var prefersStatusBarHidden : Bool {
  72 + override var prefersStatusBarHidden: Bool {
37 73 return true
38 74 }
39 75 }
App/addPerson/VcListPerson.swift
... ... @@ -14,35 +14,76 @@
14 14 let vcOpen = storyboard.instantiateViewController(withIdentifier: "VcListPerson") as! VcListPerson
15 15 viewController.present(vcOpen, animated: true, completion: nil)
16 16 }
17   -
  17 +
18 18 override func viewDidLoad() {
19 19 super.viewDidLoad()
20   - vTopLogo.leftBtnClick = {self.dismiss(animated: true, completion: nil)}
  20 + vTopLogo.leftBtnClick = { self.dismiss(animated: true, completion: nil) }
21 21 tableView.emptyText = LocalizedString("list_empty")
22 22 tableView.initAndLoadData(self)
23 23 }
24   -
  24 +
25 25 @IBAction func btnAddClick(_ sender: Any) {
26   - VCAddPerson.openController(self)
  26 + VCAddPerson.openController(self, tableView: self.tableView)
27 27 }
28 28  
29 29 func loadDataOnUI(complete: @escaping ([Any]?) -> ()) {
30   - complete(nil)
  30 + NetWorkUtils.excuteHttpGet(urlStr: Constants.PathManager.ROOT_SERVER + "api/worker/get_by_user_add/" + getIDWork(),
  31 + complete: { (response, errorText) in
  32 + guard let response = response else {
  33 + CommonUtils.excuteOnMainThread({
  34 + complete(nil)
  35 + })
  36 + return false;
  37 + }
  38 + let json = JSON.parse(response);
  39 + if let isSuccess = json["iSuccess"].bool, isSuccess{
  40 + let arrayValue = json["data"].arrayValue;
  41 + var listPerson = [Person]()
  42 + for item in arrayValue {
  43 + if let rawString = item.rawString(), let person = Mapper<Person>().map(JSONString: rawString) {
  44 + listPerson.append(person);
  45 + }
  46 + }
  47 + CommonUtils.excuteOnMainThread({
  48 + complete(listPerson)
  49 + })
  50 + return true;
  51 + } else {
  52 + CommonUtils.excuteOnMainThread({
  53 + complete(nil)
  54 + })
  55 + return false;
  56 + }
  57 + });
31 58 }
  59 +
  60 + func jsonToString(_ json: Any?) -> String? {
  61 + do {
  62 + let data1 = try JSONSerialization.data(withJSONObject: json, options: JSONSerialization.WritingOptions.prettyPrinted) // first of all convert json to the data
  63 + let convertedString = String(data: data1, encoding: String.Encoding.utf8) // the data will be converted to the string
  64 + return convertedString;
  65 +
  66 + } catch let myJSONError {
  67 + return nil;
  68 + }
  69 +
  70 + }
  71 +
32 72 func getAllCell() -> [BaseCell] {
33 73 var baseCells: [BaseCell] = [BaseCell]();
34   - baseCells.append(BaseCell(type: 0, identifier: "Cell"))
  74 + baseCells.append(BaseCell(type: 0, identifier: "CellPerson"))
35 75 return baseCells
36 76 }
37 77  
38 78 func getTypeOfData(baseobj: Any) -> Int {
39 79 return 0
40 80 }
  81 +
41 82 func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
42 83 }
43 84  
44 85  
45   - override var prefersStatusBarHidden : Bool {
  86 + override var prefersStatusBarHidden: Bool {
46 87 return true
47 88 }
48 89 }
App/camera/ConfirmViewController/MyConfirmViewController.swift
... ... @@ -42,25 +42,23 @@
42 42 }
43 43  
44 44 fileprivate func configUserData() {
45   - vBoard = Board()
46   - vBoard.translatesAutoresizingMaskIntoConstraints = false
47   - self.view.insertSubview(vBoard, at: 1)
48   - NSLayoutConstraint.activate([vBoard.topAnchor.constraint(equalTo: view.topAnchor),
49   - vBoard.leftAnchor.constraint(equalTo: view.leftAnchor),
50   - vBoard.rightAnchor.constraint(equalTo: view.rightAnchor),
51   - vBoard.bottomAnchor.constraint(equalTo: view.bottomAnchor)])
52   - vBoard.initData()
53   -
54   - //TODO
55   -// if let boardObj = userData as? BoardObj {
56   -//
57   -// }
  45 + if let boardObj = userData as? BoardObj, let shootItem = boardObj.shootItem, let ctruong = boardObj.cTruong, let singboard = ctruong.signboard {
  46 + if (singboard > 0) {
  47 + vBoard = Board()
  48 + vBoard.translatesAutoresizingMaskIntoConstraints = false
  49 + self.view.insertSubview(vBoard, at: 1)
  50 + NSLayoutConstraint.activate([vBoard.topAnchor.constraint(equalTo: view.topAnchor),
  51 + vBoard.leftAnchor.constraint(equalTo: view.leftAnchor),
  52 + vBoard.rightAnchor.constraint(equalTo: view.rightAnchor),
  53 + vBoard.bottomAnchor.constraint(equalTo: view.bottomAnchor)])
  54 + vBoard.initData(ctruong: ctruong, shootItem: shootItem);
  55 + }
  56 + }
58 57 }
59 58  
60 59 public override func viewWillLayoutSubviews() {
61 60 super.viewWillLayoutSubviews()
62 61 imageView.frame = view.frame
63   -// vBoard?.frame = view.frame
64 62 }
65 63  
66 64 //region utils ========
67 65  
... ... @@ -152,6 +150,12 @@
152 150 }
153 151  
154 152 public class BoardObj {
  153 + var cTruong: CongTruong?;
  154 + var shootItem: ShootItem?;
155 155  
  156 + init(cTruong: CongTruong?, shootItem: ShootItem?) {
  157 + self.cTruong = cTruong;
  158 + self.shootItem = shootItem;
  159 + }
156 160 }
App/camera/board/Board.swift
... ... @@ -6,7 +6,12 @@
6 6 @IBOutlet weak var vRoot: UIView!
7 7 @IBOutlet weak var tvDate: UILabel!
8 8 @IBOutlet weak var tvNote: UILabel!
  9 + @IBOutlet weak var tenCtruong: UILabel!
  10 + @IBOutlet weak var tvShootItem: UILabel!
  11 + @IBOutlet weak var tvCompanyName: UILabel!
9 12  
  13 + var shootItem: ShootItem?;
  14 + var isReadOnly: Bool = false;
10 15 override init(frame: CGRect) {
11 16 super.init(frame: frame)
12 17 xibSetup()
13 18  
... ... @@ -27,9 +32,25 @@
27 32 }
28 33 }
29 34  
30   - func initData() {
31   - let date = Date()
  35 + func initData(ctruong: CongTruong, shootItem: ShootItem, imgObj: ImgObj? = nil) {
  36 + self.shootItem = shootItem;
  37 + if imgObj != nil {
  38 + isReadOnly = true;
  39 + }
  40 + var date: Date!;
  41 + if let dateSave = imgObj?.date, dateSave > 0 {
  42 + date = DataTypeUtils.getDateFromTimeSecond(timeSeconds: Double(dateSave));
  43 + } else {
  44 + date = Date()
  45 + }
32 46 setDate(date: date)
  47 +
  48 + tenCtruong.text = ctruong.constructionName
  49 + tvCompanyName.text = ctruong.companyName;
  50 + tvShootItem.text = shootItem.name;
  51 + if let note = imgObj?.note {
  52 + tvNote.text = note;
  53 + }
33 54 }
34 55  
35 56 private func setDate(date: Date) {
36 57  
37 58  
... ... @@ -37,13 +58,19 @@
37 58 dateFormatter.dateFormat = "MMM d, yyyy"
38 59 dateFormatter.locale = Locale(identifier: "ja_JP")
39 60 tvDate.text = dateFormatter.string(from: date)
  61 + self.shootItem?.date = DataTypeUtils.getCurrentTimeSecond(date: date);
40 62 }
41 63  
42 64 @IBAction func noteClick(_ sender: Any) {
  65 + if isReadOnly {
  66 + return;
  67 + }
43 68 let dialog = DialogUtils.builderDialog(showCloseButton: false, showTitle: false)
44 69 let edt = dialog.addTextField()
45 70 dialog.addButton(LocalizedString("OK"), action: {
46   - self.tvNote.text = " " + (edt.text ?? "")
  71 + let node = (edt.text ?? "");
  72 + self.shootItem?.note = node
  73 + self.tvNote.text = " " + node;
47 74 })
48 75 dialog.showTitle("", subTitle: "備考", style: .edit)
49 76 edt.becomeFirstResponder()
... ... @@ -51,11 +78,10 @@
51 78  
52 79 @IBAction func dateClick(_ sender: Any) {
53 80 DatePickerDialog().show("撮影日", datePickerMode: .date, callback: { date in
54   - if let date = date {
55   - self.setDate(date: date)
56   - //TODO
57   - }
58   - })
  81 + if let date = date {
  82 + self.setDate(date: date)
  83 + }
  84 + })
59 85 }
60 86  
61 87 func scale() {
App/camera/board/Board.xib
... ... @@ -10,8 +10,11 @@
10 10 <objects>
11 11 <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="Board" customModule="App" customModuleProvider="target">
12 12 <connections>
  13 + <outlet property="tenCtruong" destination="Opz-gX-las" id="FQ4-hh-KFx"/>
  14 + <outlet property="tvCompanyName" destination="gjw-ZI-udI" id="IXK-lI-s5W"/>
13 15 <outlet property="tvDate" destination="jej-JA-xdR" id="qmC-4q-Zfe"/>
14 16 <outlet property="tvNote" destination="9gR-gg-DJg" id="afM-4w-6Ma"/>
  17 + <outlet property="tvShootItem" destination="oUA-qo-531" id="hva-sN-e1b"/>
15 18 <outlet property="vRoot" destination="06q-TN-AUr" id="MTh-qQ-qmq"/>
16 19 </connections>
17 20 </placeholder>
App/commons/CellMucChupWithCamera.swift
... ... @@ -49,24 +49,29 @@
49 49 }
50 50  
51 51 func titleClick() {
52   - guard let viewController = self.viewController else { return }
53   - if viewController is VCConfirmMucDaChon { return }
  52 + guard let viewController = self.viewController as? VCShootItemList else { return }
  53 + let cTruong = viewController.cTruong;
54 54 if let imgs = shootItem.imgs, imgs.count > 0 {
55   - VCPageImgs.openController(viewController, imgObjs: imgs)
  55 + VCPageImgs.openController(viewController, imgObjs: imgs, cTruong: cTruong!, shootItem: self.shootItem);
56 56 }
57 57 }
58 58  
59 59 func btnImvClick() {
60   - guard let viewController = self.viewController else { return }
61   - if viewController is VCConfirmMucDaChon { return }
62   - let cameraViewController = CameraViewController(croppingEnabled: false, allowsLibraryAccess: true) { image, asset in
  60 + guard let viewController = self.viewController as? VCShootItemList else { return }
  61 +// if let imgs = shootItem.imgs, imgs.count > 0 {
  62 +// DialogUtils.showQuestion(titleParam: <#T##String?##Swift.String?#>, messageParam: <#T##String?##Swift.String?#>, type: <#T##TypeDialog##GeneralUtils.TypeDialog#>, yesTitle: <#T##String##Swift.String#>, noTitle: <#T##String##Swift.String#>, yesAction: <#T##@escaping () -> Void##@escaping () -> Swift.Void#>)
  63 +// }
  64 + let cTruong = viewController.cTruong;
  65 + let userData = BoardObj(cTruong: cTruong, shootItem: self.shootItem);
  66 +
  67 + let cameraViewController = CameraViewController(croppingEnabled: false, allowsLibraryAccess: true, userData: userData) { image, asset in
63 68 viewController.dismiss(animated: true, completion: nil)
64 69 guard let image = image else { return }
65 70 self.imv?.image = image
66 71 guard let id = self.shootItem.id, let data = UIImageJPEGRepresentation(image, 1.0) else { return }
67 72 let signboard = self.shootItem?.signboard ?? 1
68 73  
69   - self.uploadImage(id: id, signboard: signboard, data: data)
  74 + self.uploadImage(id: id, signboard: signboard, date: self.shootItem?.date, note: self.shootItem.note, data: data)
70 75 }
71 76  
72 77 viewController.present(cameraViewController, animated: true, completion: nil)
73 78  
74 79  
75 80  
76 81  
... ... @@ -84,27 +89,33 @@
84 89 }
85 90  
86 91 //region upload =======
87   - fileprivate func uploadImage(id: Int, signboard: Int, data: Data) {
  92 + //TODO: Them 2 field date: String, note: String?
  93 + fileprivate func uploadImage(id: Int, signboard: Int, date: Double?, note: String?, data: Data) {
88 94 let tvProgress = SwiftOverlays.showBlockingWaitOverlayWithText(LocalizedString("Uploading") + ".....")
89 95 Alamofire.upload(multipartFormData: { (multipartFormData: MultipartFormData) in
90 96 multipartFormData.append(data, withName: "file", fileName: "file_\(DataTypeUtils.getCurrentTimeSecond()).jpg", mimeType: "image/jpeg")
91 97 multipartFormData.append("\(id)".data(using: String.Encoding.utf8)!, withName: "idShooting")
92 98 multipartFormData.append("\(signboard)".data(using: String.Encoding.utf8)!, withName: "signboard")
93   -// if let note = self.shootItem. {
94   -//multipartFormData.append("\(note)".data(using: String.Encoding.utf8)!, withName: "note")
95   -// }
  99 + if let note = note {
  100 + multipartFormData.append(note.data(using: String.Encoding.utf8)!, withName: "note")
  101 + }
  102 + if let date = date {
  103 + let dateInt = Int(date)
  104 + println("Upload: date: \(dateInt)")
  105 + multipartFormData.append("\(dateInt)".data(using: String.Encoding.utf8)!, withName: "date")
  106 + }
96 107 }, to: Constants.PathManager.ROOT_SERVER + "api/board/store", method: .post, encodingCompletion: { (encodingResult: SessionManager.MultipartFormDataEncodingResult) in
97 108 switch encodingResult {
98 109 case .success(let upload, _, _):
99 110 upload.uploadProgress(closure: { progress in
100   - CommonUtils.excuteOnMainThread({tvProgress.text = (LocalizedString("Uploading") + " \(Int(progress.fractionCompleted * 100))%")})
  111 + CommonUtils.excuteOnMainThread({ tvProgress.text = (LocalizedString("Uploading") + " \(Int(progress.fractionCompleted * 100))%") })
101 112 })
102 113 .responseString { response in
103 114 SwiftOverlays.removeAllBlockingOverlays()
104 115 debugPrint("SUCCESS RESPONSE: \(response.result.value)")
105   - if let value = response.result.value{
  116 + if let value = response.result.value {
106 117 let json = JSON.parse(value)
107   - if let isSuccess = json["isSuccess"].bool, isSuccess, let url = json["url"].string{
  118 + if let isSuccess = json["isSuccess"].bool, isSuccess, let url = json["url"].string {
108 119 self.shootItem.addImg(img: ImgObj(url: url, signboard: signboard, date: nil, note: nil))
109 120 CommonUtils.showToastLong(text: LocalizedString("successful"))
110 121 return
... ... @@ -119,7 +130,7 @@
119 130 }
120 131 })
121 132 }
122   -
  133 +
123 134 fileprivate func handleError() {
124 135 //DialogUtils.showQuestion(messageParam: <#T##String?##Swift.String?#>, yesAction: <#T##@escaping () -> Void##@escaping () -> Swift.Void#>)
125 136 }
App/createNew/VCChonMucChup.swift
... ... @@ -5,12 +5,19 @@
5 5 @IBOutlet weak var topMargin: NSLayoutConstraint!
6 6 @IBOutlet weak var tableView: UITableViewLoadDataFromUIThread!
7 7 @IBOutlet weak var vTopLogo: VTopLogo!
  8 + @IBOutlet weak var btnNext: UIButtonCustomGradientBg!
  9 + var cTruong: CongTruong?
8 10  
9 11 static func getInstance() -> VCChonMucChup {
10 12 let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
11 13 let vcOpen = storyboard.instantiateViewController(withIdentifier: "VCChonMucChup") as! VCChonMucChup
12 14 return vcOpen
13 15 }
  16 + static func openControllerFromEdit(_ viewController: UIViewController, cTruong: CongTruong?) {
  17 + let vcOpen = getInstance()
  18 + vcOpen.cTruong = cTruong;
  19 + viewController.present(vcOpen, animated: true, completion: nil)
  20 + }
14 21  
15 22 override func viewDidLoad() {
16 23 super.viewDidLoad()
... ... @@ -22,6 +29,9 @@
22 29 self.tableView.separatorStyle = UITableViewCellSeparatorStyle.singleLine
23 30 self.tableView.rowHeight = UITableViewAutomaticDimension
24 31 self.tableView.estimatedRowHeight = 150
  32 + if self.cTruong != nil {
  33 + btnNext.isHidden = true;
  34 + }
25 35 }
26 36  
27 37 override func viewWillAppear(_ animated: Bool) {
28 38  
... ... @@ -34,13 +44,21 @@
34 44 }
35 45  
36 46 @IBAction func btnLeftClick(_ sender: Any) {
37   - _ = getVcRoot()?.changeCurrentController(VCNhapMucChup.getInstance())
  47 + if self.cTruong != nil {
  48 + dismiss(animated: true)
  49 + } else {
  50 + _ = getVcRoot()?.changeCurrentController(VCNhapMucChup.getInstance())
  51 + }
38 52 }
39 53  
40 54 //region ============== TableView Data =========
41 55  
42 56 func loadDataOnUI(complete: @escaping ([Any]?) -> ()) {
43   - complete(getVcRoot()?.mucChups)
  57 + if let cTruong = self.cTruong {
  58 + complete(cTruong.shootItems);
  59 + } else {
  60 + complete(getVcRoot()?.mucChups)
  61 + }
44 62 }
45 63  
46 64 func getAllCell() -> [BaseCell] {
... ... @@ -68,6 +86,13 @@
68 86  
69 87 func getVcRoot() -> VCRootCreateNew? {
70 88 return self.parent as? VCRootCreateNew
  89 + }
  90 + override var prefersStatusBarHidden: Bool {
  91 + return true
  92 + }
  93 +
  94 + override open var supportedInterfaceOrientations: UIInterfaceOrientationMask {
  95 + return UIInterfaceOrientationMask.portrait
71 96 }
72 97 }
App/createNew/VCConfirmMucDaChon.swift
... ... @@ -17,7 +17,7 @@
17 17 vTopLogo.leftBtnClick = {
18 18 self.btnLeftClick(self.vTopLogo)
19 19 }
20   - tableView.emptyText = "Empty"
  20 + tableView.emptyText = LocalizedString("list_empty")
21 21 CellMucChupWithCamera.registerClass(tableView: tableView, forCellReuseIdentifier: "CellMucChupWithCamera")
22 22 self.tableView.separatorStyle = UITableViewCellSeparatorStyle.singleLine
23 23 self.tableView.allowsSelection = false
App/createNew/VCNhapMucChup.swift
... ... @@ -6,13 +6,22 @@
6 6 @IBOutlet weak var topMargin: NSLayoutConstraint!
7 7 @IBOutlet weak var tableView: UITableViewLoadDataFromUIThread!
8 8 @IBOutlet weak var vTopLogo: VTopLogo!
  9 + @IBOutlet weak var btnNext: UIButtonCustomGradientBg!
9 10  
  11 + var cTruong: CongTruong?
  12 +
10 13 static func getInstance() -> VCNhapMucChup {
11 14 let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
12 15 let vcOpen = storyboard.instantiateViewController(withIdentifier: "VCNhapMucChup") as! VCNhapMucChup
13 16 return vcOpen
14 17 }
15 18  
  19 + static func openControllerFromEdit(_ viewController: UIViewController, cTruong: CongTruong?) {
  20 + let vcOpen = getInstance()
  21 + vcOpen.cTruong = cTruong;
  22 + viewController.present(vcOpen, animated: true, completion: nil)
  23 + }
  24 +
16 25 override func viewDidLoad() {
17 26 super.viewDidLoad()
18 27 vTopLogo.leftBtnClick = {
... ... @@ -23,6 +32,9 @@
23 32 self.tableView.separatorStyle = UITableViewCellSeparatorStyle.singleLine
24 33 self.tableView.rowHeight = UITableViewAutomaticDimension
25 34 self.tableView.estimatedRowHeight = 150
  35 + if self.cTruong != nil {
  36 + btnNext.isHidden = true;
  37 + }
26 38 }
27 39  
28 40 override func viewWillAppear(_ animated: Bool) {
... ... @@ -54,7 +66,11 @@
54 66  
55 67 @IBAction func btnLeftClick(_ sender: Any) {
56 68 saveMucChup()
57   - _ = getVcRoot()?.changeCurrentController(VCNhapTenCtruong.getInstance())
  69 + if self.cTruong != nil {
  70 + dismiss(animated: true)
  71 + } else {
  72 + _ = getVcRoot()?.changeCurrentController(VCNhapTenCtruong.getInstance())
  73 + }
58 74 }
59 75  
60 76 private func saveMucChup() {
61 77  
... ... @@ -64,12 +80,20 @@
64 80 mucChups.append(mucChup)
65 81 }
66 82 }
67   - getVcRoot()?.mucChups = mucChups
  83 + if let cTruong = self.cTruong {
  84 + cTruong.shootItems = mucChups;
  85 + } else {
  86 + getVcRoot()?.mucChups = mucChups
  87 + }
68 88 }
69 89 //region ============== TableView Data =========
70 90  
71 91 func loadDataOnUI(complete: @escaping ([Any]?) -> ()) {
72   - complete(getVcRoot()?.mucChups)
  92 + if let cTruong = self.cTruong {
  93 + complete(cTruong.shootItems);
  94 + } else {
  95 + complete(getVcRoot()?.mucChups)
  96 + }
73 97 }
74 98  
75 99 func getAllCell() -> [BaseCell] {
... ... @@ -111,6 +135,13 @@
111 135  
112 136 func getVcRoot() -> VCRootCreateNew? {
113 137 return self.parent as? VCRootCreateNew
  138 + }
  139 + override var prefersStatusBarHidden: Bool {
  140 + return true
  141 + }
  142 +
  143 + override open var supportedInterfaceOrientations: UIInterfaceOrientationMask {
  144 + return UIInterfaceOrientationMask.portrait
114 145 }
115 146 }
App/firstInput/VCNoiDungTraoDoi.swift
1 1 import UIKit
  2 +import GeneralUtils
2 3  
3 4 class VCNoiDungTraoDoi: UIViewController {
  5 + @IBOutlet weak var vTopLogo: VTopLogo!
  6 + @IBOutlet weak var tvId: UILabel!
  7 +
  8 + var id: String!;
4 9  
5   - static func getInstance() -> VCNoiDungTraoDoi {
  10 + static func getInstance(id: String) -> VCNoiDungTraoDoi {
6 11 let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
7 12 let vcOpen = storyboard.instantiateViewController(withIdentifier: "VCNoiDungTraoDoi") as! VCNoiDungTraoDoi
  13 + vcOpen.id = id;
8 14 return vcOpen
9 15 }
10 16  
11 17 override func viewDidLoad() {
12 18 super.viewDidLoad()
  19 + vTopLogo.leftBtnClick = {
  20 + self.btnBackToTopClick(self.vTopLogo);
  21 + }
  22 + tvId.text = id;
13 23 }
14 24  
15 25 @IBAction func btnBackToTopClick(_ sender: Any) {
16   - _ = getVcRoot()?.changeCurrentController(VCInputId.getInstance())
  26 + PreferenceUtils.saveString(key: Constants.PreferenceKeys.ID, value: id)
  27 + _ = getVcRoot()?.changeCurrentController(VCHome.getInstance())
17 28 }
18 29  
19 30 func getVcRoot() -> VCRoot? {
App/firstInput/VCSendTraoDoi.swift
1 1 import UIKit
2 2 import GeneralUtils
  3 +import Alamofire
3 4  
4 5 class VCSendTraoDoi: UIViewController {
5 6 @IBOutlet weak var edtTenCty: UITextField!
6 7 @IBOutlet weak var edtPhone: UITextField!
7   - @IBOutlet weak var edtAdress: UITextField!
8   - @IBOutlet weak var edtContent: UITextViewCustom!
9   -
  8 + @IBOutlet weak var edtAdress: UITextViewCustom!
  9 + @IBOutlet weak var vTopLogo: VTopLogo!
  10 +
10 11 static func getInstance() -> VCSendTraoDoi {
11 12 let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
12 13 let vcOpen = storyboard.instantiateViewController(withIdentifier: "VCSendTraoDoi") as! VCSendTraoDoi
... ... @@ -16,7 +17,10 @@
16 17 override func viewDidLoad() {
17 18 super.viewDidLoad()
18 19 // registerKeyBoardEvent()
19   - addInputAccessoryForTextFields([edtTenCty, edtPhone, edtAdress, edtContent], dismissable: true, previousNextable: true)
  20 + addInputAccessoryForTextFields([edtTenCty, edtPhone, edtAdress], dismissable: true, previousNextable: true)
  21 + vTopLogo.leftBtnClick = {
  22 + self.btnCancelClick(self.vTopLogo)
  23 + }
20 24 }
21 25  
22 26 @IBAction func btnCancelClick(_ sender: Any) {
... ... @@ -24,7 +28,28 @@
24 28 }
25 29  
26 30 @IBAction func btnSendClick(_ sender: Any) {
27   - _ = getVcRoot()?.changeCurrentController(VCNoiDungTraoDoi.getInstance())
  31 + let companyName = self.edtTenCty.text;
  32 + let phoneNumber = self.edtPhone.text;
  33 + let address = self.edtAdress.text;
  34 + let parameters: Parameters = [
  35 + "companyName": companyName,
  36 + "phoneNumber": phoneNumber,
  37 + "address": address,
  38 + ]
  39 +
  40 + NetWorkUtils.excutePostTypeFormURLEncoded(parameters: parameters, url: Constants.PathManager.ROOT_SERVER + "api/worker/generate_id",
  41 + isShowProgress: true, vc: self, responseStringParam: { (response) in
  42 + guard let value = response.value else { return }
  43 + let json = JSON.parse(value)
  44 + if let isSuccess = json["iSuccess"].bool, isSuccess, let id = json["data"]["id"].string {
  45 + self.getVcRoot()?.changeCurrentController(VCNoiDungTraoDoi.getInstance(id: id));
  46 + return
  47 + }
  48 + })
  49 +
  50 +
  51 +
  52 +// _ = getVcRoot()?.changeCurrentController(VCNoiDungTraoDoi.getInstance())
28 53 }
29 54  
30 55 // @IBAction func edtActionTrigerClick(_ sender: Any) {
... ... @@ -38,7 +63,7 @@
38 63 func getVcRoot() -> VCRoot? {
39 64 return self.parent as? VCRoot
40 65 }
41   -
  66 +
42 67 //region ======= keyboard process ====
43 68 private func registerKeyBoardEvent() {
44 69 NotificationCenter.default.setObserver(self, selector: #selector(VCInputId.keyboardWillShow(_:)), name: NSNotification.Name.UIKeyboardWillShow.rawValue, object: nil);
App/listCtruong/VCListCtruong.swift
... ... @@ -43,7 +43,7 @@
43 43  
44 44 func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
45 45 if let cTruong = self.tableView.getItem(indexPath) as? CongTruong {
46   - VCShootItemList.openController(self, cTruong: cTruong)
  46 + VCShootItemList.openController(self, cTruong: cTruong, tableViewListCtruong: self.tableView)
47 47 }
48 48 }
49 49 //endregion
App/listCtruong/VCPageImgs.swift
... ... @@ -4,10 +4,14 @@
4 4  
5 5 class VCPageImgs: BasePageViewController {
6 6 var imgObjs: [ImgObj]!
7   - static func openController(_ viewController: UIViewController, imgObjs: [ImgObj]) {
  7 + var cTruong: CongTruong!, shootItem: ShootItem!;
  8 +
  9 + static func openController(_ viewController: UIViewController, imgObjs: [ImgObj], cTruong: CongTruong, shootItem: ShootItem) {
8 10 let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
9 11 let vcOpen = storyboard.instantiateViewController(withIdentifier: "VCPageImgs") as! VCPageImgs
10 12 vcOpen.imgObjs = imgObjs
  13 + vcOpen.cTruong = cTruong;
  14 + vcOpen.shootItem = shootItem;
11 15 viewController.present(vcOpen, animated: true, completion: nil)
12 16 }
13 17  
... ... @@ -17,7 +21,7 @@
17 21 }
18 22  
19 23 override func getViewControllerAtIndex(_ index: Int) -> UIViewController {
20   - let vc = VCImgItem.getInstance(imgObj: imgObjs[index])
  24 + let vc = VCImgItem.getInstance(imgObj: imgObjs[index], cTruong: self.cTruong, shootItem: self.shootItem)
21 25 vc.pageIndex = index
22 26 return vc
23 27 }
24 28  
25 29  
26 30  
27 31  
28 32  
... ... @@ -41,22 +45,42 @@
41 45  
42 46 var pageIndex: Int = 0
43 47 var imgObj: ImgObj!
  48 + var cTruong: CongTruong!, shootItem: ShootItem!
  49 + var vBoard: Board?
44 50  
45   - static func getInstance(imgObj: ImgObj) -> VCImgItem {
  51 + static func getInstance(imgObj: ImgObj, cTruong: CongTruong, shootItem: ShootItem) -> VCImgItem {
46 52 let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
47 53 let vcOpen = storyboard.instantiateViewController(withIdentifier: "VCImgItem") as! VCImgItem
48 54 vcOpen.imgObj = imgObj
  55 + vcOpen.cTruong = cTruong;
  56 + vcOpen.shootItem = shootItem;
49 57 return vcOpen
50 58 }
51 59  
52 60 override func viewDidLoad() {
53 61 super.viewDidLoad()
54 62 setImageUrl(imv: imv, imageUrl: imgObj.url)
  63 + configBoard()
55 64 }
56   -
  65 +
  66 +
  67 + fileprivate func configBoard() {
  68 + if let imgObj = self.imgObj, let cTruong = self.cTruong, let singboard = imgObj.signBoard, singboard > 0 {
  69 + let vBoard = Board()
  70 + self.vBoard = vBoard;
  71 + vBoard.translatesAutoresizingMaskIntoConstraints = false
  72 + self.view.insertSubview(vBoard, at: 1)
  73 + NSLayoutConstraint.activate([vBoard.topAnchor.constraint(equalTo: view.topAnchor),
  74 + vBoard.leftAnchor.constraint(equalTo: view.leftAnchor),
  75 + vBoard.rightAnchor.constraint(equalTo: view.rightAnchor),
  76 + vBoard.bottomAnchor.constraint(equalTo: view.bottomAnchor)])
  77 + vBoard.initData(ctruong: cTruong, shootItem: shootItem, imgObj: imgObj);
  78 + }
  79 + }
  80 +
57 81 @IBAction func btnCloseClick(_ sender: Any) {
58 82 dismiss(animated: true)
59 83 }
60   -
  84 +
61 85 }
App/listCtruong/VCShootItemList.swift
1 1 import UIKit
2 2 import GeneralUtils
  3 +import Alamofire
3 4  
4 5 class VCShootItemList: UIViewController, IVCLoadDataTableViewUIThread {
5 6 @IBOutlet weak var topMargin: NSLayoutConstraint!
6 7 @IBOutlet weak var tableView: UITableViewLoadDataFromUIThread!
7 8 @IBOutlet weak var imvLogo: UIImageView!
8 9 @IBOutlet weak var tvTitle: UILabel!
  10 + weak var tableViewListCtruong: UITableViewLoadDataFromUIThread?
9 11  
10 12 var cTruong: CongTruong!
11 13  
12   - static func openController(_ viewController: UIViewController, cTruong: CongTruong) {
  14 + static func openController(_ viewController: UIViewController, cTruong: CongTruong, tableViewListCtruong: UITableViewLoadDataFromUIThread?) {
13 15 let storyboard: UIStoryboard = UIStoryboard(name: "Main", bundle: nil)
14 16 let vcOpen = storyboard.instantiateViewController(withIdentifier: "VCShootItemList") as! VCShootItemList
15 17 vcOpen.cTruong = cTruong
  18 + vcOpen.tableViewListCtruong = tableViewListCtruong;
16 19 viewController.present(vcOpen, animated: true, completion: nil)
17 20 }
18 21  
... ... @@ -30,7 +33,7 @@
30 33 }
31 34  
32 35 @IBAction func btnEditClick(_ sender: Any) {
33   - VcEdit.openController(self)
  36 + VcEdit.openController(self, cTruong: self.cTruong, tableViewListCtruong: self.tableViewListCtruong, vcShootItemList: self)
34 37 }
35 38  
36 39 //region ============== TableView Data =========
37 40  
... ... @@ -60,11 +63,7 @@
60 63 }
61 64  
62 65 func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
63   - if let mucChup = self.tableView.getItem(indexPath) as? ShootItem {
64   - //TODO
65   - }
66 66 }
67   -
68 67 //endregion
69 68 override var prefersStatusBarHidden: Bool {
70 69 return true
... ... @@ -75,5 +74,6 @@
75 74 func logoClick() {
76 75 dismiss(animated: true)
77 76 }
  77 +
78 78 }
App/listCtruong/VcEdit.swift
1 1 import UIKit
2 2 import Foundation
3 3 import GeneralUtils
  4 +import Alamofire
4 5  
5 6 class VcEdit: BaseViewControllerShowTransculent {
6 7 @IBOutlet weak var root: UIView!
7 8  
8 9  
9 10  
10 11  
11 12  
12 13  
13 14  
14 15  
15 16  
16 17  
... ... @@ -9,44 +10,137 @@
9 10 @IBOutlet weak var tvListShootItem: UILabel!
10 11 @IBOutlet weak var tvListWillShoot: UILabel!
11 12 @IBOutlet weak var tvSignboard: UILabel!
  13 + weak var tableViewListCtruong: UITableViewLoadDataFromUIThread?
  14 + weak var vcShootItemList: VCShootItemList?
12 15  
13   - static func openController(_ viewController: UIViewController) {
  16 + var cTruong: CongTruong!;
  17 + var isChangedCompany = false, isChangedConstruction = false, isChangedSignboard = false, isChangedshoot = false;
  18 +
  19 + static func openController(_ viewController: UIViewController, cTruong: CongTruong, tableViewListCtruong: UITableViewLoadDataFromUIThread?,
  20 + vcShootItemList: VCShootItemList?) {
14 21 BaseViewControllerShowTransculent.showTransculent(viewController, storyboardName: "Main", viewControllerIdentifier: "VcEdit",
15   - isDismisWhenTapOutSide: true)
  22 + isDismisWhenTapOutSide: true, initBeforeLoad: { vc in
  23 + if let vc = vc as? VcEdit {
  24 + vc.cTruong = cTruong;
  25 + vc.tableViewListCtruong = tableViewListCtruong;
  26 + vc.vcShootItemList = vcShootItemList;
  27 + }
  28 + })
16 29 }
17 30  
  31 + override func viewDidLoad() {
  32 + super.viewDidLoad()
  33 + let tap = UITapGestureRecognizer.init(target: self, action: #selector(VcEdit.bgClick))
  34 + root.isUserInteractionEnabled = true
  35 + root.addGestureRecognizer(tap)
  36 + }
  37 +
  38 + override func viewWillAppear(_ animated: Bool) {
  39 + super.viewWillAppear(animated)
  40 + self.updateState()
  41 + }
  42 +
  43 + func updateState() {
  44 + tvTenCty.text = cTruong.companyName
  45 + tvTenCtruong.text = cTruong.constructionName
  46 + if let signboard = cTruong.signboard, signboard > 0 {
  47 + tvSignboard.text = "ON"
  48 + } else {
  49 + tvSignboard.text = "OFF"
  50 + }
  51 + tvListShootItem.text = cTruong.getShootItemsName(isWillshoot: false)
  52 + tvListWillShoot.text = cTruong.getShootItemsName(isWillshoot: true)
  53 + }
  54 +
18 55 @IBAction func tvTenCtyClick(_ sender: Any) {
19   - println("tvTenCtyClick")
  56 + let dialog = DialogUtils.builderDialog(showCloseButton: false, showTitle: false)
  57 + let edt = dialog.addTextField()
  58 + edt.text = cTruong.companyName
  59 + dialog.addButton(LocalizedString("OK"), action: {
  60 + let result = (edt.text ?? "");
  61 + self.cTruong.companyName = result;
  62 + self.isChangedCompany = true;
  63 + self.updateState();
  64 + })
  65 + dialog.showTitle("", subTitle: "施工会社名", style: .edit)
  66 + edt.becomeFirstResponder()
20 67 }
21 68  
22 69 @IBAction func deleteClick(_ sender: Any) {
23 70 let dialog = DialogUtils.builderDialog()
24 71 dialog.addButton("消去する", action: {
25   - println("delete")
  72 + guard let id = self.cTruong.id else { return }
  73 + let parameters: Parameters = [
  74 + "id": id,
  75 + ]
  76 + NetWorkUtils.excutePostTypeRawJSONEncoding(parameters: parameters, url: Constants.PathManager.ROOT_SERVER + "api/regulations/delete",
  77 + isShowProgress: true, vc: self, responseStringParam: { response in
  78 + guard let value = response.value else { return }
  79 + println(response.value)
  80 + let json = JSON.parse(value)
  81 + if let isSuccess = json["isSuccess"].bool, isSuccess {
  82 + guard let itemsData = self.tableViewListCtruong?.itemsData else { return }
  83 + var count = 0;
  84 + var indexFind = -1;
  85 + for e in itemsData {
  86 + if let ctr = e as? CongTruong, ObjectIdentifier(ctr) == ObjectIdentifier(self.cTruong) {
  87 + indexFind = count;
  88 + break;
  89 + }
  90 + count += 1;
  91 + }
  92 + if indexFind >= 0 {
  93 + self.tableViewListCtruong?.itemsData.remove(at: indexFind);
  94 + println("delete success: \(self.tableViewListCtruong != nil)")
  95 + self.tableViewListCtruong?.reloadDataTableView();
  96 + self.dismiss(animated: false, completion: {
  97 + UIApplication.topViewController()?.dismiss(animated: true)
  98 + })
  99 + }
  100 + return
  101 + } else {
  102 + CommonUtils.showToastLong(text: LocalizedString("Has_Error_occurred"))
  103 + }
  104 + })
26 105 })
27 106 dialog.showTitle("リスト消去", subTitle: "リストを消去すると全ての項目が消去されます",
28 107 style: .warning, closeButtonTitle: "戻る")
29 108 }
30 109  
31 110 @IBAction func boardSettingClick(_ sender: Any) {
  111 + if cTruong.signboard == 1 {
  112 + cTruong.signboard = 0
  113 + } else {
  114 + cTruong.signboard = 1
  115 + }
  116 + isChangedSignboard = true;
  117 + updateState()
32 118 }
33 119  
34 120 @IBAction func listWillShootClick(_ sender: Any) {
  121 + VCChonMucChup.openControllerFromEdit(self, cTruong: self.cTruong);
  122 + isChangedshoot = true;
35 123 }
36 124  
37 125 @IBAction func listShootClick(_ sender: Any) {
  126 + VCNhapMucChup.openControllerFromEdit(self, cTruong: self.cTruong);
  127 + isChangedshoot = true;
38 128 }
39 129  
40 130 @IBAction func cTruongClick(_ sender: Any) {
  131 + let dialog = DialogUtils.builderDialog(showCloseButton: false, showTitle: false)
  132 + let edt = dialog.addTextField()
  133 + edt.text = cTruong.constructionName
  134 + dialog.addButton(LocalizedString("OK"), action: {
  135 + let result = (edt.text ?? "");
  136 + self.cTruong.constructionName = result;
  137 + self.isChangedConstruction = true;
  138 + self.updateState();
  139 + })
  140 + dialog.showTitle("", subTitle: "工事件名", style: .edit)
  141 + edt.becomeFirstResponder()
41 142 }
42 143  
43   - override func viewDidLoad() {
44   - super.viewDidLoad()
45   - let tap = UITapGestureRecognizer.init(target: self, action: #selector(VcEdit.bgClick))
46   - root.isUserInteractionEnabled = true
47   - root.addGestureRecognizer(tap)
48   - }
49   -
50 144 override func getHeightContent() -> CGFloat {
51 145 return self.view.bounds.height
52 146 }
53 147  
... ... @@ -55,8 +149,49 @@
55 149 return true
56 150 }
57 151  
  152 + @IBAction func whiteClick(_ sender: Any) {
  153 + }
  154 +
58 155 func bgClick() {
59 156 dismiss(animated: true)
  157 + guard let id = self.cTruong.id else { return }
  158 + if isChangedshoot {
  159 + if let vcShootItemList = self.vcShootItemList {
  160 + vcShootItemList.tableView.initAndLoadData(vcShootItemList)
  161 + }
  162 + var shootingItems = [Any]()
  163 + if let shootItems = cTruong.shootItems {
  164 + for item in shootItems {
  165 + shootingItems.append(item.toDic())
  166 + }
  167 + }
  168 +
  169 + let parameters: Parameters = [
  170 + "idRegulation": id,
  171 + "shootingItems": shootingItems
  172 + ]
  173 + NetWorkUtils.excutePostTypeRawJSONEncoding(parameters: parameters, url: Constants.PathManager.ROOT_SERVER + "api/regulations/update/shooting",
  174 + responseStringParam: { response in
  175 + });
  176 + }
  177 +
  178 + var parameters: Parameters = [
  179 + "id": id
  180 + ]
  181 + if isChangedConstruction || isChangedCompany || isChangedSignboard {
  182 + if isChangedConstruction{
  183 + parameters["constructionName"] = self.cTruong.constructionName!;
  184 + }
  185 + if isChangedCompany{
  186 + parameters["companyName"] = self.cTruong.companyName!;
  187 + }
  188 + if isChangedSignboard{
  189 + parameters["signboard"] = self.cTruong.signboard!;
  190 + }
  191 + NetWorkUtils.excutePostTypeRawJSONEncoding(parameters: parameters, url: Constants.PathManager.ROOT_SERVER + "api/regulations/update",
  192 + responseStringParam: { response in
  193 + });
  194 + }
60 195 }
61 196 }
App/model/CongTruong.swift
... ... @@ -9,17 +9,35 @@
9 9 var shootItems: [ShootItem]?
10 10 var signboard: Int?
11 11  
  12 + func getShootItemsName(isWillshoot: Bool) -> String? {
  13 + guard let shootItems = shootItems else { return nil }
  14 + var result = "";
  15 + for item in shootItems {
  16 + if (isWillshoot && item.willShoot != nil && item.willShoot! > 0) || !isWillshoot {
  17 + if let name = item.name {
  18 + if result.length > 0 { result = result + ", " }
  19 + result = result + name;
  20 + }
  21 + if result.length > 100 {
  22 + return result;
  23 + }
  24 + }
  25 + }
  26 + return result;
  27 + }
  28 +
12 29 // region: ========== Mappable
13 30 init() {}
14 31 required init?(map: Map) {}
15 32  
16 33 func mapping(map: Map) {
  34 + id <- map["id"]
17 35 companyName <- map["companyName"]
18 36 constructionName <- map["constructionName"]
19 37 noCaptured <- map["noCaptured"]
20 38 noRemain <- map["noRemain"]
21 39 shootItems <- map["shootingItems"]
22   - signboard <- map["signboard"]
  40 + signboard <- map["signBoard"]
23 41 }
24 42 //endregion
25 43 }
App/model/ImgObj.swift
... ... @@ -3,14 +3,15 @@
3 3  
4 4 class ImgObj: Mappable {
5 5 var url: String?
6   - var signboard: Int?
7   - var date: Int64?
  6 + var signBoard: Int?
  7 + var date: Int?
8 8 var note: String?
  9 + var dateStr: String?
9 10  
10 11 init() {}
11   - init(url: String, signboard: Int?, date: Int64?, note: String?) {
  12 + init(url: String, signboard: Int?, date: Int?, note: String?) {
12 13 self.url = url
13   - self.signboard = signboard
  14 + self.signBoard = signboard
14 15 self.date = date
15 16 self.note = note
16 17 }
17 18  
... ... @@ -20,9 +21,14 @@
20 21  
21 22 func mapping(map: Map) {
22 23 url <- map["url"]
23   - signboard <- map["signboard"]
24   - date <- map["date"]
  24 + signBoard <- map["signBoard"]
  25 + dateStr <- map["date"]
  26 + if let dateStr = dateStr {
  27 + self.dateStr = nil;
  28 + date = Int(dateStr);
  29 + }
25 30 note <- map["note"]
  31 +
26 32 }
27 33 //endregion
28 34 }
App/model/Person.swift
  1 +import Foundation
  2 +import GeneralUtils
  3 +
  4 +class Person: Mappable {
  5 + var id: String?
  6 + var companyName: String?
  7 + var phoneNumber: String?
  8 + var address: String?
  9 + var name: String?
  10 +
  11 + func getName() -> String? {
  12 + if let name = self.name {
  13 + return name;
  14 + }
  15 + if let companyName = self.companyName {
  16 + return companyName;
  17 + }
  18 + return id;
  19 + }
  20 +
  21 + // region: ========== Mappable
  22 + init() {}
  23 + required init?(map: Map) {}
  24 +
  25 + func mapping(map: Map) {
  26 + id <- map["id"]
  27 + companyName <- map["companyName"]
  28 + phoneNumber <- map["phoneNumber"]
  29 + address <- map["address"]
  30 + name <- map["name"]
  31 + }
  32 + //endregion
  33 +}
App/model/ShootItem.swift
... ... @@ -7,10 +7,14 @@
7 7 var willShoot: Int?
8 8 var signboard: Int?
9 9 var imgs: [ImgObj]?
  10 + var date: Double?
  11 + var note: String?
  12 + var dateStr: String?
10 13  
11   - init(id: Int? = nil, name: String? = nil) {
  14 + init(id: Int? = nil, name: String? = nil, willShoot: Int? = nil) {
12 15 self.id = id
13 16 self.name = name
  17 + self.willShoot = willShoot;
14 18 }
15 19  
16 20 func addImg(img: ImgObj) {
... ... @@ -18,6 +22,15 @@
18 22 imgs?.append(img)
19 23 }
20 24  
  25 + func toDic() -> [String: Any] {
  26 + var willShoot = (self.willShoot == nil) ? 0 : 1
  27 + var params: [String: Any] = ["name": name!, "willShoot": willShoot];
  28 + if let id = self.id {
  29 + params["id"] = id;
  30 + }
  31 + return params;
  32 + }
  33 +
21 34 // region: ========== Mappable
22 35 init() {}
23 36 required init?(map: Map) {}
... ... @@ -27,6 +40,11 @@
27 40 name <- map["name"]
28 41 willShoot <- map["willShoot"]
29 42 imgs <- map["imgs"]
  43 + dateStr <- map["date"]
  44 + if let dateStr = dateStr {
  45 + date = Double(dateStr);
  46 + }
  47 + note <- map["note"]
30 48 }
31 49 //endregion
32 50 }
App/utils/AppUtils.swift
1 1 //
2   -// Created by Philip Tran on 2/26/17.
3   -//
4   -
  2 +import GeneralUtils
5 3 import Foundation
6 4  
7 5 class AppUtils {
8 6  
9 7  
10 8  
... ... @@ -9,28 +7,17 @@
9 7 static func getListCtruong() -> [CongTruong] {
10 8 var result = [CongTruong]()
11 9  
  10 +
12 11 var shootItems = [ShootItem]()
13   - shootItems.append(ShootItem(id: nil, name: "外観下塗り"))
14   - shootItems.append(ShootItem(id: nil, name: "仕上げ"))
  12 + shootItems.append(ShootItem(id: 7, name: "1", willShoot: 0))
  13 + shootItems.append(ShootItem(id: 6, name: "2", willShoot: 1))
15 14  
16 15 var ctruong = CongTruong()
17   - ctruong.companyName = "山田 花子様"
18   - ctruong.noCaptured = 1
19   - ctruong.noRemain = 4
20   - ctruong.shootItems = shootItems
21   - result.append(ctruong)
22   -
23   - ctruong = CongTruong()
24   - ctruong.companyName = "鈴木 一郎様"
25   - ctruong.noCaptured = 12
26   - ctruong.noRemain = 1
27   - ctruong.shootItems = shootItems
28   - result.append(ctruong)
29   -
30   - ctruong = CongTruong()
31   - ctruong.companyName = "斎藤 太郎様"
  16 + ctruong.companyName = "company1"
  17 + ctruong.constructionName = "ctruong1";
32 18 ctruong.noCaptured = 0
33   - ctruong.noRemain = 24
  19 + ctruong.noRemain = 2
  20 + ctruong.signboard = 0;
34 21 ctruong.shootItems = shootItems
35 22 result.append(ctruong)
36 23  
App/utils/NetWorkUtils.swift
... ... @@ -7,9 +7,14 @@
7 7 /**
8 8 The JSONEncoding type creates a JSON representation of the parameters object, which is set as the HTTP body of the request. The Content-Type HTTP header field of an encoded request is set to application/json.
9 9  
  10 + import Alamofire
  11 + let parameters: Parameters = [
  12 + "idWorker": getIDWork(),
  13 + "signboard": signboard == 1,
  14 + ]
10 15 */
11 16 public static func excutePostTypeRawJSONEncoding(parameters: Parameters, url: String, isShowProgress: Bool? = nil, vc: UIViewController? = nil,
12   - responseStringParam: @escaping (DataResponse<String>) -> Void) {
  17 + responseStringParam: (@escaping (DataResponse<String>) -> Void)) {
13 18 NetWorkUtils.excutePost(parameters: parameters, url: url, isShowProgress: isShowProgress, vc: vc, encoding: JSONEncoding.default, responseStringParam: responseStringParam)
14 19 }
15 20  
16 21  
17 22  
18 23  
... ... @@ -19,17 +24,20 @@
19 24 }
20 25  
21 26 public static func excutePostTypePropertyListEncoding(parameters: Parameters, url: String, isShowProgress: Bool? = nil, vc: UIViewController? = nil,
22   - responseStringParam: @escaping (DataResponse<String>) -> Void) {
  27 + responseStringParam: @escaping (DataResponse<String>) -> Void) {
23 28 NetWorkUtils.excutePost(parameters: parameters, url: url, isShowProgress: isShowProgress, vc: vc, encoding: PropertyListEncoding.default, responseStringParam: responseStringParam)
24 29 }
25 30  
26 31 public static func excutePost(parameters: Parameters, url: String, isShowProgress: Bool? = nil, vc: UIViewController? = nil, encoding: ParameterEncoding,
27   - responseStringParam: @escaping (DataResponse<String>) -> Void) {
  32 + responseStringParam: @escaping (DataResponse<String>) -> Void) {
28 33 if isShowProgress == true {
29 34 vc?.showWaitOverlay(isBlockTouch: true)
30 35 }
  36 + println("excutePost: " + url)
  37 + println(parameters)
31 38 Alamofire.request(url, method: .post, parameters: parameters, encoding: encoding)
32 39 .responseString { response in
  40 + println(response.value)
33 41 if isShowProgress == true {
34 42 vc?.removeAllOverlays()
35 43 }
GeneralUtils/GeneralUtils/commonUtils/DataTypeUtils.swift
... ... @@ -7,8 +7,15 @@
7 7 return NSDate().timeIntervalSince1970 * 1000
8 8 }
9 9  
10   - public static func getCurrentTimeSecond() -> Double {
  10 + public static func getCurrentTimeSecond(date: Date? = nil) -> Double {
  11 + if let date = date {
  12 + return date.timeIntervalSince1970;
  13 + }
11 14 return NSDate().timeIntervalSince1970
  15 + }
  16 +
  17 + public static func getDateFromTimeSecond(timeSeconds: Double) -> Date {
  18 + return Date(timeIntervalSince1970: timeSeconds);
12 19 }
13 20  
14 21 /**
GeneralUtils/GeneralUtils/commonUtils/NetWorkUtils.swift
... ... @@ -148,7 +148,8 @@
148 148 task.resume()
149 149 }
150 150  
151   - public static func excuteHttpGetReturnData(urlStr: String, fileSubPathCache: String? = nil, saveTo: SaveFileLocation? = nil, isDecrypt: Bool? = nil, isCheckTimeoutCache: Bool = true, complete: @escaping ((_ data: Data?, _ errorText: String?) -> Bool)) {
  151 + public static func excuteHttpGetReturnData(urlStr: String, fileSubPathCache: String? = nil, saveTo: SaveFileLocation? = nil, isDecrypt: Bool? = nil,
  152 + isCheckTimeoutCache: Bool = true, complete: @escaping ((_ data: Data?, _ errorText: String?) -> Bool)) {
152 153 CommonUtils.executebackgroundThread {
153 154 let urlStrFinal = urlStr.replacing(" ", with: "%20")
154 155 if let fileSubPathCache = fileSubPathCache, let saveTo = saveTo {
GeneralUtils/GeneralUtils/ui/views/TableView/BaseTbLoadData.swift
... ... @@ -14,7 +14,7 @@
14 14 self.delegate = self
15 15 self.dataSource = self
16 16 }
17   -
  17 + itemsData.removeAll()
18 18 loadDataAndUpdateToUI()
19 19 }
20 20  
GeneralUtils/GeneralUtils/ui/views/UIButtonCustom.swift
... ... @@ -99,7 +99,7 @@
99 99  
100 100  
101 101 @IBDesignable
102   -class UIButtonCustomGradientBg: UIButtonCustom {
  102 +public class UIButtonCustomGradientBg: UIButtonCustom {
103 103 @IBInspectable var startColor: UIColor = UIColor.init(hexString: "#FBFBFB")
104 104 @IBInspectable var endColor: UIColor = UIColor.init(hexString: "#D0D0D0")
105 105  
106 106  
... ... @@ -109,10 +109,10 @@
109 109 @IBInspectable var horizontalMode: Bool = false
110 110 @IBInspectable var diagonalMode: Bool = false
111 111  
112   - override class var layerClass: AnyClass { return CAGradientLayer.self }
  112 + override open class var layerClass: AnyClass { return CAGradientLayer.self }
113 113 var gradientLayer: CAGradientLayer { return layer as! CAGradientLayer }
114 114  
115   - override func layoutSubviews() {
  115 + override open func layoutSubviews() {
116 116 super.layoutSubviews()
117 117 if horizontalMode {
118 118 gradientLayer.startPoint = diagonalMode ? CGPoint(x: 1, y: 0) : CGPoint(x: 0, y: 0.5)
Morooka.xcodeproj/project.pbxproj
... ... @@ -36,10 +36,12 @@
36 36 660BB7279593FDA36F972908 /* CameraViewControllerConstraint.swift in Sources */ = {isa = PBXBuildFile; fileRef = 660BB44469D97644FFDBA84A /* CameraViewControllerConstraint.swift */; };
37 37 660BB76D232CBDFEFD943F56 /* VcEdit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 660BBE7F33A6B7BE9E7D5723 /* VcEdit.swift */; };
38 38 660BB78D49C4DA59425EADC9 /* VCSendTraoDoi.swift in Sources */ = {isa = PBXBuildFile; fileRef = 660BBCA62C72AB86E38044EC /* VCSendTraoDoi.swift */; };
  39 + 660BB7AF67A7A9A28AF8FBE1 /* CellPerson.swift in Sources */ = {isa = PBXBuildFile; fileRef = 660BB59CFC9018D9F0607A96 /* CellPerson.swift */; };
39 40 660BB7D60756B330D34A2882 /* VCListCtruong.swift in Sources */ = {isa = PBXBuildFile; fileRef = 660BBB53637040BA5B94E85D /* VCListCtruong.swift */; };
40 41 660BB898BB90A9259F3CB4AB /* UIButtonExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 660BB951A01BD46F1A082C7A /* UIButtonExtensions.swift */; };
41 42 660BB91CDF86A3CB452EAED6 /* SecurityUtils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 660BB7E1FEE6358AA0FF7932 /* SecurityUtils.swift */; };
42 43 660BB934436BDBC009AB9976 /* CellMucChupWithCamera.swift in Sources */ = {isa = PBXBuildFile; fileRef = 660BB27DB3FB3EDB27BCE3DD /* CellMucChupWithCamera.swift */; };
  44 + 660BB98E21C0FC277F5AD8CB /* Person.swift in Sources */ = {isa = PBXBuildFile; fileRef = 660BBE4D9462E8F5F620661C /* Person.swift */; };
43 45 660BB9C07B8D6C31DA7FA03C /* VCShootItemList.swift in Sources */ = {isa = PBXBuildFile; fileRef = 660BB84BDF20E7506F584740 /* VCShootItemList.swift */; };
44 46 660BB9F3489485A515210490 /* Board.xib in Resources */ = {isa = PBXBuildFile; fileRef = 660BB8BD46BBAF7ACD7E94BD /* Board.xib */; };
45 47 660BBA02DED5935CC2C25C50 /* VCAddPerson.swift in Sources */ = {isa = PBXBuildFile; fileRef = 660BB8496C8A11144A87AFD1 /* VCAddPerson.swift */; };
... ... @@ -132,6 +134,7 @@
132 134 660BB50191A22EBA51FE1A0C /* VCNhapTenCtruong.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VCNhapTenCtruong.swift; sourceTree = "<group>"; };
133 135 660BB506E0AB7C3B69DBE5D0 /* Constants.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Constants.swift; sourceTree = "<group>"; };
134 136 660BB550B5859DEC8E981BD6 /* NetWorkUtils.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetWorkUtils.swift; sourceTree = "<group>"; };
  137 + 660BB59CFC9018D9F0607A96 /* CellPerson.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CellPerson.swift; sourceTree = "<group>"; };
135 138 660BB5A65671E9D02EA89389 /* ConfirmViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConfirmViewController.swift; sourceTree = "<group>"; };
136 139 660BB5CCC89015E195B8616B /* VCHome.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VCHome.swift; sourceTree = "<group>"; };
137 140 660BB5CF515C992993C639D7 /* CameraGlobals.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CameraGlobals.swift; sourceTree = "<group>"; };
... ... @@ -164,6 +167,7 @@
164 167 660BBC94B22F8707D2D71D54 /* VCConfirmMucDaChon.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VCConfirmMucDaChon.swift; sourceTree = "<group>"; };
165 168 660BBCA62C72AB86E38044EC /* VCSendTraoDoi.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VCSendTraoDoi.swift; sourceTree = "<group>"; };
166 169 660BBCF400820BA278D02252 /* VolumeControl.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VolumeControl.swift; sourceTree = "<group>"; };
  170 + 660BBE4D9462E8F5F620661C /* Person.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Person.swift; sourceTree = "<group>"; };
167 171 660BBE7F33A6B7BE9E7D5723 /* VcEdit.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VcEdit.swift; sourceTree = "<group>"; };
168 172 660BBE8254E91AD46A2AE93A /* PermissionsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PermissionsView.swift; sourceTree = "<group>"; };
169 173 660BBE8DACAA2464075AFFF8 /* VCInputId.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = VCInputId.swift; sourceTree = "<group>"; };
... ... @@ -223,6 +227,7 @@
223 227 660BBF69F72B470BE44AD1D8 /* VCConfirmId.swift */,
224 228 660BB10AEDBCEAFF2B1CE9C5 /* VCBuyIncreasePerson.swift */,
225 229 660BB8496C8A11144A87AFD1 /* VCAddPerson.swift */,
  230 + 660BB59CFC9018D9F0607A96 /* CellPerson.swift */,
226 231 );
227 232 path = addPerson;
228 233 sourceTree = "<group>";
... ... @@ -283,6 +288,7 @@
283 288 660BB6D0167C62DED01BDA8D /* ShootItem.swift */,
284 289 660BB8C3076658F6777F23F4 /* CongTruong.swift */,
285 290 660BB70C02558F318204A58E /* ImgObj.swift */,
  291 + 660BBE4D9462E8F5F620661C /* Person.swift */,
286 292 );
287 293 path = model;
288 294 sourceTree = "<group>";
... ... @@ -629,6 +635,8 @@
629 635 660BBB52CA48D9835B2B4FA7 /* Constants.swift in Sources */,
630 636 660BBBC00FF5818CE1A37FF7 /* NetWorkUtils.swift in Sources */,
631 637 660BBAFF5B4B94C3D5D97EB5 /* FileUpload.swift in Sources */,
  638 + 660BB98E21C0FC277F5AD8CB /* Person.swift in Sources */,
  639 + 660BB7AF67A7A9A28AF8FBE1 /* CellPerson.swift in Sources */,
632 640 );
633 641 runOnlyForDeploymentPostprocessing = 0;
634 642 };
Morooka.xcworkspace/xcuserdata/ptran.xcuserdatad/UserInterfaceState.xcuserstate
No preview for this file type