Bläddra i källkod

提交类型 完成人脸识别操作
提交内容 完成人脸识别操作

Bitliker 7 år sedan
förälder
incheckning
672c355002

+ 27 - 0
WeiChat/src/main/res/layout/sign_senior_setting.xml

@@ -88,6 +88,33 @@
                 android:layout_height="10px"
                 android:background="@color/black_gray" />
 
+            <RelativeLayout
+                style="@style/IMTbleLine2"
+                android:layout_height="50dp"
+                android:background="@color/white"
+                android:visibility="visible">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerVertical="true"
+                    android:gravity="center"
+                    android:text="是否启用人脸打卡"
+                    android:textColor="@color/black"
+                    android:textSize="14sp" />
+
+                <com.core.widget.view.SwitchView
+                    android:id="@+id/signin_face_sv"
+                    android:layout_width="40dp"
+                    android:layout_height="25dp"
+                    android:layout_alignParentRight="true"
+                    android:layout_centerVertical="true" />
+            </RelativeLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="10px"
+                android:background="@color/black_gray" />
             <TextView
                 android:layout_width="match_parent"
                 android:layout_height="40dp"

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Wed Jun 27 10:29:32 CST 2018
+#Tue Jul 03 17:57:21 CST 2018
 debugName=502
-versionName=637
+versionName=638
 debugCode=502
-versionCode=178
+versionCode=179

+ 0 - 374
app_core/common/src/main/java/com/core/utils/CommonInterface.java~HEAD

