Просмотр исходного кода

裸瓷包装撤销(非工序)

姜永辉 1 год назад
Родитель
Сommit
327186fa05

+ 18 - 13
AndroidManifest.xml

@@ -3,7 +3,8 @@
     package="com.jiaju.activity"
     android:versionCode="1"
     android:versionName="1.2.24.0717" >
-<!-- 23  14-->
+
+    <!-- 23  14 -->
     <uses-sdk
         android:minSdkVersion="23"
         android:targetSdkVersion="23" />
@@ -74,23 +75,23 @@
             android:label="@string/title_activity_login"
             android:screenOrientation="portrait" >
         </activity>
-           <activity
+        <activity
             android:name=".AddInvoiceActivity"
             android:label="AddInvoiceActivity"
             android:screenOrientation="portrait"
-             android:windowSoftInputMode="adjustPan" >
+            android:windowSoftInputMode="adjustPan" >
         </activity>
-           <activity
+        <activity
             android:name=".QueryInvoiceActivity"
             android:label="QueryInvoiceActivity"
             android:screenOrientation="portrait"
-             android:windowSoftInputMode="adjustPan" >
+            android:windowSoftInputMode="adjustPan" >
         </activity>
-              <activity
+        <activity
             android:name=".EditInvoiceActivity"
             android:label="EditInvoiceActivity"
             android:screenOrientation="portrait"
-             android:windowSoftInputMode="adjustPan" >
+            android:windowSoftInputMode="adjustPan" >
         </activity>
         <activity
             android:name=".HomeActivity"
@@ -161,8 +162,8 @@
         </activity>
         <activity
             android:name=".FinishedProductRegistrationActivity"
-            android:screenOrientation="portrait" 
-            android:windowSoftInputMode="adjustPan|stateHidden">
+            android:screenOrientation="portrait"
+            android:windowSoftInputMode="adjustPan|stateHidden" >
         </activity>
         <activity
             android:name=".BeforeInKilnDefectActivity"
@@ -774,14 +775,18 @@
             android:windowSoftInputMode="adjustPan|stateHidden" >
         </activity>
         <activity
-            android:name=".ComponentsBreakageScanOkActivity"             
+            android:name=".ComponentsBreakageScanOkActivity"
             android:screenOrientation="portrait"
-            android:windowSoftInputMode="adjustPan|stateHidden">
+            android:windowSoftInputMode="adjustPan|stateHidden" >
         </activity>
         <activity
-            android:name=".PlcGoodActivity"             
+            android:name=".PlcGoodActivity"
             android:screenOrientation="portrait"
-            android:windowSoftInputMode="adjustPan|stateHidden">
+            android:windowSoftInputMode="adjustPan|stateHidden" >
+        </activity>
+        <activity
+            android:name=".NakedPorcelainActivity"
+            android:label="@string/title_activity_naked_porcelain" >
         </activity>
     </application>
 

+ 223 - 0
res/layout/activity_naked_porcelain.xml

@@ -0,0 +1,223 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@id/parentRel"
+    android:layout_width="fill_parent"
+    android:layout_height="fill_parent"
+    android:background="@color/background"
+    android:orientation="vertical" >
+
+    <include
+        android:id="@+id/check_title"
+        layout="@layout/fragment_title" />
+
+    <LinearLayout
+        android:id="@+id/bottom"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:gravity="center_horizontal"
+        android:orientation="horizontal" >
+        
+           <Button
+            android:id="@+id/btnMakeBillet"
+            android:layout_width="0dip"
+            android:layout_height="50dip"
+            android:layout_weight="1"
+            android:background="@drawable/login_btn_selector"
+            android:visibility="gone"
+            android:text="保存"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_24" />
+
+    
+
+    </LinearLayout>
+
+    <ScrollView
+        android:id="@+id/scrolllay"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_above="@id/bottom"
+        android:layout_below="@id/check_title" >
+
+        <RelativeLayout
+            android:layout_width="fill_parent"
+            android:layout_height="30dip"
+            android:layout_marginTop="5dip" >
+
+            <RelativeLayout
+                android:id="@+id/workno_area"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+               	android:visibility="gone"
+                android:layout_marginTop="5dip" >
+
+                <com.jiaju.widget.JustifyTextView
+                    android:id="@+id/produce_number_title"
+                    android:layout_width="70dip"
+                    android:layout_height="wrap_content"
+                    android:layout_centerVertical="true"
+                    android:layout_marginLeft="10dip"
+                    android:text="生产工号"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_16" />
+
+                <TextView
+                    android:id="@+id/symbol1"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_centerVertical="true"
+                    android:layout_toRightOf="@id/produce_number_title"
+                    android:text=":"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_16" />
+
+                <EditText
+                    android:id="@+id/user_code"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="8dip"
+                    android:layout_marginRight="10dip"
+                    android:layout_toRightOf="@id/symbol1"
+                    android:background="@null"
+                    android:maxLength="30"
+                    android:inputType="textAutoCorrect|textCapCharacters"
+                    android:singleLine="true"
+                    android:text=""
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_24" />
+
+                <View
+                    android:layout_width="fill_parent"
+                    android:layout_height="1dip"
+                    android:layout_alignBottom="@id/user_code"
+                    android:layout_marginLeft="8dip"
+                    android:layout_marginRight="10dip"
+                    android:layout_toRightOf="@id/symbol1"
+                    android:background="@color/text_gray" />
+            </RelativeLayout>
+
+            <LinearLayout
+                android:id="@+id/check_scan_area"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_below="@id/workno_area"
+                android:layout_marginTop="5.0dip"
+                android:orientation="horizontal" >
+
+                <com.jiaju.widget.JustifyTextView
+                    android:id="@+id/product_code_title"
+                    android:layout_width="70dip"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center"
+                    android:layout_marginLeft="10dip"
+                    android:text="产品条码"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_16" />
+
+                <TextView
+                    android:id="@+id/symbol2"
+                    android:layout_width="wrap_content"
+                    android:layout_height="20dip"
+                    android:layout_gravity="center"
+                    android:text=":"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_16" />
+
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginLeft="8dip"
+                    android:layout_marginRight="10dip"
+                    android:orientation="vertical" >
+
+                    <EditText
+                        android:id="@+id/bar_code"
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:background="@null"
+                        android:imeOptions="actionGo"
+                        android:singleLine="true"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_24" />
+
+                    <View
+                        android:layout_width="fill_parent"
+                        android:layout_height="1dip"
+                        android:background="@color/text_gray" />
+                </LinearLayout>
+            </LinearLayout>
+
+
+            <LinearLayout
+                android:id="@+id/llMakeBilletTitle"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginTop="10dp"
+                android:layout_below="@id/check_scan_area"
+                android:orientation="vertical" >
+                     <View
+                    android:layout_width="fill_parent"
+                    android:layout_height="1dip"
+                    android:background="@color/text_gray" />
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:orientation="horizontal" >
+
+                    <com.jiaju.widget.JustifyTextView
+                        android:layout_width="70dip"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dip"
+                        android:text="产品信息"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
+
+                    <TextView
+                        android:id="@+id/symbol12"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text=":"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
+                </LinearLayout>
+
+                <View
+                    android:layout_width="fill_parent"
+                    android:layout_height="1dip"
+                    android:background="@color/text_gray" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:id="@+id/make_billet_area"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_below="@id/llMakeBilletTitle"
+                android:orientation="vertical" >
+
+                <com.jiaju.widget.MyListView
+                    android:id="@+id/listview"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginBottom="5dip"
+                    android:divider="@color/text_gray"
+                    android:cacheColorHint="#00000000"
+                    android:dividerHeight="1dip"
+                    android:footerDividersEnabled="true"
+                    android:listSelector="@android:color/transparent" />
+
+                <View
+                    android:id="@+id/footerdivider"
+                    android:layout_width="fill_parent"
+                    android:layout_height="1dip"
+                    android:background="@color/text_gray"
+                    android:visibility="gone" />
+            </LinearLayout>
+
+           
+        </RelativeLayout>
+    </ScrollView>
+
+</RelativeLayout>

