Prechádzať zdrojové kódy

환부촬영 수정

강성희 6 rokov pred
rodič
commit
c58648cf3f

+ 14 - 14
MCPlus/Base.lproj/Main.storyboard

@@ -19,12 +19,12 @@
         <!--Extra Web View Controller-->
         <scene sceneID="aob-Xs-UUK">
             <objects>
-                <viewController storyboardIdentifier="ExtraWebViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="nDd-yG-OzX" customClass="ExtraWebViewController" customModule="kunkuk" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="ExtraWebViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="nDd-yG-OzX" customClass="ExtraWebViewController" customModule="eumc" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="ueR-nN-xEe">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bvY-we-jch" customClass="StoryBoardableWKWebView" customModule="kunkuk" customModuleProvider="target">
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="bvY-we-jch" customClass="StoryBoardableWKWebView" customModule="eumc" customModuleProvider="target">
                                 <rect key="frame" x="0.0" y="44" width="414" height="758"/>
                                 <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                             </view>
@@ -137,7 +137,7 @@
         <!--Picture View Controller-->
         <scene sceneID="fkI-Y5-awn">
             <objects>
-                <viewController storyboardIdentifier="PictureViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="IUL-tO-62n" customClass="PictureViewController" customModule="kunkuk" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="PictureViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="IUL-tO-62n" customClass="PictureViewController" customModule="eumc" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="cey-dQ-ZA5">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -181,7 +181,7 @@
         <!--Custom Camera View Controller-->
         <scene sceneID="hFe-8t-oPg">
             <objects>
-                <viewController storyboardIdentifier="CustomCameraViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="vG9-SK-zG4" customClass="CustomCameraViewController" customModule="kunkuk" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="CustomCameraViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="vG9-SK-zG4" customClass="CustomCameraViewController" customModule="eumc" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="qCj-GS-Fhf">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@@ -492,7 +492,7 @@
         <!--Photo View Controller-->
         <scene sceneID="uEH-Iw-puj">
             <objects>
-                <viewController storyboardIdentifier="PhotoViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="HAU-b8-2L8" customClass="PhotoViewController" customModule="kunkuk" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="PhotoViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="HAU-b8-2L8" customClass="PhotoViewController" customModule="eumc" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="XAP-9P-NF8">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
@@ -694,7 +694,7 @@
                                             <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
                                         </collectionViewFlowLayout>
                                         <cells>
-                                            <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="cell" id="LYJ-HX-iwP" customClass="PhotoCollectionViewCell" customModule="kunkuk" customModuleProvider="target">
+                                            <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="cell" id="LYJ-HX-iwP" customClass="PhotoCollectionViewCell" customModule="eumc" customModuleProvider="target">
                                                 <rect key="frame" x="0.0" y="50" width="50" height="50"/>
                                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                                 <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" insetsLayoutMarginsFromSafeArea="NO">
@@ -709,7 +709,7 @@
                                                                 </userDefinedRuntimeAttribute>
                                                             </userDefinedRuntimeAttributes>
                                                         </imageView>
-                                                        <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gall_chk_default" translatesAutoresizingMaskIntoConstraints="NO" id="P8T-Tu-dyy" customClass="CheckImageButton" customModule="kunkuk" customModuleProvider="target">
+                                                        <imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="gall_chk_default" translatesAutoresizingMaskIntoConstraints="NO" id="P8T-Tu-dyy" customClass="CheckImageButton" customModule="eumc" customModuleProvider="target">
                                                             <rect key="frame" x="27" y="3" width="20" height="20"/>
                                                             <constraints>
                                                                 <constraint firstAttribute="width" constant="20" id="6tc-XR-7Ca"/>
@@ -737,7 +737,7 @@
                                                 </connections>
                                             </collectionViewCell>
                                         </cells>
-                                        <collectionReusableView key="sectionHeaderView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="PhotoCollectionViewReusableView" id="HKO-B6-YDQ" customClass="PhotoCollectionViewReusableView" customModule="kunkuk" customModuleProvider="target">
+                                        <collectionReusableView key="sectionHeaderView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="PhotoCollectionViewReusableView" id="HKO-B6-YDQ" customClass="PhotoCollectionViewReusableView" customModule="eumc" customModuleProvider="target">
                                             <rect key="frame" x="0.0" y="0.0" width="398" height="50"/>
                                             <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                                             <subviews>
@@ -768,7 +768,7 @@
                                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="29Q-a9-R1k">
                                                         <rect key="frame" x="0.0" y="0.0" width="207" height="40"/>
                                                         <subviews>
-                                                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="chk_default" translatesAutoresizingMaskIntoConstraints="NO" id="xQ4-Tv-FEb" customClass="CheckImageButton" customModule="kunkuk" customModuleProvider="target">
+                                                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="chk_default" translatesAutoresizingMaskIntoConstraints="NO" id="xQ4-Tv-FEb" customClass="CheckImageButton" customModule="eumc" customModuleProvider="target">
                                                                 <rect key="frame" x="61" y="12.5" width="15" height="15"/>
                                                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                                 <constraints>
