Selaa lähdekoodia

Merge branch 'feature' of https://gitlab.com/Arisono/SkWeiChat-Baidu into developer_fix

# Conflicts:
#	WeiChat/version.properties
Arison 8 vuotta sitten
vanhempi
commit
ce9f0f2a26
57 muutettua tiedostoa jossa 4423 lisäystä ja 171 poistoa
  1. 3 0
      app_core/common/src/main/java/com/common/data/StringUtil.java
  2. 6 4
      app_core/common/src/main/java/com/core/dao/historical/HistoricalRecordDao.java
  3. 8 6
      app_core/common/src/main/java/com/core/db/CommonCursorWrapper.java
  4. 21 21
      app_core/common/src/main/java/com/core/db/DatabaseTables.java
  5. 6 1
      app_core/common/src/main/java/com/core/net/http/ViewUtil.java
  6. 6 0
      app_core/common/src/main/java/com/core/utils/CommonUtil.java
  7. 141 0
      app_core/common/src/main/java/com/core/widget/SearchActionView.java
  8. 31 0
      app_core/common/src/main/java/com/core/widget/VoiceSearchView.java
  9. BIN
      app_core/common/src/main/res/drawable-xxhdpi/phone_del.png
  10. 59 0
      app_core/common/src/main/res/layout/layout_search_action.xml
  11. 3 2
      app_core/common/src/main/res/layout/seach_include.xml
  12. 10 7
      app_modular/appme/src/main/java/com/uas/appme/settings/activity/BSettingLocationActivity.java
  13. 1 1
      app_modular/appme/src/main/java/com/uas/appme/settings/activity/FindWagePWActivity.java
  14. 47 7
      app_modular/appme/src/main/java/com/uas/appme/settings/activity/WagesDetailsActivity.java
  15. 2 1
      app_modular/appme/src/main/res/layout/item_comkey_value.xml
  16. 9 6
      app_modular/appme/src/main/res/layout/wage_forgetps.xml
  17. 20 1
      app_modular/appme/src/main/res/layout/wages_details_activity.xml
  18. 2 1
      app_modular/apputils/src/main/java/com/modular/apputils/utils/SwitchUtil.java
  19. 97 0
      app_modular/apputils/src/main/java/com/modular/apputils/widget/EmptyRecyclerView.java
  20. 140 0
      app_modular/apputils/src/main/java/com/modular/apputils/widget/MenuVoiceSearchView.java
  21. 29 0
      app_modular/apputils/src/main/res/layout/common_empty_view.xml
  22. 1 1
      app_modular/apputils/src/main/res/layout/common_refresh_recycler.xml
  23. 35 0
      app_modular/apputils/src/main/res/layout/menu_seach_include.xml
  24. 9 1
      app_modular/appworks/src/main/AndroidManifest.xml
  25. 146 53
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceCycleCountActivity.java
  26. 373 0
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceCycleCountAddActivity.java
  27. 177 0
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceCycleCountDetailsActivity.java
  28. 304 0
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceCycleCountInfoActivity.java
  29. 125 0
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceDataFormAddActivity.java
  30. 81 9
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceManageActivity.java
  31. 281 16
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/ScanDetailActivity.java
  32. 219 0
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/adapter/CycleCountAdapter.java
  33. 118 0
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/model/CycleCount.java
  34. 107 0
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/model/CycleCountAdd.java
  35. 63 0
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/model/DeviceInfo.java
  36. 18 0
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/model/DeviceManage.java
  37. 973 0
      app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/model/TestStr.java
  38. 59 26
      app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/CommonDocDetailsActivity.java
  39. 9 1
      app_modular/appworks/src/main/java/com/uas/appworks/activity/DeviceQueryActivity.java
  40. 10 4
      app_modular/appworks/src/main/java/com/uas/appworks/datainquiry/activity/DataInquiryListActivity.java
  41. BIN
      app_modular/appworks/src/main/res/drawable-xxhdpi/ic_menu_retract.png
  42. 11 0
      app_modular/appworks/src/main/res/drawable/frame_square_hint_bg.xml
  43. 7 0
      app_modular/appworks/src/main/res/drawable/text_btn_bg.xml
  44. 2 2
      app_modular/appworks/src/main/res/layout/action_device_cycle_count.xml
  45. 17 0
      app_modular/appworks/src/main/res/layout/activity_device_cycle.xml
  46. 12 0
      app_modular/appworks/src/main/res/layout/activity_device_cycle_details.xml
  47. 212 0
      app_modular/appworks/src/main/res/layout/activity_device_cycle_info.xml
  48. 3 0
      app_modular/appworks/src/main/res/layout/device_scan_head.xml
  49. 31 0
      app_modular/appworks/src/main/res/layout/item_cycle_count.xml
  50. 62 0
      app_modular/appworks/src/main/res/layout/item_device_data.xml
  51. 48 0
      app_modular/appworks/src/main/res/layout/item_device_info.xml
  52. 27 0
      app_modular/appworks/src/main/res/layout/item_pop_device_cyclecount.xml
  53. 29 0
      app_modular/appworks/src/main/res/layout/item_rl_listview.xml
  54. 4 0
      app_modular/appworks/src/main/res/layout/menu_device_scan.xml
  55. 60 0
      app_modular/appworks/src/main/res/layout/pop_device_cyclecount.xml
  56. 146 0
      app_modular/appworks/src/main/res/layout/pop_submit_cycle.xml
  57. 3 0
      app_modular/appworks/src/main/res/values/strings.xml

+ 3 - 0
app_core/common/src/main/java/com/common/data/StringUtil.java