+ 165 - 0
res/layout/list_item_naked_porcelain.xml

@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/message_relative"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:clickable="true" >
+
+    <LinearLayout
+        android:id="@+id/relativeLayout"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical" >
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="20dp"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="20dp"
+                android:layout_marginLeft="10dp"
+                android:text="产品条码:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+
+            <TextView
+                android:id="@+id/barcode"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="20dp"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="20dp"
+                android:layout_marginLeft="10dp"
+                android:text="产品编码:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+
+            <TextView
+                android:id="@+id/productioncode"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="20dp"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="20dp"
+                android:layout_marginLeft="10dp"
+                android:text="产品名称:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+
+            <TextView
+                android:id="@+id/productionName"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="20dp"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="20dp"
+                android:layout_marginLeft="10dp"
+                android:text="商标名称:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+
+            <TextView
+                android:id="@+id/logonName"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="20dp"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="20dp"
+                android:layout_marginLeft="10dp"
+                android:text="成型工号:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+
+            <TextView
+                android:id="@+id/groutingUserCode"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="20dp"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="20dp"
+                android:layout_marginLeft="10dp"
+                android:text="物料编码:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+
+            <TextView
+                android:id="@+id/materialCode"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_14" />
+        </LinearLayout> 
+
+        <View
+            android:layout_width="fill_parent"
+            android:layout_height="1dp"
+            android:background="@color/text_gray" />
+    </LinearLayout>
+
+    <FrameLayout
+        android:layout_width="60dp"
+        android:layout_height="35dp"
+        android:layout_alignParentRight="true"
+        android:layout_centerVertical="true"
+        android:layout_marginRight="5dp" >
+
+        <TextView
+            android:id="@+id/message_delete"
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent"
+            android:clickable="true"
+            android:drawableLeft="@drawable/del_icon_normal"
+            android:gravity="center"
+            android:text="删除"
+            android:textColor="@android:color/white"
+            android:visibility="gone" />
+    </FrameLayout>
+
+</RelativeLayout>

+ 1 - 0
res/values/strings.xml

@@ -119,5 +119,6 @@
     <string name="title_activity_security_code_change">SecurityCodeChangeActivity</string>
     <string name="title_activity_components_breakage_quantity_ok">ComponentsBreakageQuantityOkActivity</string>
     <string name="title_activity_components_breakage_scan_ok">ComponentsBreakageScanOkActivity</string>
+    <string name="title_activity_naked_porcelain">NakedPorcelainActivity</string>
 
 </resources>

+ 958 - 0
src/com/jiaju/activity/NakedPorcelainActivity.java

