Преглед изворни кода

Merge branch 'developer' of ssh://10.10.100.21/source/uu-android into feature

# Conflicts:
#	WeiChat/version.properties
Arison пре 6 година
родитељ
комит
b62996c8ca
42 измењених фајлова са 754 додато и 154 уклоњено
  1. 1 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/MainActivity.java
  2. 3 1
      WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/WebViewCommActivity.java
  3. BIN
      WeiChat/src/main/res/drawable-hdpi/uuu.png
  4. BIN
      WeiChat/src/main/res/drawable-mdpi/uuu.png
  5. BIN
      WeiChat/src/main/res/drawable-xhdpi/uuu.png
  6. BIN
      WeiChat/src/main/res/drawable-xxhdpi/uuu.png
  7. 5 5
      WeiChat/version.properties
  8. 11 2
      app_core/common/src/main/java/com/core/model/Approval.java
  9. BIN
      app_core/common/src/main/res/drawable-hdpi/ic_scan_gray.png
  10. BIN
      app_core/common/src/main/res/drawable-hdpi/uuu.png
  11. BIN
      app_core/common/src/main/res/drawable-mdpi/uuu.png
  12. BIN
      app_core/common/src/main/res/drawable-xhdpi/ic_scan_gray.png
  13. BIN
      app_core/common/src/main/res/drawable-xhdpi/uuu.png
  14. BIN
      app_core/common/src/main/res/drawable-xxhdpi/ic_scan_gray.png
  15. BIN
      app_core/common/src/main/res/drawable-xxhdpi/uuu.png
  16. 11 4
      app_core/common/src/main/res/layout/action_data_inquiry_list.xml
  17. 17 18
      app_core/common/src/main/res/layout/activity_data_inquiry_list.xml
  18. 217 0
      app_core/common/src/main/res/layout/activity_device_query_list.xml
  19. 1 1
      app_core/common/src/main/res/layout/activity_setting.xml
  20. 18 14
      app_modular/applogin/src/main/java/com/modular/login/activity/LoginActivity.java
  21. 1 1
      app_modular/appmessages/src/main/java/com/modular/appmessages/activity/ApprovalActivity.java
  22. 9 8
      app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/ApprovaPresenter.java
  23. 90 2
      app_modular/apputils/src/main/java/com/modular/apputils/activity/BillInputActivity.java
  24. 70 39
      app_modular/apputils/src/main/java/com/modular/apputils/adapter/BillAdapter.java
  25. 5 1
      app_modular/apputils/src/main/java/com/modular/apputils/adapter/BillDetailsAdapter.java
  26. 3 3
      app_modular/apputils/src/main/java/com/modular/apputils/model/BillGroupModel.java
  27. 30 1
      app_modular/apputils/src/main/java/com/modular/apputils/presenter/BillPresenter.java
  28. 5 2
      app_modular/apputils/src/main/java/com/modular/apputils/presenter/imp/IBill.java
  29. 14 7
      app_modular/apputils/src/main/res/layout/activity_bill_input.xml
  30. 1 1
      app_modular/apputils/src/main/res/layout/common_refresh_recycler.xml
  31. 5 3
      app_modular/apputils/src/main/res/layout/item_bill_tab.xml
  32. 2 3
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceManageActivity.java
  33. 2 0
      app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/MissionSetActivity.java
  34. 37 3
      app_modular/appworks/src/main/java/com/uas/appworks/activity/DeviceQueryActivity.java
  35. 5 0
      app_modular/appworks/src/main/java/com/uas/appworks/crm3_0/activity/BillInputBindActivity.java
  36. 5 5
      app_modular/appworks/src/main/java/com/uas/appworks/crm3_0/activity/CustomerManageActivity.java
  37. 27 11
      app_modular/appworks/src/main/java/com/uas/appworks/datainquiry/adapter/DataInquiryFlexAdapter.java
  38. 7 8
      app_modular/appworks/src/main/res/layout/item_list_data_inquiry.xml
  39. 42 0
      app_modular/appworks/src/main/res/layout/item_list_device_query.xml
  40. 31 1
      app_modular/facesdk/src/main/java/com/baidu/aip/excep/activity/FaceManageActivity.java
  41. 78 8
      app_modular/facesdk/src/main/java/com/baidu/aip/excep/activity/RealTimeDetectFaceActivty.java
  42. 1 1
      gradle/wrapper/gradle-wrapper.properties

+ 1 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/MainActivity.java

@@ -713,7 +713,7 @@ public class MainActivity extends BaseActivity implements ImStatusListener, NetW
             PreferenceUtils.putInt(MainActivity.UU_STEP, 1);
             PushManager.resumeWork(MyApplication.getInstance());
         }
