Эх сурвалжийг харах

产品测试 从三水赋值

姜永辉 4 сар өмнө
parent
commit
0371f49824

+ 5 - 0
AndroidManifest.xml

@@ -691,6 +691,11 @@
             android:name=".LuociRevokeActivity"
             >
         </activity>
+            <activity
+            android:name=".ProductTestSheetActivity"
+            android:screenOrientation="portrait"
+            android:windowSoftInputMode="adjustPan|stateHidden" >
+        </activity>
     </application>
 
 </manifest>

+ 28 - 0
res/layout/activity_product_test_sheet.xml

@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/parentRel"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/background" >
+
+    <include
+        android:id="@+id/titleset"
+        layout="@layout/fragment_title" /> 
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_above="@id/bottomLay"
+        android:layout_below="@id/titleset"
+        android:orientation="vertical" >
+
+        <ListView
+            android:id="@+id/productlst"
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent"
+            android:cacheColorHint="#00000000"
+            android:divider="@null"
+            android:listSelector="#00000000" />
+    </LinearLayout>
+
+</RelativeLayout>

+ 93 - 0
res/layout/popup_window_exit.xml

@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/rl_popup_window"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="#8000" >
+
+    <LinearLayout
+        android:layout_width="271dp"
+        android:layout_height="165dp"
+        android:layout_centerInParent="true"
+        android:background="@drawable/approve_opinion_popup_window_background"
+        android:clickable="true"
+        android:orientation="vertical" >
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="51dp" >
+
+            <TextView
+                android:id="@+id/tv_popup_window_title"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerHorizontal="true"
+                android:layout_marginTop="22dp"
+                android:text="退出程序"
+                android:textColor="#000"
+                android:textSize="16sp" />
+        </RelativeLayout>
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="70dp" >
+
+             <TextView
+                android:id="@+id/tv_popup_window_message"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_centerHorizontal="true"
+                android:layout_marginTop="22dp"
+                android:text=""
+                android:textColor="#000"
+                android:textSize="14sp" />
+        </RelativeLayout>
+        
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:orientation="horizontal" >
+
+            <RelativeLayout
+                android:id="@+id/ll_ok"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:clickable="true" >
+
+                <TextView
+                    android:id="@+id/tv_popup_window_ok"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerInParent="true"
+                    android:text="确定"
+                    android:textColor="#df00"
+                    android:textSize="14sp" />
+            </RelativeLayout>
+
+            <View
+                android:layout_width="0.5dp"
+                android:layout_height="match_parent"
+                android:layout_marginTop="10dp"
+                android:background="#1000" />
+
+            <RelativeLayout
+                android:id="@+id/ll_cancel"
+                android:layout_width="0dp"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:clickable="true" >
+
+                <TextView
+                    android:id="@+id/tv_popup_window_cancel"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerInParent="true"
+                    android:text="取消"
+                    android:textColor="#000"
+                    android:textSize="14sp" />
+            </RelativeLayout>
+        </LinearLayout>
+    </LinearLayout>
+
+</RelativeLayout>

+ 371 - 0
res/layout/product_test_sheet_head_view.xml

@@ -0,0 +1,371 @@
+<?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" >
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/ll_layout_height_5"
+        android:orientation="horizontal" >
+
+        <com.jiaju.widget.JustifyTextView
+            android:id="@+id/orderTitle"
+            android:layout_width="@dimen/ll_layout_width_80"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/ll_layout_height_10"
+            android:layout_marginTop="@dimen/ll_layout_height_10"
+            android:text="实验单"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:layout_marginTop="@dimen/ll_layout_height_10"
+            android:text=":"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical" >
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical" >
+
+                <Spinner
+                    android:id="@+id/orderSpinner"
+                    android:layout_width="fill_parent"
+                    android:layout_height="@dimen/ll_layout_height_40"
+                    android:layout_marginRight="@dimen/ll_layout_height_10"
+                    android:background="@drawable/spinner_drop_down" >
+                </Spinner>
+            </LinearLayout>
+        </LinearLayout>
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/llpurpose"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal" >
+
+        <com.jiaju.widget.JustifyTextView
+            android:id="@+id/purposeTitle"
+            android:layout_width="@dimen/ll_layout_width_80"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/ll_layout_height_10"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text="实验目的"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text=":"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical" >
+ 
+            <TextView
+                android:id="@+id/tvpurpose"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="@dimen/ll_layout_height_10"
+      
+                android:singleLine="true"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_24" />
+        </LinearLayout>
+    </LinearLayout>
+
+    <!-- 隐藏部分 -->
+
+    <LinearLayout
+        android:id="@+id/llOrderNo"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:visibility="gone" >
+
+        <com.jiaju.widget.JustifyTextView
+            android:layout_width="@dimen/ll_layout_width_80"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/ll_layout_height_10"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text="实验单号"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text=":"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical" >
+
+            <TextView
+                android:id="@+id/tvOrderNo"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="@dimen/ll_layout_height_10"
+                android:singleLine="true"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_24" />
+        </LinearLayout>
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/llPerson"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:visibility="gone" >
+
+        <com.jiaju.widget.JustifyTextView
+            android:layout_width="@dimen/ll_layout_width_80"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/ll_layout_height_10"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text="负责人"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text=":"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical" >
+
+            <TextView
+                android:id="@+id/tvPerson"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="@dimen/ll_layout_height_10"
+                android:singleLine="true"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_24" />
+        </LinearLayout>
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/llMethod"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:visibility="gone" >
+
+        <com.jiaju.widget.JustifyTextView
+            android:layout_width="@dimen/ll_layout_width_80"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/ll_layout_height_10"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text="实验方法"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text=":"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical" >
+
+            <TextView
+                android:id="@+id/tvMethod"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="@dimen/ll_layout_height_10"
+                android:singleLine="true"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_24" />
+        </LinearLayout>
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/llContext"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:visibility="gone" >
+
+        <com.jiaju.widget.JustifyTextView
+            android:layout_width="@dimen/ll_layout_width_80"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/ll_layout_height_10"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text="实验背景"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text=":"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical" >
+
+            <TextView
+                android:id="@+id/tvContext"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="@dimen/ll_layout_height_10"
+                android:singleLine="true"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_24" />
+        </LinearLayout>
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/llResult"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal"
+        android:visibility="gone" >
+
+        <com.jiaju.widget.JustifyTextView
+            android:layout_width="@dimen/ll_layout_width_80"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/ll_layout_height_10"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text="实验结果"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text=":"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical" >
+
+            <TextView
+                android:id="@+id/tvResult"
+                android:layout_width="fill_parent"						
+                android:layout_height="wrap_content"
+                android:layout_marginRight="@dimen/ll_layout_height_10"
+                android:singleLine="true"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_24" />
+        </LinearLayout>
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal" >
+
+        <com.jiaju.widget.JustifyTextView
+            android:id="@+id/barcodeTitle"
+            android:layout_width="@dimen/ll_layout_width_80"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/ll_layout_height_10"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text="产品条码"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:layout_centerVertical="true"
+            android:layout_marginTop="@dimen/ll_layout_height_5"
+            android:text=":"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:orientation="vertical" >
+
+            <EditText
+                android:id="@+id/barcodeEdt"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="@dimen/ll_layout_height_10"
+                android:background="@null"
+                android:imeOptions="actionGo"
+                android:singleLine="true"
+                android:text=""
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_24" />
+
+            <View
+                android:layout_width="fill_parent"
+                android:layout_height="1dp"
+                android:background="@color/text_gray" />
+        </LinearLayout>
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="12dp"
+        android:orientation="vertical" >
+
+        <View
+            android:layout_width="fill_parent"
+            android:layout_height="1dp"
+            android:background="@color/text_gray" />
+
+        <TextView
+            android:id="@+id/tvProductCount"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="@dimen/ll_layout_height_10"
+            android:layout_marginRight="@dimen/ll_layout_height_10"
+            android:text="产品信息"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <View
+            android:layout_width="fill_parent"
+            android:layout_height="1dp"
+            android:background="@color/text_gray" />
+    </LinearLayout>
+
+</LinearLayout>