@@ -799,7 +799,7 @@
                                                     <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="GvB-Pr-Nvx">
                                                         <rect key="frame" x="207" y="0.0" width="207" height="40"/>
                                                         <subviews>
-                                                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="chk_default" translatesAutoresizingMaskIntoConstraints="NO" id="vZ9-I9-ilh" customClass="CheckImageButton" customModule="kunkuk" customModuleProvider="target">
+                                                            <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="chk_default" translatesAutoresizingMaskIntoConstraints="NO" id="vZ9-I9-ilh" customClass="CheckImageButton" customModule="eumc" customModuleProvider="target">
                                                                 <rect key="frame" x="61" y="12.5" width="15" height="15"/>
                                                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
                                                                 <constraints>
@@ -944,7 +944,7 @@
         <!--Photo Detail View Controller-->
         <scene sceneID="aGf-vD-VaZ">
             <objects>
-                <viewController storyboardIdentifier="PhotoDetailViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="SMs-20-Sgw" customClass="PhotoDetailViewController" customModule="kunkuk" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="PhotoDetailViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="SMs-20-Sgw" customClass="PhotoDetailViewController" customModule="eumc" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="ffa-hW-lBj">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -1226,12 +1226,12 @@
         <!--Web View Controller-->
         <scene sceneID="iTK-sH-9d9">
             <objects>
-                <viewController storyboardIdentifier="WebViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="ySz-mN-COb" customClass="WebViewController" customModule="kunkuk" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="WebViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="ySz-mN-COb" customClass="WebViewController" customModule="eumc" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="FvJ-I3-Lal">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                         <subviews>
-                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="i01-15-nXY" customClass="StoryBoardableWKWebView" customModule="kunkuk" customModuleProvider="target">
+                            <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="i01-15-nXY" customClass="StoryBoardableWKWebView" customModule="eumc" customModuleProvider="target">
                                 <rect key="frame" x="0.0" y="44" width="414" height="818"/>
                             </view>
                         </subviews>
@@ -1258,7 +1258,7 @@
         <!--Barcode View Controller-->
         <scene sceneID="imo-ig-Kdc">
             <objects>
-                <viewController storyboardIdentifier="BarcodeViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="hXX-kq-ut8" customClass="BarcodeViewController" customModule="kunkuk" customModuleProvider="target" sceneMemberID="viewController">
+                <viewController storyboardIdentifier="BarcodeViewController" useStoryboardIdentifierAsRestorationIdentifier="YES" id="hXX-kq-ut8" customClass="BarcodeViewController" customModule="eumc" customModuleProvider="target" sceneMemberID="viewController">
                     <view key="view" contentMode="scaleToFill" id="5qx-dD-4na">
                         <rect key="frame" x="0.0" y="0.0" width="414" height="896"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>

+ 2 - 2
MCPlus/CustomFiles/kunkuk/Info.plist

@@ -15,7 +15,7 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>26</string>
+	<string>100</string>
 	<key>CFBundleURLTypes</key>
 	<array>
 		<dict>
@@ -30,7 +30,7 @@
 		</dict>
 	</array>
 	<key>CFBundleVersion</key>
-	<string>26</string>
+	<string>100</string>
 	<key>DomainName</key>
 	<string>https://app.hyumc.com/</string>
 	<key>Fabric</key>

+ 3 - 3
MCPlus/Images.xcassets/baseline_cloud.imageset/Contents.json

@@ -2,17 +2,17 @@
   "images" : [
     {
       "idiom" : "universal",
-      "filename" : "baseline_cloud_upload_black_36pt_1x.png",
+      "filename" : "ldpi.png",
       "scale" : "1x"
     },
     {
       "idiom" : "universal",
-      "filename" : "baseline_cloud_upload_black_36pt_2x.png",
+      "filename" : "hdpi.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "filename" : "baseline_cloud_upload_black_36pt_3x.png",
+      "filename" : "xhdpi.png",
       "scale" : "3x"
     }
   ],

BIN
MCPlus/Images.xcassets/baseline_cloud.imageset/baseline_cloud_upload_black_36pt_1x.png


BIN
MCPlus/Images.xcassets/baseline_cloud.imageset/baseline_cloud_upload_black_36pt_2x.png


BIN
MCPlus/Images.xcassets/baseline_cloud.imageset/baseline_cloud_upload_black_36pt_3x.png


BIN
MCPlus/Images.xcassets/baseline_cloud.imageset/hdpi.png


BIN
MCPlus/Images.xcassets/baseline_cloud.imageset/ldpi.png


BIN
MCPlus/Images.xcassets/baseline_cloud.imageset/xhdpi.png


+ 1 - 6
MCPlus/Model/Photo.swift