@@ -127,6 +127,9 @@ public class StringUtil {
 	public static String getTextRexHttp(TextView tv) {
 		if (tv == null || TextUtils.isEmpty(tv.getText())) return "";
 		return toHttpString(tv.getText().toString());
+	}	public static String getText(TextView tv) {
+		if (tv == null || TextUtils.isEmpty(tv.getText())) return "";
+		return toHttpString(tv.getText().toString());
 	}
 
 	//Bitliker 从字符串中取出第一个数字

+ 6 - 4
app_core/common/src/main/java/com/core/dao/historical/HistoricalRecordDao.java

@@ -4,6 +4,7 @@ import android.content.ContentValues;
 import android.database.Cursor;
 import android.database.sqlite.SQLiteDatabase;
 
+import com.core.db.CommonCursorWrapper;
 import com.core.db.DatabaseManager;
 import com.core.db.DatabaseTables;
 
@@ -24,8 +25,9 @@ public class HistoricalRecordDao {
     public static HistoricalRecordDao getInstance() {
         if (instance == null) {
             synchronized (HistoricalRecordDao.class) {
-                if (instance == null)
+                if (instance == null) {
                     instance = new HistoricalRecordDao();
+                }
             }
         }
         return instance;
@@ -54,7 +56,7 @@ public class HistoricalRecordDao {
      * @return
      */
     public List<HistoricalRecordBean> getHistoricalRecordBeansById(String schemeId) {
-        HistoricalRecordCursorWrapper cursor = queryHistoricalRecord(DatabaseTables.HistoricalRecordTable.Cols.SCHEME_ID + " = ?",
+        CommonCursorWrapper cursor = queryHistoricalRecord(DatabaseTables.HistoricalRecordTable.Cols.SCHEME_ID + " = ?",
                 new String[]{schemeId});
 
         List<HistoricalRecordBean> historicalRecordBeans = new ArrayList<>();
@@ -123,7 +125,7 @@ public class HistoricalRecordDao {
      * @param whereArgs
      * @return
      */
-    public HistoricalRecordCursorWrapper queryHistoricalRecord(String whereCause, String[] whereArgs) {
+    public CommonCursorWrapper queryHistoricalRecord(String whereCause, String[] whereArgs) {
         SQLiteDatabase sqLiteDatabase = DatabaseManager.getInstance().openDatabase();
 
         Cursor cursor = sqLiteDatabase.query(DatabaseTables.HistoricalRecordTable.NAME, null,
@@ -133,6 +135,6 @@ public class HistoricalRecordDao {
 
 //        DatabaseManager.getInstance().closeDatabase();
 
-        return new HistoricalRecordCursorWrapper(cursor);
+        return new CommonCursorWrapper(cursor);
     }
 }

+ 8 - 6
app_core/common/src/main/java/com/core/dao/historical/HistoricalRecordCursorWrapper.java → app_core/common/src/main/java/com/core/db/CommonCursorWrapper.java

@@ -1,22 +1,24 @@
-package com.core.dao.historical;
+package com.core.db;
 
 import android.database.Cursor;
 import android.database.CursorWrapper;
 
-import com.core.db.DatabaseTables;
+import com.core.dao.historical.HistoricalRecordBean;
 
 /**
- * Created by RaoMeng on 2017/8/18.
- * 历史记录的CursorWrapper封装类
+ * @author RaoMeng
+ * @describe CursorWrapper封装类
+ * @date 2017/12/12 10:17
  */
-public class HistoricalRecordCursorWrapper extends CursorWrapper {
+
+public class CommonCursorWrapper extends CursorWrapper {
 
     /**
      * Creates a cursor wrapper.
      *
      * @param cursor The underlying cursor to wrap.
      */
-    public HistoricalRecordCursorWrapper(Cursor cursor) {
+    public CommonCursorWrapper(Cursor cursor) {
         super(cursor);
     }
 

+ 21 - 21
app_core/common/src/main/java/com/core/db/DatabaseTables.java

@@ -4,32 +4,32 @@ package com.core.db;
  * Created by RaoMeng on 2017/8/14.
  * 数据库表
  */
-public class DatabaseTables {
-    public static final class HistoricalRecordTable {
-        public static final String NAME = "historical_record";
+public interface DatabaseTables {
+    interface HistoricalRecordTable {
+        String NAME = "historical_record";
 
-        public static final class Cols {
-            public static final String SCHEME_ID = "scheme_id";
-            public static final String SCHEME_NAME = "scheme_name";
-            public static final String SEARCH_FIELD = "search_field";
+        interface Cols {
+            String SCHEME_ID = "scheme_id";
+            String SCHEME_NAME = "scheme_name";
+            String SEARCH_FIELD = "search_field";
         }
     }
 
-    public static final class UUHelperTable {
-        public static final String NAME = "uu_helper";
+    interface UUHelperTable {
+        String NAME = "uu_helper";
 
-        public static final class Cols {
-            public static final String ID = "id";
-            public static final String USER_ID = "userId";
-            public static final String TIME_SEND = "timeSend";
-            public static final String DATE = "date";
-            public static final String IMAGE_URL = "imageUrl";
-            public static final String ICON_URL = "iconUrl";
-            public static final String LINK_URL = "linkUrl";
-            public static final String CONTENT = "content";
-            public static final String READED = "readed";
-            public static final String TITLE = "title";
-            public static final String TYPE = "type";
+        interface Cols {
+            String ID = "id";
+            String USER_ID = "userId";
+            String TIME_SEND = "timeSend";
+            String DATE = "date";
+            String IMAGE_URL = "imageUrl";
+            String ICON_URL = "iconUrl";
+            String LINK_URL = "linkUrl";
+            String CONTENT = "content";
+            String READED = "readed";
+            String TITLE = "title";
+            String TYPE = "type";
         }
     }
 }

+ 6 - 1
app_core/common/src/main/java/com/core/net/http/ViewUtil.java

@@ -17,6 +17,7 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.common.LogUtil;
+import com.common.config.BaseConfig;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
@@ -861,7 +862,7 @@ public class ViewUtil {
                             params.put("sessionId", CommonUtil.getSharedPreferences(ct, "sessionId"));
                         }
                         if (!params.containsKey("master") || params.get("master") == null) {
-                            params.put("master", CommonUtil.getSharedPreferences(ct, "erp_master"));
+                            params.put("master", CommonUtil.getMaster());
                         }
                         if (!params.containsKey("sessionUser"))
                             params.put("sessionUser", CommonUtil.getSharedPreferences(ct, "erp_username"));
@@ -1046,6 +1047,10 @@ public class ViewUtil {
                                     String password) {
         mdProcessDialog.setContent(MyApplication.getInstance().getString(R.string.login_progress_erp));
         url = url + "mobile/login.action";
+        if (BaseConfig.isDebug()){
+            master=CommonUtil.getMaster();
+            url="http://192.168.253.203:8090/ERP/mobile/login.action";
+        }
  //       url="http://192.168.253.58:8080/ERP/mobile/login.action";
 //        url = "http://192.168.253.29:8080/ERP/mobile/login.action";
 //        url = "http://192.168.253.6/uas_dev/mobile/login.action";

+ 6 - 0
app_core/common/src/main/java/com/core/utils/CommonUtil.java

@@ -99,6 +99,9 @@ public class CommonUtil {
             return "";
         }
         String baseUrl = getSharedPreferences(ct, "erp_baseurl");
+        if (BaseConfig.isDebug()){
+            baseUrl="http://192.168.253.203:8090/ERP/";
+        }
 //        baseUrl="http://192.168.253.203:8090/ERP/";
         return baseUrl;
     }
@@ -471,6 +474,9 @@ public class CommonUtil {
         boolean isB2b = ApiUtils.getApiModel() instanceof ApiPlatform;
         String master = isB2b ? CommonUtil.getSharedPreferences(MyApplication.getInstance().getApplicationContext(), "companyEnUu")
                 : CommonUtil.getSharedPreferences(MyApplication.getInstance(), "erp_master");
+      if (BaseConfig.isDebug()){
+          master="UAS_DEV";
+      }
         return master;
 
     }

+ 141 - 0
app_core/common/src/main/java/com/core/widget/SearchActionView.java

@@ -0,0 +1,141 @@
+package com.core.widget;
+
+import android.app.Activity;
+import android.content.Context;
+import android.support.annotation.NonNull;
+import android.support.annotation.Nullable;
+import android.util.AttributeSet;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.TextView;
+
+import com.core.app.R;
+import com.core.utils.CommonUtil;
+
+/**
+ * @author RaoMeng
+ * @describe
+ * @date 2017/12/22 10:17
+ */
+
+public class SearchActionView extends FrameLayout {
+    private ImageView mBackImageView, mMenuImageView, mVoiceImageView;
+    private OnVoiceCompleteListener mOnVoiceCompleteListener;
+    private OnEnterActionListener mOnEnterActionListener;
+    private OnMenuClickListener mOnMenuClickListener;
+    private ClearEditText mSearchEditText;
+
+    public void setOnVoiceCompleteListener(OnVoiceCompleteListener onVoiceCompleteListener) {
+        mOnVoiceCompleteListener = onVoiceCompleteListener;
+    }
+
+    public void setOnEnterActionListener(OnEnterActionListener onEnterActionListener) {
+        mOnEnterActionListener = onEnterActionListener;
+    }
+
+    public void setOnMenuClickListener(OnMenuClickListener onMenuClickListener) {
+        mOnMenuClickListener = onMenuClickListener;
+    }
+
+    public void setMenuImage(int menuImage) {
+        try {
+            mMenuImageView.setImageResource(menuImage);
+            mMenuImageView.setOnClickListener(new OnClickListener() {
+                @Override
+                public void onClick(View view) {
+                    if (mOnMenuClickListener != null) {
+                        mOnMenuClickListener.onMenuClick(view);
+                    }
+                }
+            });
+        } catch (Exception e) {
+
+        }
+
+    }
+
+    public SearchActionView(@NonNull Context context) {
+        super(context);
+        init(context, null, 0);
+    }
+
+    public SearchActionView(@NonNull Context context, @Nullable AttributeSet attrs) {
+        super(context, attrs);
+        init(context, attrs, 0);
+    }
+
+    public SearchActionView(@NonNull Context context, @Nullable AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        init(context, attrs, defStyleAttr);
+    }
+
+    private void init(final Context context, AttributeSet attrs, int defStyleAttr) {
+        LayoutInflater.from(context).inflate(R.layout.layout_search_action, this);
+
+        mBackImageView = (ImageView) findViewById(R.id.search_action_back_iv);
+        mMenuImageView = (ImageView) findViewById(R.id.search_action_menu_iv);
+        mVoiceImageView = (ImageView) findViewById(R.id.search_action_voice_iv);
+        mSearchEditText = (ClearEditText) findViewById(R.id.search_action_search_et);
+
+        mBackImageView.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                ((Activity) getContext()).finish();
+                ((Activity) getContext()).overridePendingTransition(R.anim.anim_activity_back_in, R.anim.anim_activity_back_out);
+            }
+        });
+
+        mVoiceImageView.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                CommonUtil.getVoiceText(context, mSearchEditText, new com.core.interfac.OnVoiceCompleteListener() {
+                    @Override
+                    public void onVoiceComplete() {
+                        if (mOnVoiceCompleteListener != null) {
+                            mOnVoiceCompleteListener.onVoiceComplete();
+                        }
+                    }
+                });
+            }
+        });
+
+        mSearchEditText.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
+                if (actionId == EditorInfo.IME_ACTION_SEARCH
+                        || actionId == EditorInfo.IME_ACTION_SEND
+                        || (keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_DOWN && keyEvent.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    if (mOnEnterActionListener != null) {
+                        mOnEnterActionListener.onEnterAction();
+                        return true;
+                    }
+                }
+                return false;
+            }
+        });
+    }
+
+    public void setSearchHint(String hint) {
+        mSearchEditText.setHint(hint);
+    }
+
+    public void setSearchHint(int hint) {
+        mSearchEditText.setHint(hint);
+    }
+
+    public interface OnVoiceCompleteListener {
+        void onVoiceComplete();
+    }
+
+    public interface OnEnterActionListener {
+        void onEnterAction();
+    }
+
+    public interface OnMenuClickListener {
+        void onMenuClick(View view);
+    }
+}

+ 31 - 0
app_core/common/src/main/java/com/core/widget/VoiceSearchView.java

@@ -5,9 +5,12 @@ import android.text.Editable;
 import android.text.TextUtils;
 import android.text.TextWatcher;
 import android.util.AttributeSet;
+import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.inputmethod.EditorInfo;
 import android.widget.RelativeLayout;
+import android.widget.TextView;
 
 import com.core.app.R;
 import com.core.interfac.OnVoiceCompleteListener;
@@ -28,6 +31,7 @@ import java.util.regex.Pattern;
 public class VoiceSearchView extends RelativeLayout {
     private ClearEditText search_edit;
     private OnVoiceCompleteListener mOnVoiceCompleteListener;
+    private OnEnterActionListener mOnEnterActionListener;
 
     public VoiceSearchView(Context context) {
         this(context, null);
@@ -47,12 +51,31 @@ public class VoiceSearchView extends RelativeLayout {
                 btnVoice();
             }
         });
+
+        search_edit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView textView, int actionId, KeyEvent keyEvent) {
+                if (actionId == EditorInfo.IME_ACTION_SEARCH
+                        || actionId == EditorInfo.IME_ACTION_SEND
+                        || (keyEvent != null && keyEvent.getAction() == KeyEvent.ACTION_DOWN && keyEvent.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    if (mOnEnterActionListener != null) {
+                        mOnEnterActionListener.onEnterAction();
+                        return true;
+                    }
+                }
+                return false;
+            }
+        });
     }
 
     public void setHineText(String hine) {
         search_edit.setHint(hine);
     }
 
+    public void setHineText(int hint) {
+        search_edit.setHint(hint);
+    }
+
     public void setText(String hine) {
         search_edit.setText(hine);
     }
@@ -89,6 +112,10 @@ public class VoiceSearchView extends RelativeLayout {
         mOnVoiceCompleteListener = onVoiceCompleteListener;
     }
 
+    public void setOnEnterActionListener(OnEnterActionListener onEnterActionListener) {
+        mOnEnterActionListener = onEnterActionListener;
+    }
+
     public void addTextChangedListener(TextWatcher watcher) {
         search_edit.addTextChangedListener(watcher);
     }
@@ -121,4 +148,8 @@ public class VoiceSearchView extends RelativeLayout {
             return nulltext;
         }
     }
+
+    public interface OnEnterActionListener {
+        void onEnterAction();
+    }
 }

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


+ 59 - 0
app_core/common/src/main/res/layout/layout_search_action.xml

@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout android:id="@+id/top"
+                xmlns:android="http://schemas.android.com/apk/res/android"
+                android:layout_width="match_parent"
+                android:layout_height="?attr/actionBarSize"
+                android:background="@color/antionbarcolor">
+
+    <ImageView
+        android:id="@+id/search_action_back_iv"
+        android:layout_width="24dp"
+        android:layout_height="24dp"
+        android:layout_centerVertical="true"
+        android:src="@drawable/ic_action_back" />
+
+    <ImageView
+        android:id="@+id/search_action_menu_iv"
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:layout_alignParentRight="true"
+        android:layout_centerVertical="true"
+        android:maxWidth="40dp" />
+
+    <RelativeLayout
+        android:layout_width="match_parent"
+        android:layout_height="36dp"
+        android:layout_centerInParent="true"
+        android:layout_marginLeft="40dp"
+        android:layout_marginRight="40dp"
+        android:visibility="visible">
+
+        <com.core.widget.ClearEditText
+            android:id="@+id/search_action_search_et"
+            android:layout_width="fill_parent"
+            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:paddingRight="26dp"
+            android:textColor="@color/dark_grey"
+            android:textColorHint="@color/grey"
+            android:textSize="14sp" />
+
+        <ImageView
+            android:id="@+id/search_action_voice_iv"
+            android:layout_width="20dp"
+            android:layout_height="20dp"
+            android:layout_alignParentRight="true"
+            android:layout_alignRight="@+id/search_edit"
+            android:layout_centerVertical="true"
+            android:layout_marginRight="6dp"
+            android:background="@drawable/btn_yuyin_nor"
+            android:visibility="visible" />
+    </RelativeLayout>
+
+</RelativeLayout>

+ 3 - 2
app_core/common/src/main/res/layout/seach_include.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_height="48dp"
     android:background="@drawable/bg_bar"
@@ -17,6 +17,7 @@
         android:drawableLeft="@drawable/search"
         android:drawableRight="@drawable/search_clear"
         android:hint="@string/search"
+        android:imeOptions="actionSearch"
         android:paddingRight="26dp"
         android:textColor="@color/dark_grey"
         android:textColorHint="@color/grey"
@@ -32,4 +33,4 @@
         android:layout_marginRight="6dp"
         android:background="@drawable/btn_yuyin_nor"
         android:visibility="visible" />
-</RelativeLayout>
+</merge>

+ 10 - 7
app_modular/appme/src/main/java/com/uas/appme/settings/activity/BSettingLocationActivity.java

@@ -219,14 +219,17 @@ public class BSettingLocationActivity extends BaseActivity implements View.OnCli
     public void onClick(View v) {
         if (v.getId() == R.id.add_new_rl){
             LogUtil.prinlnLongMsg("mPhotoList",JSON.toJSONString(mPhotoList));
-            if (StringUtil.isEmpty(mList.get(mList.size()-1).getSt_name())){
-                ToastMessage("请输入名称");
-                return;
-            }
-            if (mPhotoList.size() < mList.size()){
-                ToastMessage("请添加照片");
-                return;
+            if(!ListUtils.isEmpty(mList)){
+                if (StringUtil.isEmpty(mList.get(mList.size()-1).getSt_name())){
+                    ToastMessage("请输入名称");
+                    return;
+                }
+                if (mPhotoList.size() < mList.size()){
+                    ToastMessage("请添加照片");
+                    return;
+                }
             }
+
             BSetLocationBean model = new BSetLocationBean();
             model.setSt_companyname(CommonUtil.getSharedPreferences(MyApplication.getInstance(),"erp_commpany"));
             model.setSt_companyid(CommonUtil.getSharedPreferences(MyApplication.getInstance(),"erp_uu"));

+ 1 - 1
app_modular/appme/src/main/java/com/uas/appme/settings/activity/FindWagePWActivity.java

@@ -133,7 +133,7 @@ public class FindWagePWActivity extends BaseActivity implements View.OnClickList
                 mEyeTv.setImageResource(R.drawable.icon_show);
             }
         }else if (id == R.id.clearphone_tv){
-
+            mPhoneEt.setText("");
         }
     }
 

+ 47 - 7
app_modular/appme/src/main/java/com/uas/appme/settings/activity/WagesDetailsActivity.java

@@ -89,6 +89,11 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
     private Boolean haveData = true;
     private TextView announcement_tv;
     private int needSignature;
+    private JSONObject dataObject;
+    private int sl_result = -1;
+    private String sl_remark;
+    private LinearLayout error_ll;
+    private TextView error_tv;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
@@ -106,12 +111,27 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
             if (salaryObject != null){
                 JSONArray configsArray = salaryObject.getJSONArray("configs");
                 JSONObject dataObject = salaryObject.getJSONObject("data");
+                if (dataObject.size() == 0) {
+                    showEnty();
+                    return;
+                }
                 String gonggao = dataObject.getString("sl_text");
-                if (!StringUtil.isEmpty(gonggao))  announcement_tv.setText(gonggao);
+                if (!StringUtil.isEmpty(gonggao))
+                    announcement_tv.setText("通知公告:"+gonggao);
+                else if (gonggao == null)
+                    announcement_tv.setText("暂无通知公告");
 
                 needSignature = dataObject.getInteger("sl_signature");
                 if (needSignature == 0) mBtnSignature.setText("确认签收");
-                int sl_result = dataObject.getInteger("sl_result");
+                sl_result = dataObject.getInteger("sl_result");
+                sl_remark = dataObject.getString("sl_remark");
+                if (!StringUtil.isEmpty(sl_remark) && sl_result == -1){
+                    error_ll.setVisibility(View.VISIBLE);
+                    error_tv.setText(sl_remark);
+                }else {
+                    error_ll.setVisibility(View.GONE);
+                }
+
                 if (sl_result == 1 || sl_result == -1)
                     mBtnSignature.setVisibility(View.GONE);
                 else if (sl_result == 0 && haveData)
@@ -119,7 +139,7 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
 
 
                 sl_id = dataObject.getString("sl_id");
-                if (!ListUtils.isEmpty(configsArray) && dataObject != null){
+                if (!ListUtils.isEmpty(configsArray) && dataObject.size() > 0){
                     for (int i = 0; i < configsArray.size(); i++) {
                         String key = configsArray.getJSONObject(i).getString("Caption");
                         String field = configsArray.getJSONObject(i).getString("Field");
@@ -137,6 +157,9 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
                             LogUtil.prinlnLongMsg("fanglh",JSON.toJSONString(kvModeList));
                             if (ListUtils.isEmpty(kvModeList))
                                 showEnty();
+                            else {
+                                noWageLl.setVisibility(View.GONE);
+                            }
                         }
                     }
                 }else{
@@ -154,6 +177,8 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
     private void showEnty() {
         haveData = false;
         noWageLl.setVisibility(View.VISIBLE);
+        mBtnSignature.setVisibility(View.GONE);
+        Log.i("getEmSalary","showEnty");
     }
 
     private void initView() {
@@ -175,7 +200,8 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
         wageDateTv.setOnClickListener(this);
         noWageLl = (LinearLayout) findViewById(R.id.wage_nodata_ll);
         announcement_tv = (TextView) findViewById(R.id.announcement);
-
+        error_ll = (LinearLayout) findViewById(R.id.error_ll);
+        error_tv = (TextView) findViewById(R.id.error_tv);
 
 //        findViewById(R.id.h_sign_tv).setOnClickListener(this);
         Intent hh =  getIntent();
@@ -271,7 +297,10 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
     }
 
     private void searchWage() {
-        if (!ListUtils.isEmpty(kvModeList)) kvModeList.clear();
+        if (!ListUtils.isEmpty(kvModeList)) {
+            kvModeList.clear();
+            myAdapter.notifyDataSetChanged();
+        }
         //        HttpClient httpClient = new HttpClient.Builder(Constants.IM_BASE_URL()).isDebug(true).build(true);
         HttpClient httpClient = new HttpClient.Builder("http://192.168.253.58:8080/ERP/").isDebug(true).build(true);
         httpClient.Api().send(new HttpClient.Builder()
@@ -308,7 +337,7 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
                 .add("sl_id",sl_id)
                 .add("emcode",emcode)
                 .add("msg",msg_et.getText().toString())
-                .add("result",true)
+                .add("result","0")
                 .add("master", master)
                 .method(Method.POST)
                 .build(),new ResultSubscriber<>(new ResultListener<Object>() {
@@ -350,6 +379,7 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
                     Toast.makeText(ct,"工资条签名提交成功",Toast.LENGTH_LONG).show();
                     received_im.setVisibility(View.VISIBLE);
                     mBtnSignature.setText("已收签");
+                    mBtnSignature.setEnabled(false);
                     closePopupWindow();
                 }
                 progressDialog.dismiss();
@@ -443,6 +473,16 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
         DisplayUtil.backgroundAlpha(this, 1f);
     }
 
+    @Override
+    public boolean onPrepareOptionsMenu(Menu menu) {
+        menu.clear();
+        if (!haveData || !StringUtil.isEmpty(sl_remark) || sl_result != -1 ) {
+
+        } else {
+            getMenuInflater().inflate(R.menu.wage_error, menu);
+        }
+        return super.onPrepareOptionsMenu(menu);
+    }
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
         getMenuInflater().inflate(R.menu.wage_error, menu);
@@ -488,7 +528,7 @@ public class WagesDetailsActivity extends BaseActivity implements View.OnClickLi
             }
         });
         popupWindow.showAtLocation(getWindow().getDecorView().
-                findViewById(android.R.id.content), Gravity.BOTTOM, 0, 0);
+                findViewById(android.R.id.content), Gravity.CENTER, 0, 0);
         DisplayUtil.backgroundAlpha(this, 0.4f);
     }
 

+ 2 - 1
app_modular/appme/src/main/res/layout/item_comkey_value.xml

@@ -21,6 +21,7 @@
         android:layout_height="wrap_content"
         android:layout_weight="2"
         android:text="2016-11-25-21:22"
-        android:textColor="@color/done_approval"/>
+        android:textColor="#2F95DD"
+        />
 
 </LinearLayout>

+ 9 - 6
app_modular/appme/src/main/res/layout/wage_forgetps.xml

@@ -48,13 +48,12 @@
                         />
                     <TextView
                         android:id="@+id/clearphone_tv"
-                        android:layout_width="wrap_content"
-                        android:layout_height="wrap_content"
-                        android:text="X"
+                        android:layout_width="30dp"
+                        android:layout_height="30dp"
                         android:layout_alignParentRight="true"
-                        android:padding="20dp"
                         android:textSize="20sp"
-                        />
+                        android:drawableRight="@drawable/phone_del"
+                        android:layout_margin="10dp"/>
                 </RelativeLayout>
                 <View
                     android:layout_width="match_parent"
@@ -162,7 +161,10 @@
                         android:textSize="16sp"
                         android:maxLength="15"
                         android:inputType="textPassword"
-                        android:textColor="@color/black"/>
+                        android:textColor="@color/black"
+                        android:layout_alignParentTop="true"
+                        android:layout_alignParentLeft="true"
+                        android:layout_alignParentStart="true" />
                     <ImageView
                         android:id="@+id/eye_tv"
                         android:layout_width="20dp"
@@ -170,6 +172,7 @@
                         android:layout_alignParentRight="true"
                         android:textSize="20sp"
                         android:src="@drawable/icon_unshow"
+                        android:layout_margin="10dp"
                         />
                 </RelativeLayout>
 

+ 20 - 1
app_modular/appme/src/main/res/layout/wages_details_activity.xml

@@ -81,7 +81,6 @@
                 android:layout_width="match_parent"
                 android:layout_height="300dp"
                 android:gravity="center"
-                android:visibility="gone"
                 >
                 <ImageView
                     android:layout_width="100dp"
@@ -89,6 +88,26 @@
                     android:src="@drawable/wage_nodata"
                     />
             </LinearLayout>
+            <LinearLayout
+                android:id="@+id/error_ll"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical"
+                android:padding="10dp"
+                android:visibility="gone">
+                <TextView
+                    android:textColor="@color/red"
+                    android:text="报错信息"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content" />
+                <TextView
+                    android:id="@+id/error_tv"
+                    android:text="报错等我QQ信息"
+                    android:layout_width="match_parent"
+                    android:layout_height="wrap_content"
+                    android:padding="10dp"/>
+            </LinearLayout>
+
             <LinearLayout
                 android:layout_width="match_parent"
                 android:layout_height="wrap_content"

+ 2 - 1
app_modular/apputils/src/main/java/com/modular/apputils/utils/SwitchUtil.java

@@ -13,8 +13,9 @@ public class SwitchUtil {
     }
 
     public static boolean showShebeiguanli() {
-        return false;
+        return  BaseConfig.isDebug() && true;
     }
 
 
+
 }

+ 97 - 0
app_modular/apputils/src/main/java/com/modular/apputils/widget/EmptyRecyclerView.java

@@ -0,0 +1,97 @@
+package com.modular.apputils.widget;
+
+import android.content.Context;
+import android.support.v7.widget.RecyclerView;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+
+import com.modular.apputils.R;
+
+
+public class EmptyRecyclerView extends RecyclerView {
+
+    private View emptyView;
+    private static final String TAG = "EmptyRecyclerView";
+
+    final private AdapterDataObserver observer = new AdapterDataObserver() {
+        @Override
+        public void onChanged() {
+            checkIfEmpty();
+        }
+
+        @Override
+        public void onItemRangeInserted(int positionStart, int itemCount) {
+            Log.i(TAG, "onItemRangeInserted" + itemCount);
+            checkIfEmpty();
+        }
+
+        @Override
+        public void onItemRangeRemoved(int positionStart, int itemCount) {
+            checkIfEmpty();
+        }
+    };
+    private LayoutInflater mInflater;
+
+    public EmptyRecyclerView(Context context) {
+        super(context);
+        initEmptyView(context);
+    }
+
+    public EmptyRecyclerView(Context context, AttributeSet attrs) {
+        super(context, attrs);
+        initEmptyView(context);
+    }
+
+    public EmptyRecyclerView(Context context, AttributeSet attrs,
+                             int defStyle) {
+        super(context, attrs, defStyle);
+        initEmptyView(context);
+    }
+
+    private void initEmptyView(Context context) {
+        mInflater = LayoutInflater.from(context);
+        emptyView = mInflater.inflate(R.layout.common_empty_view, null);
+        post(new Runnable() {
+            @Override
+            public void run() {
+                ((ViewGroup) getRootView()).addView(emptyView);
+            }
+        });
+
+    }
+
+
+
+    private void checkIfEmpty() {
+        if (emptyView != null && getAdapter() != null) {
+            final boolean emptyViewVisible =
+                    getAdapter().getItemCount() == 0;
+            emptyView.setVisibility(emptyViewVisible ? VISIBLE : GONE);
+            setVisibility(emptyViewVisible ? GONE : VISIBLE);
+        }
+    }
+
+    @Override
+    public void setAdapter(Adapter adapter) {
+        final Adapter oldAdapter = getAdapter();
+        if (oldAdapter != null) {
+            oldAdapter.unregisterAdapterDataObserver(observer);
+        }
+        super.setAdapter(adapter);
+        if (adapter != null) {
+            adapter.registerAdapterDataObserver(observer);
+        }
+
+        checkIfEmpty();
+    }
+
+
+    //设置没有内容时,提示用户的空布局
+    public void setEmptyView(View emptyView) {
+        this.emptyView = emptyView;
+        checkIfEmpty();
+    }
+}

+ 140 - 0
app_modular/apputils/src/main/java/com/modular/apputils/widget/MenuVoiceSearchView.java

@@ -0,0 +1,140 @@
+package com.modular.apputils.widget;
+
+import android.content.Context;
+import android.text.Editable;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.util.AttributeSet;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.core.interfac.OnVoiceCompleteListener;
+import com.core.widget.ClearEditText;
+import com.core.xmpp.utils.audio.voicerecognition.JsonParser;
+import com.iflytek.cloud.RecognizerResult;
+import com.iflytek.cloud.SpeechConstant;
+import com.iflytek.cloud.SpeechError;
+import com.iflytek.cloud.ui.RecognizerDialog;
+import com.iflytek.cloud.ui.RecognizerDialogListener;
+import com.modular.apputils.R;
+
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+/**
+ * Created by Bitliker on 2017/5/15.
+ */
+
+public class MenuVoiceSearchView extends RelativeLayout {
+    private ClearEditText search_edit;
+    private OnVoiceCompleteListener mOnVoiceCompleteListener;
+
+    public MenuVoiceSearchView(Context context) {
+        this(context, null);
+    }
+
+    public MenuVoiceSearchView(Context context, AttributeSet attrs) {
+        this(context, attrs, 0);
+    }
+
+    public MenuVoiceSearchView(Context context, AttributeSet attrs, int defStyleAttr) {
+        super(context, attrs, defStyleAttr);
+        LayoutInflater.from(context).inflate(R.layout.menu_seach_include, this);
+        search_edit = (ClearEditText) findViewById(R.id.search_edit);
+        findViewById(R.id.voice_search_iv).setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                btnVoice();
+            }
+        });
+        search_edit.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                return false;
+            }
+        });
+    }
+
+
+
+
+    public void setHineText(String hine) {
+        search_edit.setHint(hine);
+    }
+
+    public void setText(String hine) {
+        search_edit.setText(hine);
+    }
+
+    public Editable getText() {
+        return search_edit.getText();
+    }
+
+    private void btnVoice() {
+        RecognizerDialog dialog = new RecognizerDialog(getContext(), null);
+        dialog.setParameter(SpeechConstant.LANGUAGE, "zh_cn");
+        dialog.setParameter(SpeechConstant.ACCENT, "mandarin");
+        dialog.setListener(new RecognizerDialogListener() {
+            @Override
+            public void onResult(RecognizerResult recognizerResult, boolean b) {
+                String text = JsonParser.parseIatResult(recognizerResult.getResultString());
+                search_edit.setText(search_edit.getText().toString() + getPlaintext(text));
+
+                if (mOnVoiceCompleteListener != null && b) {
+                    mOnVoiceCompleteListener.onVoiceComplete();
+                }
+            }
+
+            @Override
+            public void onError(SpeechError speechError) {
+
+            }
+        });
+        dialog.show();
+
+    }
+
+    public void setOnVoiceCompleteListener(OnVoiceCompleteListener onVoiceCompleteListener) {
+        mOnVoiceCompleteListener = onVoiceCompleteListener;
+    }
+
+    public void addTextChangedListener(TextWatcher watcher) {
+        search_edit.addTextChangedListener(watcher);
+    }
+
+    public void setOnEditorActionListener(TextView.OnEditorActionListener watcher) {
+        search_edit.setOnEditorActionListener(watcher);
+    }
+
+    public ClearEditText getSearch_edit() {
+        return search_edit;
+    }
+
+    public void setSearch_edit(ClearEditText search_edit) {
+        this.search_edit = search_edit;
+    }
+
+    public static String getPlaintext(String stringInfo) {
+        Pattern p = Pattern.compile("[.,,?!。\"\\?!:']");//增加对应的标点
+
+        Matcher m = p.matcher(stringInfo);
+
+        String first = m.replaceAll(""); //把英文标点符号替换成空,即去掉英文标点符号
+
+        p = Pattern.compile(" {2,}");//去除多余空格
+
+        m = p.matcher(first);
+
+        String second = m.replaceAll(" ");
+
+        String nulltext = "";
+        if (!TextUtils.isEmpty(second)) {
+            return second;
+        } else {
+            return nulltext;
+        }
+    }
+}

+ 29 - 0
app_modular/apputils/src/main/res/layout/common_empty_view.xml

@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_centerInParent="true"
+        android:orientation="vertical">
+
+        <android.support.v7.widget.AppCompatImageView
+            android:id="@+id/emptyImg"
+            android:layout_width="80dp"
+            android:layout_height="60dp"
+            android:src="@drawable/ic_empty" />
+
+        <android.support.v7.widget.AppCompatTextView
+            android:id="@+id/emptyTv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center_horizontal"
+            android:text="暂无记录"
+            android:textColor="@color/text_hine"
+            android:textSize="@dimen/text_main" />
+    </LinearLayout>
+
+</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">
 
-    <android.support.v7.widget.RecyclerView
+    <com.modular.apputils.widget.EmptyRecyclerView
         android:id="@+id/mRecyclerView"
         android:layout_width="match_parent"
         android:layout_height="match_parent" />

