Browse Source

upgrade:人员数据列表。
2.设置——人员列表”【控制设置页里的人员数据的信息】,在线配置字段加入,逻辑未完善

xwh 1 month ago
parent
commit
46cbd9c0a3

+ 5 - 6
app/src/main/java/com/hanghui/senic/activity/SetUpActivity.java

@@ -70,14 +70,13 @@ public class SetUpActivity extends BaseActivity {
     private List<SetUpBean> list = new ArrayList<>();
     private PopupWindow popupWindow;
     //数据配置
-    String[] TextString = new String[]{"基本信息", "采集配置", "支付宝刷脸配置", "结果页配置", "页面背景配置",
-            "功能配置", "系统配置", "zoloConfig摄像头配置", "人员数据","黑名单", "退出应用", "重启系统"};
-    int[] integers = new int[]{R.mipmap.basic_information_image,
+    String[] TextString = new String[]{"基本信息","摄像头配置",  "采集配置", "支付宝刷脸配置", "结果页配置", "页面背景配置",
+            "功能配置", "系统配置", "人员数据","黑名单", "退出应用", "重启系统"};
+    int[] integers = new int[]{R.mipmap.basic_information_image, R.mipmap.zoloconfigcamera_image,
             R.mipmap.acquisition_image, R.mipmap.zfb_brushface_image,
             R.mipmap.resultconfiguration_image, R.mipmap.pagebackground_image,
             R.mipmap.functionalconfiguration_image, R.mipmap.systemconfiguration_image,
-            R.mipmap.zoloconfigcamera_image,R.mipmap.personneldata_image,
-            R.mipmap.blacklist_image,
+            R.mipmap.personneldata_image, R.mipmap.blacklist_image,
             R.mipmap.exit_system, R.mipmap.reboot_system};
 
     @Override
@@ -186,7 +185,7 @@ public class SetUpActivity extends BaseActivity {
                 Intent SystemConfigurationIntent = new Intent(activity, SystemConfigurationActivity.class);
                 startActivity(SystemConfigurationIntent);
                 break;
-            case "zoloConfig摄像头配置":
+            case "摄像头配置":
                 Intent zoloConfigCameraIntent = new Intent(activity, zoloConfigCameraActivity.class);
                 startActivity(zoloConfigCameraIntent);
                 break;

+ 34 - 2
app/src/main/java/com/hanghui/senic/activity/setup/PersonnelDataActivity.java

@@ -6,19 +6,24 @@ import androidx.recyclerview.widget.LinearLayoutManager;
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
+import android.util.Log;
 import android.view.View;
 import android.widget.EditText;
 import android.widget.ImageView;
 import android.widget.LinearLayout;
 import android.widget.TextView;
+import android.widget.Toast;
 
 import com.example.datalibrary.api.FaceApi;
 import com.example.datalibrary.model.KeyboardsUtils;
 import com.example.datalibrary.model.User;
+import com.example.datalibrary.utils.ToastUtils;
 import com.hanghui.senic.R;
 import com.hanghui.senic.activity.BaseActivity;
+import com.hanghui.senic.activity.PassWordActivity;
 import com.hanghui.senic.adapter.PersonnelDataAdapter;
 import com.hanghui.senic.common.CommonUtil;
+import com.hanghui.senic.service.usbserialdemo.utile.ConfigManager;
 import com.hanghui.senic.service.usbserialdemo.utile.StringIsNull;
 import com.jcodecraeer.xrecyclerview.XRecyclerView;
 
@@ -58,7 +63,7 @@ public class PersonnelDataActivity extends BaseActivity implements View.OnClickL
     private Future future3;
 
     private List<User> dataList;
-    private volatile int totalSize=0;
+    private volatile int totalSize= -1;
     private final int WHAT_REFRESH=0x01;
 
     private volatile boolean isSearching=false;
@@ -75,7 +80,7 @@ public class PersonnelDataActivity extends BaseActivity implements View.OnClickL
                    return;
                 }
                 future3 = es3.submit(() -> {
-                    dataList = FaceApi.getInstance().getUsers();
+                    dataList = FaceApi.getInstance().getAllUserList();
                      final int tempTotalSize = dataList.size();
                     post(() -> {
                         if (!isSearching && mAdapter != null) {
@@ -148,6 +153,29 @@ public class PersonnelDataActivity extends BaseActivity implements View.OnClickL
                 , PersonnelDataActivity.this);
         personnelData_RecyclerView.setAdapter(mAdapter);
         personnelData_RecyclerView.setPullRefreshEnabled(false);//禁止下拉刷新
+       /* List<Integer> configs=  ConfigManager.getAuthenticationBeanListBean().getSetPersonalList();
+        if (configs != null) {
+            boolean isShowPhoto = false;
+            boolean isShowIDCard = false;
+            boolean isShowPhone = false;
+            for (Integer item : configs) {
+                if (item == null || item == 0) {
+                    continue;
+                }
+                switch (item) {
+                    case 1:
+                        isShowPhoto = true;
+                        break;
+                    case 2:
+                        isShowIDCard = true;
+                        break;
+                    case 3:
+                        isShowPhone = true;
+                        break;
+                }
+            }
+            mAdapter.setConfig(isShowPhoto, isShowIDCard, isShowPhone);
+        }*/
 
     }
 
@@ -187,6 +215,10 @@ public class PersonnelDataActivity extends BaseActivity implements View.OnClickL
                 //关闭软键盘
                 KeyboardsUtils.hintKeyBoards(personnelData_inquire);
                 try {
+                    if(mAdapter.getList() == null ||mAdapter.getList().size() ==0){
+                        Toast.makeText(this, "暂无人员数据,请稍后重试~", Toast.LENGTH_SHORT).show();
+                        return;
+                    }
                     personnelData_input_search.setEnabled(false);
                     mAdapter.setList(searchList(id,cardNumber,name,idNumber,phone));
                     personnelData_RecyclerView.scrollToPosition(0);

+ 4 - 4
app/src/main/java/com/hanghui/senic/activity/setup/zoloConfigCameraActivity.java

@@ -72,7 +72,7 @@ public class zoloConfigCameraActivity extends BaseActivity implements View.OnCli
 
     private void initFind() {
         SetUPIncloud_title = findViewById(R.id.setUPIncloud_title);
-        SetUPIncloud_title.setText("zoloConfig摄像头配置");
+        SetUPIncloud_title.setText("摄像头配置");
         SetUPIncloud_finish = findViewById(R.id.setUPIncloud_finish);
         SetUPIncloud_finish.setOnClickListener(activity);
         //摄像头显示角度
@@ -94,7 +94,7 @@ public class zoloConfigCameraActivity extends BaseActivity implements View.OnCli
             public void onStopTrackingTouch(SeekBar seekBar) {
                 int supAlgorithmAngleNum = refreshView(supAlgorithmAngle);
                 zoloConfigCameraActivity_supAlgorithmAngleSeekBar.setProgress(supAlgorithmAngleNum);
-                zoloConfigCameraActivity_supAlgorithmAngleText.setText(supAlgorithmAngleNum);
+                zoloConfigCameraActivity_supAlgorithmAngleText.setText(supAlgorithmAngleNum+"");
             }
         });
         //RGB摄像头旋转角度
@@ -115,7 +115,7 @@ public class zoloConfigCameraActivity extends BaseActivity implements View.OnCli
             public void onStopTrackingTouch(SeekBar seekBar) {
                 int algorithmAngleSeekBarNum = refreshView(algorithmAngle);
                 zoloConfigCameraActivity_algorithmAngleSeekBar.setProgress(algorithmAngleSeekBarNum);
-                zoloConfigCameraActivity_algorithmAngleText.setText(algorithmAngleSeekBarNum);
+                zoloConfigCameraActivity_algorithmAngleText.setText(algorithmAngleSeekBarNum+"");
             }
         });
         //IR摄像头旋转角度
@@ -136,7 +136,7 @@ public class zoloConfigCameraActivity extends BaseActivity implements View.OnCli
             public void onStopTrackingTouch(SeekBar seekBar) {
                 int displayAngleSeekBarNum = refreshView(displayAngle);
                 zoloConfigCameraActivity_displayAngleSeekBar.setProgress(displayAngleSeekBarNum);
-                zoloConfigCameraActivity_displayAngleText.setText(displayAngleSeekBarNum);
+                zoloConfigCameraActivity_displayAngleText.setText(displayAngleSeekBarNum+"");
             }
         });
         //RGB摄像头镜像

+ 33 - 1
app/src/main/java/com/hanghui/senic/adapter/PersonnelDataAdapter.java

@@ -33,6 +33,18 @@ public class PersonnelDataAdapter extends RecyclerView.Adapter<PersonnelDataAdap
             .placeholder(R.mipmap.ic_person_default)
             .transform(new CenterCrop(),new RoundedCorners(99));
 
+    private boolean isShowPhoto = true ;
+    private boolean isShowIDCard = true ;
+    private boolean isShowPhone = true ;
+
+    public void  setConfig(boolean isShowPhoto, boolean isShowIDCard, boolean isShowPhone) {
+        this.isShowPhoto = isShowPhoto;
+        this.isShowIDCard = isShowIDCard;
+        this.isShowPhone = isShowPhone;
+        notifyDataSetChanged();
+    }
+
+
     public PersonnelDataAdapter(List<User> mList, Context context) {
         this.context = context;
         this.list = mList;
@@ -46,6 +58,10 @@ public class PersonnelDataAdapter extends RecyclerView.Adapter<PersonnelDataAdap
         notifyDataSetChanged();
     }
 
+    public List<User> getList() {
+        return list;
+    }
+
     @NonNull
     @Override
     public Holder onCreateViewHolder(@NonNull ViewGroup viewGroup, int i) {
@@ -56,6 +72,17 @@ public class PersonnelDataAdapter extends RecyclerView.Adapter<PersonnelDataAdap
     @Override
     public void onBindViewHolder(@NonNull final Holder holder, final int i) {
         this.viewHolder = holder;
+        holder.personnelDataAdapter_idNumber.setVisibility(View.INVISIBLE);
+        holder.personnelDataAdapter_phone.setVisibility(View.INVISIBLE);
+        if(isShowPhone){
+            holder.personnelDataAdapter_phone.setVisibility(View.VISIBLE);
+        }
+        if(isShowIDCard){
+            holder.personnelDataAdapter_idNumber.setVisibility(View.VISIBLE);
+        }
+
+
+
         holder.personnelDataAdapter_ID.setText(StringIsNull.ReturnString(list.get(i).getUserId()+""));
         holder.personnelDataAdapter_name.setText(StringIsNull.ReturnString(list.get(i).getUserName()));
         String cardIdEx = list.get(i).getCardIdEx();
@@ -70,8 +97,13 @@ public class PersonnelDataAdapter extends RecyclerView.Adapter<PersonnelDataAdap
         holder.personnelDataAdapter_phone.setText(phone);
         //照片添加
         //设置图片圆角角度
+        if(isShowPhoto){
+            ImageLoaderUtils.loadImage(list.get(i).getPhoto(),holder.personnelDataAdapter_titleImage,options);
+        }else{
+
+            ImageLoaderUtils.loadImage(R.mipmap.ic_person_default,holder.personnelDataAdapter_titleImage,options);
+        }
 
-        ImageLoaderUtils.loadImage(list.get(i).getPhoto(),holder.personnelDataAdapter_titleImage,options);
     }
 
     @Override

+ 10 - 0
app/src/main/java/com/hanghui/senic/bean/AuthenticationBean.java

@@ -492,6 +492,8 @@ public class AuthenticationBean {
         private Integer sameFaceInterval;//1:N 同人脸间隔时间
         @SerializedName("serverTime")
         private long serverTime;//服务器时间
+        @SerializedName("setPersonalList")
+        List<Integer> setPersonalList; //设置——人员列表”【控制设置页里的人员数据的信息】 1-照片,2-证件号,3-手机号
 
         public Integer getSameFaceInterval() {
             return sameFaceInterval;
@@ -2399,5 +2401,13 @@ public class AuthenticationBean {
         public void setServerTime(long serverTime) {
             this.serverTime = serverTime;
         }
+
+        public List<Integer> getSetPersonalList() {
+            return setPersonalList;
+        }
+
+        public void setSetPersonalList(List<Integer> setPersonalList) {
+            this.setPersonalList = setPersonalList;
+        }
     }
 }