@@ -0,0 +1,958 @@
+package com.jiaju.activity;
+
+import java.lang.ref.WeakReference;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.json.JSONArray;
+import org.json.JSONObject;
+
+import com.jiaju.adapter.NakedPorcelainAdapter;
+import com.jiaju.model.NakedPorcelain; 
+import com.jiaju.net.WebClient;
+import com.jiaju.utils.CommonUtil;
+import com.jiaju.utils.Constants;
+import com.jiaju.utils.CustomToast;
+import com.jiaju.utils.ProcessDialogUtils;
+import com.jiaju.utils.Removeduplicate;
+import com.jiaju.widget.DefectCommonPopMenu;
+
+import android.app.Activity;
+import android.app.Notification;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.content.res.Configuration;
+import android.content.res.Resources;
+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.Gravity;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.inputmethod.EditorInfo;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.ListView;
+import android.widget.PopupWindow;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+/**
+ * 裸瓷包装撤销(非工序)
+ * 
+ * @author lenovo
+ *
+ */
+
+public class NakedPorcelainActivity extends Activity {
+	private EditText barcode;
+	private String accountCode;
+	private String userId;
+	private String checkCollectModify_userCode;
+	private String password;
+	private String sessionkey;
+	private SharedPreferences preferences;
+	private String ServerAddress_ip;
+	private String ServerAddress_duankou;
+	private HandlerThread thread;
+	private Handler mHandler;
+	private WebClient client = null;
+	private ImageButton backBtn;
+	private TextView back;
+	private ListView mListView;
+	private EditText worknoEdt;
+	private TextView title;
+	private boolean worknovalid;
+	private String workNoName;
+	private ImageView productRecord;
+	private RelativeLayout parent;
+	private PopupWindow mPopupWindow; // 弹出框
+	public Object obj = new Object();
+	public Button btnMakeBillet;
+	private NakedPorcelainAdapter adapter = null;
+	private List<NakedPorcelain> npList = null;
+	private ExceptionHandler exceptionHandler = new ExceptionHandler(this);
+	private ResultHandler handler = new ResultHandler(this);
+	private Handler barcodeUpperH = new Handler();
+	private String barcodeUpper; 
+
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.activity_naked_porcelain);
+
+		initView();
+		Bundle b = getIntent().getExtras();
+		String procedureName = b.getString("ProcedureName");
+
+		btnMakeBillet.setVisibility(View.VISIBLE);
+		procedureName = b.getString("title");
+		title.setText(procedureName);// 设置标题
+		npList = new ArrayList<NakedPorcelain>();
+		preferences = getSharedPreferences("user", Context.MODE_PRIVATE);
+		ServerAddress_ip = preferences.getString("ServerAddress_ip", "");
+		ServerAddress_duankou = preferences.getString("ServerAddress_duankou", "");
+		accountCode = preferences.getString("AccountCode", "");
+		userId = preferences.getString("UserID", "");
+		workNoName = preferences.getString("UserName", "");
+		checkCollectModify_userCode = preferences.getString("UserCode", "");
+		password = preferences.getString("UserPassword", "");
+		sessionkey = preferences.getString("SessionKey", "");
+		CommonUtil.BarcodeMaxLength(barcode, 50);
+		worknoEdt.setText(checkCollectModify_userCode);
+		worknoEdt.setEnabled(false);
+		worknoEdt.setFocusable(false);
+		worknoEdt.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) : "";
+			}
+		} });
+
+		AllListeners();
+		client = new WebClient();
+	}
+
+	private void initView() {
+		barcode = (EditText) findViewById(R.id.bar_code);
+		barcode.setRawInputType(InputType.TYPE_CLASS_NUMBER);
+		backBtn = (ImageButton) findViewById(R.id.left_img);
+		btnMakeBillet = (Button) findViewById(R.id.btnMakeBillet);
+		back = (TextView) findViewById(R.id.back);
+		mListView = (ListView) findViewById(R.id.listview);
+		title = (TextView) findViewById(R.id.title);
+		worknoEdt = (EditText) findViewById(R.id.user_code);
+		productRecord = (ImageView) findViewById(R.id.search);
+		productRecord.setVisibility(View.VISIBLE);
+		parent = (RelativeLayout) findViewById(R.id.parentRel);
+
+	}
+
+	private void AllListeners() {
+
+		productRecord.setOnClickListener(new View.OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				int height = parent.getHeight() - v.getHeight();
+				DefectCommonPopMenu recordPopMenu = new DefectCommonPopMenu(NakedPorcelainActivity.this, height);
+				mPopupWindow = recordPopMenu.getMenu();
+				if (mPopupWindow == null) {
+					return;
+				}
+
+				if (mPopupWindow.isShowing()) {
+					mPopupWindow.dismiss();
+					return;
+				}
+				mPopupWindow.showAtLocation(parent, Gravity.BOTTOM, 0, 0);
+				LinearLayout scanLay = (LinearLayout) recordPopMenu.menu.findViewById(R.id.scanlay);
+				ImageView scanImg = (ImageView) recordPopMenu.menu.findViewById(R.id.scanimg);
+				TextView scanTitle = (TextView) recordPopMenu.menu.findViewById(R.id.scantitle);
+				scanTitle.setText("扫一扫");
+				scanImg.setBackgroundResource(R.drawable.scan);
+				scanLay.setOnClickListener(new View.OnClickListener() {
+					@Override
+					public void onClick(View v) {
+						Intent openCameraIntent = new Intent(NakedPorcelainActivity.this, CaptureActivity.class);
+						startActivityForResult(openCameraIntent, 102);
+						if (mPopupWindow.isShowing()) {
+							mPopupWindow.dismiss();
+
+						}
+
+					}
+				});
+			}
+		});
+
+		barcode.addTextChangedListener(new TextWatcher() {
+			@Override
+			public void afterTextChanged(Editable arg0) {
+				if (barcode.getText().toString().contains("\n")) {
+					String code = barcode.getText().toString().trim().replaceAll("\\n", "");
+					String workno = worknoEdt.getText().toString();
+					if (TextUtils.isEmpty(workno)) {
+						Toast.makeText(getApplicationContext(), "生产工号不能为空", Toast.LENGTH_SHORT).show();
+
+						return;
+					}
+					ProcessDialogUtils.showProcessDialog(NakedPorcelainActivity.this);
+
+					barcode.setEnabled(false);
+					barcode.setFocusable(false);
+					barcode.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) : "";
+						}
+					} });
+					
+					if (npList.size() > 0) {
+						boolean b = Removeduplicate.removeBarCode(code,
+								npList);
+
+						if (b) {
+							ProcessDialogUtils.closeProgressDilog();
+							barcode.setEnabled(true);
+							barcode.setText("");
+							barcode.setFocusable(true);
+							barcode.setFocusableInTouchMode(true);
+							barcode.requestFocus();
+							barcode.findFocus();
+							barcode.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(barcode, 50);
+							CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
+									getApplicationContext());
+							
+							CustomToast.showToast(getApplicationContext(), "条码"
+									+ code + "重复", 2000);
+							return;
+						}
+					}
+
+					thread = new HandlerThread("barcodeThread", 5);
+					thread.start();
+					mHandler = new Handler(thread.getLooper());
+					BarcodeRunnable barcodeRunnable = new BarcodeRunnable(code, obj);
+					mHandler.post(barcodeRunnable);
+
+				}
+			}
+
+			@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 = barcode.getText().toString();
+				// 判断输入的文字是否是小写
+				for (int i = 0; i < barcodeUpper.length(); i++) {
+					if (barcodeUpper.charAt(i) - 0 >= 97 && barcodeUpper.charAt(i) - 0 <= 122) {
+						barcodeUpperH.postDelayed(BarcodeUpperCase, 300);
+					}
+				}
+			}
+		});
+
+		barcode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+
+			@Override
+			public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+				if (actionId == EditorInfo.IME_ACTION_GO) {
+					String workno = worknoEdt.getText().toString();
+					if (TextUtils.isEmpty(workno)) {
+						Toast.makeText(getApplicationContext(), "生产工号不能为空", Toast.LENGTH_SHORT).show();
+
+						return true;
+					}
+
+					 
+					String code = barcode.getText().toString().trim();
+					if (!TextUtils.isEmpty(code)) {
+
+						ProcessDialogUtils.showProcessDialog(NakedPorcelainActivity.this);
+
+						barcode.setEnabled(false);
+						barcode.setFocusable(false);
+						barcode.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) : "";
+							}
+						} });
+						
+						if (npList.size() > 0) {
+							boolean b = Removeduplicate.removeBarCode(code,
+									npList);
+
+							if (b) {
+								ProcessDialogUtils.closeProgressDilog();
+								barcode.setEnabled(true);
+								barcode.setText("");
+								barcode.setFocusable(true);
+								barcode.setFocusableInTouchMode(true);
+								barcode.requestFocus();
+								barcode.findFocus();
+								barcode.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(barcode, 50);
+								CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
+										getApplicationContext());
+								
+								CustomToast.showToast(getApplicationContext(), "条码"
+										+ code + "重复", 2000);
+								return true;
+							}
+						}
+
+						thread = new HandlerThread("barcodeThread", 5);
+						thread.start();
+						mHandler = new Handler(thread.getLooper());
+						BarcodeRunnable barcodeRunnable = new BarcodeRunnable(code, obj);
+						mHandler.post(barcodeRunnable);
+						return true;
+
+					}
+				}
+				return true;
+			}
+		});
+
+		back.setOnClickListener(new View.OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+
+				finish();
+
+			}
+		});
+
+		backBtn.setOnClickListener(new View.OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+
+				finish();
+
+			}
+		});
+
+		btnMakeBillet.setOnClickListener(new OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+				try {
+					String workno = worknoEdt.getText().toString();
+					if (TextUtils.isEmpty(workno)) {
+						Toast.makeText(getApplicationContext(), "生产工号不能为空", Toast.LENGTH_SHORT).show();
+
+						return;
+					}
+
+					if (npList != null && npList.size() > 0) {
+
+						ProcessDialogUtils.showProcessDialog(NakedPorcelainActivity.this);
+						if (btnMakeBillet.isEnabled()) {
+							btnMakeBillet.setEnabled(false);
+							thread = null;
+							thread = new HandlerThread("SaveThread", 5);
+							thread.start();
+							mHandler = null;
+							mHandler = new Handler(thread.getLooper());
+							SaveDataRunnable sRunnable = new SaveDataRunnable();
+							mHandler.post(sRunnable);
+						}
+					} else {
+						Toast.makeText(getApplicationContext(), "产品列表不能为空", Toast.LENGTH_SHORT).show();
+
+						return;
+					}
+
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+			}
+
+		});
+
+	}
+
+	Runnable BarcodeUpperCase = new Runnable() {
+		@Override
+		public void run() {
+			// 小写转大写
+			barcode.setText(barcodeUpper.toUpperCase());
+			// 设置EditText光标位置
+			barcode.setSelection(barcodeUpper.length());
+		}
+	};
+
+	private class SaveDataRunnable implements Runnable {
+
+		@Override
+		public void run() {
+			JSONObject jsonObject = new JSONObject();
+			try {
+				jsonObject.put("accountCode", accountCode);
+				jsonObject.put("userCode", checkCollectModify_userCode);
+				jsonObject.put("userPassword", password);
+				jsonObject.put("sessionKey", sessionkey);
+				jsonObject.put("module", "LuociRevoke");
+				jsonObject.put("action", "AddChancelLuoci");
+				JSONObject jsonData = new JSONObject();  
+				JSONArray componenListArray = new JSONArray();
+				if (npList != null && npList.size() > 0) {
+					for (int m = 0; m < npList.size(); m++) {
+						JSONObject componenListobj = new JSONObject(); 
+						componenListobj.put("barcode",npList.get(m).getBarcode()); 
+						componenListobj.put("productionCode",npList.get(m).getProductionCode()); 
+						componenListobj.put("productionName",npList.get(m).getProductionName()); 
+						componenListobj.put("logonName",npList.get(m).getLogonName()); 
+						componenListobj.put("groutingUserCode",npList.get(m).getGroutingUserCode()); 
+						componenListobj.put("materialCode",npList.get(m).getMaterialCode());					
+						componenListobj.put("UserID",userId);
+						componenListobj.put("Usercode",checkCollectModify_userCode);
+						componenListobj.put("UserName",workNoName); 
+						componenListArray.put(componenListobj);
+					}
+					 
+				} 
+				jsonData.put("detailTable", componenListArray); 
+				jsonObject.put("jsonData", jsonData.toString());
+				String result = client.doPost("http://" + ServerAddress_ip + ":" + ServerAddress_duankou
+						+ Constants.serverAction + "/DoAction", jsonObject.toString(), "application/json");
+				Message m = new Message();
+				m.what = 2;
+				Bundle b = new Bundle();
+				b.putString("result", result);
+				m.setData(b);
+				handler.sendMessage(m);
+
+			} catch (Exception e) {
+				e.printStackTrace();
+				Message m = new Message();
+				m.what = 0;
+				Bundle b = new Bundle();
+				b.putString("message", "网络连接异常");
+				m.setData(b);
+				exceptionHandler.sendMessage(m);
+			}
+
+		}
+
+	}
+
+	private static class ExceptionHandler extends Handler {
+		private final WeakReference mActivity;
+
+		public ExceptionHandler(NakedPorcelainActivity activity) {
+			mActivity = new WeakReference(activity);
+		}
+
+		@Override
+		public void handleMessage(Message msg) {
+			super.handleMessage(msg);
+			NakedPorcelainActivity activity = (NakedPorcelainActivity) mActivity.get();
+			switch (msg.what) {
+			case 0:
+				ProcessDialogUtils.closeProgressDilog();
+				Bundle b = msg.getData();
+				int status = b.getInt("status");
+				String errorMsg = b.getString("errorMsg");
+				CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, activity.getApplicationContext());
+				CommonUtil.showBarCodeAlertDialog(status, errorMsg, activity, activity.barcode, null, null);
+
+				if (activity.mHandler != null) {
+					activity.mHandler.removeCallbacksAndMessages(null);
+					activity.mHandler.getLooper().quit();
+				}
+				break;
+			case 1:
+				ProcessDialogUtils.closeProgressDilog();
+				Bundle b2 = msg.getData();
+				String message = b2.getString("message");
+				CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, activity);
+
+				CustomToast.showToast(activity.getApplicationContext(), message, 2000);
+
+				activity.barcode.setEnabled(true);
+				activity.barcode.setFocusable(true);
+				activity.barcode.setFocusableInTouchMode(true);
+				activity.barcode.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(activity.barcode, 50);
+
+				if (activity.mHandler != null) {
+					activity.mHandler.removeCallbacksAndMessages(null);
+					activity.mHandler.getLooper().quit();
+				}
+				break;
+
+			case 2:
+				ProcessDialogUtils.closeProgressDilog();
+				if (activity.mHandler != null) {
+					activity.mHandler.removeCallbacksAndMessages(null);
+					activity.mHandler.getLooper().quit();
+				}
+
+				Bundle b3 = msg.getData();
+				String message3 = b3.getString("message");
+				CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, activity.getApplicationContext());
+				// CommonUtil.showRepeatDialog(message3,CheckCollectModifyActivity.this);
+				// Toast.makeText(getApplicationContext(), message3,
+				// Toast.LENGTH_SHORT).show();
+				CustomToast.showToast(activity.getApplicationContext(), message3, 2000);
+				activity.barcode.setEnabled(true);
+				activity.barcode.setText("");
+				activity.barcode.setFocusable(true);
+				activity.barcode.setFocusableInTouchMode(true);
+				activity.barcode.requestFocus();
+				activity.barcode.findFocus();
+				activity.barcode.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(activity.barcode, 50);
+
+				break;
+
+			case 3:
+				ProcessDialogUtils.closeProgressDilog();
+				Bundle b7 = msg.getData();
+				int status7 = b7.getInt("status");
+				String message7 = b7.getString("message");
+
+				CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, activity.getApplicationContext());
+				CommonUtil.showBarCodeAlertDialog(status7, message7, activity, activity.barcode, null, null);
+
+				if (activity.mHandler != null) {
+					activity.mHandler.removeCallbacksAndMessages(null);
+					activity.mHandler.getLooper().quit();
+				}
+
+				break;
+
+			case 4:
+				if (activity.mHandler != null) {
+					activity.mHandler.removeCallbacksAndMessages(null);
+					activity.mHandler.getLooper().quit();
+				}
+				ProcessDialogUtils.closeProgressDilog();
+				Bundle b4 = msg.getData();
+				String message4 = b4.getString("message");
+				CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, activity.getApplicationContext());
+
+				CustomToast.showToast(activity.getApplicationContext(), message4, 2000);
+
+				break;
+
+			case 5:
+				if (activity.mHandler != null) {
+					activity.mHandler.removeCallbacksAndMessages(null);
+					activity.mHandler.getLooper().quit();
+				}
+				ProcessDialogUtils.closeProgressDilog();
+				Bundle b5 = msg.getData();
+				String message5 = b5.getString("message");
+				CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, activity.getApplicationContext());
+				// CommonUtil.showRepeatDialog(message5,CheckCollectModifyActivity.this);
+				// Toast.makeText(getApplicationContext(), message5,
+				// Toast.LENGTH_SHORT).show();
+				CustomToast.showToast(activity.getApplicationContext(), message5, 2000);
+				break;
+			case 6:
+				if (activity.mHandler != null) {
+					activity.mHandler.removeCallbacksAndMessages(null);
+					activity.mHandler.getLooper().quit();
+				}
+				ProcessDialogUtils.closeProgressDilog();
+
+				Bundle b1 = msg.getData();
+				String errmsg = b1.getString("errmsg");
+				String missingFlag = b1.getString("flag");
+				Intent intent = new Intent();
+				Bundle b6 = new Bundle();
+				b6.putString("msg", errmsg);
+				b6.putString("missingFlag", missingFlag);
+				intent.putExtras(b6);
+				intent.setClass(activity, MissingScanActivity.class);
+				activity.startActivityForResult(intent, 101);
+				break;
+
+			case 7:
+				ProcessDialogUtils.closeProgressDilog();
+				if (activity.mHandler != null) {
+					activity.mHandler.removeCallbacksAndMessages(null);
+					activity.mHandler.getLooper().quit();
+				}
+
+				Bundle b8 = msg.getData();
+				String message8 = b8.getString("message");
+				CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, activity.getApplicationContext());
+				CommonUtil.showRepeatDialog(message8, activity);
+
+				activity.barcode.setEnabled(true);
+				activity.barcode.setText("");
+				activity.barcode.setFocusable(true);
+				activity.barcode.setFocusableInTouchMode(true);
+				activity.barcode.requestFocus();
+				activity.barcode.findFocus();
+				activity.barcode.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(activity.barcode, 50);
+
+				break;
+			}
+		}
+	};
+
+	private static class ResultHandler extends Handler {
+
+		private final WeakReference mActivity;
+
+		public ResultHandler(NakedPorcelainActivity activity) {
+			mActivity = new WeakReference(activity);
+		}
+
+		@Override
+		public void handleMessage(Message msg) {
+			final NakedPorcelainActivity activity = (NakedPorcelainActivity) mActivity.get();
+			switch (msg.what) {
+
+			case 1:
+				ProcessDialogUtils.closeProgressDilog();
+
+				if (activity.adapter == null) {
+					activity.adapter = new NakedPorcelainAdapter(activity, activity.npList);
+					activity.mListView.setAdapter(activity.adapter);
+				} else {
+					activity.adapter.notifyDataSetChanged();
+				}
+
+				activity.btnMakeBillet.setText("保存(" + activity.npList.size() + ")");
+
+				activity.barcode.setEnabled(true);
+				activity.barcode.setText("");
+				activity.barcode.setFocusable(true);
+				activity.barcode.setFocusableInTouchMode(true);
+				activity.barcode.requestFocus();
+				activity.barcode.findFocus();
+				activity.barcode.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(activity.barcode, 50);
+
+				break;
+
+			case 2:
+
+				String rest8 = msg.getData().getString("result");
+				ProcessDialogUtils.closeProgressDilog();
+				activity.btnMakeBillet.setEnabled(true);
+				if (activity.mHandler != null) {
+					activity.mHandler.removeCallbacksAndMessages(null);
+					activity.mHandler.getLooper().quit();
+				}
+				try {
+					JSONObject jsonObject4 = new JSONObject(rest8);
+					JSONObject jsonObject5 = jsonObject4.getJSONObject("d");
+					int status8 = jsonObject5.getInt("Status");
+					String message8 = jsonObject5.getString("Message");
+					if (status8 == 0) {
+						activity.barcode.setEnabled(true);
+						activity.barcode.setText("");
+						activity.barcode.setFocusable(true);
+						activity.barcode.setFocusableInTouchMode(true);
+						activity.barcode.requestFocus();
+						activity.barcode.findFocus();
+						activity.barcode.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(activity.barcode, 50);
+
+						CommonUtil.playSound(activity.getApplicationContext());
+						CustomToast.showToast(activity.getApplicationContext(), "上传成功", 2000);
+
+						if (activity.npList != null && activity.npList.size() > 0) {
+							activity.npList.clear();
+							if (activity.adapter != null) {
+								activity.adapter.notifyDataSetChanged();
+							}
+
+							activity.btnMakeBillet.setText("保存(" + activity.npList.size() + ")");
+						}
+
+					}
+
+					else {
+
+						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, activity.getApplicationContext());
+						CommonUtil.showSaveAlertDialog(status8, message8, activity, activity.worknoEdt,
+								activity.barcode, 2);
+						return;
+					}
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+
+				break;
+
+			}
+
+		}
+	};
+
+	private class BarcodeRunnable implements Runnable {
+		String barcode;
+		Object obj;
+
+		public BarcodeRunnable(String barcode, Object obj) {
+			this.barcode = barcode;
+			this.obj = obj;
+		}
+
+		@Override
+		public void run() {
+			synchronized (obj) {
+				try {
+					JSONObject jsonObject = new JSONObject();
+					jsonObject.put("accountCode", accountCode);
+					jsonObject.put("userCode", checkCollectModify_userCode);
+					jsonObject.put("userPassword", password);
+					jsonObject.put("sessionKey", sessionkey);
+					jsonObject.put("module", "LuociRevoke");
+					jsonObject.put("action", "CheckLuoci");
+					JSONObject jsonData = new JSONObject();
+					jsonData.put("barcode", barcode);// 产品条码
+					jsonObject.put("jsonData", jsonData.toString());
+					String result = client.doPost("http://" + ServerAddress_ip + ":" + ServerAddress_duankou
+							+ Constants.serverAction + "/DoAction", jsonObject.toString(), "application/json");
+
+					JSONObject jsonObjectR = new JSONObject(result);
+					JSONObject jsonObjectResult = jsonObjectR.getJSONObject("d");
+					int status30 = jsonObjectResult.getInt("Status");
+					String message30 = jsonObjectResult.getString("Message");
+
+					if (status30 == 0) {
+						String result30 = jsonObjectResult.getString("Result");
+						JSONArray jsonArray30 = new JSONArray(result30);
+						JSONObject jsonObject31 = (JSONObject) jsonArray30.get(0);
+						NakedPorcelain nakedPorcelain = new NakedPorcelain();
+						nakedPorcelain.setUserId(Integer.parseInt(userId));
+						nakedPorcelain.setBarcode(jsonObject31.optString("BARCODE"));
+						nakedPorcelain.setProductionCode(jsonObject31.optString("GOODSCODE"));
+						nakedPorcelain.setProductionName(jsonObject31.optString("GOODSNAME"));
+						nakedPorcelain.setLogonName(jsonObject31.optString("LOGONAME"));
+						nakedPorcelain.setGroutingUserCode(jsonObject31.optString("GROUTINGUSERCODE"));
+						nakedPorcelain.setMaterialCode(jsonObject31.optString("MATERIALCODE"));
+						npList.add(nakedPorcelain);
+					}
+
+					else {
+						Message m = new Message();
+						m.what = 0;
+						Bundle b = new Bundle();
+						b.putInt("status", status30);
+						b.putString("errorMsg", message30);
+						m.setData(b);
+						exceptionHandler.sendMessage(m);
+						return;
+					}
+					handler.sendEmptyMessage(1);
+				}
+
+				catch (Exception e) {
+					e.printStackTrace();
+					Message m = new Message();
+					m.what = 2;
+					Bundle b4 = new Bundle();
+					b4.putString("message", "网络连接异常");
+					m.setData(b4);
+					exceptionHandler.sendMessage(m);
+					return;
+				}
+			}
+		}
+
+	};
+
+	@SuppressWarnings("unchecked")
+	@Override
+	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
+
+		if (requestCode == 101 && resultCode == 103) {
+			barcode.setEnabled(true);
+			barcode.setText("");
+			barcode.setFocusable(true);
+			barcode.setFocusableInTouchMode(true);
+			barcode.requestFocus();
+			barcode.findFocus();
+			barcode.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(barcode, 50);
+
+		}
+
+		if (requestCode == 102 && resultCode == RESULT_OK) {
+			Bundle bundle = data.getExtras();
+			String scanResult = bundle.getString("result");
+			View rootview = this.getWindow().getDecorView();
+			EditText v = (EditText) rootview.findFocus();
+			int id = v.getId();
+			v.setText(scanResult);
+			v.setSelection(scanResult.length());
+			switch (id) {
+
+			case R.id.bar_code:
+				String worknocode = worknoEdt.getText().toString();
+				if (TextUtils.isEmpty(worknocode)) {
+					// Toast.makeText(getApplicationContext(), "生产工号不能为空",
+					// Toast.LENGTH_SHORT).show();
+					CustomToast.showToast(getApplicationContext(), "生产工号不能为空", 2000);
+					worknoEdt.setEnabled(true);
+					worknoEdt.setFocusable(true);
+					worknoEdt.setFocusableInTouchMode(true);
+					worknoEdt.requestFocus();
+					worknoEdt.findFocus();
+					worknoEdt.setFilters(new InputFilter[] { new InputFilter() {
+						@Override
+						public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
+								int dend) {
+
+							return null;
+						}
+					} });
+					return;
+				} else {
+					if (!worknovalid) {
+						// Toast.makeText(getApplicationContext(), "请先验证生产工号",
+						// Toast.LENGTH_SHORT).show();
+						CustomToast.showToast(getApplicationContext(), "请先验证生产工号", 2000);
+						worknoEdt.setEnabled(true);
+						worknoEdt.setFocusable(true);
+						worknoEdt.setFocusableInTouchMode(true);
+						worknoEdt.requestFocus();
+						worknoEdt.findFocus();
+						worknoEdt.setFilters(new InputFilter[] { new InputFilter() {
+							@Override
+							public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
+									int dstart, int dend) {
+
+								return null;
+							}
+						} });
+						return;
+
+					}
+				}
+				String code = v.getText().toString().trim();
+				ProcessDialogUtils.showProcessDialog(NakedPorcelainActivity.this);
+				if (!CommonUtil.isNumber(code)) {
+					ProcessDialogUtils.closeProgressDilog();
+					// CommonUtil.showRepeatDialog(code+"格式不匹配",CheckCollectModifyActivity.this);
+					// Toast.makeText(getApplicationContext(), code + "格式不匹配",
+					// Toast.LENGTH_SHORT).show();
+					CustomToast.showToast(getApplicationContext(), code + "格式不匹配", 2000);
+					barcode.setEnabled(true);
+					barcode.setText("");
+					barcode.setFocusable(true);
+					barcode.setFocusableInTouchMode(true);
+					barcode.requestFocus();
+					barcode.findFocus();
+					barcode.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(barcode, 50);
+					return;
+				}
+
+				barcode.setEnabled(false);
+				barcode.setFocusable(false);
+				barcode.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(code, obj);
+				mHandler.post(barcodeRunnable);
+
+				break;
+			}
+		}
+
+	}
+
+	@Override
+	public void onBackPressed() { 
+		super.onBackPressed();
+	}
+
+	@Override
+	public Resources getResources() {
+		Resources res = super.getResources();
+		Configuration config = new Configuration();
+		config.setToDefaults();
+		res.updateConfiguration(config, res.getDisplayMetrics());
+		return res;
+	}
+}

