songjunekeun před 5 roky
rodič
revize
28437dc4cf

+ 10 - 14
app/build.gradle

@@ -8,8 +8,8 @@ android {
         applicationId "com.dbs.mplus.knuh"
         minSdkVersion 24
         targetSdkVersion 28
-        versionCode 3
-        versionName "1.1.0.3"
+        versionCode 4
+        versionName "1.1.0.4"
         multiDexEnabled true
 //        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
     }
@@ -74,9 +74,8 @@ android {
 
             applicationIdSuffix ".new"
             buildConfigField "String", "originalPackageName", "\"com.dbs.mplus.knuh\""
-//            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ema031.knuh.kr:9091/\""
-            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ema031.knuh.kr:9096/\""
-//            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ematest.knuh.kr:9091/\""
+            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ema031.knuh.kr:9091/\""
+//            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ema031.knuh.kr:9096/\""
             buildConfigField "String", "CONSENT_EFORM_SERVER_URL", "\"https://ema031.knuh.kr:9090/eformservice.aspx\""
             buildConfigField "String", "INST_CD", "\"031\""
 //            manifestPlaceholders = [appLabel: "본원NEW"]
@@ -85,19 +84,16 @@ android {
         bonwon_dev {
             applicationIdSuffix ".dev1_new"
             buildConfigField "String", "originalPackageName", "\"com.dbs.mplus.knuh\""
-            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ema031.knuh.kr:9096/\""
-//            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://emadev.knuh.kr:8096\""
-//            buildConfigField "String", "CONSENT_SERVER_URL", "\"http://192.168.101.93:8096/\""
-//            buildConfigField "String", "CONSENT_EFORM_SERVER_URL", "\"https://emadev.knuh.kr:8095/eformservice.aspx\""
-            buildConfigField "String", "CONSENT_EFORM_SERVER_URL", "\"https://ema031.knuh.kr:9090/eformservice.aspx\""
+            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://emadev.knuh.kr:8096/\""
+            buildConfigField "String", "CONSENT_EFORM_SERVER_URL", "\"https://emadev.knuh.kr:8095/eformservice.aspx\""
             buildConfigField "String", "INST_CD", "\"031\""
             manifestPlaceholders = [appLabel: "본원교육"]
         }
         chilgok {
             applicationIdSuffix ".chilgok_new"
             buildConfigField "String", "originalPackageName", "\"com.dbs.mplus.knuh\""
-//            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ema032.knuh.kr:8091/\""
-            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ema031.knuh.kr:8096/\""
+            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ema032.knuh.kr:8091/\""
+//            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://ema031.knuh.kr:8096/\""
             buildConfigField "String", "CONSENT_EFORM_SERVER_URL", "\"https://ema032.knuh.kr:8090/eformservice.aspx\""
             buildConfigField "String", "INST_CD", "\"032\""
             manifestPlaceholders = [appLabel: "칠곡운영"]
@@ -105,8 +101,8 @@ android {
         chilgok_dev {
             applicationIdSuffix ".chilgok.dev1_new"
             buildConfigField "String", "originalPackageName", "\"com.dbs.mplus.knuh\""
-//            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://emadev.knuh.kr:9096/\""
-            buildConfigField "String", "CONSENT_SERVER_URL", "\"http://192.168.101.93:9096/\""
+            buildConfigField "String", "CONSENT_SERVER_URL", "\"https://emadev.knuh.kr:9096/\""
+//            buildConfigField "String", "CONSENT_SERVER_URL", "\"http://192.168.101.93:9096/\""
             buildConfigField "String", "CONSENT_EFORM_SERVER_URL", "\"https://emadev.knuh.kr:9095/eformservice.aspx\""
             buildConfigField "String", "INST_CD", "\"032\""
             manifestPlaceholders = [appLabel: "칠곡교육"]

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

@@ -104,8 +104,8 @@ public class MainActivity extends AppCompatActivity {
                 }
               }
 
+              permissionCheck();
             }
-            permissionCheck();
           }
         });
 

