Prechádzať zdrojové kódy

Merge remote-tracking branch 'origin/master'

3cooking 5 rokov pred
rodič
commit
9511632e99

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

@@ -39,7 +39,7 @@ public class TopMenu {
     public void onClick(View v) {
       Log.e(TAG, "logoutClickListener");
       csAlert.show();
-      csAlert.setContent(mContext.getString(R.string.logout), "");
+      csAlert.setContent(mContext.getString(R.string.logoutMsg), "");
       csAlert.btnConfirm.setOnClickListener(new View.OnClickListener() {
         @Override
         public void onClick(View v) {

+ 101 - 3
app/src/main/java/com/dbs/mplus/knuh/adapter/ConsentListAdapter.java

@@ -2,6 +2,7 @@ package com.dbs.mplus.knuh.adapter;
 
 import android.content.Context;
 import android.graphics.drawable.GradientDrawable;
+import android.telecom.Call;
 import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -9,29 +10,38 @@ import android.view.ViewGroup;
 import android.widget.RelativeLayout;
 import android.widget.TextView;
 
+import com.dbs.mplus.knuh.BuildConfig;
 import com.dbs.mplus.knuh.R;
+import com.dbs.mplus.knuh.activity.ConsentActivity;
+import com.dbs.mplus.knuh.httpTask.CallBack;
 import com.dbs.mplus.knuh.model.ConsentFormListVO;
 import com.dbs.mplus.knuh.util.ConsentConfig;
+import com.dbs.mplus.knuh.util.Util;
 
 import java.util.ArrayList;
+import java.util.HashMap;
 
 import androidx.annotation.NonNull;
 import androidx.appcompat.app.AppCompatActivity;
 import androidx.core.content.ContextCompat;
 import androidx.recyclerview.widget.RecyclerView;
 
+import org.ksoap2.serialization.SoapObject;
+
 public class ConsentListAdapter extends RecyclerView.Adapter<ConsentListAdapter.ViewHolder> {
 
   private static final String TAG = "ConsentListAdapter";
   private AppCompatActivity            mActivity;
   private Context                      mContext;
+  private ConsentActivity instance;
   public  ArrayList<ConsentFormListVO> arrayList;
 
   private String apiType = "";
 
-  public ConsentListAdapter(AppCompatActivity mActivity, ArrayList<ConsentFormListVO> arrayList,  String apiType) {
+  public ConsentListAdapter(AppCompatActivity mActivity, Context mContext, ArrayList<ConsentFormListVO> arrayList,  String apiType) {
     this.mActivity = mActivity;
-    this.mContext  = mActivity.getApplicationContext();
+    this.mContext  = mContext;
+    this.instance  = (ConsentActivity) mContext;
     this.arrayList = arrayList;
     this.apiType   = apiType;
   }
@@ -49,6 +59,8 @@ public class ConsentListAdapter extends RecyclerView.Adapter<ConsentListAdapter.
     public TextView tvTemp;
     public TextView tvSubText;
 
+    public int position = 0;
+
     public ViewHolder(@NonNull View itemView) {
       super(itemView);
     }
@@ -97,17 +109,103 @@ public class ConsentListAdapter extends RecyclerView.Adapter<ConsentListAdapter.
 
     holder.listLayer.setOnClickListener(onClickListener);
     holder.tvSubText.setOnClickListener(onClickListener);
+
+    holder.position = position;
   }
 
   private View.OnClickListener onClickListener = new View.OnClickListener() {
     @Override
     public void onClick(View v) {
       ViewHolder holder = (ViewHolder) v.getTag();
+      Log.e(TAG, "position -- > " + holder.getLayoutPosition());
+      final int position = holder.getLayoutPosition();
+      ConsentFormListVO consentFormListVO = arrayList.get(position);
+      String formCd = consentFormListVO.getFormCd();
+      Log.e(TAG, "formCd -- > " + formCd);
 
       if (holder.listLayer == v) {
         Log.e(TAG, "listLayer");
       } else if (holder.tvSubText == v) {
-        Log.e(TAG, "tvSubText");
+
+        String soapAction = "";
+        String alertMsg   = "";
+        if (apiType.equals(ConsentConfig.GET_CONSENT_SEARCH)) {
+          soapAction = ConsentConfig.SET_USER_FORM_SET;
+          alertMsg = mContext.getString(R.string.addMaker);
+        } else {
+          soapAction = ConsentConfig.DEL_USER_FORM_SET;
+          alertMsg = mContext.getString(R.string.deleteMaker);
+        }
+
+        instance.csAlert.show();
+        instance.csAlert.setContent(alertMsg, "");
+        final String finalSoapAction = soapAction;
+        final String finalFormCd = formCd;
+        instance.csAlert.btnConfirm.setOnClickListener(new View.OnClickListener() {
+          @Override
+          public void onClick(View v) {
+            CallBack callBack = new CallBack() {
+              @Override
+              public void result(final SoapObject result) {
+                Log.e(TAG, apiType + " result -- > " + result);
+                mActivity.runOnUiThread(new Runnable() {
+                  @Override
+                  public void run() {
+                    if (result == null || result.toString().indexOf("null") > 0 || result.getPropertyCount() == 0) {
+                      stop();
+                    } else {
+                      String rts = result.getProperty("responseData").toString().trim();
+                      int res = Integer.parseInt(rts);
+
+                      if (res == 0) {
+                        stop();
+                      } else {
+                        if (apiType.equals(ConsentConfig.GET_CONSENT_SET_LIST)) {
+                          arrayList.remove(position);
+                          notifyItemRemoved(position);
+                        }
+                      }
+
+                    }
+                  }
+                });
+
+              }
+
+              @Override
+              public void stop() {
+                String message = "";
+                if (apiType.equals(ConsentConfig.GET_CONSENT_SEARCH)) {
+                  message = String.format(mContext.getString(R.string.failMakerEvent), mContext.getString(R.string.add));
+                } else {
+                  message= String.format(mContext.getString(R.string.failMakerEvent), mContext.getString(R.string.delete));
+                }
+                instance.showSingButtonDialog(message);
+
+              }
+
+              @Override
+              public void error() {
+
+              }
+            };
+
+            HashMap<String, String> mData = new HashMap<String, String>();
+            mData.put("instCd", BuildConfig.INST_CD);
+            mData.put("userId", Util.getStringPreference(mContext, "userInfo", "userId"));
+            mData.put("formCd", finalFormCd);
+
+            Util.callHttp(mContext, ConsentConfig.HOST_HOSPITAL, finalSoapAction, mData, callBack);
+            instance.csAlert.dismiss();
+          }
+        });
+
+        instance.csAlert.btnCancel.setOnClickListener(new View.OnClickListener() {
+          @Override
+          public void onClick(View v) {
+            instance.csAlert.dismiss();
+          }
+        });
 
       }
 

+ 6 - 3
app/src/main/java/com/dbs/mplus/knuh/fragment/MarkerFragment.java

@@ -74,6 +74,7 @@ public class MarkerFragment extends Fragment {
   * @since 2020-01-28 오후 5:02
   **/
   public void getConsentSetList() {
+    instance.showProgress();
     CallBack callBack = new CallBack() {
       @Override
       public void result(final SoapObject result) {
@@ -81,11 +82,12 @@ public class MarkerFragment extends Fragment {
         mActivity.runOnUiThread(new Runnable() {
           @Override
           public void run() {
-            instance.showProgress();
-            if (result == null || result.toString().indexOf("null") > 0 ) {
+            Log.e(TAG, "getConsentSetList result -- > " + result);
+            if (result == null || result.toString().indexOf("null") > 0 || result.getPropertyCount() == 0) {
               stop();
               tvEmptyMarker.setVisibility(View.VISIBLE);
             } else {
+              stop();
               tvEmptyMarker.setVisibility(View.GONE);
               ArrayList<ConsentFormListVO> arrayList = SoapParser.getConsentList(result);
               setConsentSetAdapter(arrayList);
@@ -108,6 +110,7 @@ public class MarkerFragment extends Fragment {
 
     HashMap<String, String> mData = new HashMap<String, String>();
     mData.put("userId", Util.getStringPreference(mContext, "userInfo", "userId"));
+//    mData.put("userId", "123123");
     mData.put("instCd", BuildConfig.INST_CD);
 
     Util.callHttp(mContext, ConsentConfig.HOST_HOSPITAL, ConsentConfig.GET_CONSENT_SET_LIST, mData, callBack);
@@ -123,7 +126,7 @@ public class MarkerFragment extends Fragment {
     if (consentListAdapter == null) {
       linearLayoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false);
       markerRecyclerView.setLayoutManager(linearLayoutManager);
-      consentListAdapter = new ConsentListAdapter(mActivity, arrayList, ConsentConfig.GET_CONSENT_SET_LIST);
+      consentListAdapter = new ConsentListAdapter(mActivity, mContext, arrayList, ConsentConfig.GET_CONSENT_SET_LIST);
       markerRecyclerView.setAdapter(consentListAdapter);
     } else {
       consentListAdapter.arrayList = arrayList;

+ 2 - 6
app/src/main/java/com/dbs/mplus/knuh/fragment/SearchFragment.java

@@ -119,7 +119,6 @@ public class SearchFragment extends Fragment {
     CallBack callBack = new CallBack() {
       @Override
       public void result(SoapObject result) {
-        Log.e(TAG, "RowListResult --> " + result);
         if (result == null || result.toString().indexOf("null") > 0) {
           stop();
         } else {
@@ -166,7 +165,6 @@ public class SearchFragment extends Fragment {
     public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {
       CategoryVO categoryVO = (CategoryVO) parent.getAdapter().getItem(position);
       categoryId = categoryVO.getCategoryId();
-      Log.e(TAG, "categoryId -- > " + categoryId);
     }
 
     @Override
@@ -190,7 +188,7 @@ public class SearchFragment extends Fragment {
           public void run() {
             Log.e(TAG, "getConsentList result -- > " + result);
             instance.dismissProgress();
-            if (result == null || result.toString().indexOf("null") > 0 || result.toString().indexOf(ConsentConfig.RETURN_NULL) > 0) {
+            if (result == null || result.toString().indexOf("null") > 0 || result.getPropertyCount() == 0) {
               tvEmptySearchConsent.setVisibility(View.VISIBLE);
             } else {
               tvEmptySearchConsent.setVisibility(View.GONE);
@@ -200,8 +198,6 @@ public class SearchFragment extends Fragment {
           }
         });
 
-
-
       }
       @Override
       public void stop() {
@@ -230,7 +226,7 @@ public class SearchFragment extends Fragment {
     if (consentListAdapter == null) {
       linearLayoutManager = new LinearLayoutManager(mContext, LinearLayoutManager.VERTICAL, false);
       searchRecyclerView.setLayoutManager(linearLayoutManager);
-      consentListAdapter = new ConsentListAdapter(mActivity, arrayList, ConsentConfig.GET_CONSENT_SEARCH);
+      consentListAdapter = new ConsentListAdapter(mActivity, mContext, arrayList, ConsentConfig.GET_CONSENT_SEARCH);
       searchRecyclerView.setAdapter(consentListAdapter);
     } else {
       consentListAdapter.arrayList = arrayList;

+ 2 - 0
app/src/main/java/com/dbs/mplus/knuh/util/ConsentConfig.java

@@ -13,6 +13,8 @@ public class ConsentConfig {
   public static final String GET_DOCTOR_LIST  = "GetDoctorList"; // 진료의 리스트
   public static final String GET_PATIENT_LIST = "GetPatientList"; // 환자 리스트 조회
   public static final String GET_CONSENT_SET_LIST  = "GetConsentSetList"; // 사용자 동의서 즐겨찾기
+  public static final String SET_USER_FORM_SET     = "SetUserFormSetList"; // 즐겨찾기 추가
+  public static final String DEL_USER_FORM_SET     = "DelUserFormSetList"; // 즐겨찾기 삭제
 
   public static final String HOST_CONSENT = BuildConfig.CONSENT_SERVER_URL + "ConsentSvc.asmx";
   public static final String GET_CONSENT_CATEGORYY = "GetCategoryForDropdown";

+ 1 - 1
app/src/main/res/layout/activity_center.xml

@@ -245,7 +245,7 @@
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="@string/tempList"
+                    android:text="@string/noWriteTempList"
                     android:textSize="18sp"
                     android:textColor="@color/black"
                     android:textStyle="bold" />

+ 2 - 2
app/src/main/res/layout/activity_consent.xml

@@ -69,7 +69,7 @@
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="로그아웃"
+                    android:text="@string/logout"
                     android:textColor="@color/white"
                     android:textSize="16sp" />
             </LinearLayout>
@@ -94,7 +94,7 @@
                 <TextView
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:text="설정"
+                    android:text="@string/setting"
                     android:textColor="@color/white"
                     android:textSize="16sp" />
             </LinearLayout>

+ 14 - 14
app/src/main/res/layout/activity_history_fragment.xml

@@ -221,50 +221,50 @@
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
-                android:layout_marginHorizontal="8dp">
+                android:layout_marginHorizontal="2dp">
 
                 <CheckBox
                     android:id="@+id/checkAll"
                     android:theme="@style/CheckBoxTheme"
-                    android:layout_width="match_parent"
+                    android:layout_width="wrap_content"
                     android:layout_height="match_parent"
-                    android:layout_weight="1"
+                    android:layout_weight="0.4"
                     android:text="@string/all"
                     android:textSize="14sp" />
 
                 <CheckBox
                     android:id="@+id/checkTemp"
-                    android:theme="@style/CheckBoxTheme"
-                    android:layout_width="match_parent"
+                    android:layout_width="wrap_content"
                     android:layout_height="match_parent"
-                    android:layout_weight="1"
-                    android:text="@string/temp"
-                    android:textSize="14sp" />
+                    android:layout_weight="0.6"
+                    android:text="@string/noWrite"
+                    android:textSize="14sp"
+                    android:theme="@style/CheckBoxTheme" />
 
                 <CheckBox
                     android:id="@+id/checkCert"
                     android:theme="@style/CheckBoxTheme"
-                    android:layout_width="match_parent"
+                    android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
-                    android:layout_weight="1"
+                    android:layout_weight="0.4"
                     android:text="@string/cert"
                     android:textSize="14sp" />
 
                 <CheckBox
                     android:id="@+id/checkConfirm"
                     android:theme="@style/CheckBoxTheme"
-                    android:layout_width="match_parent"
+                    android:layout_width="wrap_content"
                     android:layout_height="match_parent"
-                    android:layout_weight="1"
+                    android:layout_weight="0.4"
                     android:text="@string/confirm"
                     android:textSize="14sp" />
 
                 <CheckBox
                     android:id="@+id/checkPrint"
                     android:theme="@style/CheckBoxTheme"
-                    android:layout_width="match_parent"
+                    android:layout_width="wrap_content"
                     android:layout_height="match_parent"
-                    android:layout_weight="1"
+                    android:layout_weight="0.4"
                     android:text="@string/print"
                     android:textSize="14sp" />
             </LinearLayout>

+ 148 - 0
app/src/main/res/layout/custom_setting_alert.xml

@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/department_layer">
+
+    <LinearLayout
+        android:layout_width="350dp"
+        android:layout_height="380dp"
+        android:layout_centerInParent="true"
+        android:background="@drawable/department_layer"
+        android:orientation="vertical">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="56dp"
+            android:layout_margin="2dp"
+            android:background="@color/commonColor">
+
+            <TextView
+                android:id="@+id/tvTitle"
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginLeft="16dp"
+                android:layout_marginRight="8dp"
+                android:gravity="center"
+                android:text="@string/setting"
+                android:textColor="@color/white"
+                android:textSize="20sp"
+                android:textStyle="bold" />
+
+        </RelativeLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="vertical">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:orientation="vertical">
+
+                <RadioGroup
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:padding="8dp">
+
+                    <RadioButton
+                        android:id="@+id/inPatientRid"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:padding="8dp"
+                        android:textSize="16sp"
+                        android:text="@string/hospitalization" />
+
+                    <RadioButton
+                        android:id="@+id/outPatientRid"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:padding="8dp"
+                        android:textSize="16sp"
+                        android:text="@string/outPatient" />
+
+                    <RadioButton
+                        android:id="@+id/erPatientRid"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:padding="8dp"
+                        android:textSize="16sp"
+                        android:text="@string/emergency" />
+
+                    <RadioButton
+                        android:id="@+id/opPatientRid"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:padding="8dp"
+                        android:textSize="16sp"
+                        android:text="@string/surgery" />
+
+                    <RadioButton
+                        android:id="@+id/examRid"
+                        android:layout_width="match_parent"
+                        android:layout_height="wrap_content"
+                        android:padding="8dp"
+                        android:textSize="16sp"
+                        android:text="@string/search" />
+
+                </RadioGroup>
+
+            </LinearLayout>
+
+            <RelativeLayout
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:background="@xml/border_top"
+                android:layout_margin="2dp"
+                android:layout_weight="3.4">
+
+                <LinearLayout
+                    android:id="@+id/btnLayout"
+                    android:layout_width="match_parent"
+                    android:layout_height="match_parent"
+                    android:orientation="horizontal"
+                    android:visibility="visible">
+
+                    <Button
+                        android:id="@+id/btnConfirm"
+                        style="?android:attr/borderlessButtonStyle"
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:layout_marginLeft="48dp"
+                        android:layout_marginTop="16dp"
+                        android:layout_marginRight="10dp"
+                        android:layout_marginBottom="16dp"
+                        android:layout_weight="1"
+                        android:background="@drawable/shape2"
+                        android:textColor="@color/white"
+                        android:textSize="16sp"
+                        android:text="@string/confirm"/>
+
+                    <Button
+                        android:id="@+id/btnCancel"
+                        style="?android:attr/borderlessButtonStyle"
+                        android:layout_width="match_parent"
+                        android:layout_height="match_parent"
+                        android:layout_marginLeft="10dp"
+                        android:layout_marginTop="16dp"
+                        android:layout_marginRight="48dp"
+                        android:layout_marginBottom="16dp"
+                        android:layout_weight="1"
+                        android:text="@string/cancel"
+                        android:textColor="@color/white"
+                        android:textSize="16sp"
+                        android:background="@drawable/shape2" />
+
+                </LinearLayout>
+
+            </RelativeLayout>
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+</RelativeLayout>

+ 8 - 2
app/src/main/res/values/strings.xml

@@ -10,6 +10,7 @@
     <string name="pwdHint">패스워드</string>
     <string name="certficate">인증적용</string>
     <string name="login">로그인</string>
+    <string name="logout">로그아웃</string>
     <string name="confirm">확인</string>
     <string name="add">추가</string>
     <string name="print">출력</string>
@@ -17,6 +18,7 @@
     <string name="exit">종료</string>
     <string name="delete">삭제</string>
     <string name="alrim">알림</string>
+    <string name="setting">설정</string>
     <string name="emptyId">사용자 ID를 입력하세요.</string>
     <string name="emptyPw">비밀번호를 입력하세요.</string>
     <string name="emptyCertPw">인증 비밀번호를 입력하세요.</string>
@@ -30,7 +32,7 @@
     <string name="emergency">응급</string>
     <string name="surgery">수술</string>
     <string name="search">검색</string>
-    <string name="admissionDay">입원일</string>
+    <string name="admissionDay">진료(입원)일</string>
     <string name="history">동의서 이력</string>
     <string name="marker">즐겨찾기</string>
     <string name="consentSearch">동의서 찾기</string>
@@ -39,8 +41,9 @@
     <string name="disease">진단명</string>
     <string name="alert">Alert</string>
     <string name="tempList">임시저장</string>
+    <string name="noWriteTempList">미작성 : 연동 &amp; 임시저장</string>
     <string name="certifySave">인증저장</string>
-    <string name="logout">로그아웃 하시겠습니까?</string>
+    <string name="logoutMsg">로그아웃 하시겠습니까?</string>
     <string name="doctorListEmpty">진료의(전체)</string>
     <string name="deptListEmpty">진료과(전체)</string>
     <string name="wardListEmpty">병동(전체)</string>
@@ -79,6 +82,9 @@
     <string name="emptySign">서명이 누락되었습니다.</string>
     <string name="emptySearchConsent">조회된 동의서가 없습니다.</string>
 
+    <string name="deleteMaker">삭제하시겠습니까?</string>
+    <string name="addMaker">즐겨찾기로 추가하시겠습니까?</string>
+    <string name="failMakerEvent">즐겨찾기 %1$s에 실패하였습니다. \n 다시 시도해주세요.</string>
     <string name="searchText">검색어를 입력해주세요.</string>
     <string name="emptyMarker">즐겨찾기 목록이 없습니다.</string>
     <string name="emptyHistory">조회된 이력이 없습니다.</string>