+ 216 - 0
src/com/jiaju/adapter/NakedPorcelainAdapter.java

@@ -0,0 +1,216 @@
+package com.jiaju.adapter;
+
+import java.util.List;
+
+import android.content.Context;
+import android.graphics.Point;
+import android.text.TextUtils;
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnTouchListener;
+import android.view.ViewGroup;
+import android.view.animation.Animation;
+import android.view.animation.Animation.AnimationListener;
+import android.view.animation.AnimationUtils;
+import android.widget.BaseAdapter;
+import android.widget.LinearLayout;
+import android.widget.RelativeLayout;
+import android.widget.TextView;
+
+import com.jiaju.activity.NakedPorcelainActivity;
+import com.jiaju.activity.R;
+import com.jiaju.model.NakedPorcelain;
+
+/**
+ * the adapter of the ListView
+ * 
+ * @author
+ */
+public class NakedPorcelainAdapter extends BaseAdapter {
+	private String TAG = "ListMessageAdapter";
+	private Context context = null;
+	private Holder holder = null;
+	private LayoutInflater inflater = null;
+	private boolean checkState;
+	// 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;
+
+	// the children item is common
+	private final int TYPE_ITEM = 0;
+
+	// the children item is searching
+	private final int TYPE_SEARCH = 1;
+
+	// the count of children item's type
+	private final int TYPE_COUNT = TYPE_SEARCH + 1;
+
+	private List<NakedPorcelain> list;
+
+	public NakedPorcelainAdapter(Context context, List<NakedPorcelain> data) {
+		this.context = context;
+		this.list = data;
+		this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+		this.startPoint = new Point();
+		this.endPoint = new Point();
+		animation = AnimationUtils.loadAnimation(context, R.anim.push_out);
+	}
+
+	public int getCount() {
+		return list.size();
+	}
+
+	@Override
+	public Object getItem(int position) {
+		return list.get(position);
+	}
+
+	@Override
+	public long getItemId(int position) {
+		return position;
+	}
+
+	@Override
+	public int getItemViewType(int position) {
+		return position == 0 ? TYPE_SEARCH : TYPE_ITEM;
+	}
+
+	@Override
+	public int getViewTypeCount() {
+		return TYPE_COUNT;
+	}
+
+	@Override
+	public View getView(final int position, View convertView, ViewGroup parent) {
+		if (convertView == null) {
+			holder = new Holder();
+			convertView = inflater.inflate(R.layout.list_item_naked_porcelain, null);
+			holder.relativelayout = (RelativeLayout) convertView.findViewById(R.id.message_relative);
+
+			holder.barcode = (TextView) convertView.findViewById(R.id.barcode);
+			holder.productionCode = (TextView) convertView.findViewById(R.id.productioncode);
+			holder.productionName = (TextView) convertView.findViewById(R.id.productionName);
+			holder.logonName = (TextView) convertView.findViewById(R.id.logonName);
+			holder.groutingUserCode = (TextView) convertView.findViewById(R.id.groutingUserCode);
+			holder.materialCode = (TextView) convertView.findViewById(R.id.materialCode); 
+			holder.delete = (TextView) convertView.findViewById(R.id.message_delete);
+
+			convertView.setTag(holder);
+		} else {
+			holder = (Holder) convertView.getTag();
+		}
+
+		final NakedPorcelain b = list.get(position);
+ 
+		holder.barcode.setText(b.getBarcode());
+		holder.productionCode.setText(b.getProductionCode());
+		holder.productionName.setText(b.getProductionName());
+		holder.logonName.setText(b.getLogonName());
+		holder.groutingUserCode.setText(b.getGroutingUserCode());
+		holder.materialCode.setText(b.getMaterialCode()); 
+		final int chickPosition = position;
+		final int finalPosition = position;
+		if (position == mLastPosition) {
+			holder.delete.setVisibility(View.VISIBLE);
+		} else {
+			holder.delete.setVisibility(View.GONE);
+		}
+
+		final View view = holder.relativelayout;
+
+		holder.delete.setOnClickListener(new OnClickListener() {
+			@Override
+			public void onClick(View v) {
+
+				view.startAnimation(animation);
+				animation.setAnimationListener(new AnimationListener() {
+					@Override
+					public void onAnimationStart(Animation arg0) {
+					}
+
+					@Override
+					public void onAnimationRepeat(Animation arg0) {
+					}
+
+					@Override
+					public void onAnimationEnd(Animation arg0) {
+						list.remove(chickPosition);
+						mLastPosition = -1;
+						notifyDataSetChanged();
+						((NakedPorcelainActivity) context).btnMakeBillet.setText("±£´æ(" + list.size() + ")");
+
+					}
+				});
+			}
+		});
+
+		holder.relativelayout.setOnTouchListener(new OnTouchListener() {
+
+			public boolean onTouch(View v, MotionEvent event) {
+				switch (event.getAction()) {
+				case MotionEvent.ACTION_DOWN:
+					loadFinish = false;
+					startPoint.set((int) event.getX(), (int) event.getY());
+					break;
+				case MotionEvent.ACTION_MOVE:
+					endPoint.set((int) event.getX(), (int) event.getY());
+					if (Math.abs(endPoint.x - startPoint.x) > 30) {
+						if (loadFinish == false) {
+							loadFinish = true;
+							if (finalPosition != mLastPosition) {
+								mLastPosition = finalPosition;
+							} else {
+								mLastPosition = -1;
+							}
+							notifyDataSetChanged();
+						} else {
+							return true;
+						}
+						return true;
+					}
+					if (Math.abs(endPoint.y - startPoint.y) > 30) {
+						return false;
+					}
+					break;
+				case MotionEvent.ACTION_UP:
+					break;
+				}
+				return false;
+			}
+		});
+
+		holder.relativelayout.setOnClickListener(new OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				if (mLastPosition != -1) {
+					mLastPosition = -1;
+					notifyDataSetChanged();
+				}
+			}
+		});
+
+		return convertView;
+	}
+
+	private class Holder {
+		TextView barcode;
+		TextView productionCode;
+		TextView productionName;
+		TextView delete;
+		TextView logonName;
+		TextView groutingUserCode;
+		TextView materialCode;
+		RelativeLayout relativelayout;
+	}
+
+}