+ 35 - 0
app_modular/apputils/src/main/res/layout/menu_seach_include.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<merge xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="48dp"
+    android:background="@drawable/bg_bar">
+
+    <com.core.widget.ClearEditText
+        android:id="@+id/search_edit"
+        android:layout_width="match_parent"
+        android:layout_height="match_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:maxLines="1"
+        android:singleLine="true"
+    android:paddingRight="26dp"
+        android:lines="1"
+        android:textColor="@color/dark_grey"
+        android:textColorHint="@color/grey"
+        android:textSize="15sp" />
+
+    <ImageView
+        android:id="@+id/voice_search_iv"
+        android:layout_width="20dp"
+        android:layout_height="20dp"
+        android:layout_alignParentRight="true"
+        android:layout_alignRight="@+id/search_edit"
+        android:layout_centerVertical="true"
+        android:layout_marginRight="6dp"
+        android:background="@drawable/btn_yuyin_nor"
+        android:visibility="visible" />
+</merge>

+ 9 - 1
app_modular/appworks/src/main/AndroidManifest.xml

@@ -334,7 +334,15 @@
             android:label="@string/text_scan_device" />
         <activity
             android:name=".CRM.erp.activity.DeviceCycleCountActivity"
-            android:label="@string/title_device_manage" />
+            android:label="@string/title_device_manage" />        <activity
+            android:name=".CRM.erp.activity.DeviceCycleCountInfoActivity"
+            android:label="@string/text_cycle_count" />  <activity
+            android:name=".CRM.erp.activity.DeviceDataFormAddActivity"
+            android:label="@string/title_device_manage" />  <activity
+            android:name=".CRM.erp.activity.DeviceCycleCountDetailsActivity"
+            android:label="@string/title_device_manage" /> <activity
+            android:name=".CRM.erp.activity.DeviceCycleCountAddActivity"
+            android:label="@string/text_cycle_count_add" />
         <activity android:name=".OA.platform.activity.BusinessTravelActivity"></activity>
 
         <activity android:name=".activity.DeviceQueryActivity"

+ 146 - 53
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceCycleCountActivity.java

@@ -1,27 +1,48 @@
 package com.uas.appworks.CRM.erp.activity;
 
 import android.content.Intent;
+import android.graphics.drawable.Drawable;
 import android.os.Bundle;
 import android.support.v7.app.ActionBar;
 import android.support.v7.widget.DefaultItemAnimator;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.text.Editable;
+import android.view.Gravity;
+import android.view.KeyEvent;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.EditText;
 import android.widget.ImageView;
+import android.widget.ListView;
+import android.widget.PopupWindow;
+import android.widget.TextView;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
 import com.common.LogUtil;
 import com.common.config.BaseConfig;
+import com.common.data.JSONUtil;
+import com.common.data.ListUtils;
+import com.common.data.StringUtil;
+import com.common.system.DisplayUtil;
 import com.core.app.MyApplication;
 import com.core.base.BaseActivity;
+import com.core.model.SelectBean;
 import com.core.net.http.ViewUtil;
 import com.core.utils.CommonUtil;
 import com.core.utils.ToastUtil;
 import com.core.widget.ClearEditText;
+import com.core.widget.EmptyLayout;
 import com.core.widget.VoiceSearchView;
 import com.core.widget.listener.EditChangeListener;
+import com.core.widget.view.Activity.SelectActivity;
 import com.core.xmpp.utils.audio.voicerecognition.JsonParser;
+import com.handmark.pulltorefresh.library.PullToRefreshBase;
+import com.handmark.pulltorefresh.library.PullToRefreshListView;
 import com.iflytek.cloud.RecognizerResult;
 import com.iflytek.cloud.SpeechConstant;
 import com.iflytek.cloud.SpeechError;
@@ -31,13 +52,19 @@ import com.me.network.app.http.HttpClient;
 import com.me.network.app.http.Method;
 import com.me.network.app.http.rx.ResultListener;
 import com.me.network.app.http.rx.ResultSubscriber;
+import com.modular.apputils.widget.MenuVoiceSearchView;
 import com.modular.apputils.widget.RecycleViewDivider;
 import com.module.recyclerlibrary.ui.refresh.BaseRefreshLayout;
+import com.uas.appworks.CRM.erp.adapter.CycleCountAdapter;
+import com.uas.appworks.CRM.erp.model.CycleCount;
+import com.uas.appworks.CRM.erp.model.CycleCountAdd;
+import com.uas.appworks.CRM.erp.model.DeviceInfo;
+import com.uas.appworks.CRM.erp.model.TestStr;
 import com.uas.appworks.R;
 
+import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.Map;
+import java.util.List;
 
 /**
  * Created by Bitlike on 2017/11/22.
@@ -45,39 +72,38 @@ import java.util.Map;
 
 public class DeviceCycleCountActivity extends BaseActivity implements View.OnClickListener {
     private HttpClient httpClient = null;
-
-    private BaseRefreshLayout mRefreshLayout;
-    private RecyclerView contantRv;
-
-    private int mPageIndex;
-    private int mSchemeId;
-    private String mCaller;
+    private List<CycleCount> allCycleCount = new ArrayList<>();
+    private PullToRefreshListView mRefreshListView;
+    private MenuVoiceSearchView mVoiceSearchView;
+    private int pageIndex;
+    private EmptyLayout mEmptyLayout;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
-        setContentView(R.layout.common_refresh_recycler);
+        setContentView(R.layout.activity_device_cycle);
         initView();
         initData();
     }
 
     private void initView() {
         initActionbar();
-        mRefreshLayout = (BaseRefreshLayout) findViewById(R.id.mRefreshLayout);
-        contantRv = (RecyclerView) findViewById(R.id.mRecyclerView);
-        contantRv.setLayoutManager(new LinearLayoutManager(ct));
-        contantRv.setItemAnimator(new DefaultItemAnimator());
-        contantRv.addItemDecoration(new RecycleViewDivider(ct, LinearLayoutManager.VERTICAL));
-        mRefreshLayout.setEnabledPullUp(true);
-        mRefreshLayout.setOnRefreshListener(new BaseRefreshLayout.onRefreshListener() {
+        mRefreshListView = (PullToRefreshListView) findViewById(R.id.mRefreshListView);
+        mRefreshListView.setMode(PullToRefreshBase.Mode.BOTH);
+        mEmptyLayout = new EmptyLayout(this, mRefreshListView.getRefreshableView());
+        mEmptyLayout.setShowLoadingButton(false);
+        mEmptyLayout.setShowEmptyButton(false);
+        mEmptyLayout.setShowErrorButton(false);
+        mEmptyLayout.setEmptyMessage("没有符合条件的数据");
+        mRefreshListView.setOnRefreshListener(new PullToRefreshBase.OnRefreshListener2<ListView>() {
             @Override
-            public void onRefresh() {
-                loadData(mPageIndex = 1);
+            public void onPullDownToRefresh(PullToRefreshBase<ListView> refreshView) {
+                loadData(pageIndex = 1);
             }
 
             @Override
-            public void onLoadMore() {
-                loadData(++mPageIndex);
+            public void onPullUpToRefresh(PullToRefreshBase<ListView> refreshView) {
+                loadData(++pageIndex);
             }
         });
     }
@@ -86,17 +112,17 @@ public class DeviceCycleCountActivity extends BaseActivity implements View.OnCli
         View view = LayoutInflater.from(ct).inflate(R.layout.action_device_cycle_count, null);
         view.findViewById(R.id.addImg).setOnClickListener(this);
         view.findViewById(R.id.backImg).setOnClickListener(this);
-        VoiceSearchView mVoiceSearchView = view.findViewById(R.id.mVoiceSearchView);
-        mVoiceSearchView.addTextChangedListener(new EditChangeListener() {
+        mVoiceSearchView = view.findViewById(R.id.mVoiceSearchView);
+        mVoiceSearchView.getSearch_edit().setOnEditorActionListener(new TextView.OnEditorActionListener() {
             @Override
-            public void afterTextChanged(Editable s) {
-                try {
-                    changedText(s.toString());
-                } catch (Exception e) {
-                    e.printStackTrace();
-                }
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                loadData(pageIndex = 1);
+                return false;
             }
         });
+        ActionBar bar = this.getSupportActionBar();
+        bar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
+        bar.setCustomView(view);
     }
 
     @Override
@@ -105,26 +131,26 @@ public class DeviceCycleCountActivity extends BaseActivity implements View.OnCli
         if (id == R.id.backImg) {
             onBackPressed();
         } else if (R.id.addImg == id) {
-            showAddPop();
+            startActivityForResult(new Intent(ct, DeviceCycleCountAddActivity.class), 0x12);
+        }
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (0x12 == requestCode && 0x12 == resultCode) {
+            loadData(pageIndex = 1);
         }
     }
 
     private void initData() {
-        mPageIndex = 1;
         Intent intent = getIntent();
         if (intent == null) {
             ToastUtil.showToast(ct, R.string.data_exception);
             finish();
         } else {
-            this.mSchemeId = intent.getIntExtra("id", 0);
-            this.mCaller = intent.getStringExtra("caller");
-            if (BaseConfig.isDebug()) {
-                this.mSchemeId = 3285;
-                this.mCaller = "SalePrice!query";
-
-            }
             String sessionId = CommonUtil.getSharedPreferences(ct, "sessionId");
-            String emCode = CommonUtil.getSharedPreferences(ct, "sessionId");
+            String emCode = CommonUtil.getEmcode();
             httpClient = new HttpClient.Builder(CommonUtil.getAppBaseUrl(MyApplication.getInstance()))
                     .isDebug(true)
                     .add("sessionId", sessionId)
@@ -134,21 +160,26 @@ public class DeviceCycleCountActivity extends BaseActivity implements View.OnCli
                     .header("Cookie", "JSESSIONID=" + sessionId)
                     .header("sessionUser", emCode)
                     .build();
-            loadData(mPageIndex);
+            loadData(pageIndex = 1);
         }
     }
 
-    private void loadData(int mPageIndex) {
-        if (!mRefreshLayout.isRefreshing()) {
+    private void loadData(int pageIndex) {
+        if (!mRefreshListView.isRefreshing()) {
             progressDialog.show();
         }
+        String condition = null;
+        Editable editable = mVoiceSearchView.getText();
+        if (editable != null && !StringUtil.isEmpty(editable.toString())) {
+            String text = editable.toString();
+            condition = "db_code like '" + text + "' or db_inman like '" + text + "'  or db_devtype like '" + text + "' or db_centercode like '" + text + "'";
+        }
         httpClient.Api().send(new HttpClient.Builder()
-                .url("mobile/qry/schemeResult.action")
-                .add("caller", mCaller)
-                .add("id", mSchemeId)
-                .add("pageIndex", mPageIndex)
-                .add("pageSize", 30)
-                .add("condition", "1=1")
+                .url("mobile/common/list.action")
+                .add("condition", "db_class='周期盘点' and db_statuscode='COMMITED'" + (StringUtil.isEmpty(condition) ? "" : ("  and (" + condition + ")")))
+                .add("caller", "DeviceBatch!Stock")
+                .add("page", pageIndex)
+                .add("pageSize", 25)
                 .method(Method.GET)
                 .build(), new ResultSubscriber<>(new ResultListener<Object>() {
             @Override
@@ -160,22 +191,84 @@ public class DeviceCycleCountActivity extends BaseActivity implements View.OnCli
                         LogUtil.i("e=" + e.getMessage());
                     }
                 }
-                mRefreshLayout.stopRefresh();
+                mRefreshListView.onRefreshComplete();
                 progressDialog.dismiss();
             }
         }));
     }
 
-    private void changedText(String message) throws Exception {
-
-    }
 
     private void handleData(String message) throws Exception {
+        JSONObject object = JSON.parseObject(message);
+        JSONArray columns = JSONUtil.getJSONArray(object, "columns");
+        JSONArray listdata = JSONUtil.getJSONArray(object, "listdata");
+        List<CycleCount> moreListData = new ArrayList<>();
+        for (int i = 0; i < listdata.size(); i++) {
+            moreListData.add(handleFrom(columns, listdata.getJSONObject(i)));
+        }
+        if (pageIndex == 1) {
+            allCycleCount = moreListData;
+            if (ListUtils.isEmpty(moreListData)) {
+                mEmptyLayout.showEmpty();
+            }
+        } else {
+            allCycleCount.addAll(moreListData);
+        }
+        setAdapter(allCycleCount);
+    }
 
+    private CycleCount handleFrom(JSONArray columns, JSONObject data) throws Exception {
+        CycleCount cycleCount = new CycleCount();
+        for (int i = 0; i < columns.size(); i++) {
+            JSONObject item = columns.getJSONObject(i);
+            String field = JSONUtil.getText(item, "dataIndex", "field");
+            String caption = JSONUtil.getText(item, "caption");
+            int width = JSONUtil.getInt(item, "width");
+            String values = JSONUtil.getText(data, field);
+            CycleCount.Data o = new CycleCount.Data(caption, values);
+            if (caption.equals("ID")) {
+                cycleCount.setId(values);
+            }
+            if (width > 0) {
+                if (width < 100 && columns.size() > (i + 1) && JSONUtil.getInt(columns.getJSONObject(i + 1), "width") < 100) {
+                    //有两个
+                    JSONObject item2 = columns.getJSONObject(i + 1);
+                    String field2 = JSONUtil.getText(item2, "dataIndex", "field");
+                    String caption2 = JSONUtil.getText(item2, "caption");
+                    String values2 = JSONUtil.getText(data, field2);
+                    o.setCaption2(caption2);
+                    o.setValues2(values2);
+                    o.setHasTwo(true);
+                    if (caption.equals("ID")) {
+                        cycleCount.setId(values);
+                    }
+                    i++;
+                }
+                cycleCount.addData(o);
+            }
+        }
+        return cycleCount;
     }
 
-    private void showAddPop() {
 
+    private CycleCountAdapter mAdapter;
+
+    private void setAdapter(List<CycleCount> models) {
+        if (mAdapter == null) {
+            mAdapter = new CycleCountAdapter(ct, models);
+            mAdapter.setOnItemClickListener(new CycleCountAdapter.OnItemClickListener() {
+                @Override
+                public void click(CycleCount model) {
+                    startActivity(new Intent(ct, DeviceCycleCountInfoActivity.class)
+                            .putExtra("models", JSON.toJSONString(model.getDatas()))
+                            .putExtra("id", model.getId()));
+                }
+            });
+            mRefreshListView.setAdapter(mAdapter);
+        } else {
+            mAdapter.setModels(models);
+        }
     }
 
+
 }

+ 373 - 0
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceCycleCountAddActivity.java

@@ -0,0 +1,373 @@
+package com.uas.appworks.CRM.erp.activity;
+
+import android.content.Intent;
+import android.graphics.drawable.Drawable;
+import android.os.Bundle;
+import android.support.v7.app.ActionBar;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.text.Editable;
+import android.view.Gravity;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.AdapterView;
+import android.widget.EditText;
+import android.widget.ListView;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.common.LogUtil;
+import com.common.data.JSONUtil;
+import com.common.data.ListUtils;
+import com.common.data.StringUtil;
+import com.common.system.DisplayUtil;
+import com.core.app.MyApplication;
+import com.core.base.BaseActivity;
+import com.core.model.Approval;
+import com.core.model.SelectBean;
+import com.core.utils.CommonUtil;
+import com.core.utils.ToastUtil;
+import com.core.widget.VoiceSearchView;
+import com.core.widget.listener.EditChangeListener;
+import com.core.widget.view.Activity.SelectActivity;
+import com.handmark.pulltorefresh.library.PullToRefreshBase;
+import com.handmark.pulltorefresh.library.PullToRefreshListView;
+import com.me.network.app.http.HttpClient;
+import com.me.network.app.http.Method;
+import com.me.network.app.http.rx.ResultListener;
+import com.me.network.app.http.rx.ResultSubscriber;
+import com.modular.apputils.activity.SelectNetAcitivty;
+import com.uas.appworks.CRM.erp.adapter.CycleCountAdapter;
+import com.uas.appworks.CRM.erp.model.CycleCount;
+import com.uas.appworks.CRM.erp.model.CycleCountAdd;
+import com.uas.appworks.CRM.erp.model.TestStr;
+import com.uas.appworks.R;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Created by Bitlike on 2017/11/22.
+ */
+
+public class DeviceCycleCountAddActivity extends BaseActivity implements View.OnClickListener {
+    private HttpClient httpClient = null;
+    private RecyclerView popListView = null;
+    private PopAdapter popAdapter = null;
+    private List<CycleCountAdd> cycleCountAdds;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.pop_device_cyclecount);
+        initView();
+        initData();
+    }
+
+    private void initView() {
+        popListView = findViewById(R.id.mRecyclerView);
+        findViewById(R.id.cancelBtn).setOnClickListener(this);
+        findViewById(R.id.sureBtn).setOnClickListener(this);
+        findViewById(R.id.resetBtn).setOnClickListener(this);
+        popListView.setLayoutManager(new LinearLayoutManager(ct));
+    }
+
+
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+        if (R.id.cancelBtn == id) {
+            finish();
+        } else if (R.id.resetBtn == id) {
+            if (popAdapter != null) {
+                popAdapter.reset();
+            }
+        } else if (R.id.sureBtn == id) {
+            if (popAdapter != null) {
+                addCycle(popAdapter.getModels());
+            }
+        }
+    }
+
+    private void initData() {
+        Intent intent = getIntent();
+        if (intent == null) {
+            ToastUtil.showToast(ct, R.string.data_exception);
+            finish();
+        } else {
+            String sessionId = CommonUtil.getSharedPreferences(ct, "sessionId");
+            String emCode = CommonUtil.getEmcode();
+            httpClient = new HttpClient.Builder(CommonUtil.getAppBaseUrl(MyApplication.getInstance()))
+                    .isDebug(true)
+                    .add("sessionId", sessionId)
+                    .add("master", CommonUtil.getSharedPreferences(ct, "erp_master"))
+                    .add("sessionUser", emCode)
+                    .add("sessionId", sessionId)
+                    .header("Cookie", "JSESSIONID=" + sessionId)
+                    .header("sessionUser", emCode)
+                    .build();
+            loadPopData();
+        }
+    }
+
+
+    private void loadPopData() {
+        progressDialog.show();
+        httpClient.Api().send(new HttpClient.Builder()
+                .url("mobile/common/getFormPanel.action")
+                .add("caller", "DeviceBatch!Stock")
+                .method(Method.GET)
+                .build(), new ResultSubscriber<>(new ResultListener<Object>() {
+            @Override
+            public void onResponse(Object o) {
+                try {
+                    handlePopData(o.toString());
+                } catch (Exception e) {
+                    if (e != null) {
+                        LogUtil.i("e=" + e.getMessage());
+                    }
+                }
+                if (progressDialog != null) {
+                    progressDialog.dismiss();
+                }
+            }
+        }));
+    }
+
+    private boolean isSubmitl;
+
+    private void addCycle(List<CycleCountAdd> models) {
+        Map<String, Object> formStore = new HashMap<>();
+        for (CycleCountAdd e : models) {
+            if (!StringUtil.isEmpty(e.getValues())) {
+                formStore.put(e.getField(), e.getValues());
+            } else if (!e.isAllowblank()) {
+                ToastUtil.showToast(ct, e.getCaption() + "为必填项,请输入后提交");
+                return;
+            }
+        }
+        if (isSubmitl) return;
+        isSubmitl = true;
+        progressDialog.show();
+        httpClient.Api().send(new HttpClient.Builder()
+                .url("mobile/device/saveAndSubmitDeviceStock.action")
+                .add("caller", "DeviceBatch!Stock")
+                .add("formStore", JSONUtil.map2JSON(formStore))
+                .method(Method.POST)
+                .build(), new ResultSubscriber<>(new ResultListener<Object>() {
+            @Override
+            public void onResponse(Object o) {
+                try {
+                    if (progressDialog != null) {
+                        progressDialog.dismiss();
+                    }
+                    boolean success = JSONUtil.getBoolean(o.toString(), "success");
+                    if (success) {
+                        setResult(0x12);
+                        ToastUtil.showToast(ct, "添加成功");
+                        finish();
+                    }
+                    isSubmitl = false;
+
+                } catch (Exception e) {
+                    if (e != null) {
+                        LogUtil.i("e=" + e.getMessage());
+                    }
+                }
+            }
+        }));
+    }
+
+    private void handlePopData(String message) throws Exception {
+        cycleCountAdds = new ArrayList<>();
+        JSONObject data = JSONUtil.getJSONObject(message, "data");
+        JSONArray items = JSONUtil.getJSONArray(data, "formdetail");
+        for (int i = 0; i < items.size(); i++) {
+            cycleCountAdds.add(new CycleCountAdd(items.getJSONObject(i)));
+        }
+        popAdapter = new PopAdapter(cycleCountAdds);
+        popListView.setAdapter(popAdapter);
+    }
+
+
+    private class PopAdapter extends RecyclerView.Adapter<PopAdapter.ViewHodler> {
+        private List<CycleCountAdd> models;
+        private Drawable drawable;
+
+        public List<CycleCountAdd> getModels() {
+            return models;
+        }
+
+        public void updateValues(int selectPosition, String values) {
+            if (ListUtils.getSize(models) > selectPosition) {
+                models.get(selectPosition).setValues(values);
+                notifyItemChanged(selectPosition);
+            }
+        }
+
+        public void updateValues(String message) {
+            if (!StringUtil.isEmpty(message) && JSONUtil.validateJSONObject(message)) {
+                JSONObject object = JSON.parseObject(message);
+                if (models != null) {
+                    for (CycleCountAdd e : models) {
+                        for (Map.Entry<String, Object> map : object.entrySet()) {
+                            if (map.getKey().equals(e.getField()) && map.getValue() != null) {
+                                e.setValues(map.getValue().toString());
+                            }
+                        }
+                    }
+                    notifyDataSetChanged();
+                }
+            }
+        }
+
+        public PopAdapter(List<CycleCountAdd> models) {
+            this.models = models;
+            drawable = getResources().getDrawable(R.drawable.ic_menu_retract);
+        }
+
+        private class TextChangListener extends EditChangeListener {
+            ViewHodler hodler;
+            private int position;
+
+            public TextChangListener(ViewHodler hodler, int position) {
+                this.hodler = hodler;
+                this.position = position;
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                if (this.position >= 0) {
+                    if (this.hodler.valuesEd != null) {
+                        String valueEt = this.hodler.valuesEd.getText().toString();
+                        models.get(this.position).setValues(valueEt == null ? "" : valueEt);
+                    }
+                }
+            }
+        }
+
+        @Override
+        public ViewHodler onCreateViewHolder(ViewGroup parent, int viewType) {
+            return new ViewHodler(parent);
+        }
+
+        @Override
+        public void onBindViewHolder(ViewHodler holder, int position) {
+            CycleCountAdd model = models.get(position);
+            holder.captionTv.setText(model.getCaption());
+            holder.valuesEd.setText(model.getValues());
+            if (model.getType().equals("DBFIND") || model.getType().equals("C")) {
+                holder.valuesEd.setFocusableInTouchMode(false);
+                holder.valuesEd.setTag(R.id.tag_key, position);
+                holder.valuesEd.setTag(model);
+                holder.valuesEd.setOnClickListener(onClickListener);
+                holder.valuesEd.setCompoundDrawablesWithIntrinsicBounds(null, null, drawable, null);
+            } else {
+                holder.valuesEd.setFocusableInTouchMode(true);
+                holder.valuesEd.setCompoundDrawablesWithIntrinsicBounds(null, null, null, null);
+            }
+            holder.valuesEd.addTextChangedListener(new TextChangListener(holder, position));
+        }
+
+        @Override
+        public int getItemCount() {
+            return models == null ? 0 : models.size();
+        }
+
+        public void reset() {
+            if (models != null) {
+                for (CycleCountAdd e : models) {
+                    e.setValues("");
+                }
+            }
+            notifyDataSetChanged();
+        }
+
+        class ViewHodler extends RecyclerView.ViewHolder {
+            TextView captionTv;
+            EditText valuesEd;
+
+            public ViewHodler(ViewGroup viewGroup) {
+                this(LayoutInflater.from(ct).inflate(R.layout.item_pop_device_cyclecount, viewGroup, false));
+            }
+
+            public ViewHodler(View itemView) {
+                super(itemView);
+                captionTv = itemView.findViewById(R.id.captionTv);
+                valuesEd = itemView.findViewById(R.id.valuesEd);
+            }
+        }
+
+        private View.OnClickListener onClickListener = new View.OnClickListener() {
+            @Override
+            public void onClick(View view) {
+                try {
+                    if (view.getId() == R.id.valuesEd) {
+                        CycleCountAdd model = (CycleCountAdd) view.getTag();
+                        selectPosition = (int) view.getTag(R.id.tag_key);
+                        Intent intent = new Intent(ct, SelectActivity.class);
+                        intent.putExtra("title", model.getCaption());
+                        if (model.getType().equals("C")) {
+                            ArrayList<SelectBean> formBeaans = new ArrayList<>();
+                            for (Approval.Data e : model.getDatas()) {
+                                formBeaans.add(new SelectBean(e.display));
+                            }
+                            intent.putExtra("type", 2);
+                            intent.putParcelableArrayListExtra("data", formBeaans);
+                            startActivityForResult(intent, 0x21);
+                        } else {
+                            startActivityForResult(new Intent(ct, SelectNetAcitivty.class)
+                                            .putExtra("fieldKey", model.getField())
+                                            .putExtra("caller", "DeviceBatch!Stock")
+                                            .putExtra("isForm", true)
+                                    , 90);
+//                            HashMap param = new HashMap<>();
+//                            param.put("which", model.getWhich());
+//                            param.put("caller", "DeviceBatch!Stock");
+//                            param.put("field", model.getField());
+//                            param.put("pageSize", 1000);
+//                            Bundle bundle = new Bundle();
+//                            bundle.putSerializable("param", param);
+//                            intent.putExtra("type", 1);
+//                            intent.putExtras(bundle);
+//                            intent.putExtra("key", "datas");
+//                            intent.putExtra("showKey", model.getField());
+//                            intent.putExtra("action", "mobile/common/getDbfind.action");
+                        }
+
+                    }
+                } catch (Exception e) {
+
+                }
+            }
+        };
+    }
+
+    private int selectPosition;
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        LogUtil.i("selectPosition=" + selectPosition);
+        if (data != null) {
+            if (0x21 == requestCode && popAdapter != null) {
+                SelectBean b = data.getParcelableExtra("data");
+                LogUtil.d(JSON.toJSONString(b));
+                if (b == null ) return;
+                popAdapter.updateValues(selectPosition, b.getName());
+            } else if (90 == requestCode) {
+                String json = data.getStringExtra("data");
+                LogUtil.i("json=" + json);
+                popAdapter.updateValues(json);
+            }
+        }
+    }
+}