+ 2 - 0
app/src/main/java/com/dbs/mplus/knuh/activity/ConsentActivity.java

@@ -37,6 +37,7 @@ import com.dbs.mplus.knuh.activity.activityEvent.RightMenu;
 import com.dbs.mplus.knuh.activity.activityEvent.TapMenu;
 import com.dbs.mplus.knuh.activity.activityEvent.TopMenu;
 import com.dbs.mplus.knuh.adapter.ConsentHistoryAdapter;
+import com.dbs.mplus.knuh.adapter.ConsentTempAdapter;
 import com.dbs.mplus.knuh.adapter.ViewPagerAdapter;
 import com.dbs.mplus.knuh.consent.sign.SignWrapper;
 import com.dbs.mplus.knuh.customView.CustomAlertDialog;
@@ -67,6 +68,7 @@ public class ConsentActivity extends AppCompatActivity {
   public MarkerFragment marker;
   public SearchFragment search;
 
+//  public ConsentTempAdapter consentCenterAdaper;
   public ConsentHistoryAdapter consentCenterAdaper;
   public ConsentHistoryAdapter consentHistoryAdapter;
 

+ 2 - 0
app/src/main/java/com/dbs/mplus/knuh/activity/activityEvent/CenterMenu.java

@@ -12,6 +12,7 @@ import com.dbs.mplus.knuh.R;
 import com.dbs.mplus.knuh.activity.ConsentActivity;
 import com.dbs.mplus.knuh.adapter.ConsentHistoryAdapter;
 import com.dbs.mplus.knuh.adapter.ConsentListAdapter;
+import com.dbs.mplus.knuh.adapter.ConsentTempAdapter;
 import com.dbs.mplus.knuh.httpTask.CallBack;
 import com.dbs.mplus.knuh.httpTask.HttpRunnable;
 import com.dbs.mplus.knuh.httpTask.SoapParser;
@@ -177,6 +178,7 @@ public class CenterMenu {
 
         if (instance.consentCenterAdaper == null) {
           instance.consentCenterAdaper = new ConsentHistoryAdapter(mActivity, mContext, arrayList, "centerTemp");
+//          instance.consentCenterAdaper = new ConsentTempAdapter(mActivity, mContext, arrayList);
           linearLayoutManager = new LinearLayoutManager(mActivity, LinearLayoutManager.VERTICAL, false);
           instance.tempRecyclerView.setLayoutManager(linearLayoutManager);
           instance.tempRecyclerView.setAdapter(instance.consentCenterAdaper);

+ 196 - 0
app/src/main/java/com/dbs/mplus/knuh/adapter/ConsentTempAdapter.java

@@ -0,0 +1,196 @@
+package com.dbs.mplus.knuh.adapter;
+
+import android.content.Context;
+import android.graphics.drawable.GradientDrawable;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import androidx.annotation.NonNull;
+import androidx.appcompat.app.AppCompatActivity;
+import androidx.core.content.ContextCompat;
+import androidx.recyclerview.widget.RecyclerView;
+
+import com.dbs.mplus.knuh.R;
+import com.dbs.mplus.knuh.activity.ConsentActivity;
+import com.dbs.mplus.knuh.consent.ConsentCreateParam;
+import com.dbs.mplus.knuh.consent.ConsentEvent;
+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;
+
+public class ConsentTempAdapter extends RecyclerView.Adapter<ConsentTempAdapter.ViewHolder> {
+  private static final String TAG = "ConsentTempAdapter";
+  private AppCompatActivity mActivity;
+  private Context mContext;
+  private ConsentActivity instance;
+  public ArrayList<ConsentFormListVO> arrayList;
+  private ConsentEvent consentEvent;
+  private String userId = "";
+
+  private HashMap<Integer, Object> checkMap;
+
+  public ConsentTempAdapter(AppCompatActivity mActivity, Context mContext, ArrayList<ConsentFormListVO> arrayList) {
+    this.mActivity = mActivity;
+    this.mContext  = mContext;
+    this.instance  = (ConsentActivity) this.mContext;
+    this.arrayList = arrayList;
+    this.userId    = Util.getStringPreference(mContext, "userInfo", "userId");
+    this.checkMap = new HashMap<Integer, Object>();
+  }
+
+  @Override
+  public int getItemCount() {
+    return arrayList.size();
+  }
+
+  public class ViewHolder extends RecyclerView.ViewHolder {
+    public RelativeLayout listLayer;
+    public CheckBox chkConsent;
+    public TextView tvConsentName;
+    public TextView tvPatientName;
+    public TextView tvTemp;
+    public TextView tvSubText;
+
+    public int position = 0;
+
+    public ViewHolder(@NonNull View itemView) {
+      super(itemView);
+    }
+  }
+
+  @NonNull
+  @Override
+  public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
+    View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.consent_list_item, parent, false);
+    ViewHolder holder = new ViewHolder(view);
+
+    holder.listLayer     = (RelativeLayout) view.findViewById(R.id.listLayer);
+    holder.chkConsent    = (CheckBox) view.findViewById(R.id.chkConsent);
+    holder.tvConsentName = (TextView) view.findViewById(R.id.tvConsentName);
+    holder.tvPatientName = (TextView) view.findViewById(R.id.tvPatientName);
+    holder.tvTemp        = (TextView) view.findViewById(R.id.tvTemp);
+    holder.tvSubText     = (TextView) view.findViewById(R.id.tvSubText);
+
+    holder.listLayer.setTag(holder);
+    holder.tvSubText.setTag(holder);
+    holder.chkConsent.setTag(holder);
+    return holder;
+  }
+
+  @Override
+  public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
+    ConsentFormListVO consentFormListVO = arrayList.get(position);
+    String formName        = consentFormListVO.getFormName();
+    String consentState    = consentFormListVO.getConsentState();
+    String consentStateEng = consentFormListVO.getConsentStateEng();
+    String createUserId    = consentFormListVO.getCreateUserId();
+
+    holder.chkConsent.setVisibility(View.VISIBLE);
+
+    GradientDrawable tvTempBg = (GradientDrawable) holder.tvTemp.getBackground().getCurrent();
+    GradientDrawable tvSubBg = (GradientDrawable) holder.tvSubText.getBackground().getCurrent();
+
+    if (consentStateEng.equals(ConsentConfig.TEMP)) {
+      tvTempBg.setColor(ContextCompat.getColor(mContext, R.color.tempColor));
+      tvSubBg.setColor(ContextCompat.getColor(mContext, R.color.tempColor));
+    } else if (consentStateEng.equals(ConsentConfig.UNFINISHED)) {
+      tvTempBg.setColor(ContextCompat.getColor(mContext, R.color.tempColor));
+      tvSubBg.setColor(ContextCompat.getColor(mContext, R.color.tempColor));
+    }else if (consentStateEng.equals(ConsentConfig.ELECTR_CMP)) {
+      tvTempBg.setColor(ContextCompat.getColor(mContext, R.color.typeRightColor));
+      tvSubBg.setColor(ContextCompat.getColor(mContext, R.color.typeRightColor));
+    }
+
+    holder.tvPatientName.setVisibility(View.GONE);
+    holder.tvTemp.setText(consentState);
+
+    if (createUserId.equals(userId)) {
+      holder.tvTemp.setVisibility(View.VISIBLE);
+      holder.tvSubText.setText(mContext.getString(R.string.delete));
+      tvSubBg.setColor(ContextCompat.getColor(mContext, R.color.alertColor));
+//      holder.tvSubText.setOnClickListener(onClickListener);
+    } else if (consentStateEng.equals(ConsentConfig.UNFINISHED)) {
+      holder.tvTemp.setVisibility(View.VISIBLE);
+      holder.tvSubText.setText(mContext.getString(R.string.delete));
+      tvSubBg.setColor(ContextCompat.getColor(mContext, R.color.alertColor));
+//      holder.tvSubText.setOnClickListener(onClickListener);
+
+    } else {
+      holder.tvTemp.setVisibility(View.GONE);
+      holder.tvSubText.setText(consentState);
+    }
+
+    holder.chkConsent.setChecked(false);
+    holder.tvConsentName.setText(formName);
+
+    holder.chkConsent.setOnCheckedChangeListener(onCheckedChangeListener);
+    holder.listLayer.setOnClickListener(onClickListener);
+  }
+
+  private View.OnClickListener onClickListener = new View.OnClickListener() {
+    @Override
+    public void onClick(View v) {
+      ViewHolder holder = (ViewHolder) v.getTag();
+      final int position = holder.getLayoutPosition();
+      ConsentFormListVO consentFormListVO = arrayList.get(position);
+
+      consentEvent = new ConsentEvent(mContext, instance, consentFormListVO);
+      if (checkMap.size() == 0) {
+        consentEvent.consentOpenProc(instance.centerMenu.patientInfoVO, "centerTemp");
+
+        ConsentHistoryAdapter adapter = (ConsentHistoryAdapter) instance.history.historyWriteRecyclerView.getAdapter();
+        if (adapter != null) {
+          adapter.arrayList.clear();
+          adapter = null;
+        }
+      } else {
+        ConsentCreateParam consentCreateParam = new ConsentCreateParam(mContext);
+        for (int key : checkMap.keySet()) {
+          Log.e(TAG, "key -- > " + key);
+          ConsentFormListVO consentFormVO = arrayList.get(position);
+          String consentMstRid   = consentFormVO.getConsentMstRid();
+          String formRid         = consentFormVO.getFormRid();
+          String guid            = consentFormVO.getFormGuid();
+          String formPrntNm      = consentFormVO.getFormPrntNm();
+          String linkCd          = consentFormVO.getLinkFormCd();
+          String ocrTag          = consentFormVO.getOcrTag();
+          String userDrFlag      = consentFormVO.getUserDrFlag();
+          String consentState    = consentFormVO.getConsentState();
+          String consentStateEng = consentFormVO.getConsentStateEng();
+
+
+          HashMap<String, String> globalParam = consentCreateParam.setGlobalParam(instance.centerMenu.patientInfoVO, consentMstRid, consentFormListVO);
+        }
+      }
+
+    }
+  };
+
+  private CheckBox.OnCheckedChangeListener onCheckedChangeListener = new CompoundButton.OnCheckedChangeListener() {
+    @Override
+    public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+      ViewHolder holder = (ViewHolder) buttonView.getTag();
+      final int position = holder.getLayoutPosition();
+      ConsentFormListVO consentFormListVO = arrayList.get(position);
+      String consentMstRid = consentFormListVO.getConsentMstRid();
+
+      Log.e(TAG, "position -- > " + position);
+      Log.e(TAG, "isChecked -- > " + isChecked);
+      if (isChecked == true) {
+        checkMap.put(position, consentMstRid);
+      } else {
+        checkMap.remove(position);
+      }
+
+    }
+  };
+}

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

@@ -31,6 +31,10 @@ public class ConsentCreateParam {
   private String consentState = "";
   private String consentStateEng = "";
 
+  public ConsentCreateParam(Context mContext) {
+    this.mContext = mContext;
+  }
+
   public ConsentCreateParam(Context mContext, String userDrFlag, String consentState, String consentStateEng) {
     this.mContext        = mContext;
     this.indexPage       = ((ConsentActivity) mContext).indexPage;
@@ -39,7 +43,6 @@ public class ConsentCreateParam {
     this.consentStateEng = consentStateEng;
   }
 
-
   public HashMap<String, String> setGlobalParam(PatientInfoVO patientInfoVO, String consentMstRid, ConsentFormListVO consentFormListVO) {
     HashMap<String, String> map = new HashMap<String, String>();
     String loginUserId         = Util.getStringPreference(mContext, "userInfo", "userId");
@@ -148,6 +151,7 @@ public class ConsentCreateParam {
         map.put("mainDrId", mainDrId);
       }
     }
+
     map.put("userDrFlag", userDrFlag);
 
     mData.put("instCd", BuildConfig.INST_CD);