@@ -197,7 +197,7 @@ extension Photo{
             }
             let keys = photos.map({$0.key})
                 .compactMap({$0})
-            let _keys = Set(keys).sorted().reversed()
+            let _keys = Set(keys).sorted()
             
             for key in _keys{
                 print(key)
@@ -247,11 +247,6 @@ extension Photo{
             
             let dicCount = returnDic.count
             
-            
-            
-            
-            
-            
             contactDB.close()
         } else {
             print("Error \(contactDB.lastErrorMessage())")

+ 4 - 6
MCPlus/ViewControllers/PhotoDetailViewController.swift

@@ -144,22 +144,20 @@ extension PhotoDetailViewController:UIScrollViewDelegate{
                 
                 guard let `result` = result["result"] as? [[String:Any]] else{ return }
                 let returnCd = result.first?["returnCd"] as? String
+                let returnMsg = result.first?["returnMsg"] as? String
                 //성공일시
-                if returnCd == "0000"{
+                if returnCd == "0000" {
                     photo.isSended = true
                     photo.update()
-                    self?.showAlert("서버에 업로드 되었습니다.", "", "확인", nil, { action in
+                    self?.showAlert("전송 완료되었습니다.", "", "확인", nil, { action in
                         self?.closeAction()
                     })
                 }else{
-                    self?.showAlert("서버업로드에 실패하였습니다. 관리자에게 문의하여 주세요.", "", "확인", nil, { action in
+                    self?.showAlert(returnMsg ?? "전송 실패하였습니다.", "", "확인", nil, { action in
                         self?.closeAction()
                     })
                 }
         }
         
-        
-        
-        
     }
 }

+ 32 - 7
MCPlus/ViewControllers/PhotoViewController.swift

@@ -132,6 +132,7 @@ class PhotoViewController: UIViewController{
 
     var successCount = 0
     var failCount = 0
+    var uploadCount = 0 //전체 업로드한 개수를 기억한다.
 }
 
 extension PhotoViewController{
@@ -169,7 +170,6 @@ extension PhotoViewController{
             }
             self?.photoCollectionView.reloadData()
         }
-        
     }
     
     override func viewWillLayoutSubviews() {
@@ -187,8 +187,10 @@ extension PhotoViewController{
     
     //선택된 사진 전송
     func okAction(){
-        successCount = 0
-        failCount = 0
+        self.successCount = 0
+        self.failCount = 0
+        self.uploadCount = 0
+        
         let isCheckCount = self.adapter.list?.filter({
             $0.1.filter({$0.isChecked}).count > 0
         }).count ?? 0
@@ -196,23 +198,29 @@ extension PhotoViewController{
 //            self.showAlert("파일을 한 개 이상 선택해주세요", "", "확인")
             return
         }
-        //비동기화 통신코드 동기화 구현 필요
         guard let list = self.adapter.list else{ return }
+        var arrayUploadList:[Photo]? = [Photo]()
+        
         for item in list{
             for item2 in item.1{
                 //선택된 사진이 이미 보낸적이 있다면 업데이트하지 않는다
                 if item2.isChecked && item2.isSended == false{
-                    self.uploadItem(item2)
+                    arrayUploadList?.append(item2)
                 }else{
                     continue
                 }
             }
         }
         
+        self.uploadCount = arrayUploadList?.count ?? 0
+        if self.uploadCount != 0 {
+            for upload in arrayUploadList! {
+                self.uploadItem(upload)
+            }
+        }
         if let parent = self.parent as? PictureViewController{
             parent.callBack?(["success":"\(successCount)", "fail":"\(failCount)"])
         }
-        self.showAlert("서버에 업로드 되었습니다.", "", "확인")
     }
     
     func uploadItem(_ photo:Photo){
@@ -259,8 +267,24 @@ extension PhotoViewController{
                 }else{
                     self?.failCount += 1
                 }
+                self!.isUploadComplete()
             }
+    }
+    
+    func isUploadComplete(){
+        let total = self.uploadCount
+        let sumCount = self.successCount + self.failCount
         
+        if total == sumCount {
+            //전송완료
+            if failCount == 0 {
+                self.showAlert("\(successCount)건 전송 완료되었습니다.", "", "확인")
+            } else {
+                self.showAlert("\(failCount)건 전송 실패하였습니다.", "", "확인")
+            }
+        } else {
+            //전송중
+        }
     }
     
     //선택된 사진 삭제
@@ -292,7 +316,7 @@ extension PhotoViewController{
                 }
             }
             
-            self.reloadTable()
+            self.reloadTable(checkAll: self.allUserAlbumCheck.checked)
             }, { [weak self] (action) in
                 
         })
@@ -401,6 +425,7 @@ extension PhotoViewController{
 //            self.allUserAlbumLabel.text = "전체환자"
 //        }
 //        self.allUserAlbumCheck.isChecked = !self.allUserAlbumCheck.isChecked
+        self.allSelectCheck.isChecked = false
         self.reloadTable()
         
     }