songjunekeun 5 years ago
parent
commit
e06e6f5abe

+ 4 - 3
app/src/main/java/com/dbs/mplus/knuh/activity/ConsentActivity.java

@@ -215,6 +215,10 @@ public class ConsentActivity extends AppCompatActivity {
     indexPage  = intent.getStringExtra("indexPage");
     drKind     = intent.getStringExtra("drKind");
 
+    if (!(indexPage.equals("I") || indexPage.equals("O") || indexPage.equals("E") || indexPage.equals("OP") || indexPage.equals("SR"))) {
+      indexPage = "I";
+    }
+
     Log.e(TAG, "deptCd    -- > " + deptCd   );
     Log.e(TAG, "deptNm    -- > " + deptNm   );
     Log.e(TAG, "jobKindCd -- > " + jobKindCd);
@@ -497,8 +501,5 @@ public class ConsentActivity extends AppCompatActivity {
     }
 
     super.onDestroy();
-//    if (softKeyboard != null) {
-//      softKeyboard.unRegisterSoftKeyboardCallback();
-//    }
   }
 }

+ 12 - 3
app/src/main/java/com/dbs/mplus/knuh/activity/LoginActivity.java

@@ -222,11 +222,11 @@ public class LoginActivity extends AppCompatActivity {
         Log.e(TAG, "result -- > " + result);
 
         if (result == null || result.toString().indexOf("null") > 0) {
-          stop();
+          error();
         } else {
           ArrayList<UserLoginDeptList> arrayList = SoapParser.userLoginDeptList(result);
           if (arrayList.size() == 0) {
-            stop();
+            error();
           } else {
             stop();
             nextActivity(arrayList);
@@ -248,7 +248,16 @@ public class LoginActivity extends AppCompatActivity {
 
       @Override
       public void error() {
-
+        runOnUiThread(new Runnable() {
+          @Override
+          public void run() {
+            if (certCheck.isChecked() == false) {
+              alertView(getString(R.string.loginFailed));
+            } else {
+              alertView(getString(R.string.certAuthFail));
+            }
+          }
+        });
       }
     };
 

+ 1 - 1
app/src/main/java/com/dbs/mplus/knuh/activity/activityEvent/LeftMenu.java

@@ -334,7 +334,7 @@ public class LeftMenu {
   public EditText.OnEditorActionListener onEditorActionListener = new EditText.OnEditorActionListener() {
     @Override
     public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
-      if (actionId == EditorInfo.IME_ACTION_DONE) {
+      if (actionId == EditorInfo.IME_ACTION_DONE && (event != null && (event.getKeyCode() == KeyEvent.KEYCODE_ENTER))) {
         if (v == instance.etPatientId) {
           getPatientList();
         }

+ 6 - 1
app/src/main/java/com/dbs/mplus/knuh/adapter/ConsentHistoryAdapter.java

@@ -133,7 +133,12 @@ public class ConsentHistoryAdapter extends RecyclerView.Adapter<ConsentHistoryAd
         tvSubText.setColor(ContextCompat.getColor(mContext, R.color.paperOutcolor));
       }
 
-      holder.tvPatientName.setVisibility(View.VISIBLE);
+      if (apiType.equals("patient")) {
+        holder.tvPatientName.setVisibility(View.GONE);
+      } else {
+        holder.tvPatientName.setVisibility(View.VISIBLE);
+      }
+
       holder.tvPatientName.setText(builder, TextView.BufferType.SPANNABLE);
       holder.tvSubText.setText(consentState);
     } else if (apiType.equals("centerTemp")) {

+ 1 - 1
app/src/main/java/com/dbs/mplus/knuh/consent/ConsentEvent.java

@@ -145,7 +145,7 @@ public class ConsentEvent {
                 HashMap map = new HashMap();
                 map.put("globalParam", globalParam);
                 map.put("formListParam", mapArrayList);
-                ConsentFacade consentFacade = new ConsentFacade(mContext);
+                ConsentFacade consentFacade = new ConsentFacade(mContext, consentStateEng);
                 consentFacade.startConsent(map, certPass, apiType);
               }
 

+ 47 - 21
app/src/main/java/com/dbs/mplus/knuh/consent/ConsentFacade.java

@@ -7,12 +7,17 @@ import android.content.Intent;
 import android.net.Uri;
 import android.os.Build;
 import android.text.InputType;
+import android.text.SpannableString;
+import android.text.SpannableStringBuilder;
 import android.text.method.PasswordTransformationMethod;
+import android.text.style.ForegroundColorSpan;
 import android.util.Log;
 import android.view.View;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.EditText;
 
+import androidx.core.content.ContextCompat;
+
 import com.dbs.mplus.knuh.BuildConfig;
 import com.dbs.mplus.knuh.R;
 import com.dbs.mplus.knuh.activity.ConsentActivity;
@@ -40,11 +45,13 @@ public class ConsentFacade {
   private ConsentActivity instance;
 
   private EFormToolkit eFormToolkit;
+  private String consentStateEng = "";
 
-  public ConsentFacade(Context mContext) {
+  public ConsentFacade(Context mContext, String consentStateEng) {
     this.mContext = mContext;
     this.instance = (ConsentActivity) mContext;
     this.eFormToolkit = new EFormToolkit(mContext);
+    this.consentStateEng = consentStateEng;
   }
 
   private RunOption createRunOption() {
@@ -335,6 +342,11 @@ public class ConsentFacade {
       visible = "false";
     }
 
+    String pageattachVisible = "true";
+    if (consentStateEng.equals(ConsentConfig.ELECTR_CMP)) {
+      pageattachVisible = "false";
+    }
+
     String uiStyle = "{                                                                                                                             " +
                      "  'required-input': {                                                                                                         " +
                      "    'border': {                                                                                                               " +
@@ -359,7 +371,7 @@ public class ConsentFacade {
                      "  },                                                                                                                          " +
                      "  'toast-message': {                                                                                                          " +
                      "    'signature-missing-data': {                                                                                               " +
-                     "      'text': '" + mContext.getString(R.string.emptySign) + "'                                                                " +
+                     "      'text': '" + mContext.getString(R.string.emptySign) + "'                                                                                " +
                      "    }                                                                                                                         " +
                      "  },                                                                                                                          " +
                      "  'toolbar': {                                                                                                                " +
@@ -371,26 +383,26 @@ public class ConsentFacade {
                      "        'visible': 'true'                                                                                                     " +
                      "      },                                                                                                                      " +
                      "      'tempsave2': {                                                                                                          " +
-                     "        'visible': '" + visible + "',                                                                                                    " +
+                     "        'visible': '" + visible + "',                                                                                         " +
                      "        'enabled': 'true',                                                                                                    " +
-                     "        'text': '" + mContext.getString(R.string.confirmSave) + "'                                                            " +
+                     "        'text': '" + mContext.getString(R.string.confirmSave) + "'                                                                                           " +
                      "      },                                                                                                                      " +
                      "      'tempsave': {                                                                                                           " +
                      "        'visible': 'true',                                                                                                    " +
                      "        'enabled': 'true',                                                                                                    " +
-                     "        'text': '" + mContext.getString(R.string.tempList) + "'                                                               " +
+                     "        'text': '" + mContext.getString(R.string.tempList) + "'                                                                                           " +
                      "      },                                                                                                                      " +
                      "      'save': {                                                                                                               " +
                      "        'visible': 'true',                                                                                                    " +
                      "        'enabled': 'true',                                                                                                    " +
-                     "        'text': '" + mContext.getString(R.string.certifySave) + "'                                                            " +
+                     "        'text': '" + mContext.getString(R.string.certifySave) + "'                                                                                           " +
                      "      },                                                                                                                      " +
                      "      'exit': {                                                                                                               " +
                      "        'visible': 'true',                                                                                                    " +
-                     "        'text': '" + mContext.getString(R.string.exit) + "'                                                                   " +
+                     "        'text': '" + mContext.getString(R.string.exit) + "'                                                                                               " +
                      "      },                                                                                                                      " +
                      "      'pageattach': {                                                                                                         " +
-                     "        'visible': 'true'                                                                                                     " +
+                     "        'visible': '" + pageattachVisible + "'                                                                                " +
                      "      },                                                                                                                      " +
                      "      'page-number': {                                                                                                        " +
                      "        'current': {                                                                                                          " +
@@ -406,22 +418,22 @@ public class ConsentFacade {
                      "    'move-next': {                                                                                                            " +
                      "      'buttons': {                                                                                                            " +
                      "        'save-move': {                                                                                                        " +
-                     "          'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.certifySave)) + "',   " +
+                     "          'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.certifySave)) + "',                                                          " +
                      "          'visible': true,                                                                                                    " +
                      "          'enabled': true                                                                                                     " +
                      "        },                                                                                                                    " +
                      "        'tempsave-move': {                                                                                                    " +
-                     "          'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.tempList)) + "',      " +
+                     "          'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.tempList)) + "',                                                          " +
                      "          'visible': true,                                                                                                    " +
                      "          'enabled': true                                                                                                     " +
                      "        },                                                                                                                    " +
                      "        'tempsave2-move': {                                                                                                   " +
-                     "          'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.confirmSave)) + "',   " +
+                     "          'text': '" + String.format(mContext.getString(R.string.saveNext), mContext.getString(R.string.confirmSave)) + "',                                                          " +
                      "          'visible': true,                                                                                                    " +
                      "          'enabled': true                                                                                                     " +
                      "        },                                                                                                                    " +
                      "        'move': {                                                                                                             " +
-                     "          'text': '"+ mContext.getString(R.string.notSaveNext) +"',                                                           " +
+                     "          'text': '"+ mContext.getString(R.string.notSaveNext) +"',                                                                                    " +
                      "          'visible': true,                                                                                                    " +
                      "          'enabled': true                                                                                                     " +
                      "        }                                                                                                                     " +
@@ -430,19 +442,33 @@ public class ConsentFacade {
                      "  },                                                                                                                          " +
                      "  'dialog': {                                                                                                                 " +
                      "    'save': {                                                                                                                 " +
-                     "      'title': '" + mContext.getString(R.string.certifySave) + "',                                                            " +
-                     "      'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.certifySave)) + "'  " +
+                     "      'title': '" + mContext.getString(R.string.certifySave) + "',                                                                                           " +
+                     "      'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.certifySave)) + "'                                                      " +
                      "    },                                                                                                                        " +
                      "    'temp-save': {                                                                                                            " +
-                     "      'title': '" + mContext.getString(R.string.tempList) + "',                                                               " +
-                     "      'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.tempList)) + "'     " +
+                     "      'title': '" + mContext.getString(R.string.tempList) + "',                                                                                           " +
+                     "      'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.tempList)) + "'                                                      " +
                      "    },                                                                                                                        " +
                      "    'temp-save2': {                                                                                                           " +
-                     "      'title': '" + mContext.getString(R.string.confirmSave) + "',                                                            " +
-                     "      'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.confirmSave)) + "'  " +
-                     "    }                                             " +
-                     "  }                                               " +
-                     "}                                                 ";
+                     "      'title': '" + mContext.getString(R.string.confirmSave) + "',                                                                                           " +
+                     "      'contents': '" + String.format(mContext.getString(R.string.saveAction), mContext.getString(R.string.confirmSave)) + "'                                                      " +
+                     "    }                                                                                                                         " +
+                     "  },                                                                                                                          " +
+                     "  'progress': {                                                                                                               " +
+                     "    'save': {                                                                                                                 " +
+                     "      'title': '" + String.format(mContext.getString(R.string.eformSaveProgressTitle), mContext.getString(R.string.certifySave)) + "',                                                                                            " +
+                     "      'contents': '" + String.format(mContext.getString(R.string.eformSaveProgressMsg), mContext.getString(R.string.certifySave)) + "'                                                            " +
+                     "    },                                                                                                                        " +
+                     "    'tempsave': {                                                                                                             " +
+                     "      'title': '" + String.format(mContext.getString(R.string.eformSaveProgressTitle), mContext.getString(R.string.tempList)) + "',                                                                                            " +
+                     "      'contents': '" + String.format(mContext.getString(R.string.eformSaveProgressMsg), mContext.getString(R.string.tempList)) + "'                                                            " +
+                     "    },                                                                                                                        " +
+                     "    'tempsave2': {                                                                                                            " +
+                     "      'title': '" + String.format(mContext.getString(R.string.eformSaveProgressTitle), mContext.getString(R.string.confirmSave)) + "',                                                                                            " +
+                     "      'contents': '" + String.format(mContext.getString(R.string.eformSaveProgressMsg), mContext.getString(R.string.confirmSave)) + "'                                                            " +
+                     "    }                                                                                                                         " +
+                     "  }                                                                                                                           " +
+                     "}                                                                                                                             ";
     return uiStyle;
   }
 }

+ 3 - 2
app/src/main/java/com/dbs/mplus/knuh/consent/EFormSaveHandler.java

@@ -81,6 +81,7 @@ public class EFormSaveHandler implements IEventHandler<ResultEventArgs>, CallBac
     HashMap<String, String> formParam = (HashMap<String, String>) formListParam.get(index);
 
     String userId            = Util.getStringPreference(mContext, "userInfo", "userId");
+    String userName          = Util.getStringPreference(mContext, "userInfo", "userName");
     String userDeptCd        = Util.getStringPreference(mContext, "userInfo", "deptCd");
     String patientCode       = globalParam.get("parCMDCHD_1PatientNo");
     String clnDeptCode       = globalParam.get("parCMDCHD_1DepartmentCd");
@@ -101,8 +102,8 @@ public class EFormSaveHandler implements IEventHandler<ResultEventArgs>, CallBac
     String orderCd           = "";
     String ocrCode           = formParam.get("parCMSGBD_ocr_cd");
     int cretNo               = Integer.parseInt(globalParam.get("parCMSGBD_Cretno") == null ? "0" : globalParam.get("parCMSGBD_Cretno"));
-    String createUserName    = userId;
-    String modifyUserName    = userId;
+    String createUserName    = userName;
+    String modifyUserName    = userName;
     String mainDrId          = globalParam.get("mainDrId");
     String pageCnt           = String.valueOf(eventArgs.getTotalPagesCount());
     String actKind           = ""; // (임시 확인 : P), 인증 C, 삭제 CP

+ 8 - 1
app/src/main/java/com/dbs/mplus/knuh/fragment/SearchFragment.java

@@ -154,7 +154,7 @@ public class SearchFragment extends Fragment {
       }
     };
 
-    if (instCd.equals(BuildConfig.INST_CD)) {
+    if (instCd.equals("031")) {
       tvHospitalName.setText(getText(R.string.knuh));
     } else {
       tvHospitalName.setText(getText(R.string.chilgok));
@@ -209,9 +209,16 @@ public class SearchFragment extends Fragment {
           @Override
           public void run() {
             Log.e(TAG, "getConsentList result -- > " + result);
+            Log.e(TAG, "getConsentList result -- > " + result.getPropertyCount());
             instance.dismissProgress();
             if (result == null || result.toString().indexOf("null") > 0 || result.getPropertyCount() == 0) {
               tvEmptySearchConsent.setVisibility(View.VISIBLE);
+
+              if (consentListAdapter != null) {
+                consentListAdapter.arrayList.clear();
+                consentListAdapter.notifyDataSetChanged();
+              }
+
             } else {
               tvEmptySearchConsent.setVisibility(View.GONE);
               ArrayList<ConsentFormListVO> arrayList = SoapParser.getConsentList(result);

+ 7 - 4
app/src/main/res/values/strings.xml

@@ -50,6 +50,7 @@
     <string name="emptyPw">비밀번호를 입력하세요.</string>
     <string name="emptyCertPw">인증 비밀번호를 입력하세요.</string>
     <string name="sessionTimeOut">사용시간이 만료되었습니다.</string>
+    <string name="loginFailed">로그인에 실패하였습니다. 다시 시도해주세요.</string>
     <string name="certAuthFail">인증 로그인 시, 오류가 발생하였습니다.</string>
     <string name="doublePressed">뒤로가기 버튼을 한번 더 누르시면 종료됩니다.</string>
     <string name="selectDept">부서를 선택해주세요.</string>
@@ -131,23 +132,25 @@
     <string name="settingError">설정이 변경에 실패하였습니다.</string>
     <string name="deleteMaker">삭제하시겠습니까?</string>
     <string name="addMaker">즐겨찾기로 추가하시겠습니까?</string>
-    <string name="failMakerEvent">즐겨찾기 %1$s에 실패하였습니다. \n 다시 시도해주세요.</string>
+    <string name="failMakerEvent">즐겨찾기 %1s에 실패하였습니다. \n 다시 시도해주세요.</string>
     <string name="searchText">검색어를 입력해주세요.</string>
     <string name="emptyMarker">즐겨찾기 목록이 없습니다.</string>
     <string name="emptyHistory">조회된 이력이 없습니다.</string>
     <string name="searchPatient">조회된 환자 목록이 없습니다.</string>
     <string name="permissionCheck">전자동의서 로그인을 위해 파일 접근 권한 및 DeviceId 획득을 위한 전화번호 권한이 필요합니다.</string>
-    <string name="permissionDenied">권한 허용이 되지 않아 사용하실 수 없습니다. [설정] > [애플리케이션] > %1$s 에서 권한을 허용해주세요.</string>
+    <string name="permissionDenied">권한 허용이 되지 않아 사용하실 수 없습니다. [설정] > [애플리케이션] > %1s 에서 권한을 허용해주세요.</string>
     <string name="notReadEptFile">EPT 파일을 읽을수 없습니다.</string>
     <string name="saveFailed">%1s저장에 실패하였습니다.</string>
     <string name="imageLoadFailed">동의서 이미지 조회에 실패하였습니다.</string>
     <string name="deleteConsent">%1$s를 삭제하시겠습니까?</string>
     <string name="deleteConsentFailed">%1$s 삭제에 실패하였습니다.</string>
     <string name="emptyPatientId">조회할 등록번호를 입력해주세요.</string>
+    <string name="eformSaveProgressTitle">%1s 중입니다.</string>
+    <string name="eformSaveProgressMsg">잠시만 기다려주십시오. \n%1s 후에는 종료됩니다.</string>
 
-    <string name="saveNext">%1$s 후 이동</string>
+    <string name="saveNext">%1s 후 이동</string>
     <string name="notSaveNext">저장 없이 이동</string>
-    <string name="saveAction">%1$s 하시겠습니까?</string>
+    <string name="saveAction">%1s 하시겠습니까?</string>
 
     <string name="viewer">뷰어</string>
     <string name="ERROR_000">뷰어 호출에 실패하였습니다.</string>