-        doSendSignAutoLog(); // 获取数据库中监控日志上传至服务器操作
+//        doSendSignAutoLog(); // 获取数据库中监控日志上传至服务器操作
         //桌面红点显示逻辑
         if (OAConfig.canShowRed) {
             if (handler == null) {

+ 3 - 1
WeiChat/src/main/java/com/xzjmyk/pm/activity/ui/erp/activity/WebViewCommActivity.java

@@ -135,6 +135,7 @@ public class WebViewCommActivity extends BaseActivity implements View.OnClickLis
         Map<String, String> headers = new HashMap<>();
         headers.put("clientType", "uas client");
         headers.put("Cookie", com.core.utils.CommonUtil.getErpCookie(ct));
+        headers.put("master", com.core.utils.CommonUtil.getMaster());
         headers.put("sessionUser", com.core.utils.CommonUtil.getEmcode());
         headers.put("sessionId", com.core.utils.CommonUtil.getSharedPreferences(ct, "sessionId"));
         return headers;
@@ -237,7 +238,7 @@ public class WebViewCommActivity extends BaseActivity implements View.OnClickLis
         if (isCookie) {
             synCookies(this, url);
         }
-
+        Log.d("webUrl", url);
         webView.loadUrl(url, getWebHeader());
         webView.setWebChromeClient(new ChromeClient());
         webView.setWebViewClient(new WebViewClient() {
@@ -263,6 +264,7 @@ public class WebViewCommActivity extends BaseActivity implements View.OnClickLis
 
             @Override
             public boolean shouldOverrideUrlLoading(WebView view, String url) {
+                Log.d("webUrl", url);
                 if (!TextUtils.isEmpty(url)) {
                     if (url.contains("https://account.ubtob.com/sso/login") ||
 //                            url.equals("https://sso.ubtob.com/") ||

BIN
WeiChat/src/main/res/drawable-hdpi/uuu.png


BIN
WeiChat/src/main/res/drawable-mdpi/uuu.png


BIN
WeiChat/src/main/res/drawable-xhdpi/uuu.png


BIN
WeiChat/src/main/res/drawable-xxhdpi/uuu.png


+ 5 - 5
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Mon May 27 17:26:29 CST 2019
-debugName=994
-versionName=680
-debugCode=994
-versionCode=235
+#Mon Jun 17 18:31:03 CST 2019
+debugName=972
+versionName=686
+debugCode=972
+versionCode=241

+ 11 - 2
app_core/common/src/main/java/com/core/model/Approval.java

@@ -49,6 +49,7 @@ public class Approval {
     private String values = "";//字幕对应的值显示
     private String oldValues = "";//变更前的值
     private String valuesKey = "";//字幕对应的值显示的key值
+    private String renderer = "";
     private List<Data> datas = new ArrayList<>();
 
     public Approval(@Duration int type) {
@@ -151,7 +152,7 @@ public class Approval {
             }
             if (!StringUtil.isEmail(v2)) {
                 int floatcolumn = floatcolumn();//保留小数后几位
-                LogUtil.i("gong",values+"="+floatcolumn);
+                LogUtil.i("gong", values + "=" + floatcolumn);
                 if (floatcolumn == 0) {
                     if (v2.length() - 1 > 2) {
                         builder.append(v2.substring(0, 2));
@@ -161,7 +162,7 @@ public class Approval {
                 } else {
                     //计算小数点后几位
                     if (v2.length() > floatcolumn) {
-                        builder.append(v2.substring(0,Math.min( floatcolumn+1,v2.length())));
+                        builder.append(v2.substring(0, Math.min(floatcolumn + 1, v2.length())));
                     } else {
                         builder.append(v2);
                     }
@@ -185,6 +186,14 @@ public class Approval {
         this.valuesKey = valuesKey;
     }
 
+    public String getRenderer() {
+        return renderer;
+    }
+
+    public void setRenderer(String renderer) {
+        this.renderer = renderer;
+    }
+
     public List<Data> getDatas() {
         return datas;
     }

BIN
app_core/common/src/main/res/drawable-hdpi/ic_scan_gray.png


BIN
app_core/common/src/main/res/drawable-hdpi/uuu.png


BIN
app_core/common/src/main/res/drawable-mdpi/uuu.png


BIN
app_core/common/src/main/res/drawable-xhdpi/ic_scan_gray.png


BIN
app_core/common/src/main/res/drawable-xhdpi/uuu.png


BIN
app_core/common/src/main/res/drawable-xxhdpi/ic_scan_gray.png


BIN
app_core/common/src/main/res/drawable-xxhdpi/uuu.png


+ 11 - 4
app_core/common/src/main/res/layout/action_data_inquiry_list.xml

@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:id="@+id/top"
-    xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="?attr/actionBarSize"
     android:focusable="true"
@@ -37,22 +36,30 @@
             android:layout_height="fill_parent"
             android:layout_centerVertical="true"
             android:background="@drawable/search_input"
-            android:drawableLeft="@drawable/search"
             android:drawableRight="@drawable/search_clear"
             android:hint="@string/search"
             android:imeOptions="actionSearch"
             android:inputType="text"
+            android:paddingLeft="34dp"
             android:paddingRight="26dp"
             android:textColor="@color/dark_grey"
             android:textColorHint="@color/grey"
             android:textSize="14sp" />
 
+        <ImageView
+            android:id="@+id/data_inquiry_filter_scan_iv"
+            android:layout_width="24dp"
+            android:layout_height="24dp"
+            android:layout_centerVertical="true"
+            android:layout_marginLeft="6dp"
+            android:src="@drawable/ic_scan_gray" />
+
         <ImageView
             android:id="@+id/data_inquiry_voice_iv"
             android:layout_width="10dp"
             android:layout_height="16dp"
-            android:layout_alignParentRight="true"
             android:layout_alignRight="@+id/search_edit"
+            android:layout_alignParentRight="true"
             android:layout_centerVertical="true"
             android:layout_marginRight="6dp"
             android:background="@drawable/btn_yuyin_nor"

+ 17 - 18
app_core/common/src/main/res/layout/activity_data_inquiry_list.xml

@@ -1,18 +1,18 @@
 <?xml version="1.0" encoding="utf-8"?>
 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
-                xmlns:app="http://schemas.android.com/apk/res-auto"
-                android:layout_width="match_parent"
-                android:layout_height="match_parent"
-                android:focusable="true"
-                android:focusableInTouchMode="true"
-                android:orientation="vertical">
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:focusable="true"
+    android:background="#f6f6f6"
+    android:focusableInTouchMode="true"
+    android:orientation="vertical">
 
     <RelativeLayout
         android:layout_width="match_parent"
         android:layout_height="match_parent"
         android:orientation="vertical">
 
-
         <com.handmark.pulltorefresh.library.PullToRefreshListView
             android:id="@+id/data_inquiry_list_ptlv"
             android:layout_width="match_parent"
@@ -54,8 +54,7 @@
             android:id="@+id/data_inquiry_list_total_hide_rl"
             android:layout_width="match_parent"
             android:layout_height="26dp"
-            android:background="@color/background"
-            >
+            android:background="@color/background">
 
             <ImageView
                 android:id="@+id/data_inquiry_list_total_hide_iv"
@@ -80,10 +79,10 @@
             android:id="@+id/data_inquiry_list_total_lv"
             android:layout_width="match_parent"
             android:layout_height="120dp"
-            android:layout_marginBottom="10dp"
             android:layout_marginTop="10dp"
-            android:scrollbars="none"
-            android:overScrollMode="never" />
+            android:layout_marginBottom="10dp"
+            android:overScrollMode="never"
+            android:scrollbars="none" />
     </LinearLayout>
 
     <View
@@ -114,10 +113,10 @@
                 android:background="#eeeeee"
                 android:clickable="true"
                 android:orientation="horizontal"
-                android:paddingBottom="8dp"
                 android:paddingLeft="16dp"
+                android:paddingTop="8dp"
                 android:paddingRight="16dp"
-                android:paddingTop="8dp">
+                android:paddingBottom="8dp">
 
                 <TextView
                     android:layout_width="0dp"
@@ -140,8 +139,8 @@
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"
                 android:background="@color/me_menu_item_normal"
-                android:scrollbars="none"
-                android:overScrollMode="never"/>
+                android:overScrollMode="never"
+                android:scrollbars="none" />
 
         </LinearLayout>
 
@@ -166,8 +165,8 @@
                 android:layout_width="match_parent"
                 android:layout_height="0dp"
                 android:layout_weight="1"
-                android:scrollbars="none"
-                android:overScrollMode="never"/>
+                android:overScrollMode="never"
+                android:scrollbars="none" />
 
             <LinearLayout
                 android:layout_width="match_parent"

+ 217 - 0
app_core/common/src/main/res/layout/activity_device_query_list.xml

@@ -0,0 +1,217 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#f6f6f6"
+    android:focusable="true"
+    android:focusableInTouchMode="true"
+    android:orientation="vertical">
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical">
+
+        <com.handmark.pulltorefresh.library.PullToRefreshListView
+            android:id="@+id/data_inquiry_list_ptlv"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:hardwareAccelerated="true"
+            android:layerType="software"
+            android:scrollbars="none"
+            android:scrollingCache="false"
+            android:visibility="visible" />
+
+        <ImageView
+            android:id="@+id/data_inquiry_list_total_spread_iv"
+            android:layout_width="match_parent"
+            android:layout_height="26dp"
+            android:layout_alignParentBottom="true"
+            android:background="#20000000"
+            android:scaleType="centerInside"
+            android:src="@drawable/ic_expansion_spread"
+            android:visibility="invisible" />
+    </RelativeLayout>
+
+    <LinearLayout
+        android:id="@+id/data_inquiry_list_total_ll"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:background="@color/white"
+        android:orientation="vertical"
+        android:visibility="gone">
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="0.5dp"
+            android:background="@color/gray_light" />
+
+        <RelativeLayout
+            android:id="@+id/data_inquiry_list_total_hide_rl"
+            android:layout_width="match_parent"
+            android:layout_height="26dp"
+            android:background="@color/background">
+
+            <ImageView
+                android:id="@+id/data_inquiry_list_total_hide_iv"
+                android:layout_width="wrap_content"
+                android:layout_height="26dp"
+                android:layout_centerInParent="true"
+                android:scaleType="centerInside"
+                android:src="@drawable/ic_expansion_retract" />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="match_parent"
+                android:layout_marginRight="10dp"
+                android:layout_toLeftOf="@id/data_inquiry_list_total_hide_iv"
+                android:gravity="center_vertical"
+                android:text="合计"
+                android:textSize="14sp" />
+
+        </RelativeLayout>
+
+        <ListView
+            android:id="@+id/data_inquiry_list_total_lv"
+            android:layout_width="match_parent"
+            android:layout_height="120dp"
+            android:layout_marginTop="10dp"
+            android:layout_marginBottom="10dp"
+            android:overScrollMode="never"
+            android:scrollbars="none" />
+    </LinearLayout>
+
+    <View
+        android:id="@+id/data_inquiry_list_gray_bg"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:background="#20000000"
+        android:clickable="true"
+        android:visibility="gone" />
+
+    <LinearLayout
+        android:id="@+id/data_inquiry_list_fuzzy_ll"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:visibility="gone">
+
+        <LinearLayout
+            android:id="@+id/data_inquiry_list_history_ll"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:background="@color/white"
+            android:orientation="vertical">
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="#eeeeee"
+                android:clickable="true"
+                android:orientation="horizontal"
+                android:paddingLeft="16dp"
+                android:paddingTop="8dp"
+                android:paddingRight="16dp"
+                android:paddingBottom="8dp">
+
+                <TextView
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:text="@string/str_search_history"
+                    android:textSize="16sp" />
+
+                <TextView
+                    android:id="@+id/data_inquiry_history_clear_tv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text="@string/str_clear"
+                    android:textColor="@color/LightBlue"
+                    android:textSize="16sp" />
+            </LinearLayout>
+
+            <com.core.widget.MyListView
+                android:id="@+id/data_inquiry_list_history_data_lv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@color/me_menu_item_normal"
+                android:overScrollMode="never"
+                android:scrollbars="none" />
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/data_inquiry_list_exact_ll"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:visibility="gone">
+
+        <LinearLayout
+            android:id="@+id/data_inquiry_list_option_ll"
+            android:layout_width="match_parent"
+            android:layout_height="260dp"
+            android:background="@color/white"
+            android:orientation="vertical">
+
+            <ListView
+                android:id="@+id/data_inquiry_list_option_lv"
+                android:layout_width="match_parent"
+                android:layout_height="0dp"
+                android:layout_weight="1"
+                android:overScrollMode="never"
+                android:scrollbars="none" />
+
+            <LinearLayout
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:background="@color/background"
+                android:clickable="true"
+                android:orientation="horizontal"
+                android:padding="10dp">
+
+                <TextView
+                    android:id="@+id/data_inquiry_list_option_cancel_tv"
+                    android:layout_width="0dp"
+                    android:layout_height="35dp"
+                    android:layout_marginLeft="30dp"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_cancel_bg"
+                    android:gravity="center"
+                    android:text="@string/cancel"
+                    android:textColor="@color/selector_cancel_text_color"
+                    android:textSize="14sp" />
+
+                <TextView
+                    android:id="@+id/data_inquiry_list_option_reset_tv"
+                    android:layout_width="0dp"
+                    android:layout_height="35dp"
+                    android:layout_marginLeft="20dp"
+                    android:layout_marginRight="20dp"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_confirm_bg"
+                    android:gravity="center"
+                    android:text="@string/reset"
+                    android:textColor="@color/white"
+                    android:textSize="14sp" />
+
+                <TextView
+                    android:id="@+id/data_inquiry_list_option_confirm_tv"
+                    android:layout_width="0dp"
+                    android:layout_height="35dp"
+                    android:layout_marginRight="30dp"
+                    android:layout_weight="1"
+                    android:background="@drawable/selector_confirm_bg"
+                    android:gravity="center"
+                    android:text="@string/app_dialog_ok"
+                    android:textColor="@color/white"
+                    android:textSize="14sp" />
+            </LinearLayout>
+        </LinearLayout>
+    </LinearLayout>
+
+</RelativeLayout>

+ 1 - 1
app_core/common/src/main/res/layout/activity_setting.xml

@@ -266,8 +266,8 @@
                     android:id="@+id/tv_sign_new"
                     android:layout_width="10dp"
                     android:layout_height="10dp"
-                    android:layout_alignParentRight="true"
                     android:layout_alignTop="@+id/tv_oa"
+                    android:layout_alignParentRight="true"
                     android:layout_centerVertical="true"
                     android:layout_marginRight="10dp"
                     android:background="@drawable/hongdian"

+ 18 - 14
app_modular/applogin/src/main/java/com/modular/login/activity/LoginActivity.java

@@ -60,6 +60,7 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
         getSupportActionBar().hide();
         StatusBarUtil.immersive(this, 0x00000000, 0.0f);
         initView();
+        initPhonePass();
     }
 
     @Override
@@ -74,22 +75,8 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
     protected void onResume() {
         super.onResume();
 
-        requestPermission(Manifest.permission.READ_PHONE_STATE, null, null);
-        if (!UasLocationHelper.getInstance().isLocationUpdate()) {
-            UasLocationHelper.getInstance().requestLocation();
-        }
-        if (ViewUtil.mdProcessDialog != null) {
-            ViewUtil.mdProcessDialog.cancel();
-        }
-        if (CommonUtil.getSharedPreferences(this, "user_phone") != null && CommonUtil.getSharedPreferences(this, "user_phone").length() > 0) {
-            mPhoneNumberEdit.setText(CommonUtil.getSharedPreferences(this, "user_phone"));
-        }
-        if (PreferenceUtils.getString(this, PASS_WORDS) != null && PreferenceUtils.getString(this, PASS_WORDS).length() > 0) {
-            mPasswordEdit.setText(PreferenceUtils.getString(this, PASS_WORDS));
-        }
     }
 
-
     private void initView() {
         mToastHead = findViewById(R.id.login_toast_head);
         mToastLayout = findViewById(R.id.login_toast_fl);
@@ -122,6 +109,23 @@ public class LoginActivity extends BaseActivity implements View.OnClickListener
         mPasswordEdit.addTextChangedListener(new MyTextWatcher());
     }
 
+    private void initPhonePass() {
+        requestPermission(Manifest.permission.READ_PHONE_STATE, null, null);
+        if (!UasLocationHelper.getInstance().isLocationUpdate()) {
+            UasLocationHelper.getInstance().requestLocation();
+        }
+        if (ViewUtil.mdProcessDialog != null) {
+            ViewUtil.mdProcessDialog.cancel();
+        }
+        if (CommonUtil.getSharedPreferences(this, "user_phone") != null && CommonUtil.getSharedPreferences(this, "user_phone").length() > 0) {
+            mPhoneNumberEdit.setText(CommonUtil.getSharedPreferences(this, "user_phone"));
+        }
+        if (PreferenceUtils.getString(this, PASS_WORDS) != null && PreferenceUtils.getString(this, PASS_WORDS).length() > 0) {
+            mPasswordEdit.setText(PreferenceUtils.getString(this, PASS_WORDS));
+        }
+    }
+
+
     class MyTextWatcher implements TextWatcher {
 
         @Override

+ 1 - 1
app_modular/appmessages/src/main/java/com/modular/appmessages/activity/ApprovalActivity.java

@@ -234,7 +234,7 @@ public class ApprovalActivity extends BaseActivity implements IApproval, Approva
             }
         }
         mPresenter = new ApprovaPresenter(this, getIntent());
-        final LinearLayout mRootLL = findViewById(R.id.mRootLL);
+        final View mRootLL = findViewById(R.id.mRootLL);
         if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
             mRootLL.post(new Runnable() {
                 @Override

+ 9 - 8
app_modular/appmessages/src/main/java/com/modular/appmessages/presenter/ApprovaPresenter.java

@@ -871,6 +871,7 @@ public class ApprovaPresenter implements OnHttpResultListener {
             if (!isMain) {
                 String findTionName = JSONUtil.getText(config, "DG_FINDFUNCTIONNAME");
                 String renderer = JSONUtil.getText(config, "DG_RENDERER");
+                approval.setRenderer(renderer);
                 if (!StringUtil.isEmpty(findTionName) && findTionName.contains("|")) {
                     int hhitem = findTionName.indexOf('|');
                     String gCaller = findTionName.substring(0, hhitem);
@@ -885,12 +886,11 @@ public class ApprovaPresenter implements OnHttpResultListener {
                         if (renderer.contains("字段需要设置为app显示")) {
                             newValues = renderer;
                         } else {
-                            newValues=renderer;
-                            //先不格式化
-//                            double val = MathUtil.eval(renderer);
-//                            if (val != Double.NEGATIVE_INFINITY && val != Double.POSITIVE_INFINITY) {
-//                                newValues = getDecimalFormat(val);
-//                            }
+                            newValues = renderer;
+                            double val = MathUtil.eval(renderer);
+                            if (val != Double.NEGATIVE_INFINITY && val != Double.POSITIVE_INFINITY) {
+                                newValues = getDecimalFormat(val);
+                            }
                         }
 
                     } catch (Exception e) {
@@ -915,7 +915,9 @@ public class ApprovaPresenter implements OnHttpResultListener {
                 setData2ListThread();
                 continue;
             }
-            if (approval.isDftypeEQ("FF") || (record.title.contains("公章用印申请流程") && "附件".equals(caption))) {
+            if (approval.isDftypeEQ("FF")
+                    || ("detailAttach".equals(approval.getRenderer()))
+                    || (record.title.contains("公章用印申请流程") && "附件".equals(caption))) {
                 if (isMain) {
                     final String fb_attach = newValues;
                     OAHttpHelper.getInstance().post(new Runnable() {
@@ -1034,7 +1036,6 @@ public class ApprovaPresenter implements OnHttpResultListener {
                     return str + "字段需要设置为app显示";
                 } else {
                     renderer = renderer.replaceAll(str, val);
-
                 }
             }
         }

+ 90 - 2
app_modular/apputils/src/main/java/com/modular/apputils/activity/BillInputActivity.java

@@ -7,14 +7,18 @@ import android.net.Uri;
 import android.os.Build;
 import android.os.Bundle;
 import android.os.Handler;
+import android.support.design.widget.TabLayout;
 import android.support.v7.widget.DividerItemDecoration;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.text.TextUtils;
+import android.util.Log;
 import android.view.Menu;
 import android.view.MenuItem;
 import android.view.View;
+import android.widget.FrameLayout;
 import android.widget.LinearLayout;
+import android.widget.TableLayout;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -42,6 +46,7 @@ import com.modular.apputils.model.BillGroupModel;
 import com.modular.apputils.model.BillListConfig;
 import com.modular.apputils.presenter.BillPresenter;
 import com.modular.apputils.presenter.imp.IBill;
+import com.modular.apputils.widget.WrapContentLinearLayoutManager;
 
 import java.io.File;
 import java.io.Serializable;
@@ -66,7 +71,10 @@ public class BillInputActivity extends OABaseActivity implements IBill, BillAdap
     public RecyclerView mRecyclerView;
     public BillPresenter mBillPresenter;
     public BillAdapter mBillAdapter;
+    public FrameLayout mTopLayout;
+    public TabLayout mTabLayout;
     private String mListCondition;
+    private RecyclerView.AdapterDataObserver mAdapterDataObserver;
     public int selectPosition = -1;//当前选择调转界面的index,本来不想添加全局变量的,没有办法
     private HashMap<String, String> dbFindCondition;
 
@@ -174,8 +182,10 @@ public class BillInputActivity extends OABaseActivity implements IBill, BillAdap
 
 
     private void initView() {
+        mTopLayout = findViewById(R.id.bill_input_top_fl);
         mRecyclerView = findViewById(R.id.mRecyclerView);
-        mRecyclerView.setLayoutManager(new LinearLayoutManager(ct));
+        mRecyclerView.setLayoutManager(new WrapContentLinearLayoutManager(ct,
+                LinearLayoutManager.VERTICAL, false));
         mRecyclerView.addItemDecoration(new DividerItemDecoration(ct, LinearLayout.VERTICAL));
         if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT) {
             final View mRootLL = findViewById(R.id.mRootLL);
@@ -187,6 +197,26 @@ public class BillInputActivity extends OABaseActivity implements IBill, BillAdap
                 }
             });
         }
+        mRecyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
+            @Override
+            public void onScrolled(RecyclerView recyclerView, int dx, int dy) {
+                super.onScrolled(recyclerView, dx, dy);
+                //控制顶部TabLayout是否显示
+                if (mBillAdapter != null && mBillAdapter.mTabIndex != -1) {
+                    RecyclerView.LayoutManager layoutManager = mRecyclerView.getLayoutManager();
+                    if (layoutManager instanceof WrapContentLinearLayoutManager && mTopLayout != null) {
+                        WrapContentLinearLayoutManager linearLayoutManager = (WrapContentLinearLayoutManager) layoutManager;
+                        int firstVisibleItemPosition = linearLayoutManager.findFirstVisibleItemPosition();
+                        if (firstVisibleItemPosition >= mBillAdapter.mTabIndex) {
+                            mTopLayout.setVisibility(View.VISIBLE);
+                            mTopLayout.requestLayout();
+                        } else {
+                            mTopLayout.setVisibility(View.GONE);
+                        }
+                    }
+                }
+            }
+        });
     }
 
     @Override
@@ -194,6 +224,16 @@ public class BillInputActivity extends OABaseActivity implements IBill, BillAdap
         if (mBillAdapter == null) {
             mBillAdapter = newBillAdapter(groupModels);
             mRecyclerView.setAdapter(mBillAdapter);
+            mAdapterDataObserver = new RecyclerView.AdapterDataObserver() {
+                @Override
+                public void onChanged() {
+                    if (mBillAdapter.mTabIndex != -1 && mBillAdapter.mTabPosition != -1
+                            && mTabLayout != null && mTabLayout.getSelectedTabPosition() != mBillAdapter.mTabPosition) {
+                        mTabLayout.getTabAt(mBillAdapter.mTabPosition).select();
+                    }
+                }
+            };
+            mBillAdapter.registerAdapterDataObserver(mAdapterDataObserver);
         } else {
             mBillAdapter.setBillGroupModels(groupModels);
             mBillAdapter.notifyDataSetChanged();
@@ -207,6 +247,47 @@ public class BillInputActivity extends OABaseActivity implements IBill, BillAdap
         mBillPresenter.saveAndSubmit(mBillAdapter.getBillGroupModels());
     }
 
+    @Override
+    public void addTopLayout(View... view) {
+        if (view != null && view.length > 0) {
+            mTopLayout.addView(view[0]);
+
+            if (view.length > 1 && view[1] instanceof TabLayout) {
+                mTabLayout = (TabLayout) view[1];
+                if (mTabLayout != null) {
+                    mTabLayout.addOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {
+                        @Override
+                        public void onTabSelected(TabLayout.Tab tab) {
+                            int tabPosition = tab.getPosition();
+                            if (mBillAdapter != null && mBillAdapter.mTabIndex != -1
+                                    && tabPosition != mBillAdapter.mTabPosition) {
+                                mBillAdapter.switchTabIndex(tabPosition);
+                                mRecyclerView.scrollToPosition(mBillAdapter.mTabIndex);
+//                                WrapContentLinearLayoutManager mLayoutManager =
+//                                        (WrapContentLinearLayoutManager) mRecyclerView.getLayoutManager();
+//                                mLayoutManager.scrollToPositionWithOffset(mBillAdapter.mTabIndex, 0);
+                            }
+                        }
+
+                        @Override
+                        public void onTabUnselected(TabLayout.Tab tab) {
+
+                        }
+
+                        @Override
+                        public void onTabReselected(TabLayout.Tab tab) {
+
+                        }
+                    });
+                }
+            }
+        } else {
+            mTopLayout.setVisibility(View.GONE);
+            mTopLayout.removeAllViews();
+            mTopLayout.invalidate();
+        }
+    }
+
     @Override
     public void toSelect(int position, BillGroupModel.BillModel model) {
         if (TextUtils.isEmpty(model.getType())) return;
@@ -577,6 +658,9 @@ public class BillInputActivity extends OABaseActivity implements IBill, BillAdap
     }
 
     protected void handlerSelectDbFind(JSONObject object, int groupId, boolean isForm) {
+        if (object == null) {
+            return;
+        }
         if (isForm) {
             List<BillGroupModel.BillModel> formBillModels = mBillAdapter.getFormBillModels();
 
@@ -610,5 +694,9 @@ public class BillInputActivity extends OABaseActivity implements IBill, BillAdap
         mBillAdapter.notifyDataSetChanged();
     }
 
-
+    @Override
+    protected void onDestroy() {
+        super.onDestroy();
+        mBillAdapter.unregisterAdapterDataObserver(mAdapterDataObserver);
+    }
 }

+ 70 - 39
app_modular/apputils/src/main/java/com/modular/apputils/adapter/BillAdapter.java

@@ -8,6 +8,7 @@ import android.support.v7.widget.RecyclerView;
 import android.text.Editable;
 import android.text.InputType;
 import android.text.TextUtils;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -35,7 +36,8 @@ import java.util.List;
  * 0.标题
  * 1.请选择
  */
-public class BillAdapter extends RecyclerView.Adapter<BillAdapter.BaseViewHolder> implements View.OnClickListener {
+public class BillAdapter extends RecyclerView.Adapter<BillAdapter.BaseViewHolder>
+        implements View.OnClickListener {
 
     public Context ct;
     protected List<BillGroupModel> mBillGroupModels;
@@ -47,8 +49,8 @@ public class BillAdapter extends RecyclerView.Adapter<BillAdapter.BaseViewHolder
     //所有字段列表
     protected List<BillGroupModel.BillModel> mAllBillModels;
     protected OnAdapterListener mOnAdapterListener;
-    protected int mTabIndex = -1;
-    private int mTabPosition = 0;
+    public int mTabIndex = -1;
+    public int mTabPosition = 0;
     private List<BillGroupModel> mOldTabModels;
 
     public BillAdapter(Context ct, List<BillGroupModel> mBillGroupModels, OnAdapterListener mOnAdapterListener) {
@@ -264,7 +266,6 @@ public class BillAdapter extends RecyclerView.Adapter<BillAdapter.BaseViewHolder
         return viewHolder;
     }
 
-
     @Override
     public int getItemCount() {
         return mShowBillModels == null ? 0 : mShowBillModels.size();
@@ -372,15 +373,26 @@ public class BillAdapter extends RecyclerView.Adapter<BillAdapter.BaseViewHolder
         @Override
         public void initView(View view) {
             mTabLayout = (TabLayout) view.findViewById(R.id.bill_tab_tl);
-            mTabLayout.setTabMode(TabLayout.MODE_FIXED);
-            final List<BillGroupModel.GridTab> tabList = mShowBillModels.get(mTabIndex).getTabList();
-            if (tabList != null && tabList.size() > 0) {
-                for (int i = 0; i < tabList.size(); i++) {
-                    BillGroupModel.GridTab gridTab = tabList.get(i);
-                    if (gridTab != null) {
-                        mTabLayout.addTab(mTabLayout.newTab().setText(gridTab.getTitle()));
+            if (mTabIndex != -1) {
+                BillGroupModel.BillModel billModel = mShowBillModels.get(mTabIndex);
+                final List<BillGroupModel.GridTab> tabList = billModel.getTabList();
+                if (tabList != null && tabList.size() > 0) {
+                    for (int i = 0; i < tabList.size(); i++) {
+                        BillGroupModel.GridTab gridTab = tabList.get(i);
+                        if (gridTab != null) {
+                            mTabLayout.addTab(mTabLayout.newTab().setText(gridTab.getTitle()));
+                        }
                     }
                 }
+                Log.d("raomengBill", "TabViewHolder---" + mTabPosition);
+                if (mTabPosition >= 0) {
+                    mTabLayout.getTabAt(mTabPosition).select();
+                }
+                if (mTabLayout.getTabCount() > 4) {
+                    mTabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
+                } else {
+                    mTabLayout.setTabMode(TabLayout.MODE_FIXED);
+                }
             }
         }
 
@@ -394,6 +406,7 @@ public class BillAdapter extends RecyclerView.Adapter<BillAdapter.BaseViewHolder
             model = mShowBillModels.get(position);
         }
         try {
+            holder.itemView.setTag(model);
             if (holder instanceof InputViewHolder) {
                 bindInputView((InputViewHolder) holder, model, position);
             } else if (holder instanceof TitleViewHolder) {
@@ -412,11 +425,21 @@ public class BillAdapter extends RecyclerView.Adapter<BillAdapter.BaseViewHolder
     }
 
     private void bindTabView(TabViewHolder holder, final BillGroupModel.BillModel model, final int position) {
+        Log.d("raomengBill", "bindTabView");
         if (holder.mTabLayout.getTag() != null && holder.mTabLayout.getTag() instanceof MyTabChangeListener) {
             holder.mTabLayout.removeOnTabSelectedListener((TabLayout.OnTabSelectedListener) holder.mTabLayout.getTag());
         }
-        MyTabChangeListener myTabChangeListener = new MyTabChangeListener(holder.mTabLayout, position);
+        /*int selectedTabPosition = holder.mTabLayout.getSelectedTabPosition();
+        if (mTabPosition >= 0 && mTabPosition != selectedTabPosition) {
+            holder.mTabLayout.getTabAt(mTabPosition).select();
+//            switchTabData(mTabPosition);
+        }*/
+        MyTabChangeListener myTabChangeListener = new MyTabChangeListener(position);
         holder.mTabLayout.addOnTabSelectedListener(myTabChangeListener);
+        int selectedTabPosition = holder.mTabLayout.getSelectedTabPosition();
+        if (mTabPosition >= 0 && mTabPosition != selectedTabPosition) {
+            holder.mTabLayout.getTabAt(mTabPosition).select();
+        }
         holder.mTabLayout.setTag(myTabChangeListener);
     }
 
@@ -603,38 +626,14 @@ public class BillAdapter extends RecyclerView.Adapter<BillAdapter.BaseViewHolder
 
 
     public class MyTabChangeListener implements TabLayout.OnTabSelectedListener {
-        private TabLayout mTabLayout;
-        private int mPosition;
 
-        public MyTabChangeListener(TabLayout tabLayout, int position) {
-            mTabLayout = tabLayout;
-            mPosition = position;
+        public MyTabChangeListener(int position) {
+            mTabIndex = position;
         }
 
         @Override
         public void onTabSelected(TabLayout.Tab tab) {
-            if (this.mPosition >= 0 && mShowBillModels != null && mShowBillModels.size() > this.mPosition && mTabLayout != null) {
-                mTabPosition = tab.getPosition();
-                BillGroupModel.BillModel model = mShowBillModels.get(mPosition);
-                if (model != null) {
-                    List<BillGroupModel.GridTab> tabList = model.getTabList();
-                    int tabGroupIndex = model.getGroupIndex();
-
-                    List<BillGroupModel> newGroupModels = new ArrayList<>();
-                    List<BillGroupModel> billGroupModels = mBillGroupModels.subList(0, tabGroupIndex + 1);
-                    mOldTabModels = mBillGroupModels.subList(tabGroupIndex + 1, mBillGroupModels.size());
-
-                    newGroupModels.addAll(billGroupModels);
-                    BillGroupModel.GridTab gridTab = tabList.get(mTabPosition);
-                    if (gridTab != null) {
-                        List<BillGroupModel> tabGroupModels = gridTab.getBillGroupModels();
-
-                        newGroupModels.addAll(tabGroupModels);
-                    }
-                    setBillGroupModels(newGroupModels);
-                    notifyDataSetChanged();
-                }
-            }
+            switchTabData(tab.getPosition());
         }
 
         @Override
@@ -648,6 +647,38 @@ public class BillAdapter extends RecyclerView.Adapter<BillAdapter.BaseViewHolder
         }
     }
 
+    private void switchTabData(int tabPosition) {
+        mTabPosition = tabPosition;
+        if (mTabIndex >= 0 && mShowBillModels != null && mShowBillModels.size() > mTabIndex) {
+            BillGroupModel.BillModel model = mShowBillModels.get(mTabIndex);
+            if (model != null) {
+                List<BillGroupModel.GridTab> tabList = model.getTabList();
+                int tabGroupIndex = model.getGroupIndex();
+
+                List<BillGroupModel> newGroupModels = new ArrayList<>();
+                List<BillGroupModel> billGroupModels = mBillGroupModels.subList(0, tabGroupIndex + 1);
+                mOldTabModels = mBillGroupModels.subList(tabGroupIndex + 1, mBillGroupModels.size());
+
+                newGroupModels.addAll(billGroupModels);
+                BillGroupModel.GridTab gridTab = tabList.get(mTabPosition);
+                if (gridTab != null) {
+                    List<BillGroupModel> tabGroupModels = gridTab.getBillGroupModels();
+
+                    newGroupModels.addAll(tabGroupModels);
+                }
+                setBillGroupModels(newGroupModels);
+                notifyDataSetChanged();
+            }
+        }
+    }
+
+    public void switchTabIndex(int tabPosition) {
+        if (mTabIndex >= 0 && mShowBillModels != null && mShowBillModels.size() > mTabIndex) {
+            mTabPosition = tabPosition;
+            notifyItemChanged(mTabIndex);
+//            notifyDataSetChanged();
+        }
+    }
 
     private void showDeleteGroup(final int groupIndex) {
         new VeriftyDialog.Builder(ct)

+ 5 - 1
app_modular/apputils/src/main/java/com/modular/apputils/adapter/BillDetailsAdapter.java

@@ -420,7 +420,6 @@ public class BillDetailsAdapter extends RecyclerView.Adapter<BillDetailsAdapter.
         @Override
         public void initView(View view) {
             mTabLayout = (TabLayout) view.findViewById(R.id.bill_tab_tl);
-            mTabLayout.setTabMode(TabLayout.MODE_FIXED);
             final List<BillGroupModel.GridTab> tabList = mShowBillModels.get(mTabIndex).getTabList();
             if (tabList != null && tabList.size() > 0) {
                 for (int i = 0; i < tabList.size(); i++) {
@@ -430,6 +429,11 @@ public class BillDetailsAdapter extends RecyclerView.Adapter<BillDetailsAdapter.
                     }
                 }
             }
+            if (mTabLayout.getTabCount() > 4) {
+                mTabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
+            } else {
+                mTabLayout.setTabMode(TabLayout.MODE_FIXED);
+            }
         }
 
     }

+ 3 - 3
app_modular/apputils/src/main/java/com/modular/apputils/model/BillGroupModel.java

@@ -177,7 +177,7 @@ public class BillGroupModel implements Serializable {
         mGridTabs = gridTabs;
     }
 
-    public static class BillTitleModel implements Serializable{
+    public static class BillTitleModel implements Serializable {
         private int groupIndex;//组索引
         private boolean isDelete;
         private String showName;
@@ -214,7 +214,7 @@ public class BillGroupModel implements Serializable {
     /**
      * 字段详情
      */
-    public static class BillModel implements Serializable{
+    public static class BillModel implements Serializable {
         private int id;//id
         private int groupIndex;//所在组索引
         private float detno = 1000000;//序号
@@ -432,7 +432,7 @@ public class BillGroupModel implements Serializable {
         }
     }
 
-    public static class GridTab implements Serializable{
+    public static class GridTab implements Serializable {
         private String title;
         private String caller;
         private int position;

+ 30 - 1
app_modular/apputils/src/main/java/com/modular/apputils/presenter/BillPresenter.java

@@ -3,7 +3,12 @@ package com.modular.apputils.presenter;
 import android.content.Context;
 import android.content.Intent;
 import android.support.annotation.Nullable;
+import android.support.design.widget.TabLayout;
 import android.text.TextUtils;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.FrameLayout;
+import android.widget.LinearLayout;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -590,6 +595,7 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
             JSONObject data = JSONUtil.getJSONObject(resultObject, "data");
             JSONArray formdetail = JSONUtil.getJSONArray(data, "formdetail");
             Map<String, BillGroupModel> formdeMap = handlerFormdetail(formdetail);
+            List<BillGroupModel> formBillModels = new ArrayList<>();
             if (formdeMap != null && !formdeMap.isEmpty()) {
                 for (Map.Entry<String, BillGroupModel> entry : formdeMap.entrySet()) {
                     BillGroupModel entryValue = entry.getValue();
@@ -597,10 +603,12 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
                         //主表caller为单据caller
                         entryValue.setBillCaller(mCaller);
                         showBillModels.add(entryValue);
+                        formBillModels.add(entryValue);
                     }
                 }
-                if (!ListUtils.isEmpty(showBillModels)) {
+                if (!ListUtils.isEmpty(formBillModels)) {
                     Collections.sort(showBillModels, mComparator);
+                    Collections.sort(formBillModels, mComparator);
                 }
             }
             multidetailgrid = JSONUtil.getBoolean(data, "multidetailgrid");
@@ -608,6 +616,12 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
                 JSONArray othergridetail = JSONUtil.getJSONArray(data, "othergridetail");
                 if (othergridetail != null && othergridetail.size() > 0) {
                     List<BillGroupModel.GridTab> otherGridTabs = handlerGirdTabs(showBillModels.size() + 1, othergridetail);
+                    BillGroupModel.GridTab formGridTab = new BillGroupModel.GridTab();
+                    formGridTab.setPosition(0);
+                    formGridTab.setTitle("基础信息");
+                    formGridTab.setCaller(mCaller);
+                    formGridTab.setBillGroupModels(formBillModels);
+                    otherGridTabs.add(0, formGridTab);
                     if (otherGridTabs.size() > 0) {
                         BillGroupModel billTab = new BillGroupModel();
                         billTab.setForm(false);
@@ -617,6 +631,21 @@ public class BillPresenter extends BaseNetPresenter implements OnSmartHttpListen
                         showBillModels.add(billTab);
 
                         showBillModels.addAll(otherGridTabs.get(0).getBillGroupModels());
+
+                        View topLayout = View.inflate(ct, R.layout.item_bill_tab, null);
+                        TabLayout tabLayout = topLayout.findViewById(R.id.bill_tab_tl);
+                        if (tabLayout != null) {
+                            for (int i = 0; i < otherGridTabs.size(); i++) {
+                                tabLayout.addTab(tabLayout.newTab().setText(otherGridTabs.get(i).getTitle()));
+                            }
+                            if (tabLayout.getTabCount() > 4) {
+                                tabLayout.setTabMode(TabLayout.MODE_SCROLLABLE);
+                            } else {
+                                tabLayout.setTabMode(TabLayout.MODE_FIXED);
+                            }
+                        }
+
+                        iBill.addTopLayout(topLayout, tabLayout);
                     }
                 }
             } else {

+ 5 - 2
app_modular/apputils/src/main/java/com/modular/apputils/presenter/imp/IBill.java

@@ -2,20 +2,23 @@ package com.modular.apputils.presenter.imp;
 
 
 import android.content.Intent;
+import android.view.View;
 
 import com.core.base.HttpImp;
 import com.modular.apputils.model.BillGroupModel;
 
 import java.util.List;
 
-public interface IBill extends HttpImp{
+public interface IBill extends HttpImp {
     void setAdapter(List<BillGroupModel> groupModels);
+
     void setTitle(CharSequence title);
 
-    void commitSuccess(int keyValue,String code);//提交成功
+    void commitSuccess(int keyValue, String code);//提交成功
 
     void startActivityForResult(Intent intent, int requestCode);
 
     void updateFileOk();
 
+    void addTopLayout(View ...view);
 }

+ 14 - 7
app_modular/apputils/src/main/res/layout/activity_bill_input.xml

@@ -1,14 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/mRootLL"
     android:layout_width="match_parent"
+    android:layout_height="match_parent"
     android:fitsSystemWindows="true"
-    android:id="@+id/mRootLL"
-    android:focusableInTouchMode="true"
-    android:layout_height="match_parent">
+    android:focusableInTouchMode="true">
 
     <android.support.v7.widget.RecyclerView
         android:id="@+id/mRecyclerView"
-        android:focusableInTouchMode="false"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"/>
-</LinearLayout>
+        android:layout_height="match_parent"
+        android:focusableInTouchMode="false" />
+
+    <FrameLayout
+        android:id="@+id/bill_input_top_fl"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@color/white"
+        android:visibility="gone" />
+</RelativeLayout>

+ 1 - 1
app_modular/apputils/src/main/res/layout/common_refresh_recycler.xml

@@ -6,7 +6,7 @@
     android:layout_height="match_parent"
     app:fectiveScroll="30dp">
 
-    <com.modular.apputils.widget.EmptyRecyclerView
+    <android.support.v7.widget.RecyclerView
         android:id="@+id/mRecyclerView"
         android:layout_width="match_parent"
         android:layout_height="match_parent" />

+ 5 - 3
app_modular/apputils/src/main/res/layout/item_bill_tab.xml

@@ -1,14 +1,15 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout
-    xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:app="http://schemas.android.com/apk/res-auto"
     android:layout_width="match_parent"
     android:layout_height="50dp"
     android:orientation="vertical">
+
     <View
         android:layout_width="match_parent"
         android:layout_height="8dp"
-        android:background="#f2f2f2"/>
+        android:background="#f2f2f2" />
+
     <android.support.design.widget.TabLayout
         android:id="@+id/bill_tab_tl"
         android:layout_width="match_parent"
@@ -16,6 +17,7 @@
         android:background="@color/white"
         app:tabIndicatorColor="#33A2EE"
         app:tabIndicatorHeight="4dp"
+        app:tabMode="scrollable"
         app:tabSelectedTextColor="#1084D1"
         app:tabTextColor="#666666" />
 </LinearLayout>

+ 2 - 3
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceManageActivity.java

@@ -36,7 +36,7 @@ public class DeviceManageActivity extends SupportToolBarActivity {
     }
 
     private void initView() {
-        contantRv =findViewById(R.id.contantRv);
+        contantRv = findViewById(R.id.contantRv);
         contantRv.setLayoutManager(new GridLayoutManager(ct, 4));
         List<DeviceManage> models = new ArrayList<>();
         //扫一扫
@@ -75,7 +75,7 @@ public class DeviceManageActivity extends SupportToolBarActivity {
             if (bundle != null) {
                 intent.putExtra("data", bundle);
                 if (bundle.keySet() != null) {
-                    for (String e : bundle.keySet()){
+                    for (String e : bundle.keySet()) {
                         intent.putExtra(e, bundle.getString(e));
                     }
                 }
@@ -114,7 +114,6 @@ public class DeviceManageActivity extends SupportToolBarActivity {
                 }
             } else if (requestCode == 0x22) {
                 showDialog(data.getStringExtra("data"));
-
             }
         }
     }

+ 2 - 0
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/MissionSetActivity.java

@@ -104,6 +104,8 @@ public class MissionSetActivity extends SupportToolBarActivity implements View.O
         auto_sv.setClickable(adminStatus);
         needprocess_sv.setFocusable(adminStatus);
         needprocess_sv.setClickable(adminStatus);
+        mFaceSignSwitchView.setFocusable(adminStatus);
+        mFaceSignSwitchView.setClickable(adminStatus);
     }
 
     private void initView() {

+ 37 - 3
app_modular/appworks/src/main/java/com/uas/appworks/activity/DeviceQueryActivity.java

@@ -1,6 +1,9 @@
 package com.uas.appworks.activity;
 
+import android.Manifest;
+import android.app.Activity;
 import android.content.Intent;
+import android.os.Bundle;
 import android.support.annotation.NonNull;
 import android.support.v7.app.ActionBar;
 import android.text.TextUtils;
@@ -32,6 +35,7 @@ import com.core.dao.historical.HistoricalRecordBean;
 import com.core.dao.historical.HistoricalRecordDao;
 import com.core.interfac.OnVoiceCompleteListener;
 import com.core.utils.CommonUtil;
+import com.core.utils.ToastUtil;
 import com.core.widget.ClearEditText;
 import com.core.widget.EmptyLayout;
 import com.core.widget.MyListView;
@@ -49,6 +53,8 @@ import com.uas.appworks.datainquiry.bean.DataInquiryFlexBean;
 import com.uas.appworks.datainquiry.bean.SchemeConditionBean;
 import com.uas.appworks.presenter.WorkPlatPresenter;
 import com.uas.appworks.view.WorkPlatView;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
 
 import java.io.IOException;
 import java.util.ArrayList;
@@ -67,7 +73,7 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
     private final int OBTAIN_DEVICE_LIST = 0x11;
 
     private PullToRefreshListView mDataListView;
-    private ImageView mTotalImage, mBackImageView, mFilterImageView, mVoiceImageView;
+    private ImageView mTotalImage, mBackImageView, mFilterImageView, mVoiceImageView, mScanImageView;
     private View mGrayBackGround;
     private ClearEditText mSearchEditText;
     private LinearLayout mHistoryWholeLl, mOptionWholeLl, mHistoryLayout, mOptionLayout;
@@ -92,7 +98,7 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
 
     @Override
     protected int getLayout() {
-        return R.layout.activity_data_inquiry_list;
+        return R.layout.activity_device_query_list;
     }
 
     @Override
@@ -108,6 +114,7 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
         mFilterImageView = (ImageView) view.findViewById(R.id.data_inquiry_filter_iv);
         mVoiceImageView = (ImageView) view.findViewById(R.id.data_inquiry_voice_iv);
         mSearchEditText = (ClearEditText) view.findViewById(R.id.data_inquiry_filter_et);
+        mScanImageView = (ImageView) view.findViewById(R.id.data_inquiry_filter_scan_iv);
         ActionBar bar = this.getSupportActionBar();
         bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
         bar.setCustomView(view);
@@ -142,7 +149,7 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
         mHistoryListView.setAdapter(mHistoricalRecordAdapter);
 
         mDeviceQueryFlexBeans = new ArrayList<>();
-        mDeviceQueryFlexAdapter = new DataInquiryFlexAdapter(mContext, mDeviceQueryFlexBeans);
+        mDeviceQueryFlexAdapter = new DataInquiryFlexAdapter(mContext, mDeviceQueryFlexBeans, true);
         mDataListView.setAdapter(mDeviceQueryFlexAdapter);
 
         Intent intent = getIntent();
@@ -179,6 +186,7 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
     protected void initEvent() {
         mBackImageView.setOnClickListener(this);
         mFilterImageView.setOnClickListener(this);
+        mScanImageView.setOnClickListener(this);
         mVoiceImageView.setOnClickListener(this);
         mClearHistoryTextView.setOnClickListener(this);
         mOptionCancelTextView.setOnClickListener(this);
@@ -502,6 +510,18 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
             if (data != null) {
                 showDialog(data.getStringExtra("data"));
             }
+        } else if (requestCode == 0x33 && resultCode == Activity.RESULT_OK) {
+            Bundle bundle = data.getExtras();
+            if (bundle != null) {
+                if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_SUCCESS) {
+                    String result = bundle.getString(CodeUtils.RESULT_STRING);
+                    Log.d("scanurl", result);
+                    startActivityForResult(new Intent(ct, ScanDetailActivity.class).
+                            putExtra("decode", result), 0x34);
+                }
+            }
+        } else if (requestCode == 0x34) {
+            showDialog(data.getStringExtra("data"));
         }
     }
 
@@ -847,6 +867,19 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
                     mGrayBackGround.setVisibility(View.GONE);
                 }
             }
+        } else if (i == R.id.data_inquiry_filter_scan_iv) {
+            requestPermission(Manifest.permission.CAMERA, new Runnable() {
+                @Override
+                public void run() {
+                    startActivityForResult(new Intent(DeviceQueryActivity.this, CaptureActivity.class)
+                            , 0x33);
+                }
+            }, new Runnable() {
+                @Override
+                public void run() {
+                    ToastUtil.showToast(ct, R.string.not_camera_permission);
+                }
+            });
         }
     }
 
@@ -978,4 +1011,5 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
 
         }
     }
+
 }

+ 5 - 0
app_modular/appworks/src/main/java/com/uas/appworks/crm3_0/activity/BillInputBindActivity.java

@@ -210,6 +210,11 @@ public class BillInputBindActivity extends OABaseActivity implements IBill, Bill
         mBillPresenter.saveAndSubmit(mBillAdapter.getBillGroupModels());
     }
 
+    @Override
+    public void addTopLayout(View ...view) {
+
+    }
+
     @Override
     public void toSelect(int position, BillGroupModel.BillModel model) {
         if (TextUtils.isEmpty(model.getType())) return;

+ 5 - 5
app_modular/appworks/src/main/java/com/uas/appworks/crm3_0/activity/CustomerManageActivity.java

@@ -247,11 +247,11 @@ public class CustomerManageActivity extends OABaseActivity implements ICustomerM
         list.add(map);
 
         String master = CommonUtil.getMaster();
-        if (!("DATACENTER".equals(master) || "N_SHYZ".equals(master) || "N_AJC".equals(master))) {
-            map = new HashMap<>();
-            map.put("item_name", "拜访报告");
-            list.add(map);
-        }
+//        if (!("DATACENTER".equals(master) || "N_SHYZ".equals(master) || "N_AJC".equals(master))) {
+        map = new HashMap<>();
+        map.put("item_name", "拜访报告");
+        list.add(map);
+//        }
 
 //        map = new HashMap<>();
 //        map.put("item_name", "正式客户");

+ 27 - 11
app_modular/appworks/src/main/java/com/uas/appworks/datainquiry/adapter/DataInquiryFlexAdapter.java

@@ -26,6 +26,7 @@ public class DataInquiryFlexAdapter extends BaseAdapter {
 
     private Context context;
     private LayoutInflater layoutInflater;
+    private boolean isDevice = false;
 
     public DataInquiryFlexAdapter(Context context, List<DataInquiryFlexBean> objects) {
         this.context = context;
@@ -33,6 +34,13 @@ public class DataInquiryFlexAdapter extends BaseAdapter {
         this.objects = objects;
     }
 
+    public DataInquiryFlexAdapter(Context context, List<DataInquiryFlexBean> objects, boolean isDevice) {
+        this.context = context;
+        this.layoutInflater = LayoutInflater.from(context);
+        this.objects = objects;
+        this.isDevice = isDevice;
+    }
+
     public List<List<DataInquiryFlexBean.RowBean.RowChildBean>> getRowChildBeans() {
         return mRowChildBeans;
     }
@@ -63,7 +71,11 @@ public class DataInquiryFlexAdapter extends BaseAdapter {
     @Override
     public View getView(int position, View convertView, ViewGroup parent) {
         if (convertView == null) {
-            convertView = layoutInflater.inflate(R.layout.item_list_data_inquiry, null);
+            if (isDevice) {
+                convertView = layoutInflater.inflate(R.layout.item_list_device_query, null);
+            } else {
+                convertView = layoutInflater.inflate(R.layout.item_list_data_inquiry, null);
+            }
             convertView.setTag(new ViewHolder(convertView));
         }
         initializeViews((DataInquiryFlexBean) getItem(position), (ViewHolder) convertView.getTag());
@@ -89,18 +101,22 @@ public class DataInquiryFlexAdapter extends BaseAdapter {
         DataInquiryFlexChildAdapter dataInquiryFlexChildAdapter = new DataInquiryFlexChildAdapter(context, rowBeans);
 
         holder.itemDataInquiryFlexLv.setAdapter(dataInquiryFlexChildAdapter);
-        if (object.getRowBeans().size() <= mFlexLines || rowBeans.size() < mFlexLines) {
-            holder.itemDataInquiryFlexIv.setVisibility(View.INVISIBLE);
+        if (isDevice) {
+            holder.itemDataInquiryFlexIv.setVisibility(View.GONE);
         } else {
-            holder.itemDataInquiryFlexIv.setVisibility(View.VISIBLE);
-        }
-        holder.itemDataInquiryFlexIv.setOnClickListener(new View.OnClickListener() {
-            @Override
-            public void onClick(View v) {
-                object.setIsFlex(!object.isFlex());
-                notifyDataSetChanged();
+            if (object.getRowBeans().size() <= mFlexLines || rowBeans.size() < mFlexLines) {
+                holder.itemDataInquiryFlexIv.setVisibility(View.INVISIBLE);
+            } else {
+                holder.itemDataInquiryFlexIv.setVisibility(View.VISIBLE);
             }
-        });
+            holder.itemDataInquiryFlexIv.setOnClickListener(new View.OnClickListener() {
+                @Override
+                public void onClick(View v) {
+                    object.setIsFlex(!object.isFlex());
+                    notifyDataSetChanged();
+                }
+            });
+        }
 
 //        holder.itemDataInquiryFlexRl.setOnClickListener(new View.OnClickListener() {
 //            @Override

+ 7 - 8
app_modular/appworks/src/main/res/layout/item_list_data_inquiry.xml

@@ -1,22 +1,21 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:app="http://schemas.android.com/apk/res-auto"
     android:id="@+id/item_data_inquiry_flex_rl"
-    xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:descendantFocusability="blocksDescendants">
 
-
     <ImageView
         android:id="@+id/item_data_inquiry_flex_iv"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:layout_alignParentBottom="true"
         android:layout_alignParentRight="true"
-        android:paddingBottom="10dp"
-        android:paddingRight="10dp"
+        android:layout_alignParentBottom="true"
         android:paddingTop="10dp"
-        android:src="@drawable/ic_menu_retract"/>
+        android:paddingRight="10dp"
+        android:paddingBottom="10dp"
+        android:src="@drawable/ic_menu_retract" />
 
 
     <com.core.widget.MyListView
@@ -27,5 +26,5 @@
         android:clickable="false"
         android:divider="@null"
         android:focusable="false"
-        android:scrollbars="none"/>
+        android:scrollbars="none" />
 </RelativeLayout>

+ 42 - 0
app_modular/appworks/src/main/res/layout/item_list_device_query.xml

@@ -0,0 +1,42 @@
+<?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="wrap_content"
+    android:descendantFocusability="blocksDescendants"
+    android:background="#f6f6f6"
+    android:paddingLeft="8dp"
+    android:paddingRight="8dp"
+    android:paddingTop="4dp"
+    android:paddingBottom="4dp"
+    >
+
+    <RelativeLayout
+        android:id="@+id/item_data_inquiry_flex_rl"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:background="@drawable/shape_b2b_change_account">
+
+        <ImageView
+            android:id="@+id/item_data_inquiry_flex_iv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_alignParentRight="true"
+            android:layout_alignParentBottom="true"
+            android:paddingTop="10dp"
+            android:paddingRight="10dp"
+            android:paddingBottom="10dp"
+            android:src="@drawable/ic_menu_retract"
+            android:visibility="gone" />
+
+
+        <com.core.widget.MyListView
+            android:id="@+id/item_data_inquiry_flex_lv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_toLeftOf="@id/item_data_inquiry_flex_iv"
+            android:clickable="false"
+            android:divider="@null"
+            android:focusable="false"
+            android:scrollbars="none" />
+    </RelativeLayout>
+</RelativeLayout>

+ 31 - 1
app_modular/facesdk/src/main/java/com/baidu/aip/excep/activity/FaceManageActivity.java

@@ -16,6 +16,7 @@ import com.baidu.aip.excep.utils.FaceConfig;
 import com.common.LogUtil;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
+import com.core.app.MyApplication;
 import com.core.model.EmployeesEntity;
 import com.core.utils.CommonUtil;
 import com.core.utils.ToastUtil;
@@ -23,7 +24,10 @@ import com.core.widget.EmptyLayout;
 import com.core.widget.VoiceSearchView;
 import com.core.widget.listener.EditChangeListener;
 import com.handmark.pulltorefresh.library.PullToRefreshListView;
+import com.me.network.app.base.HttpCallback;
+import com.me.network.app.base.HttpParams;
 import com.me.network.app.http.HttpClient;
+import com.me.network.app.http.HttpRequest;
 import com.me.network.app.http.Method;
 import com.me.network.app.http.rx.Result2Listener;
 import com.me.network.app.http.rx.ResultSubscriber;
@@ -185,11 +189,37 @@ public class FaceManageActivity extends BaseNetActivity {
             ToastUtil.showToast(ct, R.string.delete_succeed_notice1);
             allDatas.remove(model);
             search(TextUtils.isEmpty(voiceSearchView.getText()) ? "" : voiceSearchView.getText().toString());
+            faceDeleteErp(model);
         } else {
             ToastUtil.showToast(ct, R.string.delete_failed);
         }
     }
 
+    /**
+     * 向erp删除人脸
+     */
+    private void faceDeleteErp(EmployeesEntity model) {
+        HttpRequest.getInstance().sendRequest(CommonUtil.getAppBaseUrl(this),
+                new HttpParams.Builder()
+                        .url("mobile/updateUploadPictureSign.action")
+                        .method(Method.POST)
+                        .addParam("master", CommonUtil.getMaster())
+                        .addParam("em_imid", model.getEm_IMID())
+                        .addParam("emcode", model.getEM_CODE())
+                        .addParam("em_uploadsign", 0)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+
+                    }
+                });
+    }
+
     private void handlerUserList(final JSONArray userListArray) throws Exception {
         if (ListUtils.isEmpty(userListArray)) {
             mEmptyLayout.showEmpty();
@@ -221,7 +251,7 @@ public class FaceManageActivity extends BaseNetActivity {
                                 notHasUser.add(userId);
                             }
                         }
-                        LogUtil.i("gong","notHasUser="+JSON.toJSONString(notHasUser));
+                        LogUtil.i("gong", "notHasUser=" + JSON.toJSONString(notHasUser));
                         if (ListUtils.isEmpty(hasFaceModels)) {
                             ToastUtil.showToast(ct, R.string.not_load_ok_fefresh);
                         } else {

+ 78 - 8
app_modular/facesdk/src/main/java/com/baidu/aip/excep/activity/RealTimeDetectFaceActivty.java

@@ -3,6 +3,7 @@ package com.baidu.aip.excep.activity;
 import android.content.Intent;
 import android.os.Looper;
 import android.text.TextUtils;
+import android.util.Log;
 
 import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
@@ -16,14 +17,17 @@ import com.core.app.Constants;
 import com.core.app.MyApplication;
 import com.core.model.User;
 import com.core.utils.CommonUtil;
+import com.me.network.app.base.HttpCallback;
+import com.me.network.app.base.HttpParams;
 import com.me.network.app.http.HttpClient;
+import com.me.network.app.http.HttpRequest;
 import com.me.network.app.http.Method;
 import com.me.network.app.http.rx.Result2Listener;
 import com.me.network.app.http.rx.ResultSubscriber;
 import com.modular.apputils.widget.VeriftyDialog;
 
 public class RealTimeDetectFaceActivty extends DetectLoginActivity {
-    private final int MAX_DETECT_COUNT = 2;
+    private final int MAX_DETECT_COUNT = 1;
 
 
     @Override
@@ -38,7 +42,7 @@ public class RealTimeDetectFaceActivty extends DetectLoginActivity {
         runOnUiThread(new Runnable() {
             @Override
             public void run() {
-                verify(faceBase64, master, imid);
+                verify(faceBase64, master, imid, true);
             }
         });
     }
@@ -103,9 +107,12 @@ public class RealTimeDetectFaceActivty extends DetectLoginActivity {
      * @param faceBase64    脸部信息
      * @param group_id_list 组Id
      * @param user_id       用户Id
+     * @param isFirst       是否是第一次验证,如果是第一次,验证失败的话重新验证
      */
-    private void verify(final String faceBase64, final String group_id_list, final String user_id) {
-        showProgress();
+    private void verify(final String faceBase64, final String group_id_list, final String user_id, final boolean isFirst) {
+        if (isFirst) {
+            showProgress();
+        }
         LogUtil.i("gong", "isMain" + (Looper.getMainLooper() == Looper.myLooper()));
         mUploading = true;
         FaceConfig.loadToken(new FaceConfig.FaceTokenListener() {
@@ -126,7 +133,7 @@ public class RealTimeDetectFaceActivty extends DetectLoginActivity {
                     @Override
                     public void onResponse(Object o) {
                         try {
-                            handleDetectResult(o.toString(), faceBase64, group_id_list, user_id);
+                            handleDetectResult(o.toString(), faceBase64, group_id_list, user_id, isFirst);
                         } catch (Exception e) {
                             e.printStackTrace();
                         }
@@ -171,6 +178,7 @@ public class RealTimeDetectFaceActivty extends DetectLoginActivity {
                             JSONObject object = JSON.parseObject(o.toString());
                             String error_msg = JSONUtil.getText(object, "error_msg");
                             if (TextUtils.isEmpty(error_msg) || error_msg.equals("SUCCESS")) {
+                                faceRegisterErp();
                                 okAndEnd(faceBase64);
                             } else {
                                 showErrorDialog(error_msg);
@@ -192,13 +200,39 @@ public class RealTimeDetectFaceActivty extends DetectLoginActivity {
         });
     }
 
+    /**
+     * 向erp注册人脸
+     */
+    private void faceRegisterErp() {
+        HttpRequest.getInstance().sendRequest(CommonUtil.getAppBaseUrl(this),
+                new HttpParams.Builder()
+                        .url("mobile/updateUploadPictureSign.action")
+                        .method(Method.POST)
+                        .addParam("master", CommonUtil.getMaster())
+                        .addParam("em_imid", MyApplication.getInstance().mLoginUser.getUserId())
+                        .addParam("emcode", CommonUtil.getEmcode())
+                        .addParam("em_uploadsign", 1)
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+
+                    }
+                });
+    }
+
     /**
      * 处理人脸扫描
      *
      * @param messgae
-     * @throws Exception
+     * @param isFirst
+     * @throws
      */
-    private void handleDetectResult(String messgae, String faceBase64, final String group_id_list, final String user_id) throws Exception {
+    private void handleDetectResult(String messgae, final String faceBase64, final String group_id_list, final String user_id, boolean isFirst) throws Exception {
         LogUtil.i("gong", "onResponse=" + messgae);
         JSONObject object = JSON.parseObject(messgae);
         String error_msg = JSONUtil.getText(object, "error_msg");
@@ -231,7 +265,43 @@ public class RealTimeDetectFaceActivty extends DetectLoginActivity {
                 }
             }
         } else if (222207 == error_code) {
-            showRegisterDialog(faceBase64, group_id_list, user_id);
+//            if (isFirst) {
+//                verify(faceBase64, group_id_list, user_id, false);
+//            } else {
+//                Log.e("facesignresult","222207");
+            HttpRequest.getInstance().sendRequest(CommonUtil.getAppBaseUrl(this),
+                    new HttpParams.Builder()
+                            .url("mobile/getUploadPictureSign.action")
+                            .method(Method.POST)
+                            .addParam("master", CommonUtil.getMaster())
+                            .addParam("em_imid", MyApplication.getInstance().mLoginUser.getUserId())
+                            .addParam("emcode", CommonUtil.getEmcode())
+                            .build(), new HttpCallback() {
+                        @Override
+                        public void onSuccess(int flag, Object o) throws Exception {
+                            dismissProgress();
+                            try {
+                                String result = o.toString();
+                                JSONObject resultObject = JSON.parseObject(result);
+                                int uploadsign = JSONUtil.getInt(resultObject, "em_uploadsign");
+                                if (uploadsign == 1) {
+                                    detectError();
+                                } else {
+                                    showRegisterDialog(faceBase64, group_id_list, user_id);
+                                }
+                            } catch (Exception e) {
+                                e.printStackTrace();
+                                detectError();
+                            }
+                        }
+
+                        @Override
+                        public void onFail(int flag, String failStr) throws Exception {
+                            dismissProgress();
+                            detectError();
+                        }
+                    });
+//            }
         } else {
             detectError();
         }

+ 1 - 1
gradle/wrapper/gradle-wrapper.properties

@@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
 distributionPath=wrapper/dists
 zipStoreBase=GRADLE_USER_HOME
 zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-all.zip