Преглед на файлове

提交类型 添加功能,处理bug
提交内容 添加设备管理方面需求代码

Bitliker преди 8 години
родител
ревизия
24fb791377

+ 3 - 3
WeiChat/version.properties

@@ -1,5 +1,5 @@
-#Thu Mar 15 16:31:15 CST 2018
-debugName=286
+#Mon Mar 19 17:14:22 CST 2018
+debugName=295
 versionName=622
 versionName=622
-debugCode=286
+debugCode=295
 versionCode=161
 versionCode=161

+ 3 - 2
app_core/common/src/main/java/com/core/app/Constants.java

@@ -20,8 +20,8 @@ public class Constants {
     public static String IM_BASE_URL() {
     public static String IM_BASE_URL() {
         String url = "";
         String url = "";
         if (BaseConfig.isDebug()) {
         if (BaseConfig.isDebug()) {
-            url = IM_BASE_URL_TEST;
-//            url = IM_BASE_URL;
+//            url = IM_BASE_URL_TEST;
+            url = IM_BASE_URL;
         } else {
         } else {
             url = IM_BASE_URL;
             url = IM_BASE_URL;
         }
         }
@@ -481,6 +481,7 @@ public class Constants {
         String DEVICE_WHICH_PAGE = "device_which_page";
         String DEVICE_WHICH_PAGE = "device_which_page";
         String DEVICE_FROM_COMMON = "device_from_common";
         String DEVICE_FROM_COMMON = "device_from_common";
         String DEVICE_FROM_QUERY = "device_from_query";
         String DEVICE_FROM_QUERY = "device_from_query";
+        String MODEL = "model";
 
 
         /**
         /**
          * 一元捐
          * 一元捐

+ 31 - 9
app_core/common/src/main/res/layout/activity_common_docui.xml

@@ -356,17 +356,39 @@
 
 
     </LinearLayout>
     </LinearLayout>
 
 
-    <TextView
-        android:id="@+id/sureTv"
+    <LinearLayout
+        android:id="@+id/deviceLL"
         android:layout_width="match_parent"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:layout_height="wrap_content"
+        android:orientation="horizontal"
         android:layout_marginTop="10dp"
         android:layout_marginTop="10dp"
-        android:gravity="center"
-        android:paddingBottom="10dp"
-        android:paddingTop="10dp"
-        android:text="@string/common_sure"
-        android:background="@drawable/selector_me_menu_item_bg"
-        android:textColor="@color/titleBlue"
         android:visibility="gone"
         android:visibility="gone"
-        android:textSize="18sp" />
+        >
+        <TextView
+            android:id="@+id/sureTv"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:paddingBottom="10dp"
+            android:paddingTop="10dp"
+            android:text="@string/common_sure"
+            android:background="@drawable/selector_me_menu_item_bg"
+            android:textColor="@color/titleBlue"
+            android:textSize="18sp" />
+        <TextView
+            android:id="@+id/turnScrapTv"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:paddingBottom="10dp"
+            android:paddingTop="10dp"
+            android:visibility="gone"
+            android:text="转报废申请单"
+            android:background="@drawable/selector_me_menu_item_bg"
+            android:textColor="@color/titleBlue"
+            android:textSize="18sp" />
+    </LinearLayout>
+
 </LinearLayout>
 </LinearLayout>

+ 93 - 5
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceCycleCountInfoActivity.java

@@ -47,11 +47,12 @@ public class DeviceCycleCountInfoActivity extends BaseActivity implements View.O
     private String id;
     private String id;
     private TextView actionqtyTv;
     private TextView actionqtyTv;
     private TextView unactionqtyTv;
     private TextView unactionqtyTv;
-    private TextView codeTv;
+    private TextView codeTv, workshopTv;
     private ListView mListView;
     private ListView mListView;
     private TextView centerTv;
     private TextView centerTv;
     private TextView lineTv;
     private TextView lineTv;
     private TextView kindTv;
     private TextView kindTv;
+    private ListView gridList;
 
 
     @Override
     @Override
     protected void onCreate(Bundle savedInstanceState) {
     protected void onCreate(Bundle savedInstanceState) {
@@ -83,8 +84,11 @@ public class DeviceCycleCountInfoActivity extends BaseActivity implements View.O
             }
             }
         }
         }
         loadData(true);
         loadData(true);
+        loadGridData(page);
     }
     }
 
 
+    private int page=1;
+
     private void initJSONData(String message) throws Exception {
     private void initJSONData(String message) throws Exception {
         JSONArray array = JSON.parseArray(message);
         JSONArray array = JSON.parseArray(message);
         JSONObject object;
         JSONObject object;
@@ -108,6 +112,8 @@ public class DeviceCycleCountInfoActivity extends BaseActivity implements View.O
 
 
     private void initView() {
     private void initView() {
         codeTv = findViewById(R.id.codeTv);
         codeTv = findViewById(R.id.codeTv);
+        workshopTv = findViewById(R.id.workshopTv);
+        gridList = findViewById(R.id.gridList);
         centerTv = findViewById(R.id.centerTv);
         centerTv = findViewById(R.id.centerTv);
         lineTv = findViewById(R.id.lineTv);
         lineTv = findViewById(R.id.lineTv);
         kindTv = findViewById(R.id.kindTv);
         kindTv = findViewById(R.id.kindTv);
@@ -117,11 +123,13 @@ public class DeviceCycleCountInfoActivity extends BaseActivity implements View.O
         findViewById(R.id.actionqtyTv).setOnClickListener(this);
         findViewById(R.id.actionqtyTv).setOnClickListener(this);
         findViewById(R.id.unactionqtyTv).setOnClickListener(this);
         findViewById(R.id.unactionqtyTv).setOnClickListener(this);
         findViewById(R.id.cycleBtn).setOnClickListener(this);
         findViewById(R.id.cycleBtn).setOnClickListener(this);
+        findViewById(R.id.deviceAttributeBtn).setOnClickListener(this);
+        findViewById(R.id.lossDeviceBtn).setOnClickListener(this);
     }
     }
 
 
 
 
     private void loadData(boolean showDialog) {
     private void loadData(boolean showDialog) {
-        if (showDialog){
+        if (showDialog) {
             progressDialog.show();
             progressDialog.show();
         }
         }
         httpClient.Api().send(new HttpClient.Builder()
         httpClient.Api().send(new HttpClient.Builder()
@@ -172,17 +180,95 @@ public class DeviceCycleCountInfoActivity extends BaseActivity implements View.O
         }));
         }));
     }
     }
 
 
+    private void loadGridData(int page) {
+        progressDialog.show();
+        String condition = "dc_dbid="+id;
+        httpClient.Api().send(new HttpClient.Builder()
+                .url("mobile/common/getGridPanelandDataPage.action")
+                .add("caller", "DeviceBatch!Stock")
+                .add("condition", condition)
+                .add("page", page)
+                .add("pageSize", 50)
+                .method(Method.POST)
+                .build(), new ResultSubscriber<>(new ResultListener<Object>() {
+            @Override
+            public void onResponse(Object o) {
+                if (progressDialog != null) {
+                    progressDialog.dismiss();
+                }
+                try {
+                    LogUtil.i("o.toString()="+o.toString());
+                } catch (Exception e) {
+                    if (e != null) {
+                        LogUtil.i("e=" + e.getMessage());
+                    }
+                }
+
+            }
+        }));
+    }
+
+    private void deviceAttribute() {
+        progressDialog.show();
+        httpClient.Api().send(new HttpClient.Builder()
+                .url("mobile/device/getDeviceAttribute.action")
+                .add("caller", "DeviceBatch!Stock")
+                .add("id", id)
+                .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 lossDevice() {
+        progressDialog.show();
+        httpClient.Api().send(new HttpClient.Builder()
+                .url("mobile/device/lossDevice.action")
+                .add("caller", "DeviceBatch!Stock")
+                .add("id", id)
+                .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 {
     private void handleData(String message) throws Exception {
         JSONObject object = JSONUtil.getJSONObject(message, "data");
         JSONObject object = JSONUtil.getJSONObject(message, "data");
         String code = JSONUtil.getText(object, "DB_CODE");
         String code = JSONUtil.getText(object, "DB_CODE");
-        String centercode = JSONUtil.getText(object, "DB_CENTERCODE");
+        String workShop = JSONUtil.getText(object, "DB_WORKSHOP");
         String centername = JSONUtil.getText(object, "DB_CENTERNAME");
         String centername = JSONUtil.getText(object, "DB_CENTERNAME");
         String linecode = JSONUtil.getText(object, "DB_LINECODE");
         String linecode = JSONUtil.getText(object, "DB_LINECODE");
         String devkind = JSONUtil.getText(object, "DB_DEVTYPE");
         String devkind = JSONUtil.getText(object, "DB_DEVTYPE");
         String actionqty = JSONUtil.getText(object, "DB_ACTIONQTY");
         String actionqty = JSONUtil.getText(object, "DB_ACTIONQTY");
         String unactionqty = JSONUtil.getText(object, "DB_UNACTIONQTY");
         String unactionqty = JSONUtil.getText(object, "DB_UNACTIONQTY");
         codeTv.setText(code);
         codeTv.setText(code);
+        workshopTv.setText(workShop);
         centerTv.setText(centername);
         centerTv.setText(centername);
         lineTv.setText(linecode);
         lineTv.setText(linecode);
         kindTv.setText(devkind);
         kindTv.setText(devkind);
@@ -286,6 +372,10 @@ public class DeviceCycleCountInfoActivity extends BaseActivity implements View.O
             if (mPopupWindow != null && mPopupWindow.isShowing()) {
             if (mPopupWindow != null && mPopupWindow.isShowing()) {
                 mPopupWindow.dismiss();
                 mPopupWindow.dismiss();
             }
             }
+        } else if (R.id.deviceAttributeBtn == id) {
+            deviceAttribute();
+        } else if (R.id.lossDeviceBtn == id) {
+            lossDevice();
         }
         }
     }
     }
 
 
@@ -318,8 +408,6 @@ public class DeviceCycleCountInfoActivity extends BaseActivity implements View.O
             if (bundle != null) {
             if (bundle != null) {
                 if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_SUCCESS) {
                 if (bundle.getInt(CodeUtils.RESULT_TYPE) == CodeUtils.RESULT_SUCCESS) {
                     String result = bundle.getString(CodeUtils.RESULT_STRING);
                     String result = bundle.getString(CodeUtils.RESULT_STRING);
-                    //TODO 测试数据
-//                    result = "ASDF01098";
                     submitCycle(result);
                     submitCycle(result);
                 }
                 }
             }
             }

+ 53 - 20
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/DeviceDataFormAddActivity.java

@@ -58,6 +58,7 @@ import com.uas.appworks.OA.erp.activity.form.FormListSelectActivity;
 import com.uas.appworks.OA.erp.model.form.GroupData;
 import com.uas.appworks.OA.erp.model.form.GroupData;
 import com.uas.appworks.R;
 import com.uas.appworks.R;
 import com.uas.appworks.activity.DeviceQueryActivity;
 import com.uas.appworks.activity.DeviceQueryActivity;
+import com.uas.appworks.model.Device;
 
 
 import java.text.DecimalFormat;
 import java.text.DecimalFormat;
 import java.text.ParseException;
 import java.text.ParseException;
@@ -171,15 +172,15 @@ public class DeviceDataFormAddActivity extends BaseActivity implements View.OnCl
                                 data.setMaxlength(String.valueOf(items.getIntValue("fd_maxlength")));
                                 data.setMaxlength(String.valueOf(items.getIntValue("fd_maxlength")));
                                 data.setFdid(items.getIntValue("fd_id"));
                                 data.setFdid(items.getIntValue("fd_id"));
 
 
-                                if ("ID".equals(data.getName())){
-                                    formidkey=data.getField();
+                                if ("ID".equals(data.getName())) {
+                                    formidkey = data.getField();
                                 }
                                 }
                                 if (formData == null || formData.isEmpty()) {
                                 if (formData == null || formData.isEmpty()) {
                                     data.setValue(items.getString("fd_value"));
                                     data.setValue(items.getString("fd_value"));
                                 } else {
                                 } else {
-                                    String values=JSONUtil.getText(formData,data.getField().toUpperCase());
+                                    String values = JSONUtil.getText(formData, data.getField().toUpperCase());
 //                                    LogUtil.i("keys="+keys);
 //                                    LogUtil.i("keys="+keys);
-                                    LogUtil.i("values="+values);
+                                    LogUtil.i("values=" + values);
                                     data.setValue(values);
                                     data.setValue(values);
                                 }
                                 }
                                 if (startDate.equals(items.getString("fd_field"))) {
                                 if (startDate.equals(items.getString("fd_field"))) {
@@ -195,17 +196,51 @@ public class DeviceDataFormAddActivity extends BaseActivity implements View.OnCl
                                     endDate_v = data.getValue();
                                     endDate_v = data.getValue();
                                 }
                                 }
                                 //添加默认值
                                 //添加默认值
-                                if (TextUtils.isEmpty(data.getValue())){
-                                    if (data.getName().equals("设备编号")) {
-                                        data.setValue(noCode);
-                                    } else if (data.getName().equals("送检人编号") || data.getName().equals("申请人编号") || data.getName().equals("送检人编号") || data.getName().equals("人员编号")) {
-                                        data.setValue(CommonUtil.getEmcode());
-                                    } else if (data.getName().equals("送检人名称") || data.getName().equals("申请人名称") || data.getName().equals("送检人名称") || data.getName().equals("人员名称")) {
-                                        data.setValue(CommonUtil.getName());
-                                    } else if ("dc_emcode".equals(data.getField())) {
-                                        data.setValue(CommonUtil.getEmcode());
-                                    } else if ("dc_emname".equals(data.getField())) {
-                                        data.setValue(CommonUtil.getName());
+                                if (TextUtils.isEmpty(data.getValue())) {
+
+                                    switch (data.getName()) {
+                                        case "设备编号":
+                                            if (mDevice != null) {
+                                                data.setValue(mDevice.getCode());
+                                            }
+                                            break;
+                                        case "设备名称":
+                                            if (mDevice != null) {
+                                                data.setValue(mDevice.getName());
+                                            }
+                                            break;
+                                        case "当前线别":
+                                            if (mDevice != null) {
+                                                data.setValue(mDevice.getLineCode());
+                                            }
+                                            break;
+                                        case "当前使用部门":
+                                            if (mDevice != null) {
+                                                data.setValue(mDevice.getCenterCode());
+                                            }
+                                            break;
+                                        case "当前部门名称":
+                                            if (mDevice != null) {
+                                                data.setValue(mDevice.getCenterName());
+                                            }
+                                            break;
+                                        case "送检人编号":
+                                        case "申请人编号":
+                                        case "人员编号":
+                                            data.setValue(CommonUtil.getEmcode());
+                                            break;
+                                        case "送检人名称":
+                                        case "申请人名称":
+                                        case "人员名称":
+                                            data.setValue(CommonUtil.getName());
+                                            break;
+                                        default:
+                                            if ("dc_emcode".equals(data.getField())) {
+                                                data.setValue(CommonUtil.getEmcode());
+                                            } else if ("dc_emname".equals(data.getField())) {
+                                                data.setValue(CommonUtil.getName());
+                                            }
+
                                     }
                                     }
                                 }
                                 }
                                 if (data.getField().equals("dc_class")) {
                                 if (data.getField().equals("dc_class")) {
@@ -510,7 +545,7 @@ public class DeviceDataFormAddActivity extends BaseActivity implements View.OnCl
                         va_id = JSONUtil.getInt(object, "dc_id", "db_id");
                         va_id = JSONUtil.getInt(object, "dc_id", "db_id");
                         LogUtil.i("va_id=" + va_id);
                         LogUtil.i("va_id=" + va_id);
                         LogUtil.i("result=" + result);
                         LogUtil.i("result=" + result);
-                       judgeApprovers(va_id);//TODO 默认先不使用审批流
+                        judgeApprovers(va_id);//TODO 默认先不使用审批流
 //                        commitSuccess();
 //                        commitSuccess();
                     } catch (Exception e) {
                     } catch (Exception e) {
                         e.printStackTrace();
                         e.printStackTrace();
@@ -637,7 +672,7 @@ public class DeviceDataFormAddActivity extends BaseActivity implements View.OnCl
     }
     }
 
 
     private String status;
     private String status;
-    private String noCode;
+    private Device mDevice;
 
 
     private void initView() {
     private void initView() {
         ViewUtils.inject(this);
         ViewUtils.inject(this);
@@ -647,13 +682,11 @@ public class DeviceDataFormAddActivity extends BaseActivity implements View.OnCl
         if (intent != null) {
         if (intent != null) {
             formid = intent.getIntExtra("id", 0);
             formid = intent.getIntExtra("id", 0);
             status = intent.getStringExtra("status");
             status = intent.getStringExtra("status");
-            noCode = intent.getStringExtra("noCode");
+            mDevice = intent.getParcelableExtra(Constants.FLAG.MODEL);
             caller = intent.getStringExtra("caller");
             caller = intent.getStringExtra("caller");
             if (!StringUtil.isEmpty(intent.getStringExtra("title"))) {
             if (!StringUtil.isEmpty(intent.getStringExtra("title"))) {
                 getSupportActionBar().setTitle(intent.getStringExtra("title"));
                 getSupportActionBar().setTitle(intent.getStringExtra("title"));
             }
             }
-            LogUtil.i("更新caller:" + caller);
-            LogUtil.i("更新id:" + formid);
         }
         }
     }
     }
 
 

+ 42 - 7
app_modular/appworks/src/main/java/com/uas/appworks/CRM/erp/activity/ScanDetailActivity.java

@@ -6,6 +6,8 @@ import android.support.v7.app.ActionBar;
 import android.support.v7.widget.DefaultItemAnimator;
 import android.support.v7.widget.DefaultItemAnimator;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.LinearLayoutManager;
 import android.support.v7.widget.RecyclerView;
 import android.support.v7.widget.RecyclerView;
+import android.text.TextUtils;
+import android.util.Log;
 import android.view.LayoutInflater;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.View;
 import android.view.ViewGroup;
 import android.view.ViewGroup;
@@ -19,11 +21,13 @@ import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.common.LogUtil;
 import com.common.LogUtil;
+import com.common.config.BaseConfig;
 import com.common.data.DateFormatUtil;
 import com.common.data.DateFormatUtil;
 import com.common.data.JSONUtil;
 import com.common.data.JSONUtil;
 import com.common.data.ListUtils;
 import com.common.data.ListUtils;
 import com.common.data.StringUtil;
 import com.common.data.StringUtil;
 import com.common.system.DisplayUtil;
 import com.common.system.DisplayUtil;
+import com.core.app.Constants;
 import com.core.app.MyApplication;
 import com.core.app.MyApplication;
 import com.core.base.BaseActivity;
 import com.core.base.BaseActivity;
 import com.core.net.utils.NetUtils;
 import com.core.net.utils.NetUtils;
@@ -37,6 +41,7 @@ import com.modular.apputils.widget.RecycleViewDivider;
 import com.module.recyclerlibrary.ui.refresh.BaseRefreshLayout;
 import com.module.recyclerlibrary.ui.refresh.BaseRefreshLayout;
 import com.uas.appworks.CRM.erp.model.DeviceInfo;
 import com.uas.appworks.CRM.erp.model.DeviceInfo;
 import com.uas.appworks.R;
 import com.uas.appworks.R;
+import com.uas.appworks.model.Device;
 
 
 import java.util.ArrayList;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Collections;
@@ -61,6 +66,7 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
     private List<DeviceInfo> historyInfoList;
     private List<DeviceInfo> historyInfoList;
 
 
     private int selectItem;
     private int selectItem;
+    private Device mDevice;
 
 
     @Override
     @Override
     protected void onCreate(Bundle savedInstanceState) {
     protected void onCreate(Bundle savedInstanceState) {
@@ -180,16 +186,16 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
         } else if (R.id.doneTv == id) {
         } else if (R.id.doneTv == id) {
             showMuenPop(v);
             showMuenPop(v);
         } else if (R.id.popUseApplyBtn == id) {
         } 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));
+            startActivity(new Intent(ct, DeviceDataFormAddActivity.class).putExtra("title", StringUtil.getMessage(R.string.text_application_use)).putExtra("caller", "DeviceChange!Use").putExtra(Constants.FLAG.MODEL, mDevice));
             dismissMenuPop();
             dismissMenuPop();
         } else if (R.id.popScrapApplyBtn == id) {
         } 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));
+            startActivity(new Intent(ct, DeviceDataFormAddActivity.class).putExtra("title", StringUtil.getMessage(R.string.text_scrap_application)).putExtra("caller", "DeviceChange!Scrap").putExtra(Constants.FLAG.MODEL, mDevice));
             dismissMenuPop();
             dismissMenuPop();
         } else if (R.id.popMaintenanceBtn == id) {
         } 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));
+            startActivity(new Intent(ct, DeviceDataFormAddActivity.class).putExtra("title", StringUtil.getMessage(R.string.text_maintenance)).putExtra("caller", "DeviceChange!Maintain").putExtra(Constants.FLAG.MODEL, mDevice));
             dismissMenuPop();
             dismissMenuPop();
         } else if (R.id.popInspectBtn == id) {
         } 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));
+            startActivity(new Intent(ct, DeviceDataFormAddActivity.class).putExtra("title", StringUtil.getMessage(R.string.text_fault_inspection)).putExtra("caller", "DeviceChange!Inspect").putExtra(Constants.FLAG.MODEL, mDevice));
             dismissMenuPop();
             dismissMenuPop();
         }
         }
 
 
@@ -211,6 +217,7 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
             httpClient.Api().send(new HttpClient.Builder()
             httpClient.Api().send(new HttpClient.Builder()
                     .url("mobile/device/getDeviceInfo.action")
                     .url("mobile/device/getDeviceInfo.action")
                     .add("decode", decode)
                     .add("decode", decode)
+                    .isDebug(BaseConfig.isDebug())
                     .method(Method.GET)
                     .method(Method.GET)
                     .build(), new ResultSubscriber<>(new ResultListener<Object>() {
                     .build(), new ResultSubscriber<>(new ResultListener<Object>() {
                 @Override
                 @Override
@@ -244,13 +251,15 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
         finish();
         finish();
     }
     }
 
 
-    private Comparator<Sort> comparator=new Comparator<Sort>() {
+    private Comparator<Sort> comparator = new Comparator<Sort>() {
         @Override
         @Override
         public int compare(Sort o1, Sort o2) {
         public int compare(Sort o1, Sort o2) {
-            return o1.sort-o2.sort;
+            return o1.sort - o2.sort;
         }
         }
     };
     };
+
     private void handleData(String message) throws Exception {
     private void handleData(String message) throws Exception {
+        LogUtil.i(message);
         JSONObject json = JSON.parseObject(message);
         JSONObject json = JSON.parseObject(message);
         boolean success = JSONUtil.getBoolean(json, "success");
         boolean success = JSONUtil.getBoolean(json, "success");
         JSONObject object = JSONUtil.getJSONObject(json, "data");
         JSONObject object = JSONUtil.getJSONObject(json, "data");
@@ -274,7 +283,7 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
                 JSONObject o = grid2Data.getJSONObject(i);
                 JSONObject o = grid2Data.getJSONObject(i);
                 sorts.add(new Sort(JSONUtil.getInt(o, "DC_ID"), o));
                 sorts.add(new Sort(JSONUtil.getInt(o, "DC_ID"), o));
             }
             }
-            Collections.sort(sorts,comparator);
+            Collections.sort(sorts, comparator);
             List<DeviceInfo> historyListData = new ArrayList<>();
             List<DeviceInfo> historyListData = new ArrayList<>();
             for (int i = 0; i < sorts.size(); i++) {
             for (int i = 0; i < sorts.size(); i++) {
                 historyListData.addAll(handleFromGrid(false, "设备履历" + (i + 1), grid2Item, sorts.get(i).object));
                 historyListData.addAll(handleFromGrid(false, "设备履历" + (i + 1), grid2Item, sorts.get(i).object));
@@ -323,6 +332,8 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
 
 
     private List<DeviceInfo> handleFromGrid(boolean isFrom, String title, JSONArray items, JSONObject data) throws Exception {
     private List<DeviceInfo> handleFromGrid(boolean isFrom, String title, JSONArray items, JSONObject data) throws Exception {
         List<DeviceInfo> deviceInfos = new ArrayList<>();
         List<DeviceInfo> deviceInfos = new ArrayList<>();
+        mDevice = new Device();
+        mDevice.setCode(decode);
         for (int i = 0; i < items.size(); i++) {
         for (int i = 0; i < items.size(); i++) {
             JSONObject item = items.getJSONObject(i);
             JSONObject item = items.getJSONObject(i);
             String field = JSONUtil.getText(item, "field", "dataIndex");
             String field = JSONUtil.getText(item, "field", "dataIndex");
@@ -332,6 +343,30 @@ public class ScanDetailActivity extends BaseActivity implements View.OnClickList
             if (isFrom && caption.equals("ID")) {
             if (isFrom && caption.equals("ID")) {
                 id = values;
                 id = values;
             }
             }
+
+            switch (caption) {
+                case "使用车间":
+                    mDevice.setWorkshop(values);
+                    break;
+                case "设备名称":
+                    mDevice.setName(values);
+                    break;
+                case "设备编号":
+                    if (!TextUtils.isEmpty(values)) {
+                        mDevice.setCode(values);
+                    }
+                    break;
+                case "当前线别":
+                    mDevice.setLineCode(values);
+                    break;
+                case "当前使用部门":
+                    mDevice.setCenterCode(values);
+                    break;
+                case "当前部门名称":
+                    mDevice.setCenterName(values);
+                    break;
+            }
+
             deviceInfos.add(new DeviceInfo(isFrom, i == 0 ? title : null, caption, field, values));
             deviceInfos.add(new DeviceInfo(isFrom, i == 0 ? title : null, caption, field, values));
         }
         }
 
 

+ 51 - 9
app_modular/appworks/src/main/java/com/uas/appworks/OA/erp/activity/CommonDocDetailsActivity.java

@@ -74,6 +74,7 @@ import java.util.Map;
  */
  */
 public class CommonDocDetailsActivity extends BaseActivity {
 public class CommonDocDetailsActivity extends BaseActivity {
 
 
+    private static final int COM_DOC_DEVICE_TURN_SACN = 1214;
     private static final int COM_DOC_RESUB_SUCCESSFUL = 1213;
     private static final int COM_DOC_RESUB_SUCCESSFUL = 1213;
     private static final int COM_DOC_REDELETE_SUCCESSFUL = 1215;
     private static final int COM_DOC_REDELETE_SUCCESSFUL = 1215;
     private static final int NEW_DOC_RESUB_SUCCESSFUL = 52601;
     private static final int NEW_DOC_RESUB_SUCCESSFUL = 52601;
@@ -113,6 +114,8 @@ public class CommonDocDetailsActivity extends BaseActivity {
     private LinearLayout disagree_ll;
     private LinearLayout disagree_ll;
     private LinearLayout resanddel_ll;
     private LinearLayout resanddel_ll;
     private TextView sureTv;
     private TextView sureTv;
+    private TextView turnScrapTv;
+    private LinearLayout deviceLL;
     private LinearLayout resubmit_ll;
     private LinearLayout resubmit_ll;
     private LinearLayout delete_ll;
     private LinearLayout delete_ll;
     private CustomerScrollView commondoc_sv;
     private CustomerScrollView commondoc_sv;
@@ -208,6 +211,8 @@ public class CommonDocDetailsActivity extends BaseActivity {
         disagree_ll = (LinearLayout) findViewById(R.id.common_docui_disagree_ll);
         disagree_ll = (LinearLayout) findViewById(R.id.common_docui_disagree_ll);
         resanddel_ll = (LinearLayout) findViewById(R.id.item_common_docui_res_and_del_ll);
         resanddel_ll = (LinearLayout) findViewById(R.id.item_common_docui_res_and_del_ll);
         sureTv = (TextView) findViewById(R.id.sureTv);
         sureTv = (TextView) findViewById(R.id.sureTv);
+        turnScrapTv = findViewById(R.id.turnScrapTv);
+        deviceLL = findViewById(R.id.deviceLL);
         resubmit_ll = (LinearLayout) findViewById(R.id.common_docui_resubmit_ll);
         resubmit_ll = (LinearLayout) findViewById(R.id.common_docui_resubmit_ll);
         delete_ll = (LinearLayout) findViewById(R.id.common_docui_delete_ll);
         delete_ll = (LinearLayout) findViewById(R.id.common_docui_delete_ll);
         commondoc_sv = (CustomerScrollView) findViewById(R.id.common_docui_sv);
         commondoc_sv = (CustomerScrollView) findViewById(R.id.common_docui_sv);
@@ -338,6 +343,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
     public Handler mHandler = new Handler() {
     public Handler mHandler = new Handler() {
         @Override
         @Override
         public void handleMessage(Message msg) {
         public void handleMessage(Message msg) {
+            String message = msg.getData().getString("result");
             switch (msg.what) {
             switch (msg.what) {
                 case SURE_DEVICE:
                 case SURE_DEVICE:
 
 
@@ -473,6 +479,19 @@ public class CommonDocDetailsActivity extends BaseActivity {
                         progressDialog.dismiss();
                         progressDialog.dismiss();
                     }
                     }
                     break;
                     break;
+
+                case COM_DOC_DEVICE_TURN_SACN://设备管理送检单转报废申请
+                    JSONObject turnSacnObject = JSON.parseObject(message);
+                    if (JSONUtil.getBoolean(turnSacnObject, "success")) {
+                        int sacnId = JSONUtil.getInt(turnSacnObject, "data");
+                        startActivity(new Intent(ct, CommonDocDetailsActivity.class)
+                                .putExtra("caller", mCaller)
+                                .putExtra("keyValue", sacnId)
+                                .putExtra("device", true)
+                                .putExtra("status", "在录入"));
+                        finish();
+                    }
+                    break;
             }
             }
         }
         }
     };
     };
@@ -658,19 +677,32 @@ public class CommonDocDetailsActivity extends BaseActivity {
 //            resanddel_ll.setVisibility(View.GONE);
 //            resanddel_ll.setVisibility(View.GONE);
             if (real_status.equals("已审核") && !StringUtil.isEmpty(mCaller) && (mCaller.equals("DeviceChange!Use") || mCaller.equals("DeviceChange!Inspect"))) {
             if (real_status.equals("已审核") && !StringUtil.isEmpty(mCaller) && (mCaller.equals("DeviceChange!Use") || mCaller.equals("DeviceChange!Inspect"))) {
                 resanddel_ll.setVisibility(View.GONE);
                 resanddel_ll.setVisibility(View.GONE);
-                sureTv.setVisibility(View.VISIBLE);
-                sureTv.setOnClickListener(new View.OnClickListener() {
-                    @Override
-                    public void onClick(View v) {
-                        sureDevice();
-                    }
-                });
+                deviceLL.setVisibility(View.VISIBLE);
+                sureTv.setOnClickListener(mOnClickListener);
+                if (mCaller != null && mCaller.equals("DeviceChange!Inspect")) {
+                    turnScrapTv.setVisibility(View.VISIBLE);
+                    turnScrapTv.setOnClickListener(mOnClickListener);
+                }
 
 
             }
             }
 
 
         }
         }
     }
     }
 
 
+
+    private View.OnClickListener mOnClickListener = new View.OnClickListener() {
+        @Override
+        public void onClick(View v) {
+            int id = v.getId();
+            if (id == R.id.sureTv) {
+                sureDevice();
+            } else if (id == R.id.turnScrapTv) {
+                deviceTurnScrap();
+            }
+        }
+    };
+
+
     /**
     /**
      * 处理请求审批流url后获取到的数据并显示
      * 处理请求审批流url后获取到的数据并显示
      *
      *
@@ -937,7 +969,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
             } catch (Exception e) {
             } catch (Exception e) {
                 e.printStackTrace();
                 e.printStackTrace();
             }
             }
-        }else{
+        } else {
             String em_name = CommonUtil.getName();
             String em_name = CommonUtil.getName();
             name_tv.setText(em_name);
             name_tv.setText(em_name);
             String loginUserId = MyApplication.getInstance().mLoginUser.getUserId();
             String loginUserId = MyApplication.getInstance().mLoginUser.getUserId();
@@ -1063,6 +1095,16 @@ public class CommonDocDetailsActivity extends BaseActivity {
         }
         }
     }
     }
 
 
+    private void deviceTurnScrap() {
+        progressDialog.show();
+        Map<String, Object> params = new HashMap<>();
+        params.put("caller", mCaller);
+        params.put("id", mkeyValue);
+        LinkedHashMap<String, Object> headers = new LinkedHashMap<>();
+        headers.put("Cookie", "JSESSIONID=" + CommonUtil.getSharedPreferences(ct, "sessionId"));
+        String url = CommonUtil.getAppBaseUrl(ct) + "mobile/device/turnScrap/action";
+        ViewUtil.httpSendRequest(ct, url, params, mHandler, headers, COM_DOC_DEVICE_TURN_SACN, null, null, "post");
+    }
 
 
     private void getapplypeomsg(String em_number) {
     private void getapplypeomsg(String em_number) {
         if (TextUtils.isEmpty(em_number)) {
         if (TextUtils.isEmpty(em_number)) {
@@ -1090,7 +1132,7 @@ public class CommonDocDetailsActivity extends BaseActivity {
                     Log.i("aptodo", "imId=" + imId + "imName" + imName + "imDepartment" + imDepartment + "imPosition" + imPosition);
                     Log.i("aptodo", "imId=" + imId + "imName" + imName + "imDepartment" + imDepartment + "imPosition" + imPosition);
                 } else {
                 } else {
                     name_tv.setText(CommonUtil.getName());
                     name_tv.setText(CommonUtil.getName());
-                    String imId=MyApplication.getInstance().getLoginUserId();
+                    String imId = MyApplication.getInstance().getLoginUserId();
                     if (!StringUtil.isEmpty(imId)) {
                     if (!StringUtil.isEmpty(imId)) {
                         AvatarHelper.getInstance().display(imId, photo_im, true, false);
                         AvatarHelper.getInstance().display(imId, photo_im, true, false);
                     }
                     }

+ 12 - 10
app_modular/appworks/src/main/java/com/uas/appworks/activity/DeviceQueryActivity.java

@@ -207,8 +207,8 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
                 int reallyPosition = (int) parent.getItemIdAtPosition(position);
                 int reallyPosition = (int) parent.getItemIdAtPosition(position);
                 if (Constants.FLAG.DEVICE_FROM_COMMON.equals(mWhichPage)) {
                 if (Constants.FLAG.DEVICE_FROM_COMMON.equals(mWhichPage)) {
                     String keyValue = null, status = null;
                     String keyValue = null, status = null;
-                    if (ListUtils.getSize(mDeviceQueryFlexAdapter.getRowChildBeans())<=reallyPosition)
-                    return;
+                    if (ListUtils.getSize(mDeviceQueryFlexAdapter.getRowChildBeans()) <= reallyPosition)
+                        return;
                     List<DataInquiryFlexBean.RowBean.RowChildBean> childBeans = mDeviceQueryFlexAdapter.getRowChildBeans().get(reallyPosition);
                     List<DataInquiryFlexBean.RowBean.RowChildBean> childBeans = mDeviceQueryFlexAdapter.getRowChildBeans().get(reallyPosition);
                     for (DataInquiryFlexBean.RowBean.RowChildBean rowChildBean : childBeans) {
                     for (DataInquiryFlexBean.RowBean.RowChildBean rowChildBean : childBeans) {
                         if ("dc_id".equals(rowChildBean.getField())) {
                         if ("dc_id".equals(rowChildBean.getField())) {
@@ -225,7 +225,7 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
                             .putExtra("caller", mCaller)
                             .putExtra("caller", mCaller)
                             .putExtra("keyValue", keyValue)
                             .putExtra("keyValue", keyValue)
                             .putExtra("device", true)
                             .putExtra("device", true)
-                            .putExtra("status", status),0x981);
+                            .putExtra("status", status), 0x981);
 
 
                 } else {
                 } else {
                     if (CommonUtil.isRepeatClick()) {
                     if (CommonUtil.isRepeatClick()) {
@@ -372,8 +372,9 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
 
 
     private void initConditions() {
     private void initConditions() {
         if ("Device".equals(mCaller)) {
         if ("Device".equals(mCaller)) {
-            SchemeConditionBean schemeConditionBean
-                    = initCondition("设备编号", "de_code", "S");
+            SchemeConditionBean schemeConditionBean = null;
+
+            schemeConditionBean = initCondition("设备编号", "de_code", "S");
             mConditionBeans.add(schemeConditionBean);
             mConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
 
 
@@ -381,19 +382,20 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
             mConditionBeans.add(schemeConditionBean);
             mConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
 
 
-            schemeConditionBean = initCondition("设备类型", "de_type", "S");
+            schemeConditionBean = initCondition("设备种类", "de_kind", "S");
             mConditionBeans.add(schemeConditionBean);
             mConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
 
 
-            schemeConditionBean = initCondition("设备种类", "de_kind", "S");
+
+            schemeConditionBean = initCondition("设备类型", "de_type", "S");
             mConditionBeans.add(schemeConditionBean);
             mConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
 
 
-            schemeConditionBean = initCondition("所属部门", "de_currentcentercode", "S");
+            schemeConditionBean = initCondition("所属线别", "de_currentlinecode", "S");
             mConditionBeans.add(schemeConditionBean);
             mConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
 
 
-            schemeConditionBean = initCondition("所属线别", "de_currentlinecode", "S");
+            schemeConditionBean = initCondition("所属部门", "de_currentcentercode", "S");
             mConditionBeans.add(schemeConditionBean);
             mConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
             mfuzzyConditionBeans.add(schemeConditionBean);
 
 
@@ -461,7 +463,7 @@ public class DeviceQueryActivity extends BaseMVPActivity<WorkPlatPresenter> impl
     @Override
     @Override
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
     protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
         super.onActivityResult(requestCode, resultCode, data);
-        if (requestCode==0x981){
+        if (requestCode == 0x981) {
             mPageIndex = 1;
             mPageIndex = 1;
             obtainDeviceList();
             obtainDeviceList();
         }
         }

+ 105 - 0
app_modular/appworks/src/main/java/com/uas/appworks/model/Device.java

@@ -0,0 +1,105 @@
+package com.uas.appworks.model;
+
+import android.os.Parcel;
+import android.os.Parcelable;
+
+/**
+ * Created by Bitlike on 2018/3/19.
+ */
+
+public class Device implements Parcelable {
+    private String code;
+    private String name;
+    private String lineCode;//线别
+    private String centerCode;//部门
+    private String centerName;//部门
+    private String workshop;//使用车间
+
+
+    public String getCode() {
+        return code;
+    }
+
+    public void setCode(String code) {
+        this.code = code;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
+    }
+
+    public String getLineCode() {
+        return lineCode;
+    }
+
+    public void setLineCode(String lineCode) {
+        this.lineCode = lineCode;
+    }
+
+    public String getCenterCode() {
+        return centerCode;
+    }
+
+    public void setCenterCode(String centerCode) {
+        this.centerCode = centerCode;
+    }
+
+    public String getCenterName() {
+        return centerName;
+    }
+
+    public void setCenterName(String centerName) {
+        this.centerName = centerName;
+    }
+
+    public String getWorkshop() {
+        return workshop;
+    }
+
+    public void setWorkshop(String workshop) {
+        this.workshop = workshop;
+    }
+
+    @Override
+    public int describeContents() {
+        return 0;
+    }
+
+    @Override
+    public void writeToParcel(Parcel dest, int flags) {
+        dest.writeString(this.code);
+        dest.writeString(this.name);
+        dest.writeString(this.lineCode);
+        dest.writeString(this.centerCode);
+        dest.writeString(this.centerName);
+        dest.writeString(this.workshop);
+    }
+
+    public Device() {
+    }
+
+    protected Device(Parcel in) {
+        this.code = in.readString();
+        this.name = in.readString();
+        this.lineCode = in.readString();
+        this.centerCode = in.readString();
+        this.centerName = in.readString();
+        this.workshop = in.readString();
+    }
+
+    public static final Parcelable.Creator<Device> CREATOR = new Parcelable.Creator<Device>() {
+        @Override
+        public Device createFromParcel(Parcel source) {
+            return new Device(source);
+        }
+
+        @Override
+        public Device[] newArray(int size) {
+            return new Device[size];
+        }
+    };
+}

+ 239 - 177
app_modular/appworks/src/main/res/layout/activity_device_cycle_info.xml

@@ -1,212 +1,274 @@
 <?xml version="1.0" encoding="utf-8"?>
 <?xml version="1.0" encoding="utf-8"?>
-<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
     android:layout_width="match_parent"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical">
     android:orientation="vertical">
 
 
-    <LinearLayout
+
+    <RelativeLayout
         android:layout_width="match_parent"
         android:layout_width="match_parent"
-        android:layout_height="match_parent"
-        android:orientation="vertical">
+        android:layout_height="wrap_content"
+        android:padding="@dimen/padding">
 
 
-        <RelativeLayout
-            android:layout_width="match_parent"
+        <TextView
+            android:id="@+id/codeTag"
+            android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             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" />
+            android:text="单号"
+            android:textColor="@color/text_hine"
+            android:textSize="@dimen/text_main" />
 
 
-        <RelativeLayout
+        <TextView
+            android:id="@+id/codeTv"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             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" />
+            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>
 
 
-        <RelativeLayout
-            android:layout_width="match_parent"
+    <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: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" />
+            android:text="所属部门"
+            android:textColor="@color/text_hine"
+            android:textSize="@dimen/text_main" />
 
 
-        <RelativeLayout
+        <TextView
+            android:id="@+id/centerTv"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             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" />
+            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/workshopTag"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="车间"
+            android:textColor="@color/text_hine"
+            android:textSize="@dimen/text_main" />
 
 
-        <RelativeLayout
+        <TextView
+            android:id="@+id/workshopTv"
             android:layout_width="match_parent"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
             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_marginLeft="@dimen/padding"
+            android:layout_toRightOf="@id/workshopTag"
+            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_width="match_parent"
-            android:layout_height="@dimen/line"
-            android:background="@color/item_line" />
+            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">
 
 
-        <RelativeLayout
+        <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_width="match_parent"
             android:layout_height="wrap_content"
             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_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_width="match_parent"
-            android:layout_height="@dimen/line"
-            android:background="@color/item_line" />
+            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" />
 
 
-        <com.core.widget.MyListView
-            android:id="@+id/mListView"
-            android:visibility="gone"
+    <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_width="match_parent"
-            android:layout_height="wrap_content" />
+            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:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:visibility="gone" />
+
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_marginTop="@dimen/padding"
+        android:orientation="horizontal">
+
+        <Button
+            android:id="@+id/lossDeviceBtn"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_margin="@dimen/padding"
+            android:layout_weight="1"
+            android:background="@drawable/bg_bule_btn"
+            android:padding="@dimen/paddingMin"
+            android:text="盘亏"
+            android:textColor="@color/white"
+            android:textSize="@dimen/text_main" />
 
 
         <Button
         <Button
             android:id="@+id/cycleBtn"
             android:id="@+id/cycleBtn"
-            android:layout_width="match_parent"
+            android:layout_width="0dp"
             android:layout_height="wrap_content"
             android:layout_height="wrap_content"
-            android:layout_marginBottom="50dp"
-            android:layout_marginLeft="40dp"
-            android:layout_marginRight="40dp"
-            android:layout_marginTop="100dp"
+            android:layout_margin="@dimen/padding"
+            android:layout_weight="1"
             android:background="@drawable/bg_bule_btn"
             android:background="@drawable/bg_bule_btn"
-            android:padding="10dp"
+            android:padding="@dimen/paddingMin"
             android:text="@string/cycle"
             android:text="@string/cycle"
             android:textColor="@color/white"
             android:textColor="@color/white"
             android:textSize="@dimen/text_main" />
             android:textSize="@dimen/text_main" />
+
+        <Button
+            android:id="@+id/deviceAttributeBtn"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_margin="@dimen/padding"
+            android:layout_weight="1"
+            android:background="@drawable/bg_bule_btn"
+            android:padding="@dimen/paddingMin"
+            android:text="获取明细"
+            android:textColor="@color/white"
+            android:textSize="@dimen/text_main" />
+
     </LinearLayout>
     </LinearLayout>
-</ScrollView>
+
+
+    <com.core.widget.MyListView
+        android:id="@+id/gridList"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent" />
+</LinearLayout>