@@ -1,374 +0,0 @@
-package com.core.utils;
-
-import android.os.Bundle;
-import android.support.annotation.NonNull;
-import android.support.annotation.Nullable;
-import android.util.Log;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONObject;
-import com.common.data.DateFormatUtil;
-import com.common.data.JSONUtil;
-import com.core.api.wxapi.ApiConfig;
-import com.core.api.wxapi.ApiPlatform;
-import com.core.api.wxapi.ApiUtils;
-import com.core.app.MyApplication;
-import com.core.net.http.http.OAHttpHelper;
-import com.core.net.http.http.OnHttpResultListener;
-import com.core.net.http.http.Request;
-
-import java.io.Serializable;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-/**
- * 公用接口封装类
- * Created by Bitliker on 2016/12/30.
- */
-public class CommonInterface implements OnHttpResultListener {
-    private static CommonInterface instance;
-
-    public static final int CODE_WHAT = 0x11;//获取code
-    public static final int ID_WHAT = 0x12;//获取id
-    public static final int OUT_SET_WHAT = 0x13;//获取外勤设置
-    public static final int ADD_OUT_SET_WHAT = 0x14;//外勤设置
-    public static final int LOAD_COMPANY_WHAT = 0x15;//外勤设置
-    public static final int ISMAIN_WHAT = 0x16;//是否管理员
-    public static final int LOAD_CONFIG_WHAT = 0x17;//获取高级设置
-    public static final int WORK_DATA_WHAT = 0x18;//获取班次接口
-    public static final int WORK_LOG_WHAT = 0x19;//获取班次打卡记录接口
-    public static final int END_MISSION = 0x20;//更新外勤状态
-    public static final int ADD_CONTACT = 0x21;//添加了联系人
-
-    public static CommonInterface getInstance() {
-        if (instance == null) {
-            synchronized (CommonInterface.class) {
-                instance = new CommonInterface();
-            }
-        }
-        return instance;
-    }
-
-
-    /**
-     * 获取服务端表的id
-     *
-     * @param sql              表名+"_sql"
-     * @param onResultListener 回调
-     */
-    public void getIdByNet(String sql, OnResultListener onResultListener) {
-        if (ApiUtils.getApiModel() instanceof ApiPlatform) return;
-        Map<String, Object> param = new HashMap<>();
-        param.put("seq", sql);
-        loadNet(ID_WHAT, "common/getId.action", param, new Bundle(), Request.Mode.GET, onResultListener);
-    }
-
-    /**
-     * 获取服务端表的编号
-     *
-     * @param titleName        表名
-     * @param onResultListener 回调
-     */
-    public void getCodeByNet(String titleName, OnResultListener onResultListener) {
-        if (ApiUtils.getApiModel() instanceof ApiPlatform) return;
-        Map<String, Object> param = new HashMap<>();
-        param.put("type", 2);
-        param.put("caller", titleName);
-        loadNet(CODE_WHAT, "common/getCodeString.action", param, new Bundle(), Request.Mode.GET, onResultListener);
-    }
-
-
-    /**
-     * 获取外勤设置,判断是否是
-     *
-     * @param onResultListener 回调
-     */
-    public void getOutSetInfo(OnResultListener onResultListener) {
-        boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
-        String url = isB2b ? ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getOutSet : "mobile/getOutSetInfo.action";
-        loadNet(OUT_SET_WHAT, url, new HashMap<String, Object>(), new Bundle(), Request.Mode.GET, onResultListener);
-    }
-
-
-    /**
-     * 更新外勤设置
-     *
-     * @param distance         范围
-     * @param time             预留时间
-     * @param isAuto           是否开启自动外勤
-     * @param onResultListener
-     */
-    public void addOutSet(int distance, int time, boolean isAuto, boolean needprocess, OnResultListener onResultListener) {
-        boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
-        Map<String, Object> param = new HashMap<>();
-        Map<String, Object> formStore = new HashMap<>();
-        if (isB2b) {
-            formStore.put("enuu", CommonUtil.getSharedPreferences(MyApplication.getInstance().getApplicationContext(), "companyEnUu"));
-            formStore.put("emcode", CommonUtil.getSharedPreferences(MyApplication.getInstance().getApplicationContext(), "b2b_uu"));
-        } else param.put("caller", "OUTSET");
-
-        formStore.put("mo_distance", distance);//距离
-        formStore.put("mo_needprocess", needprocess ? 1 : 0);//距离
-        formStore.put("mo_time", time);//预留时间
-        formStore.put("mo_autosign", isAuto ? 1 : 0);//是否自动外勤
-        param.put("formStore", JSONUtil.map2JSON(formStore));
-        String url = isB2b ? ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().saveOutSet : "mobile/addOutSet.action";
-        loadNet(ADD_OUT_SET_WHAT, url, param, new Bundle(), Request.Mode.POST, onResultListener);
-
-    }
-
-    /*获取企业架构数据*/
-    public void loadCompanyData(OnResultListener onResultListener) {
-        String master = CommonUtil.getMaster();
-        Map<String, Object> param = new HashMap<>();
-        param.put("master", master);
-        param.put("lastdate", "");
-        Bundle bundle = new Bundle();
-        boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
-        bundle.putBoolean("isB2b", isB2b);
-        String url = isB2b ? ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getUsersInfo : "mobile/getAllHrorgEmps.action";
-        loadNet(LOAD_COMPANY_WHAT, url, param, bundle, Request.Mode.GET, onResultListener);
-    }
-
-
-    //判断是否管理员
-    public void judgeManager(OnResultListener onResultListener) {
-        Map<String, Object> param = new HashMap<>();
-        boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
-        String url = isB2b ? ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().getUserInfo : "mobile/ifadmin.action";
-        param.put("emcode", CommonUtil.getEmcode());
-        loadNet(ISMAIN_WHAT, url, param, new Bundle(), Request.Mode.GET, onResultListener);
-    }
-
-    //获取高级设置数据
-    public void loadConfigs(OnResultListener onResultListener) {
-        //获取考勤高级设置时间请求
-        boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
-        Map<String, Object> param = new HashMap<>();
-        if (!isB2b)
-            param.put("code", 1);
-        String url = isB2b ? ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().get_plat_senior_setting_url : "/mobile/getconfigs.action";
-        loadNet(LOAD_CONFIG_WHAT, url, param, new Bundle(), Request.Mode.GET, onResultListener);
-    }
-
-    //获取班次数据
-    private void loadWorkData(long time, OnResultListener onResultListener) {
-        Map<String, Object> param = new HashMap<>();
-        param.put("date", DateFormatUtil.long2Str(time,"yyyyMMdd"));
-        Bundle bundle = new Bundle();
-        bundle.putLong("time", time);
-        boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
-        if (!isB2b)
-            param.put("emcode", CommonUtil.getEmcode());
-        String url = isB2b ? ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().punch_schedule_url : "mobile/getWorkDate.action";
-        loadNet(WORK_DATA_WHAT, url, param, bundle, Request.Mode.GET, onResultListener);
-    }
-
-
-    /**
-     * 更新外勤计划状态
-     *
-     * @param id     外勤id
-     * @param isDone 是否已完成,否则未签退
-     */
-    public void endMission(int id, boolean isDone) {
-        if (id == 0) return;
-        boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
-        Map<String, Object> param = new HashMap<>();
-        param.put("id", id);
-        String url = isB2b ? ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().updateOutplanStatus : "mobile/mobileplanUpdate.action";
-        if (isB2b)
-            param.put("statuscode", isDone ? "done" : "CHECKOUT");//TODO done使用小写
-
-        Request request = new Request.Bulider()
-                .setWhat(END_MISSION)
-                .setUrl(url)
-                .setParam(param)
-                .setMode(Request.Mode.POST)
-                .bulid();
-        OAHttpHelper.getInstance().requestHttp(request, this);
-
-    }
-
-    //获取打卡数据
-    private void loadLog(Bundle bundle) {
-        long time = 0;
-        if (bundle == null) bundle = new Bundle();
-        else time = bundle.getLong("time");
-        if (time == 0)
-            time = System.currentTimeMillis();
-        String date = TimeUtils.s_long_2_str(time);
-        Map<String, Object> param = new HashMap<>();
-        String code = CommonUtil.getEmcode();
-        param.put("currentMaster", CommonUtil.getMaster());
-        boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
-        if (isB2b)
-            param.put("pageNumber", 1);
-        else
-            param.put("page", 1);
-        param.put("pageSize", 100);
-        if (!isB2b)
-            param.put("condition", "cl_emcode='" + code + "' and to_char(cl_time,'yyyy-MM-dd')='" + date + "'");
-        else
-            param.put("date", DateFormatUtil.long2Str(time, "yyyyMMdd"));
-        param.put("caller", "CardLog");
-        param.put("emcode", code);
-        param.put("master", CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_master"));
-        bundle.putLong("time", time);
-        String url = isB2b ? ApiConfig.getInstance(ApiUtils.getApiModel()).getmApiBase().punch_record_url
-                : "mobile/oa/workdata.action";
-        Request request = new Request.Bulider()
-                .setWhat(WORK_LOG_WHAT)
-                .setUrl(url)
-                .setParam(param)
-                .setBundle(bundle)
-                .setMode(Request.Mode.GET)
-                .bulid();
-        OAHttpHelper.getInstance().requestHttp(request, this);
-
-    }
-
-    private void loadNet(int waht, String url, Map<String, Object> param, Bundle bundle, Request.Mode mode, OnResultListener onResultListener) {
-        if (bundle == null) bundle = new Bundle();
-        bundle.putSerializable("onResultListener", onResultListener);
-
-        Request request = new Request.Bulider()
-                .setWhat(waht)
-                .setUrl(url)
-                .setParam(param)
-                .setBundle(bundle)
-                .setMode(mode)
-                .bulid();
-        OAHttpHelper.getInstance().requestHttp(request, this);
-
-    }
-
-    /*添加联系人接口*/
-    public void addContact(List<Map<String, Object>> formStores, OnHttpResultListener listener) {
-        Map<String, Object> param = new HashMap<>();
-        param.put("caller", "contact");
-        param.put("formStore", JSONUtil.map2JSON(formStores));
-        Request request = new Request.Bulider()
-                .setWhat(ADD_CONTACT)
-                .setUrl("mobile/crm/addContactPerson.action")
-                .setParam(param)
-                .setMode(Request.Mode.POST)
-                .bulid();
-        OAHttpHelper.getInstance().requestHttp(request, listener == null ? this : listener);
-    }
-
-    /**
-     * @param sourcecode  来源编号
-     * @param contactName 联系人名字
-     * @param mobile      联系人手机
-     * @param cuname      客户名字
-     * @param cucode      客户编号
-     * @param address     客户地址
-     * @param job         岗位
-     * @return
-     */
-    public Map<String, Object> getFormStoreContact(String sourcecode,
-                                                   String contactName,
-                                                   String mobile,
-                                                   String cuname,
-                                                   String cucode,
-                                                   String address,
-                                                   String job) {
-        Map<String, Object> param = new HashMap<>();
-        param.put("ct_sourcecode", sourcecode);//来源编号
-        param.put("ct_name", contactName);//联系人名字
-        param.put("ct_mobile", mobile);//联系人手机
-        param.put("ct_cuname", cuname);//客户名字
-        param.put("ct_cucode", cucode);//客户编号
-        param.put("ct_address", address);//客户地址
-        param.put("ct_job", job);      //岗位
-
-        return param;
-    }
-
-    @Override
-    public void result(int what, boolean isJSON, String message, Bundle bundle) {
-        OnResultListener listener = (OnResultListener) bundle.getSerializable("onResultListener");
-        String resultMessage = message;
-        try {
-            if (!isJSON) {
-                if (listener != null)
-                    listener.result(false, what, message);
-                return;
-            }
-            JSONObject object = JSON.parseObject(message);
-            boolean success = true;
-            switch (what) {
-                case CODE_WHAT://获取编号
-                    resultMessage = object.getString("code");
-                    break;
-                case ID_WHAT:
-                    success = (object.containsKey("success") && object.getBoolean("success"));
-                    int id = JSONUtil.getInt(object, "id");
-                    if (id != 0)
-                        resultMessage = String.valueOf(id);
-                    else success = false;
-                    break;
-                case OUT_SET_WHAT://获取外勤地址
-                    success = CommonInterfaceHandler.getOutSet(object);
-                    break;
-                case ADD_OUT_SET_WHAT://添加外勤地址
-                    success = true;
-                    break;
-                case LOAD_COMPANY_WHAT://获取企业信息的内容,有与该信息比较特殊,将数据处理逻辑放到外面去
-                    break;
-                case ISMAIN_WHAT://判断是否是管理员
-                    success = CommonInterfaceHandler.saveMainStatus(object);
-                    break;
-                case LOAD_CONFIG_WHAT://获取高级设置
-                    WorkHandlerUtil.handlerWorkSet(object);
-                    break;
-                case WORK_DATA_WHAT://获取班次接口
-                    success = CommonInterfaceHandler.saveWorkData(object, bundle);
-                    if (success)
-                        loadLog(bundle);
-                    break;
-                case WORK_LOG_WHAT://获取班次打卡记录接口
-
-                    break;
-
-            }
-            if (listener != null)
-                listener.result(success, what, resultMessage);
-        } catch (NullPointerException e) {
-            if (e != null) {
-                Log.i("gongpengming", "handleMessage NullPointerException=" + e.getMessage());
-                resultMessage = e.getMessage();
-            }
-            if (listener != null)
-                listener.result(false, what, resultMessage);
-        } catch (Exception e) {
-            if (e != null) {
-                Log.i("gongpengming", "handleMessage Exception=" + e.getMessage());
-                resultMessage = e.getMessage();
-            }
-            if (listener != null)
-                listener.result(false, what, resultMessage);
-        }
-    }
-
-    @Override
-    public void error(int what, String message, Bundle bundle) {
-        OnResultListener listener = (OnResultListener) bundle.getSerializable("onResultListener");
-        if (listener != null)
-            listener.result(false, what, message);
-    }
-
-
-    public interface OnResultListener extends Serializable {
-        /**
-         * 通用接口保存后返回接口
-         *
-         * @param success 成功
-         * @param what    请求的what
-         * @param message 返回的外面需要用到的信息
-         */
-        void result(@NonNull boolean success, @NonNull int what, @Nullable String message);
-    }
-}

+ 0 - 78
app_core/common/src/main/java/com/core/utils/CommonInterfaceHandler.java~HEAD

@@ -1,78 +0,0 @@
-package com.core.utils;
-
-import android.os.Bundle;
-
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.common.data.JSONUtil;
-import com.common.data.ListUtils;
-import com.common.data.StringUtil;
-import com.common.preferences.PreferenceUtils;
-import com.core.api.wxapi.ApiPlatform;
-import com.core.api.wxapi.ApiUtils;
-import com.core.app.AppConfig;
-import com.core.model.WorkModel;
-
-import java.util.ArrayList;
-
-
-/**
- * Created by Bitliker on 2017/3/23.
- */
-
-public class CommonInterfaceHandler {
-
-    public static boolean saveWorkData(JSONObject object, Bundle bundle) throws Exception {
-        boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
-        ArrayList<WorkModel> models = WorkHandlerUtil.handlerWorkData(object, isB2b);
-        bundle.putParcelableArrayList("models", models);
-        WorkHandlerUtil.handerLocation(object, isB2b);
-        String days = JSONUtil.getText(object, "wd_day", "day");
-        String name = JSONUtil.getText(object, "wd_name", "name");
-        bundle.putString("days", days);
-        bundle.putString("name", name);
-        return true;
-    }
-
-
-    /*保存管理员状态*/
-    public static boolean saveMainStatus(JSONObject object) throws Exception {
-        boolean isAdmin = false;
-        boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
-        if (isB2b)
-            object = object.getJSONObject("data");
-        if (object.containsKey("isAdmin")) {
-            if (StringUtil.isEmpty(JSONUtil.getText(object, "isAdmin"))) {
-                isAdmin = JSONUtil.getInt(object, "isAdmin") > 0;
-            } else {
-                String adminStatus = JSONUtil.getText(object, "isAdmin");
-                isAdmin = Integer.valueOf(adminStatus) > 0;
-            }
-            PreferenceUtils.putBoolean(AppConfig.IS_ADMIN, isAdmin);
-        }
-        return isAdmin;
-    }
-
-    /*保存外勤设置*/
-    public static boolean getOutSet(JSONObject o) {
-        boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
-        JSONObject object = null;
-        if (!isB2b) {
-            JSONArray array = o.getJSONArray("result");
-            if (ListUtils.isEmpty(array)) return false;
-            object = array.getJSONObject(0);
-        } else object = o;
-        int distance = JSONUtil.getInt(object, "mo_distance", "MO_DISTANCE");
-        int time = JSONUtil.getInt(object, "mo_time", "MO_TIME");
-        boolean isAuto = JSONUtil.getInt(object, "mo_autosign", "MO_AUTOSIGN") > 0;
-        boolean needprocess = JSONUtil.getInt(object, "MO_NEEDPROCESS", "MO_NEEDPROCESS") > 0;
-        //获取到外勤设置   保存下来
-        PreferenceUtils.putBoolean(AppConfig.AUTO_MISSION, isAuto);
-        PreferenceUtils.putBoolean(AppConfig.NEED_PROCESS, needprocess);
-        PreferenceUtils.putInt(AppConfig.ALARM_MISSION_DISTANCE, distance);
-        PreferenceUtils.putInt(AppConfig.AUTO_MISSION_TIME, time);
-        return true;
-    }
-
-
-}

+ 1 - 2
app_core/common/src/main/java/com/core/utils/WorkHandlerUtil.java

@@ -309,6 +309,7 @@ public class WorkHandlerUtil {
         int earlyoff = getIntByJson(o, "earlyoff");     //早退时间
         int overlatetime = getIntByJson(o, "overlatetime"); //严重迟到时间
         int latetime = getIntByJson(o, "latetime");    //迟到时间
+        OAConfig.needValidateFace = JSONUtil.getBoolean(o, "needValidateFace");    //迟到时间
         if (nonclass != 0)
             OAConfig.nonclass = nonclass;
         if (earlyoff != 0)
@@ -319,8 +320,6 @@ public class WorkHandlerUtil {
             OAConfig.latetime = latetime;
         OAConfig.loadWorkSeted = true;//是否下拉过高级考勤数据
         OAConfig.autosign = getIntByJson(o, "autosign") == 1;     //是否自动考勤
-        //TODO 发布版本先默认为true
-//        AutoMemoryUtil.autosign = true;
     }
 
 

+ 1 - 0
app_core/common/src/main/java/com/core/widget/view/SwitchView.java

@@ -100,6 +100,7 @@ public class SwitchView extends View {
             mOnCheckedlistener.onCheckedChanged(this, check);
         }
         isChecked = check;
+        invalidate();
     }
 
     // interface to get isChecked state

+ 29 - 7
app_core/common/src/main/res/layout/sign_senior_setting.xml

@@ -88,6 +88,33 @@
                 android:layout_height="10px"
                 android:background="@color/black_gray" />
 
+            <RelativeLayout
+                style="@style/IMTbleLine2"
+                android:layout_height="50dp"
+                android:background="@color/white"
+                android:visibility="visible">
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerVertical="true"
+                    android:gravity="center"
+                    android:text="是否启用人脸打卡"
+                    android:textColor="@color/black"
+                    android:textSize="14sp" />
+
+                <com.core.widget.view.SwitchView
+                    android:id="@+id/signin_face_sv"
+                    android:layout_width="40dp"
+                    android:layout_height="25dp"
+                    android:layout_alignParentRight="true"
+                    android:layout_centerVertical="true" />
+            </RelativeLayout>
+
+            <View
+                android:layout_width="match_parent"
+                android:layout_height="10px"
+                android:background="@color/black_gray" />
             <TextView
                 android:layout_width="match_parent"
                 android:layout_height="40dp"
@@ -258,17 +285,12 @@
 
             <Button
                 android:id="@+id/senior_setting_save_bt"
-                android:layout_width="match_parent"
-                android:layout_height="wrap_content"
+                style="@style/commonButtonStyle"
                 android:layout_marginBottom="30dp"
                 android:layout_marginLeft="20dp"
                 android:layout_marginRight="20dp"
                 android:layout_marginTop="100dp"
-                android:background="@drawable/bg_bule_btn"
-                android:padding="10dp"
-                android:text="@string/common_save_button"
-                android:textColor="@color/white"
-                android:textSize="@dimen/text_main" />
+                android:text="@string/common_save_button" />
         </LinearLayout>
     </ScrollView>
 </LinearLayout>

+ 21 - 7
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/SignSeniorSettingActivity.java

@@ -13,6 +13,7 @@ import android.widget.Toast;
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.common.LogUtil;
+import com.common.data.JSONUtil;
 import com.common.data.StringUtil;
 import com.common.preferences.PreferenceUtils;
 import com.core.api.wxapi.ApiConfig;
@@ -24,6 +25,7 @@ import com.core.model.OAConfig;
 import com.core.model.SelectBean;
 import com.core.net.http.ViewUtil;
 import com.core.utils.CommonUtil;
+import com.core.utils.ToastUtil;
 import com.core.utils.WorkHandlerUtil;
 import com.core.widget.view.Activity.SelectActivity;
 import com.core.widget.view.SwitchView;
@@ -93,6 +95,7 @@ public class SignSeniorSettingActivity extends BaseActivity implements View.OnCl
                             OAConfig.overlatetime = seniouslatetime;
                             OAConfig.earlyoff = leaveearlytime;
                             OAConfig.nonclass = absenteeismtime;
+                            OAConfig.needValidateFace = signin_face_sv.isChecked();
                             try {
                                 save_return_id = JSON.parseObject(sava_time_result).getIntValue("id");
                             } catch (Exception e) {
@@ -207,6 +210,7 @@ public class SignSeniorSettingActivity extends BaseActivity implements View.OnCl
     private int leaveearlytime;
     private int absenteeismtime;
     private Boolean platform;
+    private SwitchView signin_face_sv;
 
 
     @Override
@@ -222,6 +226,7 @@ public class SignSeniorSettingActivity extends BaseActivity implements View.OnCl
     private void initView() {
 
         auto_sign_sw = (SwitchView) findViewById(R.id.senior_setting_auto_sign_sw);
+        signin_face_sv = (SwitchView) findViewById(R.id.signin_face_sv);
         signin_alert_sv = (SwitchView) findViewById(R.id.signin_alert_sv);
         late_time_tv = (TextView) findViewById(R.id.senior_setting_late_time_tv);
         serious_late_time_tv = (TextView) findViewById(R.id.senior_setting_serious_late_time_tv);
@@ -233,6 +238,7 @@ public class SignSeniorSettingActivity extends BaseActivity implements View.OnCl
         isAuto = true; //初次进来设置状态
         auto_sign_sw.setChecked(isAuto);
         auto_sign_sw.setOnCheckedChangeListener(this);
+        signin_face_sv.setOnCheckedChangeListener(this);
         auto_sign_sw.setOnClickListener(this);
 
         boolean isAlert = PreferenceUtils.getBoolean(PreferenceUtils.AUTO_SIGN_SW, true);
@@ -282,12 +288,17 @@ public class SignSeniorSettingActivity extends BaseActivity implements View.OnCl
     //每次进入高级设置界面时请求url后返回要显示的设置时间
     private void doShowGetConfigsTime(String getconfigs_time_result) {
         try {
-            save_return_id = JSON.parseObject(getconfigs_time_result).getIntValue("id");
-            first_latetime = JSON.parseObject(getconfigs_time_result).getString("latetime");
-            first_overlatetime = JSON.parseObject(getconfigs_time_result).getString("overlatetime");
-            first_earlyoff = JSON.parseObject(getconfigs_time_result).getString("earlyoff");
-            first_nonclass = JSON.parseObject(getconfigs_time_result).getString("nonclass");
-            first_autosign = JSON.parseObject(getconfigs_time_result).getString("autosign");
+            JSONObject object = JSON.parseObject(getconfigs_time_result);
+            save_return_id = object.getIntValue("id");
+            first_latetime = object.getString("latetime");
+            first_overlatetime = object.getString("overlatetime");
+            first_earlyoff = object.getString("earlyoff");
+            first_nonclass = object.getString("nonclass");
+            first_autosign = object.getString("autosign");
+            boolean needValidateFace = JSONUtil.getBoolean(object, "needValidateFace");
+            signin_face_sv.setOnCheckedChangeListener(null);
+            signin_face_sv.setChecked(needValidateFace);
+            signin_face_sv.setOnCheckedChangeListener(this);
             JSONObject o = JSON.parseObject(getconfigs_time_result);
             WorkHandlerUtil.handlerWorkSet(o);
             auto_sign = CommonUtil.getNumByString(first_autosign);
@@ -438,7 +449,6 @@ public class SignSeniorSettingActivity extends BaseActivity implements View.OnCl
         seniouslatetime = CommonUtil.getNumByString(serious_late_time_tv.getText().toString());
         leaveearlytime = CommonUtil.getNumByString(leave_early_tv.getText().toString());
         absenteeismtime = CommonUtil.getNumByString(absenteeism_time_tv.getText().toString());
-
         if (seniouslatetime > latetime && absenteeismtime > leaveearlytime && absenteeismtime > seniouslatetime) {
             doSaveSeniorSetting(latetime, seniouslatetime, leaveearlytime, absenteeismtime);
         } else {
@@ -464,6 +474,7 @@ public class SignSeniorSettingActivity extends BaseActivity implements View.OnCl
             formStoreMap.put("MA_SERIOUSLATETIME", t2);
             formStoreMap.put("MA_EARLYTIME", t3);
             formStoreMap.put("MA_ABSENTTIME", t4);
+            formStoreMap.put("MA_NEEDVALIDATEFACE", signin_face_sv.isChecked() ? 1 : 0);
             String url = CommonUtil.getSharedPreferences(ct, "erp_baseurl") + "/mobile/saveconfigs.action";
             HashMap<String, Object> params = new HashMap<>();
             String formStore = JSON.toJSONString(formStoreMap);
@@ -498,6 +509,9 @@ public class SignSeniorSettingActivity extends BaseActivity implements View.OnCl
     public void onCheckedChanged(View view, final boolean isChecked) {
         if (view.getId() == R.id.signin_alert_sv) {
             PreferenceUtils.putBoolean(PreferenceUtils.AUTO_SIGN_SW, isChecked);
+        } else if (R.id.signin_face_sv == view.getId()) {
+            //TODO
+            ToastUtil.showToast(ct, "请点击下方保存按钮以保存数据");
         }
     }