+ 177 - 0
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceCycleCountDetailsActivity.java

@@ -0,0 +1,177 @@
+package com.uas.appworks.CRM.erp.activity;
+
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.ListView;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.common.LogUtil;
+import com.common.data.JSONUtil;
+import com.common.data.ListUtils;
+import com.core.app.MyApplication;
+import com.core.base.BaseActivity;
+import com.core.utils.CommonUtil;
+import com.core.widget.EmptyLayout;
+import com.me.network.app.http.HttpClient;
+import com.me.network.app.http.Method;
+import com.me.network.app.http.rx.ResultListener;
+import com.me.network.app.http.rx.ResultSubscriber;
+import com.uas.appworks.CRM.erp.adapter.CycleCountAdapter;
+import com.uas.appworks.CRM.erp.model.CycleCount;
+import com.uas.appworks.CRM.erp.model.TestStr;
+import com.uas.appworks.R;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Bitlike on 2017/12/19.
+ */
+
+public class DeviceCycleCountDetailsActivity extends BaseActivity {
+    private HttpClient httpClient = null;
+    private ListView mListView;
+    private boolean isAct;
+    private EmptyLayout mEmptyLayout;
+
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_device_cycle_details);
+        initView();
+        initData();
+    }
+
+    private String id;
+
+    private void initData() {
+        String sessionId = CommonUtil.getSharedPreferences(ct, "sessionId");
+        String emCode = CommonUtil.getEmcode();
+        httpClient = new HttpClient.Builder(CommonUtil.getAppBaseUrl(MyApplication.getInstance()))
+                .isDebug(true)
+                .add("sessionId", sessionId)
+                .add("master", CommonUtil.getSharedPreferences(ct, "erp_master"))
+                .add("sessionUser", emCode)
+                .add("sessionId", sessionId)
+                .header("Cookie", "JSESSIONID=" + sessionId)
+                .header("sessionUser", emCode)
+                .build();
+        Intent intent = getIntent();
+        if (intent != null) {
+            isAct = intent.getBooleanExtra("isAct", false);
+            id = intent.getStringExtra("id");
+            String title = isAct ? "已盘点" : "未盘点";
+            if (title != null) {
+                getSupportActionBar().setTitle(title);
+            }
+            String modelJSON = intent.getStringExtra("models");
+            List<CycleCount.Data> models = JSON.parseArray(modelJSON, CycleCount.Data.class);
+            mListView.setAdapter(new CycleCountAdapter.DataAdapter(ct, models));
+        }
+        loadData();
+    }
+
+    private void initView() {
+        mListView = findViewById(R.id.mListView);
+        mEmptyLayout = new EmptyLayout(this, mListView);
+        mEmptyLayout.setShowLoadingButton(false);
+        mEmptyLayout.setShowEmptyButton(false);
+        mEmptyLayout.setShowErrorButton(false);
+    }
+
+    private void loadData() {
+        progressDialog.show();
+        String condition = (isAct ? "nvl(dc_actionresult,' ')<>' '" : "nvl(dc_actionresult,' ')=' '") + "  and dc_dbid='" + id + "'";
+        httpClient.Api().send(new HttpClient.Builder()
+                .url("mobile/common/getGridPanel.action")
+                .add("caller", "DeviceBatch!Stock")
+                .add("condition", condition)
+                .method(Method.GET)
+                .build(), new ResultSubscriber<>(new ResultListener<Object>() {
+            @Override
+            public void onResponse(Object o) {
+                try {
+                    handleData(o.toString());
+                } catch (Exception e) {
+                    if (e != null) {
+                        LogUtil.i("e=" + e.getMessage());
+                    }
+                }
+                if (progressDialog != null) {
+                    progressDialog.dismiss();
+                }
+            }
+        }));
+    }
+
+
+    private void handleData(String message) throws Exception {
+        JSONObject object = JSON.parseObject(message);
+        JSONArray columns = JSONUtil.getJSONArray(object, "gridItem");
+        JSONArray listdata = JSONUtil.getJSONArray(object, "gridData");
+        List<CycleCount> moreListData = new ArrayList<>();
+        for (int i = 0; i < listdata.size(); i++) {
+            moreListData.add(handleFrom(columns, listdata.getJSONObject(i)));
+        }
+        setAdapter(moreListData);
+    }
+
+    private CycleCount handleFrom(JSONArray columns, JSONObject data) throws Exception {
+        CycleCount cycleCount = new CycleCount();
+        for (int i = 0; i < columns.size(); i++) {
+            JSONObject item = columns.getJSONObject(i);
+            String field = JSONUtil.getText(item, "dataIndex", "field", "dg_field");
+            String caption = JSONUtil.getText(item, "caption", "dg_caption");
+            int width = JSONUtil.getInt(item, "width", "dg_appwidth");
+            String values = JSONUtil.getText(data, field.toUpperCase());
+            CycleCount.Data o = new CycleCount.Data(caption, values);
+            if (caption.equals("ID")) {
+                cycleCount.setId(values);
+            }
+//            if (width < 100 && columns.size() > (i + 1) && JSONUtil.getInt(columns.getJSONObject(i + 1), "width") < 100) {
+//                //有两个
+//                JSONObject item2 = columns.getJSONObject(i + 1);
+//                String field2 = JSONUtil.getText(item2, "dataIndex", "field");
+//                String caption2 = JSONUtil.getText(item2, "caption");
+//                String values2 = JSONUtil.getText(data, field2);
+//                o.setCaption2(caption2);
+//                o.setValues2(values2);
+//                o.setHasTwo(true);
+//                if (caption.equals("ID")) {
+//                    cycleCount.setId(values);
+//                }
+//                i++;
+//            }
+            if (width > 0) {
+                cycleCount.addData(o);
+            }
+        }
+        return cycleCount;
+    }
+
+    private CycleCountAdapter mAdapter;
+
+    private void setAdapter(List<CycleCount> models) {
+        if (mAdapter == null) {
+            mAdapter = new CycleCountAdapter(ct, models);
+            mAdapter.setNeedShowAll(true);
+            mAdapter.setOnItemClickListener(new CycleCountAdapter.OnItemClickListener() {
+                @Override
+                public void click(CycleCount model) {
+                    LogUtil.i("model.getDatas()=" + JSON.toJSONString(model.getDatas()));
+                }
+            });
+            mListView.setAdapter(mAdapter);
+        } else {
+            mAdapter.setModels(models);
+        }
+        if (ListUtils.isEmpty(models)){
+            mEmptyLayout.showEmpty();
+        }
+    }
+}

+ 304 - 0
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceCycleCountInfoActivity.java

@@ -0,0 +1,304 @@
+package com.uas.appworks.CRM.erp.activity;
+
+import android.Manifest;
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.text.Html;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.ListView;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.common.LogUtil;
+import com.common.data.JSONUtil;
+import com.common.data.StringUtil;
+import com.common.system.DisplayUtil;
+import com.core.app.MyApplication;
+import com.core.base.BaseActivity;
+import com.core.utils.CommonUtil;
+import com.core.utils.ToastUtil;
+import com.me.network.app.http.HttpClient;
+import com.me.network.app.http.Method;
+import com.me.network.app.http.rx.ResultListener;
+import com.me.network.app.http.rx.ResultSubscriber;
+import com.uas.appworks.CRM.erp.adapter.CycleCountAdapter;
+import com.uas.appworks.CRM.erp.model.CycleCount;
+import com.uas.appworks.CRM.erp.model.TestStr;
+import com.uas.appworks.R;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Bitlike on 2017/12/19.
+ */
+
+public class DeviceCycleCountInfoActivity extends BaseActivity implements View.OnClickListener {
+    private HttpClient httpClient = null;
+    private String id;
+    private TextView actionqtyTv;
+    private TextView unactionqtyTv;
+    private TextView codeTv;
+    private ListView mListView;
+    private TextView centerTv;
+    private TextView lineTv;
+    private TextView kindTv;
+
+    @Override
+    protected void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        setContentView(R.layout.activity_device_cycle_info);
+        initView();
+        initData();
+    }
+
+    private void initData() {
+        String sessionId = CommonUtil.getSharedPreferences(ct, "sessionId");
+        String emCode = CommonUtil.getEmcode();
+        httpClient = new HttpClient.Builder(CommonUtil.getAppBaseUrl(MyApplication.getInstance()))
+                .isDebug(true)
+                .add("sessionId", sessionId)
+                .add("master", CommonUtil.getSharedPreferences(ct, "erp_master"))
+                .add("sessionUser", emCode)
+                .add("sessionId", sessionId)
+                .header("Cookie", "JSESSIONID=" + sessionId)
+                .header("sessionUser", emCode)
+                .build();
+        Intent intent = getIntent();
+        if (intent != null) {
+            id = intent.getStringExtra("id");
+            try {
+                initJSONData(intent.getStringExtra("models"));
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        loadData();
+    }
+
+    private void initJSONData(String message) throws Exception {
+        JSONArray array = JSON.parseArray(message);
+        JSONObject object;
+        CycleCount.Data data;
+        List<CycleCount.Data> models = new ArrayList<>();
+        for (int i = 0; i < array.size(); i++) {
+            object = array.getJSONObject(i);
+            String caption = JSONUtil.getText(object, "caption");
+            boolean hasTwo = JSONUtil.getBoolean(object, "hasTwo");
+            String values = JSONUtil.getText(object, "values");
+            String caption2 = JSONUtil.getText(object, "caption2");
+            String values2 = JSONUtil.getText(object, "values2");
+            data = new CycleCount.Data(caption, values);
+            data.setHasTwo(hasTwo);
+            data.setCaption2(caption2);
+            data.setValues2(values2);
+            models.add(data);
+        }
+        mListView.setAdapter(new CycleCountAdapter.DataAdapter(ct, models));
+    }
+
+    private void initView() {
+        codeTv = findViewById(R.id.codeTv);
+        centerTv = findViewById(R.id.centerTv);
+        lineTv = findViewById(R.id.lineTv);
+        kindTv = findViewById(R.id.kindTv);
+        mListView = findViewById(R.id.mListView);
+        actionqtyTv = findViewById(R.id.actionqtyTv);
+        unactionqtyTv = findViewById(R.id.unactionqtyTv);
+        findViewById(R.id.actionqtyTv).setOnClickListener(this);
+        findViewById(R.id.unactionqtyTv).setOnClickListener(this);
+        findViewById(R.id.cycleBtn).setOnClickListener(this);
+    }
+
+
+    private void loadData() {
+        progressDialog.show();
+        httpClient.Api().send(new HttpClient.Builder()
+                .url("mobile/device/getCheckQty.action")
+                .add("caller", "DeviceBatch!Stock")
+                .add("id", id)
+                .method(Method.GET)
+                .build(), new ResultSubscriber<>(new ResultListener<Object>() {
+            @Override
+            public void onResponse(Object o) {
+                try {
+                    handleData(o.toString());
+                } catch (Exception e) {
+                    if (e != null) {
+                        LogUtil.i("e=" + e.getMessage());
+                    }
+                }
+                if (progressDialog != null) {
+                    progressDialog.dismiss();
+                }
+            }
+        }));
+    }
+
+    private void submitCycle(String de_code) {
+        progressDialog.show();
+        httpClient.Api().send(new HttpClient.Builder()
+                .url("mobile/device/deviceStock.action")
+                .add("caller", "DeviceBatch!Stock")
+                .add("id", id)
+                .add("de_code", de_code)
+                .method(Method.POST)
+                .build(), new ResultSubscriber<>(new ResultListener<Object>() {
+            @Override
+            public void onResponse(Object o) {
+                if (progressDialog != null) {
+                    progressDialog.dismiss();
+                }
+                try {
+                    handleSubmitCycle(o.toString());
+                } catch (Exception e) {
+                    if (e != null) {
+                        LogUtil.i("e=" + e.getMessage());
+                    }
+                }
+
+            }
+        }));
+    }
+
+
+    private void handleData(String message) throws Exception {
+        JSONObject object = JSONUtil.getJSONObject(message, "data");
+        String code = JSONUtil.getText(object, "DB_CODE");
+        String centercode = JSONUtil.getText(object, "DB_CENTERCODE");
+        String centername = JSONUtil.getText(object, "DB_CENTERNAME");
+        String linecode = JSONUtil.getText(object, "DB_LINECODE");
+        String devkind = JSONUtil.getText(object, "DB_DEVTYPE");
+        String actionqty = JSONUtil.getText(object, "DB_ACTIONQTY");
+        String unactionqty = JSONUtil.getText(object, "DB_UNACTIONQTY");
+        codeTv.setText(code);
+        centerTv.setText(centername);
+        lineTv.setText(linecode);
+        kindTv.setText(devkind);
+        actionqtyTv.setText(Html.fromHtml("<u>" + actionqty + "</u>"));
+        unactionqtyTv.setText(Html.fromHtml("<u>" + unactionqty + "</u>"));
+    }
+
+    private void handleSubmitCycle(String message) throws Exception {
+        boolean success = JSONUtil.getBoolean(message, "success");
+        if (success) {
+            JSONObject object = JSONUtil.getJSONObject(message, "data");
+            String popCode = JSONUtil.getText(object, "DE_CODE");
+            String popName = JSONUtil.getText(object, "DE_NAME");
+            String popGui = JSONUtil.getText(object, "DE_SPEC");
+            String popUnActNum = String.valueOf(JSONUtil.getInt(object, "DB_UNACTIONQTY"));
+            showMuenPop(popCode, popName, popGui, popUnActNum);
+        } else {
+            String exceptionInfo = JSONUtil.getText(message, "exceptionInfo");
+            if (!StringUtil.isEmpty(exceptionInfo)) {
+                ToastUtil.showToast(ct, exceptionInfo);
+            }
+        }
+    }
+
+    private PopupWindow mPopupWindow;
+    private TextView popCodeTv;
+    private TextView popNameTv;
+    private TextView popGuiTv;
+    private TextView popUnActNumTv;
+
+    private void showMuenPop(String popCode, String popName, String popGui, String popUnActNum) {
+        View view = LayoutInflater.from(ct).inflate(R.layout.pop_submit_cycle, null);
+        if (mPopupWindow == null) {
+            mPopupWindow = new PopupWindow(ct);
+            mPopupWindow.setContentView(view);
+            mPopupWindow.setBackgroundDrawable(ct.getResources().getDrawable(R.color.white));
+            mPopupWindow.setTouchable(true);
+            DisplayUtil.backgroundAlpha(ct, 0.4f);
+            mPopupWindow.setOutsideTouchable(false);
+            mPopupWindow.setFocusable(true);
+            mPopupWindow.setWidth(DisplayUtil.dip2px(ct, 300));
+            mPopupWindow.setHeight(DisplayUtil.dip2px(ct, 250));
+            mPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+                @Override
+                public void onDismiss() {
+                    DisplayUtil.backgroundAlpha(ct, 1.0f);
+                }
+            });
+            popCodeTv = view.findViewById(R.id.popCodeTv);
+            popNameTv = view.findViewById(R.id.popNameTv);
+            popGuiTv = view.findViewById(R.id.popGuiTv);
+            popUnActNumTv = view.findViewById(R.id.popUnActNumTv);
+            view.findViewById(R.id.nextBtn).setOnClickListener(this);
+            view.findViewById(R.id.backBtn).setOnClickListener(this);
+        }
+        if (popCodeTv != null) {
+            popCodeTv.setText(popCode);
+        }
+        if (popNameTv != null) {
+            popNameTv.setText(popName);
+        }
+        if (popGuiTv != null) {
+            popGuiTv.setText(popGui);
+        }
+        if (popUnActNumTv != null) {
+            popUnActNumTv.setText(popUnActNum);
+        }
+        DisplayUtil.backgroundAlpha(ct, 0.4f);
+        if (!mPopupWindow.isShowing()) {
+            mPopupWindow.showAtLocation(view, Gravity.CENTER, 0, 0);
+        }
+    }
+
+
+    @Override
+    public void onClick(View v) {
+        int id = v.getId();
+        if (id == R.id.actionqtyTv) {
+            startActivity(new Intent(ct, DeviceCycleCountDetailsActivity.class).putExtra("isAct", true)
+                    .putExtra("id", this.id));
+        } else if (id == R.id.unactionqtyTv) {
+            startActivity(new Intent(ct, DeviceCycleCountDetailsActivity.class).putExtra("isAct", false)
+                    .putExtra("id", this.id));
+        } else if (id == R.id.cycleBtn || R.id.nextBtn == id) {
+            requestPermission(Manifest.permission.CAMERA, new Runnable() {
+                @Override
+                public void run() {
+                    startActivityForResult(new Intent(ct, CaptureActivity.class), 0x21);
+                }
+            }, new Runnable() {
+                @Override
+                public void run() {
+                    ToastUtil.showToast(ct, R.string.not_camera_permission);
+                }
+            });
+            if (mPopupWindow != null && mPopupWindow.isShowing()) {
+                mPopupWindow.dismiss();
+            }
+        } else if (R.id.backBtn == id) {
+            if (mPopupWindow != null && mPopupWindow.isShowing()) {
+                mPopupWindow.dismiss();
+            }
+        }
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (requestCode == 0x21 && resultCode == Activity.RESULT_OK && data != null) {
+            Bundle bundle = data.getExtras();
+            if (bundle != null) {
+                if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_SUCCESS) {
+                    String result = bundle.getString(CodeUtils.RESULT_STRING);
+                    //TODO 测试数据
+//                    result = "ASDF01098";
+                    submitCycle(result);
+                }
+            }
+        }
+    }
+}

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 125 - 0
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceDataFormAddActivity.java