+ 27 - 0
res/values/dimens.xml

@@ -54,4 +54,31 @@
     <!-- 顶部按钮文字大小 -->
     <dimen name="pickerview_topbar_btn_textsize">20sp</dimen>
     <dimen name="pickerview_topbar_title_textsize">21sp</dimen>
+    
+     <dimen name="ll_layout_width">800dp</dimen>
+    <dimen name="ll_layout_width_45">45dp</dimen>
+    <dimen name="ll_layout_width_50">50dp</dimen>
+    <dimen name="ll_layout_width_70">70dp</dimen>
+    <dimen name="ll_layout_width_80">80dp</dimen>
+    <dimen name="ll_layout_width_90">90dp</dimen>
+    <dimen name="ll_layout_width_100">100dp</dimen>
+    <dimen name="ll_layout_height_0">0dp</dimen>
+    <dimen name="ll_layout_height_5">5dp</dimen>
+    <dimen name="ll_layout_height_10">10dp</dimen>
+    <dimen name="ll_layout_height_40">40dp</dimen>
+    <dimen name="ll_layout_height_45">45dp</dimen>
+    <dimen name="ll_layout_height_50">50dp</dimen>
+    <dimen name="ll_layout_height_60">60dp</dimen>
+    <dimen name="ll_layout_height_70">70dp</dimen>
+    <dimen name="ll_layout_height_80">80dp</dimen>
+    <dimen name="ll_layout_margin_10">10dp</dimen>
+    <dimen name="Phone_OR_Pad_170">170dp</dimen>
+    <dimen name="Phone_OR_Pad_250">250dp</dimen>
+    <dimen name="Phone_OR_Pad_60">60dp</dimen>
+    <dimen name="Phone_OR_Pad_50">50dp</dimen>
+    <dimen name="Phone_OR_Pad_30">30dp</dimen>
+    <dimen name="Phone_OR_Pad_20">20dp</dimen>
+     <dimen name="Phone_OR_Pad_10">10dp</dimen>
+      <dimen name="Phone_OR_Pad_8">8dp</dimen>
+    <dimen name="Phone_OR_Pad_5">5dp</dimen>
 </resources>

+ 27 - 0
src/com/jiaju/activity/HomeActivity.java