Разница между файлами не показана из-за своего большого размера
+ 868 - 856
src/com/jiaju/adapter/ProductLineExpandableListView.java


+ 72 - 0
src/com/jiaju/model/NakedPorcelain.java

@@ -0,0 +1,72 @@
+package com.jiaju.model;
+
+import java.io.Serializable; 
+
+public class NakedPorcelain implements Serializable {
+	private boolean checkstate;
+	private int userId; 
+
+	private String  barcode;
+	private String  productionCode;
+	private String  productionName;
+	private String  delete; 
+	private String  logonName;
+	private String  groutingUserCode;
+	private String  materialCode;
+	public boolean isCheckstate() {
+		return checkstate;
+	}
+	public void setCheckstate(boolean checkstate) {
+		this.checkstate = checkstate;
+	}
+	public int getUserId() {
+		return userId;
+	}
+	public void setUserId(int userId) {
+		this.userId = userId;
+	}
+	public String getBarcode() {
+		return barcode;
+	}
+	public void setBarcode(String barcode) {
+		this.barcode = barcode;
+	}
+	public String getProductionCode() {
+		return productionCode;
+	}
+	public void setProductionCode(String productionCode) {
+		this.productionCode = productionCode;
+	}
+	public String getProductionName() {
+		return productionName;
+	}
+	public void setProductionName(String productionName) {
+		this.productionName = productionName;
+	}
+	public String getDelete() {
+		return delete;
+	}
+	public void setDelete(String delete) {
+		this.delete = delete;
+	}
+	public String getLogonName() {
+		return logonName;
+	}
+	public void setLogonName(String logonName) {
+		this.logonName = logonName;
+	}
+	public String getGroutingUserCode() {
+		return groutingUserCode;
+	}
+	public void setGroutingUserCode(String groutingUserCode) {
+		this.groutingUserCode = groutingUserCode;
+	}
+	public String getMaterialCode() {
+		return materialCode;
+	}
+	public void setMaterialCode(String materialCode) {
+		this.materialCode = materialCode;
+	} 
+	
+	
+}

+ 28 - 0
src/com/jiaju/utils/Removeduplicate.java

@@ -75,6 +75,34 @@ public class Removeduplicate {
 				}
 
 			}
+			if (clssName.equals("com.jiaju.model.NakedPorcelain")) {
+
+				try {
+					m = clss.getMethod("getBarcode");
+				} catch (NoSuchMethodException e) {
+
+					e.printStackTrace();
+				}
+				String bar;
+				try {
+					bar = (String) m.invoke(S);
+					if (bar.equals(code)) {
+						rem = true;
+						return rem;
+
+					}
+				} catch (IllegalArgumentException e) {
+
+					e.printStackTrace();
+				} catch (IllegalAccessException e) {
+
+					e.printStackTrace();
+				} catch (InvocationTargetException e) {
+
+					e.printStackTrace();
+				}
+
+			}
 
 			if (clssName.equals("com.jiaju.model.CartInfo")) {
 

Некоторые файлы не были показаны из-за большого количества измененных файлов