+ 81 - 9
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceManageActivity.java

@@ -1,15 +1,25 @@
 package com.uas.appworks.CRM.erp.activity;
 
+import android.Manifest;
+import android.app.Activity;
 import android.content.Intent;
 import android.os.Bundle;
 import android.support.v7.widget.GridLayoutManager;
 import android.support.v7.widget.RecyclerView;
+import android.util.Log;
 
+import com.afollestad.materialdialogs.MaterialDialog;
 import com.common.data.StringUtil;
+import com.core.app.Constants;
+import com.core.app.MyApplication;
 import com.core.base.BaseActivity;
+import com.core.utils.ToastUtil;
 import com.uas.appworks.CRM.erp.adapter.DeviceManageAdapter;
 import com.uas.appworks.CRM.erp.model.DeviceManage;
 import com.uas.appworks.R;
+import com.uas.appworks.activity.DeviceQueryActivity;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
 
 import java.util.ArrayList;
 import java.util.List;
@@ -30,14 +40,15 @@ public class DeviceManageActivity extends BaseActivity {
         contantRv.setLayoutManager(new GridLayoutManager(ct, 4));
         List<DeviceManage> models = new ArrayList<>();
         //扫一扫
-        models.add(new DeviceManage(1, R.drawable.icon_scan_device, StringUtil.getMessage(R.string.text_scan_device)).setCazz(ScanDetailActivity.class));
+        models.add(new DeviceManage(1, R.drawable.icon_scan_device, StringUtil.getMessage(R.string.text_scan_device)).setCazz(CaptureActivity.class).setRequest(0x21));
         //设备查询
-        models.add(new DeviceManage(2, R.drawable.icon_device_query, StringUtil.getMessage(R.string.text_device_query)));
+        models.add(new DeviceManage(2, R.drawable.icon_device_query, StringUtil.getMessage(R.string.text_device_query)).setCazz(DeviceQueryActivity.class).addString(Constants.FLAG.DEVICE_CALLER, "Device"));
         //通用配置表单
-        models.add(new DeviceManage(3, R.drawable.icon_application_use, StringUtil.getMessage(R.string.text_application_use)));
-        models.add(new DeviceManage(4, R.drawable.icon_scrap_application, StringUtil.getMessage(R.string.text_scrap_application)));
-        models.add(new DeviceManage(5, R.drawable.icon_maintenance, StringUtil.getMessage(R.string.text_maintenance)));
-        models.add(new DeviceManage(6, R.drawable.icon_fault_inspection, StringUtil.getMessage(R.string.text_fault_inspection)));
+
+        models.add(new DeviceManage(3, R.drawable.icon_application_use, StringUtil.getMessage(R.string.text_application_use)).setCazz(DeviceDataFormAddActivity.class).addString("caller", "DeviceChange!Use"));
+        models.add(new DeviceManage(4, R.drawable.icon_scrap_application, StringUtil.getMessage(R.string.text_scrap_application)).setCazz(DeviceDataFormAddActivity.class).addString("caller", "DeviceChange!Scrap"));
+        models.add(new DeviceManage(5, R.drawable.icon_maintenance, StringUtil.getMessage(R.string.text_maintenance)).setCazz(DeviceDataFormAddActivity.class).addString("caller", "DeviceChange!Maintain"));
+        models.add(new DeviceManage(6, R.drawable.icon_fault_inspection, StringUtil.getMessage(R.string.text_fault_inspection)).setCazz(DeviceDataFormAddActivity.class).addString("caller", "DeviceChange!Inspect"));
         //周期盘点
         models.add(new DeviceManage(7, R.drawable.icon_cycle_count, StringUtil.getMessage(R.string.text_cycle_count)).setCazz(DeviceCycleCountActivity.class));
         DeviceManageAdapter adapter = new DeviceManageAdapter(this, models);
@@ -54,15 +65,76 @@ public class DeviceManageActivity extends BaseActivity {
         });
     }
 
-    private void clickDevice(DeviceManage manage) throws Exception {
+    private void clickDevice(final DeviceManage manage) throws Exception {
         if (manage != null) {
             Class cazz = manage.getCazz();
-            Intent intent = new Intent(ct, cazz);
+            final Intent intent = new Intent(ct, cazz);
+            intent.putExtra("title", manage.getName());
             Bundle bundle = manage.getBundle();
             if (bundle != null) {
                 intent.putExtra("data", bundle);
+                if (bundle.keySet() != null) {
+                    for (String e : bundle.keySet())
+                        intent.putExtra(e, bundle.getString(e));
+                }
+            }
+            if (manage.getRequest() > 0) {
+                requestPermission(Manifest.permission.CAMERA, new Runnable() {
+                    @Override
+                    public void run() {
+                        startActivityForResult(intent, manage.getRequest());
+                    }
+                }, new Runnable() {
+                    @Override
+                    public void run() {
+                        ToastUtil.showToast(ct, R.string.not_camera_permission);
+                    }
+                });
+            } else {
+                startActivity(intent);
+            }
+        }
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+        if (data != null) {
+            if (requestCode == 0x21 && 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);
+                        ToastUtil.showToast(ct, result);
+                        startActivityForResult(new Intent(ct, ScanDetailActivity.class).putExtra("decode", result), 0x22);
+                    }
+                }
+            } else if (requestCode == 0x22) {
+                showDialog(data.getStringExtra("data"));
+
             }
-            startActivity(intent);
         }
     }
+
+    private void showDialog(String message) {
+        if (StringUtil.isEmpty(message)) return;
+        new MaterialDialog.Builder(ct)
+                .title(R.string.app_dialog_title)
+                .content(message)
+                .positiveText(MyApplication.getInstance().getString(R.string.app_dialog_ok))
+                .autoDismiss(false)
+                .callback(new MaterialDialog.ButtonCallback() {
+                    @Override
+                    public void onPositive(MaterialDialog dialog) {
+                        dialog.dismiss();
+
+                    }
+
+                    @Override
+                    public void onNegative(MaterialDialog dialog) {
+                        dialog.dismiss();
+                    }
+                }).show();
+    }
 }

+ 281 - 16
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/ScanDetailActivity.java

@@ -8,36 +8,109 @@ import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.ViewGroup;
 import android.widget.PopupWindow;
 import android.widget.RadioButton;
 import android.widget.RadioGroup;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
 
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.common.LogUtil;
+import com.common.data.JSONUtil;
+import com.common.data.ListUtils;
+import com.common.data.StringUtil;
 import com.common.system.DisplayUtil;
+import com.core.app.MyApplication;
 import com.core.base.BaseActivity;
+import com.core.net.utils.NetUtils;
+import com.core.utils.CommonUtil;
+import com.core.utils.ToastUtil;
+import com.me.network.app.http.HttpClient;
+import com.me.network.app.http.Method;
+import com.me.network.app.http.rx.ResultListener;
+import com.me.network.app.http.rx.ResultSubscriber;
 import com.modular.apputils.widget.RecycleViewDivider;
+import com.module.recyclerlibrary.ui.refresh.BaseRefreshLayout;
+import com.uas.appworks.CRM.erp.model.DeviceInfo;
 import com.uas.appworks.R;
 
+import java.util.ArrayList;
+import java.util.List;
+
+
 /**
  * Created by Bitlike on 2017/11/22.
  */
 
 public class ScanDetailActivity extends BaseActivity implements View.OnClickListener {
-
+    private HttpClient httpClient = null;
     private RecyclerView mRecyclerView;
+    private BaseRefreshLayout mRefreshLayout;
+
+    private String decode;
+    private String id;
+    private DeviceInfoAdapter mAdapter;
+    private List<DeviceInfo> baseInfoList;
+    private List<DeviceInfo> moreInfoList;
+    private List<DeviceInfo> historyInfoList;
+
+    private int selectItem;
 
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         setContentView(R.layout.common_refresh_recycler);
         initView();
+        initData();
     }
 
+    private void initData() {
+        Intent intent = getIntent();
+        if (intent != null) {
+            decode = intent.getStringExtra("decode");
+            LogUtil.i("decode=" + decode);
+        }
+        baseInfoList = new ArrayList<>();
+        moreInfoList = new ArrayList<>();
+        historyInfoList = new ArrayList<>();
+        String sessionId = CommonUtil.getSharedPreferences(ct, "sessionId");
+        String emCode = CommonUtil.getSharedPreferences(ct, "sessionId");
+        httpClient = new HttpClient.Builder(CommonUtil.getAppBaseUrl(MyApplication.getInstance()))
+                .isDebug(true)
+                .add("sessionId", sessionId)
+                .add("master", CommonUtil.getSharedPreferences(ct, "erp_master"))
+                .add("sessionUser", emCode)
+                .add("sessionId", sessionId)
+                .header("Cookie", "JSESSIONID=" + sessionId)
+                .header("sessionUser", emCode)
+                .build();
+        selectItem = 1;
+        loadData();
+    }
+
+
     private void initView() {
         mRecyclerView = (RecyclerView) findViewById(R.id.mRecyclerView);
+        mRefreshLayout = (BaseRefreshLayout) findViewById(R.id.mRefreshLayout);
         mRecyclerView.setLayoutManager(new LinearLayoutManager(ct));
         mRecyclerView.setItemAnimator(new DefaultItemAnimator());
         mRecyclerView.addItemDecoration(new RecycleViewDivider(ct, LinearLayoutManager.VERTICAL));
         initActionBar();
+        mRefreshLayout.setEnabledPullUp(false);
+        mRefreshLayout.setOnRefreshListener(new BaseRefreshLayout.onRefreshListener() {
+            @Override
+            public void onRefresh() {
+                loadData();
+            }
+
+            @Override
+            public void onLoadMore() {
+
+            }
+        });
     }
 
     private void initActionBar() {
@@ -47,20 +120,17 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
         bar.setCustomView(view);
         view.findViewById(R.id.backImg).setOnClickListener(this);
         view.findViewById(R.id.doneTv).setOnClickListener(this);
-
         RadioGroup selectRg = view.findViewById(R.id.selectRg);
 
         selectRg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
             @Override
             public void onCheckedChanged(RadioGroup group, int checkedId) {
                 if (checkedId == R.id.baseInfoRb) {
-                    ToastMessage("选择基础信息");
+                    setData2Adapter(1);
                 } else if (checkedId == R.id.moreInfoRb) {
-                    ToastMessage("选择详细信息");
-
+                    setData2Adapter(2);
                 } else if (checkedId == R.id.historyRb) {
-                    ToastMessage("选择设备履历");
-
+                    setData2Adapter(3);
                 }
             }
         });
@@ -75,25 +145,25 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
             View view = LayoutInflater.from(ct).inflate(R.layout.menu_device_scan, null);
             menuPop = new PopupWindow(ct);
             menuPop.setContentView(view);
-            menuPop.setBackgroundDrawable(ct.getResources().getDrawable(R.drawable.pop_round_bg));
+            menuPop.setBackgroundDrawable(ct.getResources().getDrawable(R.color.white));
             menuPop.setTouchable(true);
             DisplayUtil.backgroundAlpha(ct, 0.4f);
             menuPop.setOutsideTouchable(false);
             menuPop.setFocusable(true);
             menuPop.setWidth(DisplayUtil.dip2px(ct, 100));
-            menuPop.setHeight(DisplayUtil.dip2px(ct, 295));
+            menuPop.setHeight(DisplayUtil.dip2px(ct, 200));
             menuPop.setOnDismissListener(new PopupWindow.OnDismissListener() {
                 @Override
                 public void onDismiss() {
                     DisplayUtil.backgroundAlpha(ct, 1.0f);
                 }
             });
-            view.findViewById(R.id.popFindBtn).setOnClickListener(this);
+//            view.findViewById(R.id.popFindBtn).setOnClickListener(this);
             view.findViewById(R.id.popUseApplyBtn).setOnClickListener(this);
             view.findViewById(R.id.popScrapApplyBtn).setOnClickListener(this);
             view.findViewById(R.id.popMaintenanceBtn).setOnClickListener(this);
             view.findViewById(R.id.popInspectBtn).setOnClickListener(this);
-            view.findViewById(R.id.popCycleCountBtn).setOnClickListener(this);
+//            view.findViewById(R.id.popCycleCountBtn).setOnClickListener(this);
         }
         DisplayUtil.backgroundAlpha(ct, 0.4f);
         menuPop.showAsDropDown(v, 0, DisplayUtil.dip2px(ct, 10));
@@ -106,19 +176,18 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
             onBackPressed();
         } else if (R.id.doneTv == id) {
             showMuenPop(v);
-        } else if (R.id.popFindBtn == id) {
-            dismissMenuPop();
         } else if (R.id.popUseApplyBtn == id) {
+            startActivity(new Intent(ct, DeviceDataFormAddActivity.class).putExtra("title", StringUtil.getMessage(R.string.text_application_use)).putExtra("caller", "DeviceChange!Use").putExtra("noCode", decode));
             dismissMenuPop();
         } else if (R.id.popScrapApplyBtn == id) {
+            startActivity(new Intent(ct, DeviceDataFormAddActivity.class).putExtra("title", StringUtil.getMessage(R.string.text_scrap_application)).putExtra("caller", "DeviceChange!Scrap").putExtra("noCode", decode));
             dismissMenuPop();
         } else if (R.id.popMaintenanceBtn == id) {
+            startActivity(new Intent(ct, DeviceDataFormAddActivity.class).putExtra("title", StringUtil.getMessage(R.string.text_maintenance)).putExtra("caller", "DeviceChange!Maintain").putExtra("noCode", decode));
             dismissMenuPop();
         } else if (R.id.popInspectBtn == id) {
+            startActivity(new Intent(ct, DeviceDataFormAddActivity.class).putExtra("title", StringUtil.getMessage(R.string.text_fault_inspection)).putExtra("caller", "DeviceChange!Inspect").putExtra("noCode", decode));
             dismissMenuPop();
-        } else if (R.id.popCycleCountBtn == id) {
-            dismissMenuPop();
-            startActivity(new Intent(ct,DeviceCycleCountActivity.class));
         }
 
     }
@@ -128,4 +197,200 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
             menuPop.dismiss();
         }
     }