@@ -62,6 +62,7 @@ public class HomeActivity extends Activity {
 	private List<ProductLineModel> productLineList = new ArrayList<ProductLineModel>();
 	private List<ProductLineModel> otherProductLineList = new ArrayList<ProductLineModel>();
 	private List<ProductLineModel> originalProductLineList = new ArrayList<ProductLineModel>();
+	private ProductLineModel ptsPm;
 	private WebClient client;
 	private PopupWindow mPopupWindow; // 弹出框
 	private ImageView imagepath2;
@@ -307,6 +308,7 @@ public class HomeActivity extends Activity {
 						List<ProcedureModel> semiCheckReworkList = new ArrayList<ProcedureModel>();
 						List<ProcedureModel>  calloutList=new ArrayList<ProcedureModel>(); 
 						List<ProcedureModel> LCBZList = new ArrayList<ProcedureModel>();
+						List<ProcedureModel> ptsList = new ArrayList<ProcedureModel>();
 						for (int i = 0; i < jarray.length(); i++) {
 							JSONObject jo3 = jarray.optJSONObject(i);
 							String functionname = jo3.optString("FUNCTIONNAME");
@@ -776,6 +778,23 @@ public class HomeActivity extends Activity {
 								pm18.setProcedureId(106);
 								groutinglist.add(pm18);	
 							}
+							// 20210902 addd 测试产品实验单
+							else if (functionCode.equals("9006")) {
+								ptsPm = new ProductLineModel();
+								ptsPm.setProductLineMenuCode(functionCode);
+								ptsPm.setProductionMenuName(functionname);
+								ptsPm.setProcedureList(null);
+							}
+
+							else if (functionCode.equals("900601")) {
+								ProcedureModel pm18 = new ProcedureModel();
+								pm18.setProcedureMenuCode(functionCode);
+								pm18.setProcedureMenuName(functionname);
+								pm18.setProcedureModel("00" + 117);
+								pm18.setModelType(116);
+								pm18.setProcedureId(116);// 工序
+								ptsList.add(pm18);
+							}
 							else if (functionCode.equals("0634")) { //裸瓷交接
 								LCFinishedProduct = new ProductLineModel();
 								LCFinishedProduct.setProductLineMenuCode(functionCode);
@@ -897,6 +916,14 @@ public class HomeActivity extends Activity {
 							productLineList.add(calloutPm);
 						}
 						
+						if (ptsList != null && ptsList.size() > 0) {
+							if (ptsPm != null) {
+								ptsPm.setProcedureList(ptsList);
+								productLineList.add(ptsPm);
+							}
+
+						}
+						
 						if (procedurelist != null && procedurelist.size() > 0) {
 							ProductLineModel pm40 = new ProductLineModel();
 							pm40.setProductLineMenuCode("-1");

+ 972 - 0
src/com/jiaju/activity/ProductTestSheetActivity.java

@@ -0,0 +1,972 @@
+package com.jiaju.activity;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.LinkedHashMap;
+import java.util.List;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import com.jiaju.adapter.ProductTestListAdapter;
+import com.jiaju.adapter.ProductTestListAdapter.OnDeleteItemClickListener;
+import com.jiaju.adapter.ProductTestOrderAdapter;
+import com.jiaju.model.BarcodeInfo;
+import com.jiaju.model.Order;
+import com.jiaju.net.OkAsyncHttpClient;
+import com.jiaju.utils.CommonUtil;
+import com.jiaju.utils.Constants;
+import com.jiaju.utils.CustomToast;
+import com.jiaju.utils.IBossBasePopupWindow;
+import com.jiaju.utils.IBossBasePopupWindow.IPopUpWindowCallBack;
+import com.jiaju.utils.ProcessDialogUtils;
+
+import android.app.Activity;
+import android.app.Notification;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Message;
+import android.text.Editable;
+import android.text.InputFilter;
+import android.text.InputType;
+import android.text.Spanned;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.view.KeyEvent;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.inputmethod.EditorInfo;
+import android.widget.AdapterView;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.RelativeLayout;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast;
+
+/**
+ * 实验产品-20210902 添加测试产品
+ * 
+ * @author lenovo
+ *
+ */
+public class ProductTestSheetActivity extends Activity {
+
+    private TextView tvTitle;
+    private SharedPreferences preferences;
+    private String ServerAddress_ip;
+    private String ServerAddress_port;
+    private String handover_usercode;
+
+    private HandlerThread thread;
+    private Handler mHandler;
+    private OkAsyncHttpClient client;
+    private List<Order> orderList;
+    private Spinner orderSpinner;
+    private ProductTestOrderAdapter adapter;
+    private EditText barcodeEdt;
+    private TextView tvBack;
+    private ImageView ivBack;
+    private Object obj = new Object();
+    private List<BarcodeInfo> barcodeInfoList = new ArrayList<BarcodeInfo>();
+    private ListView barcodeLst;
+    private ProductTestListAdapter productTestListAdapter;
+
+    private LinearLayout llpurpose;
+    private TextView tvpurpose;
+    // 实验单号
+    private LinearLayout llOrderNo;
+    private TextView tvOrderNo;
+    // 负责人
+    private LinearLayout llPerson;
+    private TextView tvPerson;
+    // 实验背景
+    private LinearLayout llContext;
+    private TextView tvContext;
+    // 实验方法
+    private LinearLayout llMethod;
+    private TextView tvMethod;
+    // 实验结果
+    private LinearLayout llResult;
+    private TextView tvResult;
+    private TextView tvProductCount;
+
+    private Handler barcodeUpperH = new Handler();
+    private String barcodeUpper;
+    private boolean orderisgon = true; // 是否显示 true 不显示 false 显示
+    private int orderId = -1;// 实验单
+    private IBossBasePopupWindow iBossBasePopupWindowDelete;
+
+    protected void onCreate(Bundle savedInstanceState) {
+	super.onCreate(savedInstanceState);
+	setContentView(R.layout.activity_product_test_sheet);
+	initView();
+	// 获得账户信息;获取服务ip和端口号
+	preferences = getSharedPreferences("user", Context.MODE_PRIVATE);
+	ServerAddress_ip = preferences.getString("WebServerAddress_ip", "");
+	ServerAddress_port = preferences.getString("WebServerAddress_port", "");
+	handover_usercode = preferences.getString("UserCode", "");
+	client = OkAsyncHttpClient.getInstance(ProductTestSheetActivity.this);
+	Bundle b = getIntent().getExtras();
+	String title = b.getString("procedureName");
+	tvTitle.setText(title);
+
+	CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
+	allListeners();
+	thread = new HandlerThread("trademarkThread", 5);
+	thread.start();
+	mHandler = new Handler(thread.getLooper());
+	OrderListRunnable orderListRunnable = new OrderListRunnable(obj);
+	mHandler.post(orderListRunnable);
+    }
+
+    @Override
+    public boolean dispatchTouchEvent(MotionEvent ev) {
+	switch (ev.getAction()) {
+	case MotionEvent.ACTION_DOWN:
+	    View view = getCurrentFocus();
+	    CommonUtil.hideKeyboard(ev, view, ProductTestSheetActivity.this);// 调用方法判断是否需要隐藏键盘
+	    break;
+
+	default:
+	    break;
+	}
+	return super.dispatchTouchEvent(ev);
+    }
+
+    @Override
+    protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
+
+	if (requestCode == 101 && resultCode == 103) {
+
+	}
+    }
+
+    /**
+     * 初始化view
+     */
+    private void initView() {
+	tvTitle = (TextView) findViewById(R.id.title);
+	ivBack = (ImageButton) findViewById(R.id.left_img);
+	tvBack = (TextView) findViewById(R.id.back);
+
+	View head = View.inflate(this, R.layout.product_test_sheet_head_view, null);
+	orderSpinner = (Spinner) head.findViewById(R.id.orderSpinner);
+	llpurpose = (LinearLayout) head.findViewById(R.id.llpurpose);
+	tvpurpose = (TextView) head.findViewById(R.id.tvpurpose);
+	// 实验单号
+	llOrderNo = (LinearLayout) head.findViewById(R.id.llOrderNo);
+	tvOrderNo = (TextView) head.findViewById(R.id.tvOrderNo);
+	// 负责人
+	llPerson = (LinearLayout) head.findViewById(R.id.llPerson);
+	tvPerson = (TextView) head.findViewById(R.id.tvPerson);
+	// 实验背景
+	llContext = (LinearLayout) head.findViewById(R.id.llContext);
+	tvContext = (TextView) head.findViewById(R.id.tvContext);
+	// 实验方法
+	llMethod = (LinearLayout) head.findViewById(R.id.llMethod);
+	tvMethod = (TextView) head.findViewById(R.id.tvMethod);
+	// 实验结果
+	llResult = (LinearLayout) head.findViewById(R.id.llResult);
+	tvResult = (TextView) head.findViewById(R.id.tvResult);
+	tvProductCount = (TextView) head.findViewById(R.id.tvProductCount);
+
+	barcodeEdt = (EditText) head.findViewById(R.id.barcodeEdt);
+	barcodeEdt.setRawInputType(InputType.TYPE_CLASS_NUMBER);
+	barcodeLst = (ListView) findViewById(R.id.productlst);
+	barcodeLst.addHeaderView(head, null, false);
+
+	productTestListAdapter = new ProductTestListAdapter(ProductTestSheetActivity.this, barcodeInfoList);
+	barcodeLst.setAdapter(productTestListAdapter);
+
+    }
+
+    /**
+     * 设置单据的其他信息是否显示
+     * 
+     * @param blValue
+     */
+    private void orderisgon(boolean blValue) {
+	if (!blValue) {
+	    llOrderNo.setVisibility(View.VISIBLE);
+	    llPerson.setVisibility(View.VISIBLE);
+	    llContext.setVisibility(View.VISIBLE);
+	    llMethod.setVisibility(View.VISIBLE);
+	    llResult.setVisibility(View.VISIBLE);
+	} else {
+	    llOrderNo.setVisibility(View.GONE);
+	    llPerson.setVisibility(View.GONE);
+	    llContext.setVisibility(View.GONE);
+	    llMethod.setVisibility(View.GONE);
+	    llResult.setVisibility(View.GONE);
+	}
+
+    }
+
+    /**
+     * 初始化view-清空
+     */
+    private void initClearView() {
+	tvpurpose.setText("");
+	tvOrderNo.setText("");
+	tvPerson.setText("");
+	tvContext.setText("");
+	tvMethod.setText("");
+	tvResult.setText("");
+	barcodeEdt.setText("");
+	barcodeEdt.setFocusable(true);
+	barcodeEdt.requestFocus();
+	barcodeEdt.findFocus();
+	tvProductCount.setText("产品信息");
+	if (productTestListAdapter != null) {
+	    barcodeInfoList.removeAll(barcodeInfoList);
+	    productTestListAdapter.notifyDataSetChanged();
+
+	}
+    }
+
+    /**
+     * view注册事件
+     */
+    private void allListeners() {
+	// 返回
+	ivBack.setOnClickListener(new OnClickListener() {
+
+	    @Override
+	    public void onClick(View v) {
+		finish();
+	    }
+	});
+	// 返回
+	tvBack.setOnClickListener(new OnClickListener() {
+
+	    @Override
+	    public void onClick(View v) {
+		finish();
+	    }
+	});
+	// 返回
+	llpurpose.setOnClickListener(new OnClickListener() {
+
+	    @Override
+	    public void onClick(View v) {
+		orderisgon = !orderisgon;
+		orderisgon(orderisgon);
+
+	    }
+	});
+
+	// 实验单
+	orderSpinner.setOnItemSelectedListener(new Spinner.OnItemSelectedListener() {
+	    @Override
+	    public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
+		Order order = (Order) arg0.getItemAtPosition(arg2);
+		orderId = order.getOrderId();
+
+		initClearView();
+		if (orderId == -1) {
+		    return;
+		}
+		thread = new HandlerThread("trademarkThread", 5);
+		thread.start();
+		mHandler = new Handler(thread.getLooper());
+		OrderItemByRunnable ordeitemRunnable = new OrderItemByRunnable(obj, orderId);
+		mHandler.post(ordeitemRunnable);
+	    }
+
+	    @Override
+	    public void onNothingSelected(AdapterView<?> arg0) {
+
+	    }
+	});
+
+	// 扫描
+	barcodeEdt.addTextChangedListener(new TextWatcher() {
+
+	    @Override
+	    public void afterTextChanged(Editable arg0) {
+
+	    }
+
+	    @Override
+	    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+	    }
+
+	    @Override
+	    public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+		barcodeUpper = barcodeEdt.getText().toString().trim();
+		// 判断输入的文字是否是小写
+		for (int i = 0; i < barcodeUpper.length(); i++) {
+		    if (barcodeUpper.charAt(i) - 0 >= 97 && barcodeUpper.charAt(i) - 0 <= 122) {
+			barcodeUpperH.postDelayed(UpperCase, 300);
+		    }
+		}
+		if (start == 0 && before == 0 && count > 1) {
+		    String barcode = barcodeEdt.getText().toString();
+		    barcode = barcode.trim();
+		    if (!TextUtils.isEmpty(barcode)) {
+			if (orderId == -1) {
+			    barcodeEdt.setText("");
+			    barcodeEdt.setFocusable(true);
+			    barcodeEdt.requestFocus();
+			    barcodeEdt.findFocus();
+			    Toast.makeText(ProductTestSheetActivity.this, "请选择实验单号", Toast.LENGTH_SHORT).show();
+			    return;
+			}
+			ProcessDialogUtils.showProcessDialog(ProductTestSheetActivity.this);
+			barcodeEdt.setEnabled(false);
+			barcodeEdt.setFocusable(false);
+			barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
+			    @Override
+			    public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
+				    int dstart, int dend) {
+
+				return source.length() < 1 ? dest.subSequence(dstart, dend) : "";
+			    }
+			} });
+			thread = new HandlerThread("barcodeThread", 5);
+			thread.start();
+			mHandler = new Handler(thread.getLooper());
+			BarcodeRunnable barcodeRunnable = new BarcodeRunnable(obj, barcode);
+			mHandler.post(barcodeRunnable);
+		    }
+		}
+	    }
+	});
+	// 扫描
+	barcodeEdt.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+
+	    @Override
+	    public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+
+		if (actionId == EditorInfo.IME_ACTION_GO) {
+		    if (orderId == -1) {
+			barcodeEdt.setText("");
+			barcodeEdt.setFocusable(true);
+			barcodeEdt.requestFocus();
+			barcodeEdt.findFocus();
+			Toast.makeText(ProductTestSheetActivity.this, "请选择实验单号", Toast.LENGTH_SHORT).show();
+			return true;
+		    }
+		    String barcode = barcodeEdt.getText().toString();
+		    if (!TextUtils.isEmpty(barcode)) {
+			ProcessDialogUtils.showProcessDialog(ProductTestSheetActivity.this);
+			barcodeEdt.setEnabled(false);
+			barcodeEdt.setFocusable(false);
+			barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
+			    @Override
+			    public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
+				    int dstart, int dend) {
+
+				return source.length() < 1 ? dest.subSequence(dstart, dend) : "";
+			    }
+			} });
+			thread = new HandlerThread("barcodeThread", 5);
+			thread.start();
+			mHandler = new Handler(thread.getLooper());
+			BarcodeRunnable barcodeRunnable = new BarcodeRunnable(obj, barcode);
+			mHandler.post(barcodeRunnable);
+			return true;
+
+		    }
+
+		}
+
+		return false;
+
+	    }
+	});
+
+	// 删除item的注册事件
+	productTestListAdapter.setOnDeleteItemClickListener(new OnDeleteItemClickListener() {
+
+	    @Override
+	    public void onDeleteItemClick(View v, final int position) {
+
+		if (iBossBasePopupWindowDelete == null) {
+		    iBossBasePopupWindowDelete = new IBossBasePopupWindow(ProductTestSheetActivity.this,
+			    R.layout.popup_window_exit);
+		}
+		iBossBasePopupWindowDelete.setPopUpWindowCallBack(new IPopUpWindowCallBack() {
+
+		    @Override
+		    public void popUpWindowCallBack(View view) {
+			TextView tvPopupWindowMessage = (TextView) view.findViewById(R.id.tv_popup_window_message);
+			TextView tvPopupWindowTitle = (TextView) view.findViewById(R.id.tv_popup_window_title);
+			tvPopupWindowTitle.setText("提示");
+			try {
+			    tvPopupWindowMessage.setText("是否要删除? ");
+			} catch (Exception e) {
+			    e.printStackTrace();
+			}
+			// 对布局文件进行初始化
+			RelativeLayout llCancel = (RelativeLayout) view.findViewById(R.id.ll_cancel);
+			// 对布局中的控件添加事件监听
+			llCancel.setOnClickListener(new View.OnClickListener() {
+			    @Override
+			    public void onClick(View v) {
+				iBossBasePopupWindowDelete.dismiss();
+			    }
+			});
+			RelativeLayout llOK = (RelativeLayout) view.findViewById(R.id.ll_ok);
+			// 对布局中的控件添加事件监听
+			llOK.setOnClickListener(new View.OnClickListener() {
+			    @Override
+			    public void onClick(View v) {
+				iBossBasePopupWindowDelete.dismiss();
+				BarcodeInfo barcodeInfo = barcodeInfoList.get(position);
+				thread = new HandlerThread("barcodeThread", 5);
+				thread.start();
+				mHandler = new Handler(thread.getLooper());
+				DelRunnable delRunnable = new DelRunnable(obj, barcodeInfo.getBarcode());
+				mHandler.post(delRunnable);
+			    }
+			});
+		    }
+		});
+		iBossBasePopupWindowDelete.show(false, v, 0, 0);
+
+	    }
+	});
+    }
+
+    /**
+     * 小写转大写
+     */
+    Runnable UpperCase = new Runnable() {
+
+	@Override
+	public void run() {
+	    // 小写转大写
+	    barcodeEdt.setText(barcodeUpper.toUpperCase());
+	    // 设置EditText光标位置
+	    barcodeEdt.setSelection(barcodeUpper.length());
+
+	}
+
+    };
+
+    /**
+     * 保存插入条码数据
+     * 
+     * @author lenovo
+     *
+     */
+    private class DelRunnable implements Runnable {
+	private Object object;
+	private String barcode;
+
+	public DelRunnable(Object object, String barcode) {
+	    this.object = object;
+	    this.barcode = barcode;
+	}
+
+	@Override
+	public void run() {
+	    synchronized (object) {
+		try {
+		    HashMap<String, String> params = new LinkedHashMap<String, String>();
+		    params.put("BARCODE", barcode);
+		    params.put("USERCODE", handover_usercode);
+		    params.put("TESTFORMID", orderId + "");
+		    params.put("MODE", "delete");
+		    String result = client.requestGetBySyn(
+			    "http://" + ServerAddress_ip + ":" + ServerAddress_port + Constants.SET_TEST_FORM_GOODS,
+			    params);
+
+		    Message m = new Message();
+		    m.what = 2;
+		    Bundle b = new Bundle();
+		    b.putString("saveResult", result);
+		    m.setData(b);
+		    handler.sendMessage(m);
+
+		} catch (Exception e) {
+
+		    e.printStackTrace();
+		    Message m = new Message();
+		    Bundle b = new Bundle();
+		    b.putString("message", "网络连接异常");
+		    m.setData(b);
+		    m.what = 0;
+		    exceptionHandler.sendMessage(m);
+		}
+	    }
+
+	}
+
+    };
+
+    /**
+     * 扫码插入
+     * 
+     * @author lenovo
+     *
+     */
+    private class BarcodeRunnable implements Runnable {
+	private Object object;
+	private String barcode;
+
+	public BarcodeRunnable(Object object, String barcode) {
+	    this.object = object;
+	    this.barcode = barcode;
+	}
+
+	@Override
+	public void run() {
+	    synchronized (object) {
+		try {
+		    HashMap<String, String> params = new LinkedHashMap<String, String>();
+		    params.put("BARCODE", barcode);
+		    params.put("USERCODE", handover_usercode);
+		    params.put("TESTFORMID", orderId + "");
+		    params.put("MODE", "add");
+
+		    String result = client.requestGetBySyn(
+			    "http://" + ServerAddress_ip + ":" + ServerAddress_port + Constants.SET_TEST_FORM_GOODS,
+			    params);
+
+		    Bundle b = new Bundle();
+		    Message message = new Message();
+		    message.what = 3;
+		    b.putString("barcode", barcode);
+		    b.putString("saveResult", result);
+		    message.setData(b);
+		    handler.sendMessage(message);
+
+		} catch (Exception e) {
+
+		    e.printStackTrace();
+		    Message m = new Message();
+		    Bundle b = new Bundle();
+		    b.putString("message", "网络连接异常");
+		    m.setData(b);
+		    m.what = 0;
+		    exceptionHandler.sendMessage(m);
+		}
+	    }
+
+	}
+
+    };
+
+    /**
+     * 实验单的查询
+     * 
+     * @author lenovo
+     *
+     */
+    private class OrderListRunnable implements Runnable {
+	private Object object;
+
+	public OrderListRunnable(Object object) {
+	    this.object = object;
+	}
+
+	@Override
+	public void run() {
+	    synchronized (object) {
+		try {
+
+		    HashMap<String, String> params = new LinkedHashMap<String, String>();
+		    params.put("USERCODE", handover_usercode);
+		    String result = client.requestGetBySyn(
+			    "http://" + ServerAddress_ip + ":" + ServerAddress_port + Constants.GET_TEST_FORM_LIST,
+			    params);
+		    JSONObject jobj = new JSONObject(result);
+		    boolean successFlag = jobj.optBoolean("success");
+		    String message = jobj.optString("message");
+		    int status = jobj.optInt("status");
+		    if (status != 0) {
+			Message m = new Message();
+			Bundle b = new Bundle();
+			b.putString("message", "网络连接失败!请查看服务器");
+			m.setData(b);
+			m.what = 0;
+			exceptionHandler.sendMessage(m);
+			return;
+		    }
+
+		    if (successFlag) {
+			JSONArray jarray = (JSONArray) jobj.opt("rows");
+			if (jarray != null && jarray.length() > 0) {
+			    orderList = new ArrayList<Order>();
+			    Order order = new Order();
+			    order.setOrderId(-1);
+			    order.setOrderNo("请选择实验单");
+			    orderList.add(order);
+			    for (int i = 0; i < jarray.length(); i++) {
+				JSONObject obj = jarray.optJSONObject(i);
+				int orderId = obj.optInt("ID");
+				String orderNo = obj.optString("NAME");
+				Order orderdetail = new Order();
+				orderdetail.setOrderId(orderId);
+				orderdetail.setOrderNo(orderNo);
+				orderList.add(orderdetail);
+			    }
+
+			}
+
+			Message m = new Message();
+			m.what = 0;
+			Bundle b = new Bundle();
+			b.putSerializable("orderList", (Serializable) orderList);
+			m.setData(b);
+			handler.sendMessage(m);
+
+		    } else {
+			Bundle b = new Bundle();
+			b.putInt("status", status);
+			b.putString("message", message);
+			Message m = new Message();
+			m.what = 1;
+			m.setData(b);
+			exceptionHandler.sendMessage(m);
+			return;
+
+		    }
+
+		} catch (Exception e) {
+
+		    e.printStackTrace();
+		    Message m = new Message();
+		    Bundle b = new Bundle();
+		    b.putString("message", "网络连接异常");
+		    m.setData(b);
+		    m.what = 0;
+		    exceptionHandler.sendMessage(m);
+		}
+	    }
+	}
+    };
+
+    /**
+     * 实验单详细
+     * 
+     * @author lenovo
+     *
+     */
+    private class OrderItemByRunnable implements Runnable {
+	private Object object;
+	private int orderid;
+
+	public OrderItemByRunnable(Object object, int orderid) {
+	    this.object = object;
+	    this.orderid = orderid;
+	}
+
+	@Override
+	public void run() {
+	    synchronized (object) {
+		try {
+		    HashMap<String, String> params = new LinkedHashMap<String, String>();
+		    params.put("ID", orderid + "");
+		    String result = client.requestGetBySyn(
+			    "http://" + ServerAddress_ip + ":" + ServerAddress_port + Constants.GET_TEST_FORM_DETAIL,
+			    params);
+		    JSONObject jobj = new JSONObject(result);
+		    boolean successFlag = jobj.optBoolean("success");
+		    String message = jobj.optString("message");
+		    int status = jobj.optInt("status");
+		    if (status != 0) {
+			Message m = new Message();
+			Bundle b = new Bundle();
+			b.putString("message", "网络连接失败!请查看服务器");
+			m.setData(b);
+			m.what = 0;
+			exceptionHandler.sendMessage(m);
+			return;
+		    }
+		    if (successFlag) {
+			String reval = jobj.optString("rows");
+			Bundle b = new Bundle();
+			Message rmessage = new Message();
+			rmessage.what = 1;
+			b.putString("result", reval);
+			rmessage.setData(b);
+			handler.sendMessage(rmessage);
+
+		    } else {
+			Bundle b = new Bundle();
+			b.putInt("status", status);
+			b.putString("message", message);
+			Message m = new Message();
+			m.what = 1;
+			m.setData(b);
+			exceptionHandler.sendMessage(m);
+			return;
+
+		    }
+
+		} catch (Exception e) {
+		    e.printStackTrace();
+		    Message m = new Message();
+		    Bundle b = new Bundle();
+		    b.putString("message", "网络连接异常");
+		    m.setData(b);
+		    m.what = 0;
+		    exceptionHandler.sendMessage(m);
+		}
+	    }
+	}
+    };
+
+    /**
+     * 异常处理
+     */
+    Handler exceptionHandler = new Handler() {
+	@Override
+	public void handleMessage(Message msg) {
+	    switch (msg.what) {
+	    case 0:
+		Bundle b = msg.getData();
+		String message = b.getString("message");
+		ProcessDialogUtils.closeProgressDilog();
+		if (mHandler != null) {
+		    mHandler.removeCallbacksAndMessages(null);
+		    mHandler.getLooper().quit();
+		}
+		CustomToast.showToast(getApplicationContext(), message, 2000);
+
+		CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+		barcodeEdt.setEnabled(true);
+		barcodeEdt.setText("");
+		barcodeEdt.setFocusable(true);
+		barcodeEdt.setFocusableInTouchMode(true);
+		barcodeEdt.requestFocus();
+		barcodeEdt.findFocus();
+		barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
+
+		    @Override
+		    public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
+			    int dend) {
+
+			return null;
+		    }
+		} });
+		CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
+		break;
+	    case 1:
+		Bundle b1 = msg.getData();
+		int status1 = b1.getInt("status");
+		String message1 = b1.getString("message");
+		ProcessDialogUtils.closeProgressDilog();
+		if (mHandler != null) {
+		    mHandler.removeCallbacksAndMessages(null);
+		    mHandler.getLooper().quit();
+		}
+
+		CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+		CommonUtil.showBarCodeAlertDialog(status1, message1, ProductTestSheetActivity.this, barcodeEdt, null,
+			null);
+
+		break;
+
+	    }
+	}
+    };
+
+    /**
+     * 调用接口的返回操作
+     */
+    Handler handler = new Handler() {
+	@SuppressWarnings("unchecked")
+	@Override
+	public void handleMessage(Message msg) {
+	    switch (msg.what) {
+
+	    case 0:
+		// 实验单的接口返回逻辑
+		Bundle b = msg.getData();
+		orderList = (List<Order>) b.getSerializable("orderList");
+		if (mHandler != null) {
+		    mHandler.removeCallbacksAndMessages(null);
+		    mHandler.getLooper().quit();
+		}
+		ProcessDialogUtils.closeProgressDilog();
+
+		if (orderList != null && orderList.size() > 0) {
+		    adapter = new ProductTestOrderAdapter(ProductTestSheetActivity.this, orderList);
+		    orderSpinner.setAdapter(adapter);
+		}
+
+		break;
+	    case 1:
+		// 选取实验单查询总单和明细的接口返回逻辑
+		ProcessDialogUtils.closeProgressDilog();
+		if (mHandler != null) {
+		    mHandler.removeCallbacksAndMessages(null);
+		    mHandler.getLooper().quit();
+		}
+		if (productTestListAdapter != null) {
+		    barcodeInfoList.removeAll(barcodeInfoList);
+		    productTestListAdapter.notifyDataSetChanged();
+
+		}
+		Bundle bd = msg.getData();
+		String resultdetail = bd.getString("result");
+		try {
+		    JSONObject jobjdetail = new JSONObject(resultdetail);
+		    JSONObject joborder = jobjdetail.optJSONObject("order");
+		    JSONArray arrdetail = jobjdetail.optJSONArray("data");
+		    // 总单的信息
+		    tvpurpose.setText(isEmpty(jobjdetail.optString("NAME")) ? "" : jobjdetail.optString("NAME"));// 目的
+		    tvOrderNo.setText(isEmpty(jobjdetail.optString("ID")) ? "" : jobjdetail.optString("ID"));// 单号
+		    tvPerson.setText(isEmpty(jobjdetail.optString("PERSON")) ? "" : jobjdetail.optString("PERSON"));// 负责人
+		    tvContext.setText(isEmpty(jobjdetail.optString("STATE")) ? "" : jobjdetail.optString("STATE"));// 背景------------------------??
+		    tvMethod.setText(isEmpty(jobjdetail.optString("METHOD")) ? "" : jobjdetail.optString("METHOD"));// 方法
+		    tvResult.setText(isEmpty(jobjdetail.optString("RESULT")) ? "" : jobjdetail.optString("RESULT")); // 结果
+		    if (arrdetail != null && arrdetail.length() > 0) {
+			// 明细的信息
+			for (int i = 0; i < arrdetail.length(); i++) {
+			    JSONObject jobj5 = arrdetail.optJSONObject(i);
+			    String barCode = jobj5.optString("BARCODE");
+			    String goodsCode = jobj5.optString("GOODSCODE");
+			    String goodsTypeName = jobj5.optString("GOODSTYPENAME");
+			    BarcodeInfo info = new BarcodeInfo();
+			    info.setBarcode(barCode);
+			    info.setGoodsCode(goodsCode);
+			    info.setGoodsTypeName(goodsTypeName);
+			    //
+			    barcodeInfoList.add(info);
+			}
+
+			if (productTestListAdapter == null) {
+			    productTestListAdapter = new ProductTestListAdapter(ProductTestSheetActivity.this,
+				    barcodeInfoList);
+			    barcodeLst.setAdapter(productTestListAdapter);
+			} else {
+			    productTestListAdapter.notifyDataSetChanged();
+			}
+
+			if (barcodeInfoList != null && barcodeInfoList.size() > 0) {
+			    tvProductCount.setText("产品信息(" + barcodeInfoList.size() + ")条");
+			} else {
+			    tvProductCount.setText("产品信息");
+			}
+
+			barcodeEdt.setEnabled(true);
+			barcodeEdt.setText("");
+			barcodeEdt.setFocusable(true);
+			barcodeEdt.setFocusableInTouchMode(true);
+			barcodeEdt.requestFocus();
+			barcodeEdt.findFocus();
+			barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
+
+			    @Override
+			    public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
+				    int dstart, int dend) {
+
+				return null;
+			    }
+			} });
+			CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
+
+		    } else {
+			tvProductCount.setText("产品信息");
+		    }
+
+		} catch (JSONException e1) {
+		    e1.printStackTrace();
+		}
+
+		break;
+
+	    case 2:
+
+	    case 3:
+		// 保存
+		Bundle b4 = msg.getData();
+		String saveResult = b4.getString("saveResult");
+		if (mHandler != null) {
+		    mHandler.removeCallbacksAndMessages(null);
+		    mHandler.getLooper().quit();
+		}
+
+		ProcessDialogUtils.closeProgressDilog();
+		barcodeEdt.setEnabled(true);
+		barcodeEdt.setText("");
+		barcodeEdt.setFocusable(true);
+		barcodeEdt.setFocusableInTouchMode(true);
+		barcodeEdt.requestFocus();
+		barcodeEdt.findFocus();
+		barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
+		    @Override
+		    public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
+			    int dend) {
+
+			return null;
+		    }
+		} });
+		try {
+		    JSONObject jos = new JSONObject(saveResult);
+		    int status = jos.optInt("status");
+		    String message = jos.optString("message");
+		    boolean successFlag = jos.optBoolean("success");
+		    if (status != 0) {
+			CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+			CommonUtil.showBarCodeAlertDialog(status, "网络连接失败!请查看服务器", ProductTestSheetActivity.this,
+				barcodeEdt, null, null);
+
+			return;
+		    }
+		    if (successFlag) {
+			if (msg.what == 2) {
+			    CustomToast.showToast(getApplicationContext(), "删除成功", 2000);
+
+			} else {
+			    CustomToast.showToast(getApplicationContext(), "保存成功", 2000);
+			}
+
+			CommonUtil.playSound(getApplicationContext());
+			// 查询数据
+			thread = new HandlerThread("trademarkThread", 5);
+			thread.start();
+			mHandler = new Handler(thread.getLooper());
+			OrderItemByRunnable ordeitemRunnable = new OrderItemByRunnable(obj, orderId);
+			mHandler.post(ordeitemRunnable);
+
+		    } else {
+			CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+			CommonUtil.showBarCodeAlertDialog(status, message, ProductTestSheetActivity.this, barcodeEdt,
+				null, null);
+		    }
+		}
+
+		catch (JSONException e) {
+		    e.printStackTrace();
+		}
+
+		break;
+
+	    }
+	}
+    };
+
+    /**
+     * 字符串是否为空
+     * 
+     * @param str
+     * @return
+     */
+    public static boolean isEmpty(String str) {
+	boolean ret = false;
+	if (str == null || "".equals(str) || "NaN".equals(str) || "null".equals(str)) {
+	    ret = true;
+	}
+	return ret;
+    }
+
+}