+
+
+    private void loadData() {
+
+        if (NetUtils.isNetWorkConnected(ct)) {
+            if (!mRefreshLayout.isRefreshing()) {
+                progressDialog.show();
+            }
+            httpClient.Api().send(new HttpClient.Builder()
+                    .url("mobile/device/getDeviceInfo.action")
+                    .add("decode", decode)
+                    .method(Method.GET)
+                    .build(), new ResultSubscriber<>(new ResultListener<Object>() {
+                @Override
+                public void onResponse(Object o) {
+                    try {
+                        handleData(o.toString());
+                    } catch (Exception e) {
+                        if (e != null) {
+                            LogUtil.i("e=" + e.getMessage());
+                        }
+                    }
+                    if (progressDialog != null) {
+                        progressDialog.dismiss();
+
+                    }
+                    if (mRefreshLayout != null) {
+                        mRefreshLayout.stopRefresh();
+                    }
+
+                }
+            }));
+        } else {
+            if (!mRefreshLayout.isRefreshing()) {
+                endOfError(getString(R.string.networks_out));
+            }
+        }
+    }
+
+    private void endOfError(String exceptionInfo) {
+        setResult(0x22, new Intent().putExtra("data", exceptionInfo));
+        finish();
+    }
+
+    private void handleData(String message) throws Exception {
+        JSONObject json = JSON.parseObject(message);
+        boolean success = JSONUtil.getBoolean(json, "success");
+        JSONObject object = JSONUtil.getJSONObject(json, "data");
+        if (success) {
+            //处理主表
+            JSONArray formItem = JSONUtil.getJSONArray(object, "formItem");
+            JSONObject formData = JSONUtil.getJSONObject(object, "formData");
+            List<DeviceInfo> formListData = handleFromGrid(true, null, formItem, formData);
+            //详细配置
+            JSONArray grid1Data = JSONUtil.getJSONArray(object, "grid1Data");
+            List<DeviceInfo> moreListData = new ArrayList<>();
+            JSONArray grid1Item = JSONUtil.getJSONArray(object, "grid1Item");
+            for (int i = 0; i < grid1Data.size(); i++) {
+                moreListData.addAll(handleFromGrid(false, "详细配置" + (i + 1), grid1Item, grid1Data.getJSONObject(i)));
+            }
+            //设备履历数据
+            JSONArray grid2Item = JSONUtil.getJSONArray(object, "grid2Item");
+            JSONArray grid2Data = JSONUtil.getJSONArray(object, "grid2Data");
+            List<DeviceInfo> historyListData = new ArrayList<>();
+            for (int i = 0; i < grid2Data.size(); i++) {
+                historyListData.addAll(handleFromGrid(false, "设备履历" + (i + 1), grid2Item, grid2Data.getJSONObject(i)));
+            }
+            setData2Adapter(formListData, moreListData, historyListData);
+        } else {
+            String exceptionInfo = JSONUtil.getText(message, "exceptionInfo");
+            if (!StringUtil.isEmpty(exceptionInfo)) {
+                ToastUtil.showToast(ct, exceptionInfo);
+            }
+            endOfError(exceptionInfo);
+        }
+
+    }
+
+    private void setData2Adapter(int selectItem) {
+        this.selectItem = selectItem;
+        List<DeviceInfo> listData = null;
+        switch (selectItem) {
+            case 1:
+                listData = this.baseInfoList;
+                break;
+            case 2:
+                listData = this.moreInfoList;
+                break;
+            case 3:
+                listData = this.historyInfoList;
+                break;
+        }
+
+        if (mAdapter == null) {
+            mAdapter = new DeviceInfoAdapter(listData);
+            mRecyclerView.setAdapter(mAdapter);
+        } else {
+            mAdapter.setModels(listData);
+        }
+    }
+
+    private void setData2Adapter(List<DeviceInfo> baseInfoList, List<DeviceInfo> moreInfoList, List<DeviceInfo> historyInfoList) {
+        this.baseInfoList = baseInfoList;
+        this.moreInfoList = moreInfoList;
+        this.historyInfoList = historyInfoList;
+        setData2Adapter(selectItem);
+    }
+
+
+    private List<DeviceInfo> handleFromGrid(boolean isFrom, String title, JSONArray items, JSONObject data) throws Exception {
+        List<DeviceInfo> deviceInfos = new ArrayList<>();
+        for (int i = 0; i < items.size(); i++) {
+            JSONObject item = items.getJSONObject(i);
+            String field = JSONUtil.getText(item, "field", "dataIndex");
+            String caption = JSONUtil.getText(item, "caption");
+            String type = JSONUtil.getText(item, "type");
+            String values =getValues(type,JSONUtil.getText(data, field,field.toUpperCase())) ;
+            if (isFrom && caption.equals("ID")) {
+                id = values;
+            }
+            deviceInfos.add(new DeviceInfo(isFrom, i == 0 ? title : null, caption, field, values));
+        }
+        return deviceInfos;
+    }
+
+    private String getValues(String type, String values) {
+        if (type.equals("combo")) {
+            switch (values) {
+                case "UNUSED":
+                    return "闲置中";
+                case "USING":
+                    return "正常使用";
+                case "BREAKING":
+                    return "故障中";
+                case "SCRAPPED":
+                    return "已报废";
+                case "LOSSED":
+                    return "已盘亏";
+            }
+        }
+        return values;
+    }
+
+    private class DeviceInfoAdapter extends RecyclerView.Adapter<DeviceInfoAdapter.ViewHolder> {
+
+        List<DeviceInfo> models;
+
+        public DeviceInfoAdapter(List<DeviceInfo> models) {
+            this.models = models;
+        }
+
+        public void setModels(List<DeviceInfo> models) {
+            this.models = models;
+            notifyDataSetChanged();
+        }
+
+        @Override
+        public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
+            return new ViewHolder(parent);
+        }
+
+        @Override
+        public void onBindViewHolder(ViewHolder holder, int position) {
+            DeviceInfo model = models.get(position);
+            if (StringUtil.isEmpty(model.getTitle())) {
+                holder.titleRl.setVisibility(View.GONE);
+            } else {
+                holder.titleRl.setVisibility(View.VISIBLE);
+                holder.titleTv.setText(model.getTitle());
+            }
+            holder.captionTv.setText(model.getCaption());
+            holder.valuesTv.setText(model.getValues());
+        }
+
+        @Override
+        public int getItemCount() {
+            return ListUtils.getSize(models);
+        }
+
+        class ViewHolder extends RecyclerView.ViewHolder {
+            RelativeLayout titleRl;
+            TextView titleTv, captionTv, valuesTv;
+
+            public ViewHolder(ViewGroup parent) {
+                this(LayoutInflater.from(ct).inflate(R.layout.item_device_info, parent, false));
+            }
+
+            public ViewHolder(View itemView) {
+                super(itemView);
+                titleRl = itemView.findViewById(R.id.titleRl);
+                titleTv = itemView.findViewById(R.id.titleTv);
+                captionTv = itemView.findViewById(R.id.captionTv);
+                valuesTv = itemView.findViewById(R.id.valuesTv);
+            }
+        }
+    }
 }

+ 219 - 0
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/adapter/CycleCountAdapter.java

@@ -0,0 +1,219 @@
+package com.uas.appworks.CRM.erp.adapter;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.FrameLayout;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListAdapter;
+import android.widget.ListView;
+import android.widget.TextView;
+
+
+import com.common.LogUtil;
+import com.uas.appworks.CRM.erp.model.CycleCount;
+import com.uas.appworks.R;
+
+import java.util.List;
+
+/**
+ * Created by Bitlike on 2017/12/19.
+ */
+
+public class CycleCountAdapter extends BaseAdapter {
+    private Context context;
+    private boolean needShowAll;
+    private List<CycleCount> models;
+
+    public void setNeedShowAll(boolean needShowAll) {
+        this.needShowAll = needShowAll;
+    }
+
+    public CycleCountAdapter(Context context, List<CycleCount> models) {
+        this.context = context;
+        this.models = models;
+    }
+
+    public void setModels(List<CycleCount> models) {
+        this.models = models;
+        notifyDataSetChanged();
+    }
+
+
+    @Override
+    public View getView(int i, View view, ViewGroup viewGroup) {
+        CycleCount model = models.get(i);
+        ViewHolder holder = null;
+        if (view == null) {
+            view = LayoutInflater.from(context).inflate(R.layout.item_rl_listview, null);
+            holder = new ViewHolder(view);
+            view.setTag(holder);
+        } else {
+            holder = (ViewHolder) view.getTag();
+        }
+        List<CycleCount.Data> datas = null;
+        if (model.isExpand()) {
+            holder.expandImg.setImageResource(R.drawable.ic_menu_retract);
+            datas = model.getDatas();
+        } else {
+            holder.expandImg.setImageResource(R.drawable.ic_menu_retract);
+            datas = model.getLowDatas();
+        }
+        ListAdapter mAdapter = holder.mListView.getAdapter();
+        if (mAdapter != null && mAdapter instanceof DataAdapter) {
+            ((DataAdapter) mAdapter).setModels(datas);
+        } else {
+            holder.mListView.setAdapter(new DataAdapter(context, datas));
+        }
+        view.setTag(R.id.tag_key2, model);
+        view.setOnClickListener(onClickListener);
+        if (needShowAll) {
+            holder.expandImg.setVisibility(View.VISIBLE);
+            holder.expandImg.setTag(R.id.tag_key, i);
+            holder.expandImg.setOnClickListener(onClickListener);
+        } else {
+            holder.expandImg.setVisibility(View.GONE);
+        }
+        return view;
+    }
+
+    private View.OnClickListener onClickListener = new View.OnClickListener() {
+        @Override
+        public void onClick(View view) {
+            try {
+                LogUtil.i("进来点击事件");
+                if (view.getId() == R.id.expandImg) {
+                    LogUtil.i("进来拓展点击事件");
+                    int i = (int) view.getTag(R.id.tag_key);
+                    if (models != null && models.size() > i) {
+                        models.get(i).setExpand(!models.get(i).isExpand());
+                        notifyDataSetChanged();
+                    }
+                } else {
+                    LogUtil.i("进来单机点击事件");
+                    CycleCount model = (CycleCount) view.getTag(R.id.tag_key2);
+                    if (onItemClickListener != null) {
+                        onItemClickListener.click(model);
+                    }
+                }
+            } catch (Exception e) {
+                LogUtil.i("e=" + e.getMessage());
+
+            }
+        }
+    };
+    private OnItemClickListener onItemClickListener;
+
+    public void setOnItemClickListener(OnItemClickListener onItemClickListener) {
+        this.onItemClickListener = onItemClickListener;
+    }
+
+    public interface OnItemClickListener {
+        void click(CycleCount model);
+    }
+
+    @Override
+    public int getCount() {
+        return models == null ? 0 : models.size();
+    }
+
+    @Override
+    public Object getItem(int i) {
+        return models.get(i);
+    }
+
+    @Override
+    public long getItemId(int i) {
+        return i;
+    }
+
+
+    class ViewHolder {
+        ListView mListView;
+        ImageView expandImg;
+
+        public ViewHolder(View itemView) {
+            mListView = itemView.findViewById(R.id.listView);
+            expandImg = itemView.findViewById(R.id.expandImg);
+
+            mListView.setEnabled(false);
+            mListView.setFocusable(false);
+            mListView.setClickable(false);
+            mListView.setPressed(false);
+        }
+    }
+
+    public static class DataAdapter extends BaseAdapter {
+        private List<CycleCount.Data> models;
+        private Context context;
+
+        public void setModels(List<CycleCount.Data> models) {
+            this.models = models;
+            notifyDataSetChanged();
+        }
+
+        public DataAdapter(Context context, List<CycleCount.Data> models) {
+            this.context = context;
+            this.models = models;
+        }
+
+        @Override
+        public int getCount() {
+            return models == null ? 0 : models.size();
+        }
+
+
+        @Override
+        public Object getItem(int i) {
+            return models.get(i);
+        }
+
+        @Override
+        public long getItemId(int i) {
+            return i;
+        }
+
+        @Override
+        public View getView(int i, View view, ViewGroup viewGroup) {
+            CycleCount.Data model = models.get(i);
+            ViewHolder holder = null;
+            if (view == null) {
+                view = LayoutInflater.from(context).inflate(R.layout.item_device_data, null);
+                holder = new ViewHolder(view);
+                view.setTag(holder);
+            } else {
+                holder = (ViewHolder) view.getTag();
+            }
+            try {
+                if (model.isHasTwo()) {
+                    holder.twoLL.setVisibility(View.VISIBLE);
+                    holder.caption2Tv.setText(model.getCaption2() + ":");
+                    holder.values2Tv.setText(model.getValues2());
+                } else {
+                    holder.twoLL.setVisibility(View.GONE);
+                }
+                holder.caption1Tv.setText(model.getCaption() + ":");
+                holder.values1Tv.setText(model.getValues());
+            } catch (Exception e) {
+
+            }
+            return view;
+        }
+
+        class ViewHolder {
+            LinearLayout twoLL;
+            TextView caption1Tv, values1Tv, caption2Tv, values2Tv;
+
+            public ViewHolder(View itemView) {
+                twoLL = itemView.findViewById(R.id.twoLL);
+                caption1Tv = itemView.findViewById(R.id.caption1Tv);
+                values1Tv = itemView.findViewById(R.id.values1Tv);
+                values2Tv = itemView.findViewById(R.id.values2Tv);
+                caption2Tv = itemView.findViewById(R.id.caption2Tv);
+            }
+        }
+    }
+}

+ 118 - 0
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/model/CycleCount.java

@@ -0,0 +1,118 @@
+package com.uas.appworks.CRM.erp.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Bitlike on 2017/12/19.
+ */
+
+public class CycleCount {
+    private boolean isExpand;
+    private String id;
+    private List<Data> datas;
+    private List<Data> lowDatas;
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public boolean isExpand() {
+        return isExpand;
+    }
+
+    public void setExpand(boolean expand) {
+        isExpand = expand;
+    }
+
+    public List<Data> getDatas() {
+        return datas;
+    }
+
+    public List<Data> getLowDatas() {
+        return lowDatas;
+    }
+
+    public void setDatas(List<Data> datas) {
+        this.datas = datas;
+    }
+
+    public void addDatas(List<Data> datas) {
+        if (this.datas == null) {
+            this.datas = new ArrayList<>();
+        }
+        this.datas.addAll(datas);
+    }
+
+    public void addData(Data data) {
+        if (this.datas == null) {
+            this.datas = new ArrayList<>();
+        }
+        if (lowDatas == null) {
+            lowDatas = new ArrayList<>();
+            lowDatas.add(data);
+        } else if (lowDatas.size() < 3) {
+            lowDatas.add(data);
+        }
+        this.datas.add(data);
+    }
+
+    public static class Data {
+        private boolean hasTwo;
+        private String caption;
+        private String values;
+        private String caption2;
+        private String values2;
+
+        public Data(String caption, String values) {
+            this.caption = caption;
+            this.values = values;
+        }
+
+        public boolean isHasTwo() {
+            return hasTwo;
+        }
+
+        public void setHasTwo(boolean hasTwo) {
+            this.hasTwo = hasTwo;
+        }
+
+        public String getCaption() {
+            return caption;
+        }
+
+        public void setCaption(String caption) {
+            this.caption = caption;
+        }
+
+        public String getValues() {
+            return values;
+        }
+
+        public void setValues(String values) {
+            this.values = values;
+        }
+
+        public String getCaption2() {
+            return caption2;
+        }
+
+        public void setCaption2(String caption2) {
+            this.caption2 = caption2;
+        }
+
+        public String getValues2() {
+            return values2;
+        }
+
+        public void setValues2(String values2) {
+            this.values2 = values2;
+        }
+    }
+
+
+}

+ 107 - 0
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/model/CycleCountAdd.java

@@ -0,0 +1,107 @@
+package com.uas.appworks.CRM.erp.model;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.common.data.JSONUtil;
+import com.core.model.Approval;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Bitlike on 2017/12/19.
+ */
+
+public class CycleCountAdd {
+    private int id;
+    private boolean allowblank;
+    private String field;
+    private String caption;
+    private String values;
+    private String type;
+    private String which;
+    private List<Approval.Data> datas = new ArrayList<>();
+
+    public CycleCountAdd(JSONObject object) {
+        setValues(JSONUtil.getText(object, "fd_defaultvalue"));
+        setField(JSONUtil.getText(object, "fd_field"));
+        setCaption(JSONUtil.getText(object, "fd_caption"));
+        setType(JSONUtil.getText(object, "fd_type"));
+        if ("T".equals(JSONUtil.getText(object, "fd_dbfind"))) {
+            setType("DBFIND");
+        }
+        if (getType().equals("C")) {
+            JSONArray combostores = JSONUtil.getJSONArray(object, "COMBOSTORE");
+            for (int i = 0; i < combostores.size(); i++) {
+                JSONObject o = combostores.getJSONObject(i);
+                datas.add(new Approval.Data(JSONUtil.getText(o, "DLC_VALUE"), JSONUtil.getText(o, "DLC_DISPLAY")));
+            }
+        }
+        setAllowblank(JSONUtil.getBoolean(object, "fd_allowblank"));
+        setId(JSONUtil.getInt(object, "fd_id"));
+        setWhich("from");
+    }
+
+    public List<Approval.Data> getDatas() {
+        return datas;
+    }
+
+    public String getType() {
+        return type == null ? "" : type;
+
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public int getId() {
+        return id;
+    }
+
+    public void setId(int id) {
+        this.id = id;
+    }
+
+    public boolean isAllowblank() {
+        return allowblank;
+    }
+
+    public void setAllowblank(boolean allowblank) {
+        this.allowblank = allowblank;
+    }
+
+    public String getField() {
+        return field;
+    }
+
+    public void setField(String field) {
+        this.field = field;
+    }
+
+    public String getCaption() {
+        return caption;
+    }
+
+    public void setCaption(String caption) {
+        this.caption = caption;
+    }
+
+
+    public String getValues() {
+        return values == null ? "" : values;
+    }
+
+    public void setValues(String values) {
+        this.values = values;
+    }
+
+    public String getWhich() {
+        return which;
+    }
+
+    public void setWhich(String which) {
+        this.which = which;
+    }
+}

+ 63 - 0
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/model/DeviceInfo.java

@@ -0,0 +1,63 @@
+package com.uas.appworks.CRM.erp.model;
+
+/**
+ * Created by Bitlike on 2017/12/19.
+ */
+
+public class DeviceInfo {
+    private boolean isForm;
+    private String title;
+    private String caption;
+    private String field;
+    private String values;
+
+    public DeviceInfo(boolean isForm, String title, String caption, String field, String values) {
+        this.isForm = isForm;
+        this.caption = caption;
+        this.field = field;
+        this.values = values;
+        this.title = title;
+    }
+
+    public boolean getIsForm() {
+        return isForm;
+    }
+
+    public void setIsForm(boolean isForm) {
+        this.isForm = isForm;
+    }
+
+    public String getCaption() {
+        return caption;
+    }
+
+    public void setCaption(String caption) {
+        this.caption = caption;
+    }
+
+    public String getField() {
+        return field;
+    }
+
+    public void setField(String field) {
+        this.field = field;
+    }
+
+    public String getValues() {
+        return values;
+    }
+
+    public void setValues(String values) {
+        this.values = values;
+    }
+
+
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+}

+ 18 - 0
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/model/DeviceManage.java

@@ -12,8 +12,17 @@ public class DeviceManage {
     private String name;
     private Class cazz;
     private Bundle bundle;
+    private int request;
 
 
+    public int getRequest() {
+        return request;
+    }
+
+    public DeviceManage setRequest(int request) {
+        this.request = request;
+        return this;
+    }
 
     public DeviceManage(int id, int reId, String name) {
         this.id = id;
@@ -63,8 +72,17 @@ public class DeviceManage {
         return bundle;
     }
 
+
     public DeviceManage setBundle(Bundle bundle) {
         this.bundle = bundle;
         return this;
     }
+
+    public DeviceManage addString(String key, String values) {
+        if (this.bundle == null) {
+            this.bundle = new Bundle();
+        }
+        this.bundle.putString(key, values);
+        return this;
+    }
 }

+ 973 - 0
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/model/TestStr.java

@@ -0,0 +1,973 @@
+package com.uas.appworks.CRM.erp.model;
+
+/**
+ * Created by Bitlike on 2017/12/19.
+ */
+
+public class TestStr {
+    public final static String BASE_URL = "http://192.168.253.203:8090/";
+    public final static String CYCLECOUNT_MESSAGE = "{\n" +
+            "\t\"keyField\": \"sa_id\",\n" +
+            "\t\"pfField\": \"sd_said\",\n" +
+            "\t\"sessionId\": \"951961997FFD118271BFA72A4459B7AD\",\n" +
+            "\t\"columns\": [{\n" +
+            "\t\t\"dataIndex\": \"sa_id\",\n" +
+            "\t\t\"caption\": \"ID\",\n" +
+            "\t\t\"width\": 100,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": \"0,000\",\n" +
+            "\t\t\"render\": null\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"sa_status\",\n" +
+            "\t\t\"caption\": \"状态\",\n" +
+            "\t\t\"width\": 50,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": \"0,000\",\n" +
+            "\t\t\"render\": null\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"sa_recorder\",\n" +
+            "\t\t\"caption\": \"录入人\",\n" +
+            "\t\t\"width\": 50,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": \"0,000\",\n" +
+            "\t\t\"render\": null\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"sa_seller\",\n" +
+            "\t\t\"caption\": \"实行人\",\n" +
+            "\t\t\"width\": 50,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": \"0,000\",\n" +
+            "\t\t\"render\": null\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"sa_custcode\",\n" +
+            "\t\t\"caption\": \"实行人编号\",\n" +
+            "\t\t\"width\": 100,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": \"0,000\",\n" +
+            "\t\t\"render\": null\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"sa_recorddate\",\n" +
+            "\t\t\"caption\": \"录入日期\",\n" +
+            "\t\t\"width\": 100,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": \"0,000\",\n" +
+            "\t\t\"render\": null\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"sa_code\",\n" +
+            "\t\t\"caption\": \"编号\",\n" +
+            "\t\t\"width\": 50,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": \"0,000\",\n" +
+            "\t\t\"render\": null\n" +
+            "\t}],\n" +
+            "\t\"listdata\": [{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"sa_status\": \"在录入\",\n" +
+            "\t\t\"sa_recorder\": \"林子健\",\n" +
+            "\t\t\"sa_seller\": \"陈炜\",\n" +
+            "\t\t\"sa_custcode\": \"HW0006\",\n" +
+            "\t\t\"sa_recorddate\": \"2017-12-01 00:00:00\",\n" +
+            "\t\t\"sa_id\": 23039,\n" +
+            "\t\t\"sa_code\": \"SS17120001\"\n" +
+            "\t}]\n" +
+            "}";
+
+
+    public static final String CYCLE_COUNT_ADD = "{\n" +
+            "\t\"items\": [{\n" +
+            "\t\t\"fd_detno\": \"de_code\",\n" +
+            "\t\t\"fd_field\": \"db_code\",\n" +
+            "\t\t\"fd_caption\": \"单据编号\",\n" +
+            "\t\t\"fd_maxlength\": 80,\n" +
+            "\t\t\"fd_type\": \"SS\",\n" +
+            "\t\t\"fd_defaultvalue\": \"默认值\",\n" +
+            "\t\t\"fd_allowblank\": false,\n" +
+            "\t\t\"fd_group\": \"分组\",\n" +
+            "\t\t\"fd_id\": 231,\n" +
+            "\t\t\"fd_appwidth\": 12,\n" +
+            "\t\t\"fd_logictype\": \"逻辑类型\",\n" +
+            "\t\t\"fd_readonly\": false,\n" +
+            "\t\t\"fd_dbfind\": \"放大镜配置\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"fd_detno\": \"de_code\",\n" +
+            "\t\t\"fd_field\": \"db_code\",\n" +
+            "\t\t\"fd_caption\": \"单据编号\",\n" +
+            "\t\t\"fd_maxlength\": 80,\n" +
+            "\t\t\"fd_type\": \"DBFIND\",\n" +
+            "\t\t\"fd_defaultvalue\": \"\",\n" +
+            "\t\t\"fd_allowblank\": true,\n" +
+            "\t\t\"fd_group\": \"分组\",\n" +
+            "\t\t\"fd_id\": 231,\n" +
+            "\t\t\"fd_appwidth\": 12,\n" +
+            "\t\t\"fd_logictype\": \"逻辑类型\",\n" +
+            "\t\t\"fd_readonly\": false,\n" +
+            "\t\t\"fd_dbfind\": \"放大镜配置\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"fd_detno\": \"de_code\",\n" +
+            "\t\t\"fd_field\": \"db_code\",\n" +
+            "\t\t\"fd_caption\": \"单据编号\",\n" +
+            "\t\t\"fd_maxlength\": 80,\n" +
+            "\t\t\"fd_type\": \"SS\",\n" +
+            "\t\t\"fd_defaultvalue\": \"默认值\",\n" +
+            "\t\t\"fd_allowblank\": false,\n" +
+            "\t\t\"fd_group\": \"分组\",\n" +
+            "\t\t\"fd_id\": 231,\n" +
+            "\t\t\"fd_appwidth\": 12,\n" +
+            "\t\t\"fd_logictype\": \"逻辑类型\",\n" +
+            "\t\t\"fd_readonly\": false,\n" +
+            "\t\t\"fd_dbfind\": \"放大镜配置\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"fd_detno\": \"de_code\",\n" +
+            "\t\t\"fd_field\": \"db_code\",\n" +
+            "\t\t\"fd_caption\": \"单据编号\",\n" +
+            "\t\t\"fd_maxlength\": 80,\n" +
+            "\t\t\"fd_type\": \"DBFIND\",\n" +
+            "\t\t\"fd_defaultvalue\": \"\",\n" +
+            "\t\t\"fd_allowblank\": false,\n" +
+            "\t\t\"fd_group\": \"分组\",\n" +
+            "\t\t\"fd_id\": 231,\n" +
+            "\t\t\"fd_appwidth\": 12,\n" +
+            "\t\t\"fd_logictype\": \"逻辑类型\",\n" +
+            "\t\t\"fd_readonly\": false,\n" +
+            "\t\t\"fd_dbfind\": \"放大镜配置\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"fd_detno\": \"de_code\",\n" +
+            "\t\t\"fd_field\": \"db_code\",\n" +
+            "\t\t\"fd_caption\": \"单据编号\",\n" +
+            "\t\t\"fd_maxlength\": 80,\n" +
+            "\t\t\"fd_type\": \"DBFIND\",\n" +
+            "\t\t\"fd_defaultvalue\": \"\",\n" +
+            "\t\t\"fd_allowblank\": true,\n" +
+            "\t\t\"fd_group\": \"分组\",\n" +
+            "\t\t\"fd_id\": 231,\n" +
+            "\t\t\"fd_appwidth\": 12,\n" +
+            "\t\t\"fd_logictype\": \"逻辑类型\",\n" +
+            "\t\t\"fd_readonly\": false,\n" +
+            "\t\t\"fd_dbfind\": \"放大镜配置\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"fd_detno\": \"de_code\",\n" +
+            "\t\t\"fd_field\": \"db_code\",\n" +
+            "\t\t\"fd_caption\": \"单据编号\",\n" +
+            "\t\t\"fd_maxlength\": 80,\n" +
+            "\t\t\"fd_type\": \"SS\",\n" +
+            "\t\t\"fd_defaultvalue\": \"默认值\",\n" +
+            "\t\t\"fd_allowblank\": false,\n" +
+            "\t\t\"fd_group\": \"分组\",\n" +
+            "\t\t\"fd_id\": 231,\n" +
+            "\t\t\"fd_appwidth\": 12,\n" +
+            "\t\t\"fd_logictype\": \"逻辑类型\",\n" +
+            "\t\t\"fd_readonly\": false,\n" +
+            "\t\t\"fd_dbfind\": \"放大镜配置\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"fd_detno\": \"de_code\",\n" +
+            "\t\t\"fd_field\": \"db_code\",\n" +
+            "\t\t\"fd_caption\": \"单据编号\",\n" +
+            "\t\t\"fd_maxlength\": 80,\n" +
+            "\t\t\"fd_type\": \"DBFIND\",\n" +
+            "\t\t\"fd_defaultvalue\": \"\",\n" +
+            "\t\t\"fd_allowblank\": true,\n" +
+            "\t\t\"fd_group\": \"分组\",\n" +
+            "\t\t\"fd_id\": 231,\n" +
+            "\t\t\"fd_appwidth\": 12,\n" +
+            "\t\t\"fd_logictype\": \"逻辑类型\",\n" +
+            "\t\t\"fd_readonly\": false,\n" +
+            "\t\t\"fd_dbfind\": \"放大镜配置\"\n" +
+            "\t}]\n" +
+            "}";
+    public static final String CYCLE_INFO = "{\n" +
+            "\t\"data\": {\n" +
+            "\t\t\"DB_ID\": 122,\n" +
+            "\t\t\"DB_CODE\": \"盘点单号\",\n" +
+            "\t\t\"DB_CENTERCODE\": \"所属部门编号\",\n" +
+            "\t\t\"DB_CENTERNAME\": \"所属部门名称\",\n" +
+            "\t\t\"DB_LINECODE\": \"所属线别\",\n" +
+            "\t\t\"DB_DEVKIND \": \"设备种类\",\n" +
+            "\t\t\"DB_INMAN \": \"录入人\",\n" +
+            "\t\t\"DB_INDATE\": \"录入日期\",\n" +
+            "\t\t\"DB_UNACTIONQTY\": 1223,\n" +
+            "\t\t\"DB_ACTIONQTY\": 1223\n" +
+            "\t}\n" +
+            "}";
+    public static final String CYCLE_DETAILS = "{\n" +
+            "    \"gridItem\": [\n" +
+            "        {\n" +
+            "            \"dataIndex\": \"da_detno\",\n" +
+            "            \"caption\": \"序号\",\n" +
+            "            \"width\": 80,\n" +
+            "            \"type\": \"numberfield\",\n" +
+            "            \"format\": null,\n" +
+            "            \"render\": \"\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"dataIndex\": \"da_id\",\n" +
+            "            \"caption\": \"ID\",\n" +
+            "            \"width\": 80,\n" +
+            "            \"type\": \"numberfield\",\n" +
+            "            \"format\": null,\n" +
+            "            \"render\": \"\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"dataIndex\": \"da_devcode\",\n" +
+            "            \"caption\": \"编号\",\n" +
+            "            \"width\": 80,\n" +
+            "            \"type\": \"numberfield\",\n" +
+            "            \"format\": null,\n" +
+            "            \"render\": \"\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"dataIndex\": \"da_attname\",\n" +
+            "            \"caption\": \"名称\",\n" +
+            "            \"width\": 80,\n" +
+            "            \"type\": \"numberfield\",\n" +
+            "            \"format\": null,\n" +
+            "            \"render\": \"\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"dataIndex\": \"da_attvalue\",\n" +
+            "            \"caption\": \"说明\",\n" +
+            "            \"width\": 80,\n" +
+            "            \"type\": \"numberfield\",\n" +
+            "            \"format\": null,\n" +
+            "            \"render\": \"\"\n" +
+            "        }\n" +
+            "    ],\n" +
+            "    \"gridData\": [\n" +
+            "        {\n" +
+            "            \"da_id\": 12,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 13,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 14,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 15,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 16,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 17,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 18,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 19,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 120,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 1312,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 1212,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 1211,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 123,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 125,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 127,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 121213,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 1112,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 121231,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 12131,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 121234124,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 1212313,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 1214123,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 121241224,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 121241,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        },\n" +
+            "        {\n" +
+            "            \"da_id\": 1213123,\n" +
+            "            \"da_devcode\": \"DE120334\",\n" +
+            "            \"da_detno\": 1,\n" +
+            "            \"da_attname\": \"分辨率\",\n" +
+            "            \"da_attvalue\": \"600大批dpi\"\n" +
+            "        }\n" +
+            "    ]\n" +
+            "}";
+    public static final String SUBMIT_CYCLE = "{\n" +
+            "    \"data\": {\n" +
+            "        \"DE_CODE\": \"设备编号\",\n" +
+            "        \"DE_NAME\": \"设备名称\",\n" +
+            "        \"DE_SPEC\": \"设备规格\",\n" +
+            "        \"DB_UNACTIONQTY\": 12\n" +
+            "    }\n" +
+            "}";
+    public static final String SCAN_DETAIL = "{\n" +
+            "\t\"formItem\": [{\n" +
+            "\t\t\"field\": \"de_code\",\n" +
+            "\t\t\"caption\": \"设备编号\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"type\": \"textfield\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"field\": \"de_maintenancedate\",\n" +
+            "\t\t\"caption\": \"最后盘点日期\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"type\": \"textfield\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"field\": \"de_startdate\",\n" +
+            "\t\t\"caption\": \"开始日期\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"type\": \"textfield\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"field\": \"de_currentuser\",\n" +
+            "\t\t\"caption\": \"当前使用人\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"type\": \"textfield\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"field\": \"de_name\",\n" +
+            "\t\t\"caption\": \"设备名称\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"type\": \"textfield\"\n" +
+            "\t}],\n" +
+            "\t\"formData\": {\n" +
+            "\t\t\"de_code\": \"DE203923\",\n" +
+            "\t\t\"de_name\": \"打印机XI4\",\n" +
+            "\t\t\"de_maintenancedate\": \"2017-12-12 00:00:00\",\n" +
+            "\t\t\"de_startdate\": \"2017-12-12 00:00:00\",\n" +
+            "\t\t\"de_currentuser\": \"小明\"\n" +
+            "\t},\n" +
+            "\t\"grid1Item\": [{\n" +
+            "\t\t\"dataIndex\": \"da_detno\",\n" +
+            "\t\t\"caption\": \"序号\",\n" +
+            "\t\t\"width\": 80,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"render\": \"\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"DE120334\",\n" +
+            "\t\t\"caption\": \"设备编号\",\n" +
+            "\t\t\"width\": 80,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"render\": \"\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"da_attname\",\n" +
+            "\t\t\"caption\": \"什么鬼名称\",\n" +
+            "\t\t\"width\": 80,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"render\": \"\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"da_attvalue\",\n" +
+            "\t\t\"caption\": \"什么鬼的值\",\n" +
+            "\t\t\"width\": 80,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"render\": \"\"\n" +
+            "\t}],\n" +
+            "\t\"grid1Data\": [{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t}],\n" +
+            "\t\"grid2Item\": [{\n" +
+            "\t\t\"dataIndex\": \"da_detno\",\n" +
+            "\t\t\"caption\": \"序号\",\n" +
+            "\t\t\"width\": 80,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"render\": \"\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"DE120334\",\n" +
+            "\t\t\"caption\": \"设备编号\",\n" +
+            "\t\t\"width\": 80,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"render\": \"\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"da_attname\",\n" +
+            "\t\t\"caption\": \"什么鬼名称\",\n" +
+            "\t\t\"width\": 80,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"render\": \"\"\n" +
+            "\t},\n" +
+            "\t{\n" +
+            "\t\t\"dataIndex\": \"da_attvalue\",\n" +
+            "\t\t\"caption\": \"什么鬼的值\",\n" +
+            "\t\t\"width\": 80,\n" +
+            "\t\t\"type\": \"numberfield\",\n" +
+            "\t\t\"format\": null,\n" +
+            "\t\t\"render\": \"\"\n" +
+            "\t}],\n" +
+            "\t\"grid2Data\": [{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t},{\n" +
+            "\t\t\"da_devcode\": \"DE120334\",\n" +
+            "\t\t\"da_detno\": 1,\n" +
+            "\t\t\"da_attname\": \"分辨率\",\n" +
+            "\t\t\"da_attvalue\": \"600大批dpi\"\n" +
+            "\t}]\n" +
+            "}";
+}

+ 59 - 26
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/CommonDocDetailsActivity.java

@@ -55,6 +55,7 @@ import com.uas.appworks.OA.erp.model.CommonApprovalFlowBean;
 import com.uas.appworks.OA.erp.model.CommonDocAMBean;
 import com.uas.appworks.OA.erp.utils.approvautils.ApprovaNodeUtil;
 import com.uas.appworks.OA.erp.utils.approvautils.NodeAdapter;
+import com.uas.appworks.activity.DeviceQueryActivity;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -133,8 +134,13 @@ public class CommonDocDetailsActivity extends BaseActivity {
         commondoc_sv.smoothScrollTo(0, 0);
         super.onResume();
     }
-
+    private boolean device;
     public void initView() {
+        Intent intent = getIntent();
+        if (intent!=null){
+            device=intent.getBooleanExtra("device",false);
+        }
+
         platform = ApiUtils.getApiModel() instanceof ApiPlatform;
         setContentView(R.layout.activity_common_docui);
         initIDS();
@@ -269,7 +275,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
 
     @Override
     public boolean onCreateOptionsMenu(Menu menu) {
-        if (!"FeePlease!FYBX".equals(mCaller)){
+        if (!"FeePlease!FYBX".equals(mCaller)&&!device){
             getMenuInflater().inflate(R.menu.menu_add_icon, menu);
         }
         return super.onCreateOptionsMenu(menu);
@@ -283,13 +289,17 @@ public class CommonDocDetailsActivity extends BaseActivity {
             finish();
         }
         if (item.getItemId() == android.R.id.home) {
-            if (ActivityUtils.isExsitMianActivity(mContext, FormListSelectActivity.class)) {
-                LogUtil.d("正常返回...");
-                onBackPressed();
+            if (device) {
+                endDevice();
             } else {
-                LogUtil.d("非正常返回...");
-                startActivity(new Intent(mContext, FormListSelectActivity.class).putExtra("caller", mCaller));
-                finish();
+                if (ActivityUtils.isExsitMianActivity(mContext, FormListSelectActivity.class)) {
+                    LogUtil.d("正常返回...");
+                    onBackPressed();
+                } else {
+                    LogUtil.d("非正常返回...");
+                    startActivity(new Intent(mContext, FormListSelectActivity.class).putExtra("caller", mCaller));
+                    finish();
+                }
             }
         }
         return true;
@@ -556,6 +566,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
      * 申请单据的审批,提交,录入状态
      */
     private void SetComDocStatus(String real_status) {
+
         if (!TextUtils.isEmpty(real_status)) {
             if (real_status.equals("已审核")) {
                 status_tv.setTextColor(getApplicationContext().getResources().getColor(R.color.approval));
@@ -579,6 +590,9 @@ public class CommonDocDetailsActivity extends BaseActivity {
                 resanddel_ll.setVisibility(View.VISIBLE);
             }
         }
+        if (device){
+            resanddel_ll.setVisibility(View.GONE);
+        }
     }
 
     /**
@@ -1003,26 +1017,30 @@ public class CommonDocDetailsActivity extends BaseActivity {
     @Override
     public boolean onKeyDown(int keyCode, KeyEvent event) {
         if ((keyCode == KeyEvent.KEYCODE_BACK)) {
-            if (ActivityUtils.isExsitMianActivity(mContext, FormListSelectActivity.class)) {
-                LogUtil.d("正常返回...");
-                if ("1".equals(update)){
-                    startActivity(new Intent(mContext, FormListSelectActivity.class).putExtra("caller", mCaller)
-                            .putExtra("update", update));
+            if (device){
+                endDevice();
+            }else{
+                if (ActivityUtils.isExsitMianActivity(mContext, FormListSelectActivity.class)) {
+                    LogUtil.d("正常返回...");
+                    if ("1".equals(update)){
+                        startActivity(new Intent(mContext, FormListSelectActivity.class).putExtra("caller", mCaller)
+                                .putExtra("update", update));
+                        finish();
+                    }else{
+                        onBackPressed();
+                    }
+                } else {
+                    LogUtil.d("非正常返回..."+update);
+                    if ("1".equals(update)){
+                        FormListSelectActivity.reload=true;
+                    }else{
+                        FormListSelectActivity.reload=false;
+                    }
+                    startActivity(
+                            new Intent(mContext, FormListSelectActivity.class)
+                                    .putExtra("caller", mCaller));
                     finish();
-                }else{
-                    onBackPressed();
                 }
-            } else {
-                LogUtil.d("非正常返回..."+update);
-                if ("1".equals(update)){
-                    FormListSelectActivity.reload=true;
-                }else{
-                    FormListSelectActivity.reload=false;
-                }
-                startActivity(
-                        new Intent(mContext, FormListSelectActivity.class)
-                                .putExtra("caller", mCaller));
-                finish();
             }
             return false;
         } else {
@@ -1030,6 +1048,21 @@ public class CommonDocDetailsActivity extends BaseActivity {
         }
 
     }
+    private void endDevice(){
+        String dc_class = null;
+        if (mCaller.equals("DeviceChange!Use")) {
+            dc_class = "使用转移";
+        } else if (mCaller.equals("DeviceChange!Scrap")) {
+            dc_class = "报废";
+        } else if (mCaller.equals("DeviceChange!Maintain")) {
+            dc_class = "保养维护";
+        } else if (mCaller.equals("DeviceChange!Inspect")) {
+            dc_class = "故障送检";
+        }
+        startActivity(new Intent(ct, DeviceQueryActivity.class).putExtra(Constants.FLAG.DEVICE_CALLER, mCaller)
+                .putExtra(Constants.FLAG.DEVICE_CLASS, dc_class));
+        finish();
+    }
 
     /**
      * 图片适配器

+ 9 - 1
app_modular/appworks/src/main/java/com/uas/appworks/activity/DeviceQueryActivity.java

@@ -138,8 +138,16 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
             mClass = intent.getStringExtra(Constants.FLAG.DEVICE_CLASS);
         }
 
+        if (TextUtils.isEmpty(mCaller)) {
+            mCaller = "Device";
+        }
+        //TODO gongpengming
         if (!TextUtils.isEmpty(mClass)) {
-            mBaseCondition = "(dc_class = \'" + mClass + "\')";
+            String dc_class="dc_class";
+            if (mCaller!=null&&mCaller.equals("DeviceChange!Maintain")){
+                dc_class="db_class";
+            }
+            mBaseCondition = "("+dc_class+" = \'" + mClass + "\')";
             mCondition = mBaseCondition;
         }
     }

+ 10 - 4
app_modular/appworks/src/main/java/com/uas/appworks/datainquiry/activity/DataInquiryListActivity.java

@@ -113,14 +113,17 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
                     }
                     String result = msg.getData().getString("result");
                     analysisCondition(result);
-                    getSchemeData();
                     break;
                 case GET_DATA_RESULT:
                     if (mDataListView.isRefreshing()) {
                         mDataListView.onRefreshComplete();
                     }
                     progressDialog.dismiss();
-                    analysisData(msg);
+                    if (mAllSchemeConditions == null || mAllSchemeConditions.size() == 0) {
+                        mEmptyLayout.showEmpty();
+                    } else {
+                        analysisData(msg);
+                    }
                     break;
                 case 0x88:
                     mTotalLl.setVisibility(View.GONE);
@@ -479,7 +482,6 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
 
                 mDataInquiryTotalAdapter.notifyDataSetChanged();
 
-//                mDataListView.setVisibility(View.VISIBLE);
                 if (listArray != null && listArray.length() > 0) {
                     if (!TextUtils.isEmpty(mSearchField)) {
                         HistoricalRecordBean historicalRecordBean = new HistoricalRecordBean();
@@ -629,7 +631,8 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
             try {
                 JSONObject resultObject = new JSONObject(result);
                 JSONArray dataArray = resultObject.optJSONArray("data");
-                if (dataArray != null) {
+                if (dataArray != null && dataArray.length() > 0) {
+                    getSchemeData();
                     String fuzzyHint = "";
                     for (int i = 0; i < dataArray.length(); i++) {
                         JSONObject dataObject = dataArray.optJSONObject(i);
@@ -748,6 +751,9 @@ public class DataInquiryListActivity extends BaseActivity implements View.OnClic
                     } else {
                         mSearchEditText.setHint("搜索");
                     }
+                } else {
+                    progressDialog.dismiss();
+                    mEmptyLayout.showEmpty();
                 }
             } catch (JSONException e) {
                 e.printStackTrace();

BIN
app_modular/appworks/src/main/res/drawable-xxhdpi/ic_menu_retract.png


+ 11 - 0
app_modular/appworks/src/main/res/drawable/frame_square_hint_bg.xml

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item>
+        <shape>
+            <solid android:color="@color/white" />
+            <corners android:radius="0dp" />
+            <stroke android:width="@dimen/line" android:color="@color/text_hine" />
+            <padding android:bottom="2dp" android:left="2dp" android:right="2dp" android:top="2dp" />
+        </shape>
+    </item>
+</selector>

+ 7 - 0
app_modular/appworks/src/main/res/drawable/text_btn_bg.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<selector xmlns:android="http://schemas.android.com/apk/res/android">
+    <item android:state_selected="true" android:color="@color/text_main"/>
+    <item android:state_checked="true" android:color="@color/text_main"/>
+    <item android:color="@color/white"/>
+</selector>
+

+ 2 - 2
app_modular/appworks/src/main/res/layout/action_device_cycle_count.xml

@@ -17,10 +17,10 @@
         android:layout_height="match_parent"
         android:layout_alignParentRight="true"
         android:gravity="center"
-        android:src="@drawable/ic_work_module_add"
+        android:src="@drawable/more"
         android:textColor="@color/white" />
 
-    <com.core.widget.VoiceSearchView
+    <com.modular.apputils.widget.MenuVoiceSearchView
         android:id="@+id/mVoiceSearchView"
         android:layout_width="match_parent"
         android:layout_height="match_parent"

+ 17 - 0
app_modular/appworks/src/main/res/layout/activity_device_cycle.xml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <com.handmark.pulltorefresh.library.PullToRefreshListView
+        android:id="@+id/mRefreshListView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:divider="@color/gray_light"
+        android:dividerHeight="1dp"
+        android:hardwareAccelerated="true"
+        android:layerType="software"
+        android:scrollbars="none"
+        android:scrollingCache="false"
+        android:visibility="visible" />
+</RelativeLayout>

+ 12 - 0
app_modular/appworks/src/main/res/layout/activity_device_cycle_details.xml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+    <ListView
+        android:id="@+id/mListView"
+        android:layout_width="match_parent"
+        android:dividerHeight="@dimen/line"
+        android:divider="@color/item_line"
+        android:layout_height="wrap_content" />
+</LinearLayout>

+ 212 - 0
app_modular/appworks/src/main/res/layout/activity_device_cycle_info.xml

@@ -0,0 +1,212 @@
+<?xml version="1.0" encoding="utf-8"?>
+<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical">
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:padding="@dimen/padding">
+
+            <TextView
+                android:id="@+id/codeTag"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="单号"
+                android:textColor="@color/text_hine"
+                android:textSize="@dimen/text_main" />
+
+            <TextView
+                android:id="@+id/codeTv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/padding"
+                android:layout_toRightOf="@id/codeTag"
+                android:gravity="right|center_vertical"
+                android:paddingLeft="@dimen/padding"
+                android:textColor="@color/text_main"
+                android:textSize="@dimen/text_main" />
+        </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/line"
+            android:background="@color/item_line" />
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:padding="@dimen/padding">
+
+            <TextView
+                android:id="@+id/centerTag"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="所属部门"
+                android:textColor="@color/text_hine"
+                android:textSize="@dimen/text_main" />
+
+            <TextView
+                android:id="@+id/centerTv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/padding"
+                android:layout_toRightOf="@id/centerTag"
+                android:gravity="right|center_vertical"
+                android:paddingLeft="@dimen/padding"
+                android:textColor="@color/text_main"
+                android:textSize="@dimen/text_main" />
+        </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/line"
+            android:background="@color/item_line" />
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:padding="@dimen/padding">
+
+            <TextView
+                android:id="@+id/lineTag"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="所属线别"
+                android:textColor="@color/text_hine"
+                android:textSize="@dimen/text_main" />
+
+            <TextView
+                android:id="@+id/lineTv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/padding"
+                android:layout_toRightOf="@id/lineTag"
+                android:gravity="right|center_vertical"
+                android:paddingLeft="@dimen/padding"
+                android:textColor="@color/text_main"
+                android:textSize="@dimen/text_main" />
+        </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/line"
+            android:background="@color/item_line" />
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:padding="@dimen/padding">
+
+            <TextView
+                android:id="@+id/kindTag"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="设备种类"
+                android:textColor="@color/text_hine"
+                android:textSize="@dimen/text_main" />
+
+            <TextView
+                android:id="@+id/kindTv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/padding"
+                android:layout_toRightOf="@id/kindTag"
+                android:gravity="right|center_vertical"
+                android:paddingLeft="@dimen/padding"
+                android:textColor="@color/text_main"
+                android:textSize="@dimen/text_main" />
+        </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/line"
+            android:background="@color/item_line" />
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:padding="@dimen/padding">
+
+            <TextView
+                android:id="@+id/actionqtyTag"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="已盘点"
+                android:textColor="@color/text_hine"
+                android:textSize="@dimen/text_main" />
+
+            <TextView
+                android:id="@+id/actionqtyTv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/padding"
+                android:layout_toRightOf="@id/actionqtyTag"
+                android:gravity="right|center_vertical"
+                android:paddingLeft="@dimen/padding"
+                android:textColor="@color/titleBlue"
+                android:textSize="@dimen/text_main" />
+        </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/line"
+            android:background="@color/item_line" />
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:padding="@dimen/padding">
+
+            <TextView
+                android:id="@+id/unactionqtyTag"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="未盘点"
+                android:textColor="@color/text_hine"
+                android:textSize="@dimen/text_main" />
+
+            <TextView
+                android:id="@+id/unactionqtyTv"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="@dimen/padding"
+                android:layout_toRightOf="@id/unactionqtyTag"
+                android:gravity="right|center_vertical"
+                android:paddingLeft="@dimen/padding"
+                android:textColor="@color/titleBlue"
+                android:textSize="@dimen/text_main" />
+        </RelativeLayout>
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/line"
+            android:background="@color/item_line" />
+
+        <com.core.widget.MyListView
+            android:id="@+id/mListView"
+            android:visibility="gone"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content" />
+
+        <Button
+            android:id="@+id/cycleBtn"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginBottom="50dp"
+            android:layout_marginLeft="40dp"
+            android:layout_marginRight="40dp"
+            android:layout_marginTop="100dp"
+            android:background="@drawable/bg_bule_btn"
+            android:padding="10dp"
+            android:text="@string/cycle"
+            android:textColor="@color/white"
+            android:textSize="@dimen/text_main" />
+    </LinearLayout>
+</ScrollView>

+ 3 - 0
app_modular/appworks/src/main/res/layout/device_scan_head.xml

@@ -39,6 +39,7 @@
             android:layout_weight="1"
             android:background="@drawable/shape_process_item"
             android:button="@null"
+            android:textColor="@drawable/text_btn_bg"
             android:checked="true"
             android:gravity="center"
             android:text="基础信息" />
@@ -49,6 +50,7 @@
             android:layout_height="match_parent"
             android:layout_margin="1dp"
             android:layout_weight="1"
+            android:textColor="@drawable/text_btn_bg"
             android:background="@drawable/shape_process_item"
             android:button="@null"
             android:gravity="center"
@@ -60,6 +62,7 @@
             android:layout_height="match_parent"
             android:layout_margin="1dp"
             android:layout_weight="1"
+            android:textColor="@drawable/text_btn_bg"
             android:background="@drawable/shape_process_item"
             android:button="@null"
             android:gravity="center"

+ 31 - 0
app_modular/appworks/src/main/res/layout/item_cycle_count.xml

@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout
+    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:paddingTop="10dp"
+        android:src="@drawable/down"/>
+
+
+    <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>

+ 62 - 0
app_modular/appworks/src/main/res/layout/item_device_data.xml

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal"
+    android:padding="3dp">
+
+    <LinearLayout
+        android:id="@+id/oneLL"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_weight="1"
+        android:orientation="horizontal">
+
+        <TextView
+            android:id="@+id/caption1Tv"
+            android:layout_width="60dp"
+            android:layout_height="wrap_content"
+            android:paddingLeft="@dimen/padding"
+            android:text="标题"
+            android:textColor="@color/text_hine"
+            android:textSize="@dimen/text_hine" />
+
+        <TextView
+            android:id="@+id/values1Tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_toRightOf="@id/caption1Tv"
+            android:paddingLeft="@dimen/padding"
+            android:text="标题"
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_hine" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/twoLL"
+        android:layout_width="0dp"
+        android:layout_height="wrap_content"
+        android:layout_weight="1">
+
+        <TextView
+            android:id="@+id/caption2Tv"
+            android:layout_width="60dp"
+            android:layout_height="wrap_content"
+            android:paddingLeft="@dimen/padding"
+            android:text="标题"
+            android:textColor="@color/text_hine"
+            android:textSize="@dimen/text_hine" />
+
+        <TextView
+            android:id="@+id/values2Tv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_toRightOf="@id/caption2Tv"
+            android:paddingLeft="@dimen/padding"
+            android:text="标题"
+            android:textColor="@color/text_main"
+            android:textSize="@dimen/text_hine" />
+    </LinearLayout>
+
+
+</LinearLayout>

+ 48 - 0
app_modular/appworks/src/main/res/layout/item_device_info.xml

@@ -0,0 +1,48 @@
+<?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:background="@color/white">
+
+    <RelativeLayout
+        android:id="@+id/titleRl"
+        android:background="@color/base_bg"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <TextView
+            android:id="@+id/titleTv"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:gravity="left|center_vertical"
+            android:padding="10dp"
+            android:text="标题" />
+
+        <View
+            android:layout_width="match_parent"
+            android:layout_height="@dimen/line"
+            android:layout_below="@id/titleTv"
+            android:background="@color/item_line" />
+    </RelativeLayout>
+
+    <TextView
+        android:id="@+id/captionTv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/titleRl"
+        android:gravity="left|center_vertical"
+        android:padding="10dp"
+        android:text="设备编号" />
+
+    <TextView
+        android:id="@+id/valuesTv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentRight="true"
+        android:layout_alignTop="@id/captionTv"
+        android:layout_toRightOf="@id/captionTv"
+        android:gravity="right|center_vertical"
+        android:padding="10dp"
+        android:text="设备编号"
+        android:textColor="@color/text_main" />
+</RelativeLayout>

+ 27 - 0
app_modular/appworks/src/main/res/layout/item_pop_device_cyclecount.xml

@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="horizontal"
+    android:padding="@dimen/padding">
+
+    <TextView
+        android:id="@+id/captionTv"
+        android:layout_width="70dp"
+        android:textColor="@color/text_hine"
+        android:layout_height="wrap_content"
+        android:paddingBottom="3dp"
+        android:text="" />
+
+    <EditText
+        android:id="@+id/valuesEd"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="@dimen/padding"
+        android:textColor="@color/text_main"
+        android:background="@drawable/frame_square_hint_bg"
+        android:drawableRight="@drawable/ic_menu_retract"
+        android:paddingLeft="@dimen/padding" />
+
+
+</LinearLayout>

+ 29 - 0
app_modular/appworks/src/main/res/layout/item_rl_listview.xml

@@ -0,0 +1,29 @@
+<?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:background="@color/white"
+    android:orientation="vertical">
+
+    <ImageView
+        android:id="@+id/expandImg"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:layout_alignParentRight="true"
+        android:clickable="true"
+        android:focusable="false"
+        android:padding="@dimen/padding"
+        android:visibility="visible" />
+
+
+
+    <com.core.widget.MyListView
+        android:id="@+id/listView"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:divider="@color/white"
+        android:dividerHeight="0dp"
+        android:focusableInTouchMode="false" />
+
+</RelativeLayout>

+ 4 - 0
app_modular/appworks/src/main/res/layout/menu_device_scan.xml

@@ -13,12 +13,14 @@
         android:background="@drawable/selector_me_menu_item_bg"
         android:gravity="center"
         android:text="设备查找"
+        android:visibility="gone"
         android:textColor="@color/text_main"
         android:textSize="@dimen/text_hine" />
 
     <View
         android:layout_width="match_parent"
         android:layout_height="@dimen/line"
+        android:visibility="gone"
         android:background="@color/item_line" />
 
     <Button
@@ -83,6 +85,7 @@
     <View
         android:layout_width="match_parent"
         android:layout_height="@dimen/line"
+        android:visibility="gone"
         android:background="@color/item_line" />
 
     <Button
@@ -93,6 +96,7 @@
         android:background="@drawable/selector_me_menu_item_bg"
         android:gravity="center"
         android:text="周期盘点"
+        android:visibility="gone"
         android:textColor="@color/text_main"
         android:textSize="@dimen/text_hine" />
 </LinearLayout>

+ 60 - 0
app_modular/appworks/src/main/res/layout/pop_device_cyclecount.xml

@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:id="@+id/bottom"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:divider="@drawable/spacer_medium"
+        android:gravity="center_horizontal"
+        android:orientation="horizontal"
+        android:padding="@dimen/padding"
+        android:weightSum="7"
+        android:showDividers="middle">
+
+        <Button
+            android:id="@+id/cancelBtn"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:paddingTop="@dimen/padding"
+            android:paddingBottom="@dimen/padding"
+            android:layout_weight="2"
+            android:background="@drawable/bg_bule_btn"
+            android:text="取消"
+            android:textColor="@color/white" />
+
+        <Button
+            android:id="@+id/sureBtn"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="2"
+            android:background="@drawable/bg_bule_btn"
+            android:text="确认"
+            android:paddingTop="@dimen/padding"
+            android:paddingBottom="@dimen/padding"
+            android:textColor="@color/white" />
+
+        <Button
+            android:id="@+id/resetBtn"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="2"
+            android:paddingTop="@dimen/padding"
+            android:paddingBottom="@dimen/padding"
+            android:background="@drawable/bg_bule_btn"
+            android:text="重置"
+            android:textColor="@color/white" />
+    </LinearLayout>
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/mRecyclerView"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_above="@id/bottom" />
+
+
+</RelativeLayout>

+ 146 - 0
app_modular/appworks/src/main/res/layout/pop_submit_cycle.xml

@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent">
+
+    <TextView
+        android:id="@+id/titleTv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_margin="@dimen/padding"
+        android:text="扫码返回"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="@dimen/line"
+        android:layout_below="@id/titleTv"
+        android:background="@color/item_line" />
+
+    <TextView
+        android:id="@+id/popCodeTag"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:layout_alignLeft="@id/titleTv"
+        android:layout_below="@id/titleTv"
+        android:layout_marginTop="@dimen/padding"
+        android:text="设备编号"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <TextView
+        android:id="@+id/popCodeTv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/popCodeTag"
+        android:layout_toRightOf="@id/popCodeTag"
+        android:text="设备编号"
+        android:layout_marginLeft="@dimen/padding"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <TextView
+        android:id="@+id/popNameTag"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:layout_alignLeft="@id/titleTv"
+        android:layout_below="@id/popCodeTag"
+        android:layout_marginTop="@dimen/padding"
+        android:text="设备名称"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <TextView
+        android:id="@+id/popNameTv"
+        android:layout_width="wrap_content"
+        android:layout_marginLeft="@dimen/padding"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/popNameTag"
+        android:layout_toRightOf="@id/popNameTag"
+        android:text="设备名称"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <TextView
+        android:id="@+id/popGuiTag"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:layout_alignLeft="@id/titleTv"
+        android:layout_below="@id/popNameTag"
+        android:layout_marginTop="@dimen/padding"
+        android:text="设备规格"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <TextView
+        android:id="@+id/popGuiTv"
+        android:layout_width="wrap_content"
+        android:layout_marginLeft="@dimen/padding"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/popGuiTag"
+        android:layout_toRightOf="@id/popGuiTag"
+        android:text="设备规格:"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+    <TextView
+        android:id="@+id/popUnActNumTag"
+        android:layout_width="80dp"
+        android:layout_height="wrap_content"
+        android:layout_alignLeft="@id/titleTv"
+        android:layout_below="@id/popGuiTag"
+        android:layout_marginTop="@dimen/padding"
+        android:text="未盘点数量"
+        android:textColor="@color/hintColor"
+        android:textSize="@dimen/text_main" />
+
+    <TextView
+        android:id="@+id/popUnActNumTv"
+        android:layout_marginLeft="@dimen/padding"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_alignTop="@id/popUnActNumTag"
+        android:layout_toRightOf="@id/popUnActNumTag"
+        android:text="设备规格"
+        android:textColor="@color/text_main"
+        android:textSize="@dimen/text_main" />
+
+
+    <LinearLayout
+        android:layout_below="@id/popUnActNumTag"
+        android:layout_width="match_parent"
+        android:paddingLeft="50dp"
+        android:paddingRight="50dp"
+        android:layout_height="40dp"
+        android:layout_centerHorizontal="true"
+        android:layout_marginTop="20dp"
+        android:orientation="horizontal">
+
+        <Button
+            android:id="@+id/backBtn"
+            android:layout_width="0dp"
+            android:paddingLeft="12dp"
+            android:paddingRight="12dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="10dp"
+            android:layout_weight="1"
+            android:background="@drawable/bg_bule_btn"
+            android:padding="@dimen/padding"
+            android:text="返回"
+            android:textColor="@color/white" />
+
+        <Button
+            android:id="@+id/nextBtn"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="10dp"
+            android:layout_weight="1"
+            android:background="@drawable/bg_bule_btn"
+            android:padding="@dimen/padding"
+            android:text="继续"
+            android:paddingLeft="12dp"
+            android:paddingRight="12dp"
+            android:textColor="@color/white" />
+    </LinearLayout>
+</RelativeLayout>

+ 3 - 0
app_modular/appworks/src/main/res/values/strings.xml

@@ -82,6 +82,9 @@
     <string name="text_maintenance">养护管理</string>
     <string name="text_fault_inspection">故障送检</string>
     <string name="text_cycle_count">周期盘点</string>
+    <string name="text_cycle_count_add">添加盘点</string>
+    <string name="more_info"><u>详细信息</u></string>
+    <string name="cycle">盘点</string>
 
 
 </resources>

Kaikkia tiedostoja ei voida näyttää, sillä liian monta tiedostoa muuttui tässä diffissä