+ 10 - 0
src/com/jiaju/adapter/ProductLineExpandableListView.java

@@ -68,6 +68,7 @@ import com.jiaju.activity.OutKilnActivity;
 import com.jiaju.activity.PieceActivity;
 import com.jiaju.activity.ProductScrapActivity;
 import com.jiaju.activity.ProductSuspendActivity;
+import com.jiaju.activity.ProductTestSheetActivity;
 import com.jiaju.activity.ProductionQuantityAndQualityStatisticsActivity;
 import com.jiaju.activity.PublicBilletSetActivity;
 import com.jiaju.activity.R;
@@ -1555,6 +1556,15 @@ public class ProductLineExpandableListView extends ExpandableListView implements
 			mContext.startActivity(i);
 
 		} 
+		else if (procedureMenuCode.equals("900601")) {
+			Intent i = new Intent();
+			Bundle b = new Bundle();
+			b.putString("procedureName", procedureName);
+			i.putExtras(b);
+			i.setClass(mContext, ProductTestSheetActivity.class);
+			mContext.startActivity(i);
+
+		}
 		else {
 
 			ProcessDialogUtils.showProcessDialog(mContext);

+ 127 - 0
src/com/jiaju/adapter/ProductTestListAdapter.java

@@ -0,0 +1,127 @@
+package com.jiaju.adapter;
+
+import java.util.List;
+
+import android.content.Context;
+import android.graphics.Point;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.ViewGroup;
+import android.view.View.OnClickListener;
+import android.view.View.OnTouchListener;
+import android.view.animation.Animation;
+import android.view.animation.Animation.AnimationListener;
+import android.widget.BaseAdapter;
+import android.widget.Button;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+ 
+import com.jiaju.activity.R;
+import com.jiaju.model.BarcodeInfo;
+
+/**
+ * 实验产品
+ * 
+ * @author lenovo
+ *
+ */
+public class ProductTestListAdapter extends BaseAdapter {
+	private Context mContext = null;
+	private ViewHolder holder;
+	private List<BarcodeInfo> barcodeInfoList;
+	// the last position clicked
+	private int mLastPosition = -1;
+
+	// check whether a touch action is finish
+	private boolean loadFinish = false;
+
+	// the position of click and move, start and end point
+	private Point startPoint, endPoint;
+
+	// the animation of removing the item
+	private Animation animation = null;
+
+	public ProductTestListAdapter(Context ctx, List<BarcodeInfo> barcodeInfoList) {
+		mContext = ctx;
+		this.barcodeInfoList = barcodeInfoList;
+	}
+
+	@Override
+	public int getCount() {
+		return barcodeInfoList.size();
+	}
+
+	@Override
+	public Object getItem(int position) {
+		return barcodeInfoList.get(position);
+	}
+
+	@Override
+	public long getItemId(int position) {
+		return position;
+	}
+
+	@Override
+	public View getView(final int position, View convertView, ViewGroup parent) {
+		if (convertView == null) {
+			convertView = LayoutInflater.from(mContext).inflate(R.layout.producttest_list_item, parent, false);
+			holder = new ViewHolder();
+			 
+			holder.tvBarCode = (TextView) convertView.findViewById(R.id.tv_BARCODE); 
+			holder.tvGoodsCode = (TextView) convertView.findViewById(R.id.tv_GOODSCODE);
+			holder.tv_GOODSTYPENAME = (TextView) convertView.findViewById(R.id.tv_GOODSTYPENAME);
+			 
+		 
+			holder.delete = (Button) convertView.findViewById(R.id.tv_delete);
+			convertView.setTag(holder);
+		} else {
+			holder = (ViewHolder) convertView.getTag();
+		}
+
+		BarcodeInfo barcodeInfo = barcodeInfoList.get(position);
+		String barcode = barcodeInfo.getBarcode();
+		holder.tvBarCode.setText(barcode);
+		String finishedBarCode = barcodeInfo.getFinishedBarCode(); 
+		String goodscode = barcodeInfo.getGoodsCode();
+		holder.tvGoodsCode.setText(goodscode);
+		String  GoodsTypeName = barcodeInfo.getGoodsTypeName();
+		holder.tv_GOODSTYPENAME.setText(GoodsTypeName);
+ 
+		
+
+		holder.delete.setOnClickListener(new OnClickListener() {
+			@Override
+			public void onClick(View v) {
+
+						if (listener!=null) {
+							listener.onDeleteItemClick(v, position);
+						}
+						mLastPosition = -1;
+						notifyDataSetChanged();
+ 
+			}
+		});
+ 
+		return convertView;
+	}
+
+	static class ViewHolder {
+		RelativeLayout relativelayout;
+		TextView tvBarCode; 
+		TextView tvGoodsCode;
+		TextView tv_GOODSTYPENAME;
+		Button delete;
+	}
+	
+	private OnDeleteItemClickListener listener;
+	
+	public interface OnDeleteItemClickListener{
+		void onDeleteItemClick(View v, int position);
+	}
+	
+	public void setOnDeleteItemClickListener(OnDeleteItemClickListener listener) {
+		this.listener = listener;
+	}
+
+}

+ 62 - 0
src/com/jiaju/adapter/ProductTestOrderAdapter.java

@@ -0,0 +1,62 @@
+package com.jiaju.adapter;
+
+import java.util.List;
+
+import com.jiaju.activity.R;
+import com.jiaju.model.Logo;
+import com.jiaju.model.Order;
+import com.jiaju.model.ResponsibilityProcedure;
+import com.jiaju.model.WorkNo;
+import com.jiaju.model.WorkType;
+
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.TextView;
+
+/**
+ * ʵÑé²âÊÔ²úÆ·
+ * @author lenovo
+ *
+ */
+public class ProductTestOrderAdapter extends BaseAdapter {
+	private List<Order> mList;
+	private Context mContext;
+
+	public ProductTestOrderAdapter(Context pContext, List<Order> pList) {
+		this.mContext = pContext;
+		this.mList = pList;
+	}
+
+	@Override
+	public int getCount() {
+		return mList.size();
+	}
+
+	@Override
+	public Object getItem(int position) {
+		return mList.get(position);
+	}
+
+	@Override
+	public long getItemId(int position) {
+		return position;
+	}
+
+	@Override
+	public View getView(int position, View convertView, ViewGroup parent) {
+		LayoutInflater _LayoutInflater = LayoutInflater.from(mContext);
+		convertView = _LayoutInflater.inflate(R.layout.spinner, null);
+		if (convertView != null) {
+			TextView _TextView1 = (TextView) convertView
+					.findViewById(R.id.typetxt);
+
+			_TextView1.setText(mList.get(position).getOrderNo());
+
+		}
+		return convertView;
+	}
+}

+ 9 - 0
src/com/jiaju/model/BarcodeInfo.java

@@ -105,6 +105,15 @@ public class BarcodeInfo implements Serializable {
 	private int logoId;
 	private String orderNo;
 	private String finishedBarCode;
+	private String GoodsTypeName;
+	public String getGoodsTypeName() {
+		return GoodsTypeName;
+	}
+
+	public void setGoodsTypeName(String goodsTypeName) {
+		GoodsTypeName = goodsTypeName;
+	}
+
 	public String getFinishedBarCode() {
 		return finishedBarCode;
 	}

+ 6 - 0
src/com/jiaju/utils/Constants.java

@@ -103,6 +103,12 @@ public class Constants {
 	
 	public static final String  WEB_TEST_URL="/mes/sessionget.ashx";
 	
+	// ²âÊÔʵÑé²úÆ·½Ó¿Ú2021-09-03
+	public static final String GET_TEST_FORM_DETAIL =  "/api/v001/TestForm/getTestFormDetail.ashx";
+	public static final String SET_TEST_FORM_GOODS =  "/api/v001/TestForm/setTestFormGoods.ashx";
+	public static final String GET_TEST_FORM_LIST = "/api/v001/TestForm/getTestFormList.ashx";
+	public static final String DEL_TEST_FORM_GOODS = "/api/v001/TestForm/delTestFormGoods.ashx";
+	
 	public static String getRandomFilename() {
 		return UUID.randomUUID().toString();