姜永辉 5 месяцев назад
Родитель
Сommit
f29f4bb582

+ 83 - 12
res/layout/finished_product_handover_head_viewluoci.xml

@@ -1,16 +1,87 @@
 <?xml version="1.0" encoding="utf-8"?>
-<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent">
-    <LinearLayout android:orientation="horizontal" android:id="@+id/barcodelay" android:layout_width="match_parent" android:layout_height="wrap_content">
-        <com.jiaju.widget.JustifyTextView android:textSize="@dimen/textsize_16" android:textColor="@color/white" android:id="@+id/barcodeTitle" android:layout_width="80dp" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginTop="5dp" android:text="包装条码"/>
-        <TextView android:textSize="@dimen/textsize_16" android:textColor="@color/white" android:id="@+id/symbol1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_marginTop="5dp" android:text=":" android:layout_centerVertical="true"/>
-        <LinearLayout android:orientation="vertical" android:layout_width="match_parent" android:layout_height="wrap_content">
-            <EditText android:textSize="@dimen/textsize_24" android:textColor="@color/white" android:id="@+id/barcodeEdt" android:background="@null" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginRight="10dp" android:text="" android:singleLine="true" android:imeOptions="actionGo"/>
-            <View android:background="@color/text_gray" android:layout_width="match_parent" android:layout_height="1dp"/>
+<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:id="@+id/barcodelay"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal" >
+
+        <com.jiaju.widget.JustifyTextView
+            android:id="@+id/barcodeTitle"
+            android:layout_width="80dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="10dp"
+            android:layout_marginTop="5dp"
+            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_marginTop="5dp"
+            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="10dp"
+                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:orientation="vertical" android:id="@+id/lin3" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginTop="12dp">
-        <View android:background="@color/text_gray" android:layout_width="match_parent" android:layout_height="1dp"/>
-        <TextView android:textSize="@dimen/textsize_16" android:textColor="@color/white" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_marginLeft="10dp" android:layout_marginRight="10dp" android:text="产品信息:"/>
-        <View android:background="@color/text_gray" android:layout_width="match_parent" android:layout_height="1dp"/>
+
+    <LinearLayout
+        android:id="@+id/lin3"
+        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:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="10dp"
+            android:layout_marginRight="10dp"
+            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>
+
+</LinearLayout>

+ 796 - 647
src/com/jiaju/activity/LuociPriceActivity.java

@@ -1,14 +1,37 @@
 package com.jiaju.activity;
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import com.jiaju.adapter.HandOverAdapter;
+import com.jiaju.adapter.OrderSpinnerAdapter;
+import com.jiaju.adapter.SapSpinnerAdapter;
+import com.jiaju.model.BarcodeInfo;
+import com.jiaju.model.Order;
+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 android.app.Activity;
+import android.app.Notification;
+import android.content.Context;
 import android.content.Intent;
 import android.content.SharedPreferences;
+import android.content.SharedPreferences.Editor;
 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;
@@ -16,7 +39,10 @@ import android.view.KeyEvent;
 import android.view.Menu;
 import android.view.MotionEvent;
 import android.view.View;
-import android.view.ViewGroup;
+import android.view.View.OnClickListener;
+import android.view.inputmethod.EditorInfo;
+import android.widget.AdapterView;
+import android.widget.AdapterView.OnItemSelectedListener;
 import android.widget.Button;
 import android.widget.EditText;
 import android.widget.ImageButton;
@@ -25,650 +51,773 @@ import android.widget.ListView;
 import android.widget.RelativeLayout;
 import android.widget.Spinner;
 import android.widget.TextView;
-import com.jiaju.adapter.HandOverAdapter;
-import com.jiaju.adapter.OrderSpinnerAdapter;
-import com.jiaju.adapter.SapSpinnerAdapter;
-import com.jiaju.model.BarcodeInfo;
-import com.jiaju.model.Order;
-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.MessageHandler;
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
+//裸辞交接
 public class LuociPriceActivity extends Activity {
-    private static final String[] m = {"APP1", "APP2", "APP3"};
-    /* access modifiers changed from: private */
-    public String ServerAddress_ip;
-    /* access modifiers changed from: private */
-    public String ServerAddress_port;
-    Runnable UpperCase = new Runnable() {
-        public void run() {
-            LuociPriceActivity.this.barcodeEdt.setText(LuociPriceActivity.this.barcodeUpper.toUpperCase());
-            LuociPriceActivity.this.barcodeEdt.setSelection(LuociPriceActivity.this.barcodeUpper.length());
-        }
-    };
-    /* access modifiers changed from: private */
-    public String accountCode;
-    private OrderSpinnerAdapter adapter;
-    private SapSpinnerAdapter adapter1;
-    /* access modifiers changed from: private */
-    public String barcode;
-    /* access modifiers changed from: private */
-    public EditText barcodeEdt;
-    /* access modifiers changed from: private */
-    public List<BarcodeInfo> barcodeInfoList = new ArrayList();
-    /* access modifiers changed from: private */
-    public ListView barcodeLst;
-    /* access modifiers changed from: private */
-    public String barcodeUpper;
-    /* access modifiers changed from: private */
-    public Handler barcodeUpperH = new Handler();
-    private boolean checkedFlag = false;
-    /* access modifiers changed from: private */
-    public WebClient client;
-    Handler exceptionHandler = new Handler() {
-        public void handleMessage(Message msg) {
-            switch (msg.what) {
-                case 0:
-                    String message = msg.getData().getString("message");
-                    ProcessDialogUtils.closeProgressDilog();
-                    if (LuociPriceActivity.this.mHandler != null) {
-                        LuociPriceActivity.this.mHandler.removeCallbacksAndMessages((Object) null);
-                        LuociPriceActivity.this.mHandler.getLooper().quit();
-                    }
-                    CustomToast.showToast(LuociPriceActivity.this.getApplicationContext(), message, (int) MessageHandler.WHAT_SMOOTH_SCROLL);
-                    CommonUtil.setDefault(2, LuociPriceActivity.this.getApplicationContext());
-                    LuociPriceActivity.this.barcodeEdt.setEnabled(true);
-                    LuociPriceActivity.this.barcodeEdt.setText("");
-                    LuociPriceActivity.this.barcodeEdt.setFocusable(true);
-                    LuociPriceActivity.this.barcodeEdt.setFocusableInTouchMode(true);
-                    LuociPriceActivity.this.barcodeEdt.requestFocus();
-                    LuociPriceActivity.this.barcodeEdt.findFocus();
-                    LuociPriceActivity.this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                        public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                            return null;
-                        }
-                    }});
-                    return;
-                case 1:
-                    Bundle b1 = msg.getData();
-                    int status1 = b1.getInt("status");
-                    String message1 = b1.getString("message");
-                    ProcessDialogUtils.closeProgressDilog();
-                    if (LuociPriceActivity.this.mHandler != null) {
-                        LuociPriceActivity.this.mHandler.removeCallbacksAndMessages((Object) null);
-                        LuociPriceActivity.this.mHandler.getLooper().quit();
-                    }
-                    CommonUtil.setDefault(2, LuociPriceActivity.this.getApplicationContext());
-                    CommonUtil.showBarCodeAlertDialog(status1, message1, LuociPriceActivity.this, LuociPriceActivity.this.barcodeEdt, (EditText) null, (EditText) null);
-                    return;
-                default:
-                    return;
-            }
-        }
-    };
-    private boolean first = true;
-    Handler handler = new Handler() {
-        public void handleMessage(Message msg) {
-            String optString;
-            switch (msg.what) {
-                case 0:
-                    LuociPriceActivity.this.orderList = (List) msg.getData().getSerializable("orderList");
-                    if (LuociPriceActivity.this.mHandler != null) {
-                        LuociPriceActivity.this.mHandler.removeCallbacksAndMessages((Object) null);
-                        LuociPriceActivity.this.mHandler.getLooper().quit();
-                    }
-                    ProcessDialogUtils.closeProgressDilog();
-                    return;
-                case 1:
-                    ProcessDialogUtils.closeProgressDilog();
-                    if (LuociPriceActivity.this.mHandler != null) {
-                        LuociPriceActivity.this.mHandler.removeCallbacksAndMessages((Object) null);
-                        LuociPriceActivity.this.mHandler.getLooper().quit();
-                    }
-                    Bundle b1 = msg.getData();
-                    String result1 = b1.getString("result");
-                    LuociPriceActivity.this.barcode = b1.getString("barcode");
-                    try {
-                        JSONObject jobj3 = new JSONObject(result1).optJSONObject("d");
-                        int status3 = jobj3.optInt("Status");
-                        if (status3 == 0) {
-                            JSONArray arry4 = new JSONObject(jobj3.optString("Result")).optJSONArray("Table");
-                            if (arry4 != null && arry4.length() > 0) {
-                                String outbarcode = arry4.optJSONObject(0).optString("BARCODE");
-                                if (LuociPriceActivity.this.barcodeInfoList.size() > 0) {
-                                    if (Removeduplicate.removeBarCode(outbarcode, LuociPriceActivity.this.barcodeInfoList)) {
-                                        CustomToast.showToast(LuociPriceActivity.this.getApplicationContext(), "条码" + outbarcode + "重复", (int) MessageHandler.WHAT_SMOOTH_SCROLL);
-                                        CommonUtil.setDefault(2, LuociPriceActivity.this.getApplicationContext());
-                                        LuociPriceActivity.this.barcodeEdt.setEnabled(true);
-                                        LuociPriceActivity.this.barcodeEdt.setText("");
-                                        LuociPriceActivity.this.barcodeEdt.setFocusable(true);
-                                        LuociPriceActivity.this.barcodeEdt.setFocusableInTouchMode(true);
-                                        LuociPriceActivity.this.barcodeEdt.requestFocus();
-                                        LuociPriceActivity.this.barcodeEdt.findFocus();
-                                        LuociPriceActivity.this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                                            public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                                                return null;
-                                            }
-                                        }});
-                                        return;
-                                    }
-                                }
-                                for (int i = 0; i < arry4.length(); i++) {
-                                    JSONObject jobj5 = arry4.optJSONObject(i);
-                                    int logoId = jobj5.optInt("LOGOID");
-                                    String logoCode = jobj5.optString("LOGOCODE");
-                                    String logoName = jobj5.optString("LOGONAME");
-                                    String goodsCode = jobj5.optString("GOODSCODE");
-                                    String finishedBarCode = jobj5.optString("FINISHEDBARCODE");
-                                    String outbarcode1 = jobj5.optString("BARCODE");
-                                    int userId = jobj5.optInt("USERID");
-                                    String groutingUserCode = jobj5.optString("GROUTINGUSERCODE");
-                                    String mouldCode = jobj5.optString("MOULDCODE");
-                                    String groutingDate = CommonUtil.commonDateConverter(jobj5.optString("GROUTINGDATE"));
-                                    String diliverTime = jobj5.optString("DELIVERTIME");
-                                    String goodsModel = jobj5.optString("GOODSMODEL");
-                                    String diliverTime2 = CommonUtil.commonDateConverter(diliverTime);
-                                    BarcodeInfo info = new BarcodeInfo();
-                                    info.setBarcode(outbarcode1);
-                                    info.setLogoId(logoId);
-                                    info.setLogoCode(logoCode);
-                                    info.setFinishedBarCode(finishedBarCode);
-                                    info.setLogoName(logoName);
-                                    info.setGoodsCode(goodsCode);
-                                    info.setGoodsModel(goodsModel);
-                                    info.setUserId(userId);
-                                    info.setUserCode(groutingUserCode);
-                                    info.setMouldCode(mouldCode);
-                                    info.setGroutingDate(groutingDate);
-                                    info.setDeliverTime(diliverTime2);
-                                    if (jobj5.optString("BANMA") == "null") {
-                                        optString = "";
-                                    } else {
-                                        optString = jobj5.optString("BANMA");
-                                    }
-                                    info.setBanMa(optString);
-                                    LuociPriceActivity.this.barcodeInfoList.add(info);
-                                }
-                                if (LuociPriceActivity.this.handoverAdapter == null) {
-                                    LuociPriceActivity.this.handoverAdapter = new HandOverAdapter(LuociPriceActivity.this, LuociPriceActivity.this.barcodeInfoList);
-                                    LuociPriceActivity.this.barcodeLst.setAdapter(LuociPriceActivity.this.handoverAdapter);
-                                } else {
-                                    LuociPriceActivity.this.handoverAdapter.notifyDataSetChanged();
-                                }
-                                LuociPriceActivity.this.barcodeEdt.setEnabled(true);
-                                LuociPriceActivity.this.barcodeEdt.setText("");
-                                LuociPriceActivity.this.barcodeEdt.setFocusable(true);
-                                LuociPriceActivity.this.barcodeEdt.setFocusableInTouchMode(true);
-                                LuociPriceActivity.this.barcodeEdt.requestFocus();
-                                LuociPriceActivity.this.barcodeEdt.findFocus();
-                                LuociPriceActivity.this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                                    public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                                        return null;
-                                    }
-                                }});
-                            }
-                            LuociPriceActivity.this.saveBtn.setText("保存(" + LuociPriceActivity.this.barcodeInfoList.size() + ")");
-                            return;
-                        }
-                        String message = jobj3.optString("Message");
-                        CommonUtil.setDefault(2, LuociPriceActivity.this.getApplicationContext());
-                        CommonUtil.showBarCodeAlertDialog(status3, message, LuociPriceActivity.this, LuociPriceActivity.this.barcodeEdt, (EditText) null, (EditText) null);
-                        return;
-                    } catch (JSONException e1) {
-                        e1.printStackTrace();
-                        return;
-                    }
-                case 2:
-                    ProcessDialogUtils.closeProgressDilog();
-                    if (LuociPriceActivity.this.mHandler != null) {
-                        LuociPriceActivity.this.mHandler.removeCallbacksAndMessages((Object) null);
-                        LuociPriceActivity.this.mHandler.getLooper().quit();
-                    }
-                    Bundle b2 = msg.getData();
-                    String errmsg = b2.getString("msg");
-                    String missFlag = b2.getString("missingFlag");
-                    Intent intent = new Intent();
-                    Bundle b3 = new Bundle();
-                    b3.putString("msg", errmsg);
-                    b3.putString("missingFlag", missFlag);
-                    intent.putExtras(b3);
-                    intent.setClass(LuociPriceActivity.this, MissingScanActivity.class);
-                    LuociPriceActivity.this.startActivityForResult(intent, 101);
-                    return;
-                case 3:
-                    String result3 = msg.getData().getString("saveResult");
-                    if (LuociPriceActivity.this.mHandler != null) {
-                        LuociPriceActivity.this.mHandler.removeCallbacksAndMessages((Object) null);
-                        LuociPriceActivity.this.mHandler.getLooper().quit();
-                    }
-                    ProcessDialogUtils.closeProgressDilog();
-                    LuociPriceActivity.this.barcodeEdt.setEnabled(true);
-                    LuociPriceActivity.this.barcodeEdt.setText("");
-                    LuociPriceActivity.this.barcodeEdt.setFocusable(true);
-                    LuociPriceActivity.this.barcodeEdt.setFocusableInTouchMode(true);
-                    LuociPriceActivity.this.barcodeEdt.requestFocus();
-                    LuociPriceActivity.this.barcodeEdt.findFocus();
-                    LuociPriceActivity.this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                        public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                            return null;
-                        }
-                    }});
-                    try {
-                        JSONObject jo1 = new JSONObject(result3).optJSONObject("d");
-                        int status = jo1.optInt("Status");
-                        String message2 = jo1.optString("Message");
-                        if (status == 0) {
-                            CustomToast.showToast(LuociPriceActivity.this.getApplicationContext(), "保存成功", (int) MessageHandler.WHAT_SMOOTH_SCROLL);
-                            if (LuociPriceActivity.this.handoverAdapter != null) {
-                                LuociPriceActivity.this.barcodeInfoList.removeAll(LuociPriceActivity.this.barcodeInfoList);
-                                LuociPriceActivity.this.handoverAdapter.notifyDataSetChanged();
-                                LuociPriceActivity.this.saveBtn.setText("保存(" + LuociPriceActivity.this.barcodeInfoList.size() + ")");
-                            }
-                            CommonUtil.playSound(LuociPriceActivity.this.getApplicationContext());
-                            return;
-                        }
-                        CommonUtil.setDefault(2, LuociPriceActivity.this.getApplicationContext());
-                        CommonUtil.showBarCodeAlertDialog(status, message2, LuociPriceActivity.this, LuociPriceActivity.this.barcodeEdt, (EditText) null, (EditText) null);
-                        return;
-                    } catch (JSONException e) {
-                        e.printStackTrace();
-                        return;
-                    }
-                default:
-                    return;
-            }
-        }
-    };
-    /* access modifiers changed from: private */
-    public HandOverAdapter handoverAdapter;
-    /* access modifiers changed from: private */
-    public String handover_usercode;
-    private boolean isBarcodeTextChange;
-    private boolean isOrderTextChange;
-    private ImageView ivBack;
-    /* access modifiers changed from: private */
-    public Handler mHandler;
-    /* access modifiers changed from: private */
-    public Object obj = new Object();
-    private boolean orderFlag;
-    /* access modifiers changed from: private */
-    public List<Order> orderList;
-    private Spinner orderSpinner;
-    private RelativeLayout parent;
-    /* access modifiers changed from: private */
-    public String password;
-    private SharedPreferences preferences;
-    /* access modifiers changed from: private */
-    public Button saveBtn;
-    /* access modifiers changed from: private */
-    public String sessionkey;
-    private Spinner spinner;
-    /* access modifiers changed from: private */
-    public String spinnerName = "APP2";
-    private String spinner_ = "";
-    /* access modifiers changed from: private */
-    public HandlerThread thread;
-    private TextView tvBack;
-    private TextView tvTitle;
-
-    /* access modifiers changed from: protected */
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_finished_product_handover);
-        initView();
-        this.preferences = getSharedPreferences("user", 0);
-        this.ServerAddress_ip = this.preferences.getString("ServerAddress_ip", "");
-        this.ServerAddress_port = this.preferences.getString("ServerAddress_duankou", "");
-        this.accountCode = this.preferences.getString("AccountCode", "");
-        this.handover_usercode = this.preferences.getString("UserCode", "");
-        this.password = this.preferences.getString("UserPassword", "");
-        this.sessionkey = this.preferences.getString("SessionKey", "");
-        this.tvTitle.setText(getIntent().getExtras().getString("title"));
-        allListeners();
-        this.thread = new HandlerThread("trademarkThread", 5);
-        this.thread.start();
-        this.mHandler = new Handler(this.thread.getLooper());
-        this.mHandler.post(new OrderListRunnable(this.obj));
-    }
-
-    private void initView() {
-        this.tvTitle = (TextView) findViewById(R.id.title);
-        this.ivBack = (ImageButton) findViewById(R.id.left_img);
-        this.tvBack = (TextView) findViewById(R.id.back);
-        View head = View.inflate(this, R.layout.finished_product_handover_head_viewluoci, (ViewGroup) null);
-        this.barcodeEdt = (EditText) head.findViewById(R.id.barcodeEdt);
-        this.barcodeEdt.setRawInputType(2);
-        this.barcodeLst = (ListView) findViewById(R.id.handoverlst);
-        this.barcodeLst.addHeaderView(head, (Object) null, false);
-        this.handoverAdapter = new HandOverAdapter(this, this.barcodeInfoList);
-        this.barcodeLst.setAdapter(this.handoverAdapter);
-        this.saveBtn = (Button) findViewById(R.id.saveBtn);
-        this.parent = (RelativeLayout) findViewById(R.id.parentRel);
-    }
-
-    private void allListeners() {
-        this.ivBack.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                LuociPriceActivity.this.finish();
-            }
-        });
-        this.tvBack.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                LuociPriceActivity.this.finish();
-            }
-        });
-        this.saveBtn.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                if (LuociPriceActivity.this.barcodeInfoList == null || LuociPriceActivity.this.barcodeInfoList.size() == 0) {
-                    CustomToast.showToast(LuociPriceActivity.this.getApplicationContext(), "条码信息不能为空", (int) MessageHandler.WHAT_SMOOTH_SCROLL);
-                    return;
-                }
-                ProcessDialogUtils.showProcessDialog(LuociPriceActivity.this);
-                LuociPriceActivity.this.thread = null;
-                LuociPriceActivity.this.thread = new HandlerThread("saveThread", 5);
-                LuociPriceActivity.this.thread.start();
-                LuociPriceActivity.this.mHandler = new Handler(LuociPriceActivity.this.thread.getLooper());
-                LuociPriceActivity.this.mHandler.post(new SaveRunnable(LuociPriceActivity.this.obj));
-            }
-        });
-        this.barcodeEdt.addTextChangedListener(new TextWatcher() {
-            public void afterTextChanged(Editable arg0) {
-            }
-
-            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-            }
-
-            public void onTextChanged(CharSequence s, int start, int before, int count) {
-                LuociPriceActivity.this.barcodeUpper = LuociPriceActivity.this.barcodeEdt.getText().toString().trim();
-                if (LuociPriceActivity.this.barcodeUpper.length() >= 73) {
-                    String[] parts = LuociPriceActivity.this.barcodeUpper.split("-", 2);
-                    if (parts.length == 2) {
-                        LuociPriceActivity.this.barcodeUpper = parts[1];
-                    }
-                }
-                for (int i = 0; i < LuociPriceActivity.this.barcodeUpper.length(); i++) {
-                    if (LuociPriceActivity.this.barcodeUpper.charAt(i) + 0 >= 97 && LuociPriceActivity.this.barcodeUpper.charAt(i) + 0 <= 122) {
-                        LuociPriceActivity.this.barcodeUpperH.postDelayed(LuociPriceActivity.this.UpperCase, 300);
-                    }
-                }
-                if (start == 0 && before == 0 && count > 1) {
-                    String barcode = LuociPriceActivity.this.barcodeEdt.getText().toString().trim();
-                    if (!TextUtils.isEmpty(barcode)) {
-                        if (barcode.length() >= 73) {
-                            String[] parts2 = barcode.split("-", 2);
-                            if (parts2.length == 2) {
-                                barcode = parts2[1];
-                            }
-                        }
-                        ProcessDialogUtils.showProcessDialog(LuociPriceActivity.this);
-                        LuociPriceActivity.this.barcodeEdt.setEnabled(false);
-                        LuociPriceActivity.this.barcodeEdt.setFocusable(false);
-                        LuociPriceActivity.this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                            public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                                if (source.length() < 1) {
-                                    return dest.subSequence(dstart, dend);
-                                }
-                                return "";
-                            }
-                        }});
-                        LuociPriceActivity.this.thread = new HandlerThread("barcodeThread", 5);
-                        LuociPriceActivity.this.thread.start();
-                        LuociPriceActivity.this.mHandler = new Handler(LuociPriceActivity.this.thread.getLooper());
-                        LuociPriceActivity.this.mHandler.post(new BarcodeRunnable(LuociPriceActivity.this.obj, barcode));
-                    }
-                }
-            }
-        });
-        this.barcodeEdt.setOnEditorActionListener(new TextView.OnEditorActionListener() {
-            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
-                if (actionId == 2) {
-                    String barcode = LuociPriceActivity.this.barcodeEdt.getText().toString();
-                    if (!TextUtils.isEmpty(barcode)) {
-                        if (barcode.length() >= 73) {
-                            String[] parts = barcode.split("-", 2);
-                            if (parts.length == 2) {
-                                barcode = parts[1];
-                            }
-                        }
-                        ProcessDialogUtils.showProcessDialog(LuociPriceActivity.this);
-                        LuociPriceActivity.this.barcodeEdt.setEnabled(false);
-                        LuociPriceActivity.this.barcodeEdt.setFocusable(false);
-                        LuociPriceActivity.this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                            public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                                if (source.length() < 1) {
-                                    return dest.subSequence(dstart, dend);
-                                }
-                                return "";
-                            }
-                        }});
-                        LuociPriceActivity.this.thread = new HandlerThread("barcodeThread", 5);
-                        LuociPriceActivity.this.thread.start();
-                        LuociPriceActivity.this.mHandler = new Handler(LuociPriceActivity.this.thread.getLooper());
-                        LuociPriceActivity.this.mHandler.post(new BarcodeRunnable(LuociPriceActivity.this.obj, barcode));
-                        return true;
-                    }
-                }
-                return false;
-            }
-        });
-    }
-
-    public static int getOrderIndex(String order, List<Order> orderList2) {
-        for (int position = 0; position < orderList2.size(); position++) {
-            if (order.equalsIgnoreCase(orderList2.get(position).getOrderNo())) {
-                return position;
-            }
-        }
-        return -1;
-    }
-
-    private class SaveRunnable implements Runnable {
-        private Object object;
-
-        public SaveRunnable(Object object2) {
-            this.object = object2;
-        }
-
-        public void run() {
-            synchronized (this.object) {
-                try {
-                    LuociPriceActivity.this.client = null;
-                    LuociPriceActivity.this.client = new WebClient();
-                    JSONObject js = new JSONObject();
-                    js.put("accountCode", LuociPriceActivity.this.accountCode);
-                    js.put("userCode", LuociPriceActivity.this.handover_usercode);
-                    js.put("userPassword", LuociPriceActivity.this.password);
-                    js.put("sessionKey", LuociPriceActivity.this.sessionkey);
-                    js.put("module", "LCFinishedProduct");
-                    js.put("SPANAME", LuociPriceActivity.this.spinnerName);
-                    js.put("action", "LCSaveFinishedHandover");
-                    JSONArray orderEntity = new JSONArray();
-                    for (BarcodeInfo info : LuociPriceActivity.this.barcodeInfoList) {
-                        JSONObject obj = new JSONObject();
-                        obj.put("BarCode", info.getBarcode());
-                        obj.put("GoodsModel", info.getGoodsCode());
-                        obj.put("SPANAME", LuociPriceActivity.this.spinnerName);
-                        obj.put("logoID", info.getLogoId());
-                        obj.put("LogoName", info.getLogoName());
-                        orderEntity.put(obj);
-                    }
-                    JSONObject data = new JSONObject();
-                    data.put("Table", orderEntity);
-                    data.put("SPANAME", LuociPriceActivity.this.spinnerName);
-                    js.put("jsonData", data.toString());
-                    String result = LuociPriceActivity.this.client.doPost("http://" + LuociPriceActivity.this.ServerAddress_ip + ":" + LuociPriceActivity.this.ServerAddress_port + Constants.serverAction + "/DoAction", js.toString(), "application/json");
-                    Message m = new Message();
-                    m.what = 3;
-                    Bundle b = new Bundle();
-                    b.putString("saveResult", result);
-                    m.setData(b);
-                    LuociPriceActivity.this.handler.sendMessage(m);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    Message m2 = new Message();
-                    Bundle b2 = new Bundle();
-                    b2.putString("message", "网络连接异常");
-                    m2.setData(b2);
-                    m2.what = 0;
-                    LuociPriceActivity.this.exceptionHandler.sendMessage(m2);
-                }
-            }
-        }
-    }
-
-    private class BarcodeRunnable implements Runnable {
-        private String barcode;
-        private Object object;
-
-        public BarcodeRunnable(Object object2, String barcode2) {
-            this.object = object2;
-            this.barcode = barcode2;
-        }
-
-        public void run() {
-            synchronized (this.object) {
-                try {
-                    LuociPriceActivity.this.client = null;
-                    LuociPriceActivity.this.client = new WebClient();
-                    JSONObject js1 = new JSONObject();
-                    js1.put("accountCode", LuociPriceActivity.this.accountCode);
-                    js1.put("userCode", LuociPriceActivity.this.handover_usercode);
-                    js1.put("userPassword", LuociPriceActivity.this.password);
-                    js1.put("sessionKey", LuociPriceActivity.this.sessionkey);
-                    JSONObject data = new JSONObject();
-                    data.put("Barcode", this.barcode);
-                    js1.put("jsonData", data.toString());
-                    js1.put("module", "LCFinishedProduct");
-                    js1.put("action", "LCFinishedHandoverBarcode");
-                    String result2 = LuociPriceActivity.this.client.doPost("http://" + LuociPriceActivity.this.ServerAddress_ip + ":" + LuociPriceActivity.this.ServerAddress_port + Constants.serverAction + "/DoAction", js1.toString(), "application/json");
-                    Bundle b = new Bundle();
-                    Message message = new Message();
-                    message.what = 1;
-                    b.putString("barcode", this.barcode);
-                    b.putString("result", result2);
-                    message.setData(b);
-                    LuociPriceActivity.this.handler.sendMessage(message);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    Message m = new Message();
-                    Bundle b2 = new Bundle();
-                    b2.putString("message", "网络连接异常");
-                    m.setData(b2);
-                    m.what = 0;
-                    LuociPriceActivity.this.exceptionHandler.sendMessage(m);
-                }
-            }
-        }
-    }
-
-    private class OrderListRunnable implements Runnable {
-        private Object object;
-
-        public OrderListRunnable(Object object2) {
-            this.object = object2;
-        }
-
-        public void run() {
-            synchronized (this.object) {
-                try {
-                    LuociPriceActivity.this.client = null;
-                    LuociPriceActivity.this.client = new WebClient();
-                    JSONObject js = new JSONObject();
-                    js.put("accountCode", LuociPriceActivity.this.accountCode);
-                    js.put("userCode", LuociPriceActivity.this.handover_usercode);
-                    js.put("userPassword", LuociPriceActivity.this.password);
-                    js.put("sessionKey", LuociPriceActivity.this.sessionkey);
-                    js.put("order", new JSONObject());
-                    JSONObject j1 = new JSONObject(LuociPriceActivity.this.client.doPost("http://" + LuociPriceActivity.this.ServerAddress_ip + ":" + LuociPriceActivity.this.ServerAddress_port + Constants.serverAction + "/GetOrderList", js.toString(), "application/json")).optJSONObject("d");
-                    int status = j1.optInt("Status");
-                    String message = j1.optString("Message");
-                    if (status == 0) {
-                        JSONArray jarray = new JSONArray(j1.optString("Result"));
-                        if (jarray != null && jarray.length() > 0) {
-                            LuociPriceActivity.this.orderList = new ArrayList();
-                            Order order = new Order();
-                            order.setOrderId(-1);
-                            order.setOrderNo("请选择订单");
-                            LuociPriceActivity.this.orderList.add(order);
-                            for (int i = 0; i < jarray.length(); i++) {
-                                JSONObject obj = jarray.optJSONObject(i);
-                                int orderId = obj.optInt("ORDERID");
-                                String orderNo = obj.optString("ORDERNO");
-                                if (obj.optString("VALUEFLAG").equals("1")) {
-                                    Order order1 = new Order();
-                                    order1.setOrderId(orderId);
-                                    order1.setOrderNo(orderNo);
-                                    LuociPriceActivity.this.orderList.add(order1);
-                                }
-                            }
-                        }
-                        Message m = new Message();
-                        m.what = 0;
-                        Bundle b = new Bundle();
-                        b.putSerializable("orderList", (Serializable) LuociPriceActivity.this.orderList);
-                        m.setData(b);
-                        LuociPriceActivity.this.handler.sendMessage(m);
-                        return;
-                    }
-                    Bundle b2 = new Bundle();
-                    b2.putInt("status", status);
-                    b2.putString("message", message);
-                    Message m2 = new Message();
-                    m2.what = 1;
-                    m2.setData(b2);
-                    LuociPriceActivity.this.exceptionHandler.sendMessage(m2);
-                    return;
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    Message m3 = new Message();
-                    Bundle b3 = new Bundle();
-                    b3.putString("message", "网络连接异常");
-                    m3.setData(b3);
-                    m3.what = 0;
-                    LuociPriceActivity.this.exceptionHandler.sendMessage(m3);
-                }
-            }
-        }
-    }
-
-    public boolean dispatchTouchEvent(MotionEvent ev) {
-        switch (ev.getAction()) {
-            case 0:
-                CommonUtil.hideKeyboard(ev, getCurrentFocus(), this);
-                break;
-        }
-        return super.dispatchTouchEvent(ev);
-    }
-
-    /* access modifiers changed from: protected */
-    public void onActivityResult(int requestCode, int resultCode, Intent intent) {
-        if (requestCode == 101 && resultCode == 103) {
-            this.barcodeEdt.setEnabled(true);
-            this.barcodeEdt.setText("");
-            this.barcodeEdt.setFocusable(true);
-            this.barcodeEdt.setFocusableInTouchMode(true);
-            this.barcodeEdt.requestFocus();
-            this.barcodeEdt.findFocus();
-            this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                    return null;
-                }
-            }});
-        }
-    }
-
-    public boolean onCreateOptionsMenu(Menu menu) {
-        getMenuInflater().inflate(R.menu.finished_product_handover, menu);
-        return true;
-    }
-}
+	private TextView tvTitle;
+	private String password;
+	private String sessionkey;
+	private SharedPreferences preferences;
+	private String ServerAddress_ip;
+	private String ServerAddress_port;
+	private String accountCode;
+	private String handover_usercode;
+	private HandlerThread thread;
+	private Handler mHandler;
+	private WebClient client;
+	private List<Order> orderList;
+	private Spinner orderSpinner;
+	private SapSpinnerAdapter adapter1;
+	private EditText barcodeEdt;
+	private String barcode;
+	private TextView tvBack;
+	private ImageView ivBack;
+	private Object obj = new Object();
+	private List<BarcodeInfo> barcodeInfoList = new ArrayList<BarcodeInfo>();
+	private ListView barcodeLst;
+	private HandOverAdapter handoverAdapter;
+	private Button saveBtn;
+//	private EditText orderEdt;
+	private boolean orderFlag;
+	private Handler barcodeUpperH = new Handler();
+	private String barcodeUpper;
+	private boolean checkedFlag = false;
+	private boolean isOrderTextChange;
+	private OrderSpinnerAdapter adapter;
+	private boolean isBarcodeTextChange;
+	private RelativeLayout parent; 
+	private static final String[] m = {"APP1", "APP2", "APP3"};
+	private Spinner spinner;
+	private String spinnerName = "APP2";
+	private String spinner_ = "";
+	private boolean first = true;
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.activity_finished_product_handover); 
+		initView(); 
+		preferences = getSharedPreferences("user", Context.MODE_PRIVATE);
+		ServerAddress_ip = preferences.getString("ServerAddress_ip", "");
+		ServerAddress_port = preferences.getString("ServerAddress_duankou", "");
+		accountCode = preferences.getString("AccountCode", "");
+		handover_usercode = preferences.getString("UserCode", "");
+		password = preferences.getString("UserPassword", "");
+		sessionkey = preferences.getString("SessionKey", ""); 
+		Bundle b = getIntent().getExtras();
+		String title = b.getString("title");
+		tvTitle.setText(title); 
+		allListeners();
+		thread = new HandlerThread("trademarkThread", 5);
+		thread.start();
+		mHandler = new Handler(thread.getLooper());
+		OrderListRunnable orderListRunnable = new OrderListRunnable(obj);
+		mHandler.post(orderListRunnable);
+	} 
+	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.finished_product_handover_head_viewluoci, null); 
+		barcodeEdt = (EditText) head.findViewById(R.id.barcodeEdt);
+		barcodeEdt.setRawInputType(InputType.TYPE_CLASS_NUMBER);
+		barcodeLst = (ListView) findViewById(R.id.handoverlst);
+		barcodeLst.addHeaderView(head, null, false);
+		handoverAdapter = new HandOverAdapter(
+				LuociPriceActivity.this, barcodeInfoList);
+		barcodeLst.setAdapter(handoverAdapter);
+		saveBtn = (Button) findViewById(R.id.saveBtn); 
+		parent = (RelativeLayout) findViewById(R.id.parentRel); 
+	}
+	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();
+			}
+		}); 
+		saveBtn.setOnClickListener(new View.OnClickListener() {
+			@Override
+			public void onClick(View v) { 
+				int orderId; 
+				if (barcodeInfoList == null || barcodeInfoList.size() == 0) {
+					CustomToast.showToast(getApplicationContext(), "条码信息不能为空",
+							2000);
+					return;
+				}
+				ProcessDialogUtils.showProcessDialog(
+						LuociPriceActivity.this);
+				thread = null;
+				thread = new HandlerThread("saveThread", 5);
+				thread.start();
+				mHandler = new Handler(thread.getLooper());
+				SaveRunnable saveRunnable = new SaveRunnable(obj);
+				mHandler.post(saveRunnable);
+			}
+		}); 
+		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();
+				if(barcodeUpper.length() >= 73)
+				{
+					String[] parts = barcodeUpper.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2  
+					  
+			        if (parts.length == 2) {  
+			            //System.out.println("第一部分: " + parts[0]);  
+			            //System.out.println("第二部分: " + parts[1]);  
+			        	barcodeUpper = parts[1];
+			        }  
+				} 
+				// 判断输入的文字是否是小写
+				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(barcode.length() >= 73)
+						{
+							String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2  
+							  
+					        if (parts.length == 2) {  
+					            //System.out.println("第一部分: " + parts[0]);  
+					            //System.out.println("第二部分: " + parts[1]);  
+					            barcode = parts[1];
+					        }  
+						} 
+						ProcessDialogUtils.showProcessDialog(
+								LuociPriceActivity.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) {
+							String barcode = barcodeEdt.getText().toString(); 
+							if (!TextUtils.isEmpty(barcode)) {
+								if(barcode.length() >= 73)
+								{
+									String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2  
+									  
+							        if (parts.length == 2) {  
+							            //System.out.println("第一部分: " + parts[0]);  
+							            //System.out.println("第二部分: " + parts[1]);  
+							            barcode = parts[1];
+							        }  
+								} 
+								ProcessDialogUtils.showProcessDialog(
+										LuociPriceActivity.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;
+					}
+				});
+	}
+	Runnable UpperCase = new Runnable() {
+		@Override
+		public void run() {
+			// 小写转大写
+			barcodeEdt.setText(barcodeUpper.toUpperCase());
+			// 设置EditText光标位置
+			barcodeEdt.setSelection(barcodeUpper.length());
+		}
+	};
+	public static int getOrderIndex(String order, List<Order> orderList) {
+		int newposition = -1;
+		for (int position = 0; position < orderList.size(); position++) {
+			if (order
+					.equalsIgnoreCase((orderList.get(position).getOrderNo()))) {
+				newposition = position;
+				break;
+			}
+		}
+		return newposition;
+	}
+	private class SaveRunnable implements Runnable {
+		private Object object; 
+		public SaveRunnable(Object object) {
+			this.object = object; 
+		}
+		@Override
+		public void run() {
+			synchronized (object) {
+				try {
+					client = null;
+					client = new WebClient();
+					JSONObject js = new JSONObject();
+					js.put("accountCode", accountCode);
+					js.put("userCode", handover_usercode);
+					js.put("userPassword", password);
+					js.put("sessionKey", sessionkey);
+					js.put("module", "LCFinishedProduct");
+					js.put("SPANAME", spinnerName);
+					js.put("action", "LCSaveFinishedHandover");
+					JSONArray orderEntity = new JSONArray();
+					for (BarcodeInfo info : barcodeInfoList) {
+						JSONObject obj = new JSONObject();
+						obj.put("BarCode", info.getBarcode());
+						obj.put("GoodsModel", info.getGoodsCode());
+						obj.put("SPANAME", spinnerName);
+						obj.put("logoID", info.getLogoId());
+						obj.put("LogoName", info.getLogoName());
+						orderEntity.put(obj);
+					}
+					JSONObject data = new JSONObject();
+//					data.put("OrderID", orderId);
+					data.put("Table", orderEntity);
+					data.put("SPANAME", spinnerName);
+					js.put("jsonData", data.toString());
+					String result = client.doPost(
+							"http://" + ServerAddress_ip + ":"
+									+ ServerAddress_port
+									+ Constants.serverAction + "/DoAction",
+							js.toString(), "application/json");
+					Message m = new Message();
+					m.what = 3;
+					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);
+				}
+			}
+		}
+	};
+	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 {
+					client = null;
+					client = new WebClient();
+					JSONObject js1 = new JSONObject();
+					js1.put("accountCode", accountCode);
+					js1.put("userCode", handover_usercode);
+					js1.put("userPassword", password);
+					js1.put("sessionKey", sessionkey);
+					JSONObject data = new JSONObject();
+					data.put("Barcode", barcode);
+					js1.put("jsonData", data.toString());
+					js1.put("module", "LCFinishedProduct");
+					js1.put("action", "LCFinishedHandoverBarcode");
+					String result2 = client.doPost(
+							"http://" + ServerAddress_ip + ":"
+									+ ServerAddress_port
+									+ Constants.serverAction + "/DoAction",
+							js1.toString(), "application/json");
+					Bundle b = new Bundle();
+					Message message = new Message();
+					message.what = 1;
+					b.putString("barcode", barcode);
+					b.putString("result", result2);
+					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);
+				}
+			}
+		}
+	};
+	private class OrderListRunnable implements Runnable {
+		private Object object;
+		public OrderListRunnable(Object object) {
+			this.object = object;
+		}
+		@Override
+		public void run() {
+			synchronized (object) {
+				try {
+					client = null;
+					client = new WebClient();
+					JSONObject js = new JSONObject();
+					js.put("accountCode", accountCode);
+					js.put("userCode", handover_usercode);
+					js.put("userPassword", password);
+					js.put("sessionKey", sessionkey);
+					JSONObject orderEntity = new JSONObject();
+					js.put("order", orderEntity);
+					String result = client.doPost(
+							"http://" + ServerAddress_ip + ":"
+									+ ServerAddress_port
+									+ Constants.serverAction + "/GetOrderList",
+							js.toString(), "application/json");
+					JSONObject j = new JSONObject(result);
+					JSONObject j1 = j.optJSONObject("d");
+					int status = j1.optInt("Status");
+					String message = j1.optString("Message");
+					if (status == 0) {
+						String result1 = j1.optString("Result");
+						JSONArray jarray = new JSONArray(result1);
+						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("ORDERID");
+								String orderNo = obj.optString("ORDERNO");
+								String valueFlag = obj.optString("VALUEFLAG");
+								if (valueFlag.equals("1")) {
+									Order order1 = new Order();
+									order1.setOrderId(orderId);
+									order1.setOrderNo(orderNo);
+									orderList.add(order1);
+								}
+							}
+						} 
+						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);
+				}
+			}
+		}
+	};
+	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;
+						}
+					}}); 
+					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,
+							LuociPriceActivity.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(); 
+					break;
+				case 1 :
+					ProcessDialogUtils.closeProgressDilog();
+					if (mHandler != null) {
+						mHandler.removeCallbacksAndMessages(null);
+						mHandler.getLooper().quit();
+					}
+					Bundle b1 = msg.getData();
+					String result1 = b1.getString("result");
+					barcode = b1.getString("barcode");
+					JSONObject jobj2;
+					try {
+						jobj2 = new JSONObject(result1);
+						JSONObject jobj3 = jobj2.optJSONObject("d");
+						int status3 = jobj3.optInt("Status");
+						if (status3 == 0) {
+							String result4 = jobj3.optString("Result");
+							JSONObject jobj4 = new JSONObject(result4);
+							JSONArray arry4 = jobj4.optJSONArray("Table");
+							if (arry4 != null && arry4.length() > 0) {
+								JSONObject jobj6 = arry4.optJSONObject(0);
+								String outbarcode = jobj6.optString("BARCODE");
+								if (barcodeInfoList.size() > 0) {
+									boolean b2 = Removeduplicate.removeBarCode(
+											outbarcode, barcodeInfoList);
+									if (b2) {
+										String message = "条码" + outbarcode
+												+ "重复";
+										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;
+													}
+												}}); 
+										return;
+									}
+								}
+								for (int i = 0; i < arry4.length(); i++) {
+									JSONObject jobj5 = arry4.optJSONObject(i);
+									int logoId = jobj5.optInt("LOGOID");
+									String logoCode = jobj5
+											.optString("LOGOCODE");
+									String logoName = jobj5
+											.optString("LOGONAME");
+									String goodsCode = jobj5
+											.optString("GOODSCODE");
+									String finishedBarCode = jobj5
+											.optString("FINISHEDBARCODE");
+									String outbarcode1 = jobj5
+											.optString("BARCODE");
+									int userId = jobj5.optInt("USERID");
+									String groutingUserCode = jobj5
+											.optString("GROUTINGUSERCODE");
+									String mouldCode = jobj5
+											.optString("MOULDCODE");
+									String groutingDate = jobj5
+											.optString("GROUTINGDATE");
+									groutingDate = CommonUtil
+											.commonDateConverter(groutingDate);
+									String diliverTime = jobj5
+											.optString("DELIVERTIME");
+									String goodsModel = jobj5
+											.optString("GOODSMODEL");
+									diliverTime = CommonUtil
+											.commonDateConverter(diliverTime);
+									// limitNum = jobj5.optInt("PLATELIMITNUM");
+									BarcodeInfo info = new BarcodeInfo();
+									info.setBarcode(outbarcode1);
+									info.setLogoId(logoId);
+									info.setLogoCode(logoCode);
+									info.setFinishedBarCode(finishedBarCode);
+									info.setLogoName(logoName);
+									info.setGoodsCode(goodsCode);
+									info.setGoodsModel(goodsModel);
+									info.setUserId(userId);
+									info.setUserCode(groutingUserCode);
+									info.setMouldCode(mouldCode);
+									info.setGroutingDate(groutingDate);
+									info.setDeliverTime(diliverTime);
+									info.setBanMa(
+											(jobj5.optString("BANMA") == "null")
+													? ""
+													: jobj5.optString("BANMA"));
+								 
+									barcodeInfoList.add(info);
+								}
+								if (handoverAdapter == null) {
+									handoverAdapter = new HandOverAdapter(
+											LuociPriceActivity.this,
+											barcodeInfoList);
+									barcodeLst.setAdapter(handoverAdapter);
+								 
+								} else {
+									handoverAdapter.notifyDataSetChanged();
+								}
+							 
+								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;
+											}
+										}}); 
+							}
+						} else {
+							String message = jobj3.optString("Message");
+							CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
+									getApplicationContext());
+							CommonUtil.showBarCodeAlertDialog(status3, message,
+									LuociPriceActivity.this,
+									barcodeEdt, null, null);
+							return;
+						}
+						saveBtn.setText("保存(" + barcodeInfoList.size() + ")");
+					} catch (JSONException e1) {
+						e1.printStackTrace();
+					}
+					break;
+				case 2 :
+					ProcessDialogUtils.closeProgressDilog();
+					if (mHandler != null) {
+						mHandler.removeCallbacksAndMessages(null);
+						mHandler.getLooper().quit();
+					}
+					Bundle b2 = msg.getData();
+					String errmsg = b2.getString("msg");
+					String missFlag = b2.getString("missingFlag");
+					Intent intent = new Intent();
+					Bundle b3 = new Bundle();
+					b3.putString("msg", errmsg);
+					b3.putString("missingFlag", missFlag);
+					intent.putExtras(b3);
+					intent.setClass(LuociPriceActivity.this,
+							MissingScanActivity.class);
+					startActivityForResult(intent, 101);
+					break;
+				case 3 :
+					Bundle b4 = msg.getData();
+					String result3 = 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 jo = new JSONObject(result3);
+						JSONObject jo1 = jo.optJSONObject("d");
+						int status = jo1.optInt("Status");
+						String message = jo1.optString("Message");
+						if (status == 0) {
+							CustomToast.showToast(getApplicationContext(),
+									"保存成功", 2000);
+							// if (quantitySettingValue.equals("0")) {
+							// saveBtn.setEnabled(true);
+							//
+							// } else {
+							// saveBtn.setEnabled(false);
+							//
+							// }
+//							orderEdt.setText("");
+							if (handoverAdapter != null) {
+								barcodeInfoList.removeAll(barcodeInfoList);
+								handoverAdapter.notifyDataSetChanged();
+								saveBtn.setText(
+										"保存(" + barcodeInfoList.size() + ")");
+							}
+							CommonUtil.playSound(getApplicationContext());
+						} else {
+							CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
+									getApplicationContext());
+							CommonUtil.showBarCodeAlertDialog(status, message,
+									LuociPriceActivity.this,
+									barcodeEdt, null, null);
+						}
+					} catch (JSONException e) {
+						e.printStackTrace();
+					}
+					break;
+			}
+		}
+	};
+	@Override
+	public boolean dispatchTouchEvent(MotionEvent ev) {
+		switch (ev.getAction()) {
+			case MotionEvent.ACTION_DOWN :
+				View view = getCurrentFocus();
+				CommonUtil.hideKeyboard(ev, view,
+						LuociPriceActivity.this);// 调用方法判断是否需要隐藏键盘
+				break;
+			default :
+				break;
+		}
+		return super.dispatchTouchEvent(ev);
+	}
+	@Override
+	protected void onActivityResult(int requestCode, int resultCode,
+			Intent intent) {
+		if (requestCode == 101 && resultCode == 103) {
+//			orderEdt.setEnabled(true);
+//			orderEdt.setFocusable(true);
+//			orderEdt.setFocusableInTouchMode(true);
+//			orderEdt.setFilters(new InputFilter[]{new InputFilter() {
+//				@Override
+//				public CharSequence filter(CharSequence source, int start,
+//						int end, Spanned dest, int dstart, int dend) {
+//					return null;
+//				}
+//			}});
+			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;
+				}
+			}}); 
+		}
+	}
+	@Override
+	public boolean onCreateOptionsMenu(Menu menu) {
+		getMenuInflater().inflate(R.menu.finished_product_handover, menu);
+		return true;
+	}
+}

+ 603 - 573
src/com/jiaju/activity/LuociRevokeActivity.java

@@ -1,6 +1,22 @@
 package com.jiaju.activity;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import com.jiaju.adapter.CancelFinishedProductHandOverAdapter;
+import com.jiaju.model.BarcodeInfo;
+import com.jiaju.net.WebClient;
+import com.jiaju.utils.CommonUtil;
+import com.jiaju.utils.Constants;
+import com.jiaju.utils.ProcessDialogUtils;
+import com.jiaju.utils.Removeduplicate;
 
 import android.app.Activity;
+import android.app.Notification;
+import android.content.Context;
 import android.content.SharedPreferences;
 import android.os.Bundle;
 import android.os.Handler;
@@ -8,12 +24,15 @@ 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.Menu;
 import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.inputmethod.EditorInfo;
 import android.view.inputmethod.InputMethodManager;
 import android.widget.Button;
 import android.widget.EditText;
@@ -21,577 +40,588 @@ import android.widget.ImageButton;
 import android.widget.ListView;
 import android.widget.TextView;
 import android.widget.Toast;
-import com.jiaju.adapter.CancelFinishedProductHandOverAdapter;
-import com.jiaju.model.BarcodeInfo;
-import com.jiaju.net.WebClient;
-import com.jiaju.utils.CommonUtil;
-import com.jiaju.utils.Constants;
-import com.jiaju.utils.ProcessDialogUtils;
-import com.jiaju.utils.Removeduplicate;
-import java.util.ArrayList;
-import java.util.List;
-import org.json.JSONArray;
-import org.json.JSONException;
-import org.json.JSONObject;
-
+//裸辞交接 撤销
 public class LuociRevokeActivity extends Activity {
-    Runnable BarcodeUpperCase = new Runnable() {
-        public void run() {
-            LuociRevokeActivity.this.barcodeEdt.setText(LuociRevokeActivity.this.barcodeUpper.toUpperCase());
-            LuociRevokeActivity.this.barcodeEdt.setSelection(LuociRevokeActivity.this.barcodeUpper.length());
-        }
-    };
-    /* access modifiers changed from: private */
-    public String ServerAddress_duankou;
-    /* access modifiers changed from: private */
-    public String ServerAddress_ip;
-    Runnable UpperCase = new Runnable() {
-        public void run() {
-            LuociRevokeActivity.this.barcodeEdt.setText(LuociRevokeActivity.this.barcodeUpper.toUpperCase());
-            LuociRevokeActivity.this.barcodeEdt.setSelection(LuociRevokeActivity.this.barcodeUpper.length());
-        }
-    };
-    /* access modifiers changed from: private */
-    public String accountCode;
-    /* access modifiers changed from: private */
-    public CancelFinishedProductHandOverAdapter adapter = null;
-    private ImageButton backbtn;
-    private TextView backtext;
-    /* access modifiers changed from: private */
-    public EditText barcodeEdt;
-    /* access modifiers changed from: private */
-    public List<BarcodeInfo> barcodeList;
-    /* access modifiers changed from: private */
-    public String barcodeUpper;
-    /* access modifiers changed from: private */
-    public Handler barcodeUpperH = new Handler();
-    /* access modifiers changed from: private */
-    public String cancelPacking_userCode;
-    /* access modifiers changed from: private */
-    public ListView cancellstview;
-    /* access modifiers changed from: private */
-    public WebClient client = null;
-    /* access modifiers changed from: private */
-    public Handler exceptionHandler = new Handler() {
-        public void handleMessage(Message msg) {
-            super.handleMessage(msg);
-            switch (msg.what) {
-                case 0:
-                    ProcessDialogUtils.closeProgressDilog();
-                    LuociRevokeActivity.this.saveBtn.setEnabled(true);
-                    if (LuociRevokeActivity.this.mHandler != null) {
-                        LuociRevokeActivity.this.mHandler.removeCallbacksAndMessages((Object) null);
-                        LuociRevokeActivity.this.mHandler.getLooper().quit();
-                    }
-                    String message = msg.getData().getString("message");
-                    CommonUtil.setDefault(2, LuociRevokeActivity.this.getApplicationContext());
-                    Toast.makeText(LuociRevokeActivity.this.getApplicationContext(), message, 0).show();
-                    LuociRevokeActivity.this.barcodeEdt.setEnabled(true);
-                    LuociRevokeActivity.this.barcodeEdt.setText("");
-                    LuociRevokeActivity.this.barcodeEdt.setFocusable(true);
-                    LuociRevokeActivity.this.barcodeEdt.setFocusableInTouchMode(true);
-                    LuociRevokeActivity.this.barcodeEdt.requestFocus();
-                    LuociRevokeActivity.this.barcodeEdt.findFocus();
-                    LuociRevokeActivity.this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                        public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                            return null;
-                        }
-                    }});
-                    CommonUtil.BarcodeMaxLength(LuociRevokeActivity.this.barcodeEdt, 50);
-                    return;
-                default:
-                    return;
-            }
-        }
-    };
-    Handler h = new Handler() {
-        public void handleMessage(Message msg) {
-            String optString;
-            switch (msg.what) {
-                case 0:
-                    String json1 = msg.getData().getString("barcodeResult");
-                    ProcessDialogUtils.closeProgressDilog();
-                    try {
-                        JSONObject jo3 = new JSONObject(json1).optJSONObject("d");
-                        int status = jo3.optInt("Status");
-                        String message = jo3.optString("Message");
-                        if (status == 0) {
-                            JSONArray jarray = new JSONObject(jo3.optString("Result")).optJSONArray("Table");
-                            if (jarray == null || jarray.length() <= 0) {
-                                Toast.makeText(LuociRevokeActivity.this.getApplicationContext(), "此条码不存在", 0).show();
-                            } else {
-                                for (int i = 0; i < jarray.length(); i++) {
-                                    JSONObject jo = jarray.optJSONObject(i);
-                                    String orderNo = jo.optString("ORDERNO");
-                                    String goodsCode = jo.optString("GOODSCODE");
-                                    String groutingUserCode = jo.optString("GROUTINGUSERCODE");
-                                    int logoId = jo.optInt("LOGOID");
-                                    String logoCode = jo.optString("LOGOCODE");
-                                    String logoName = jo.optString("LOGONAME");
-                                    String barcode = jo.optString("BARCODE");
-                                    String finishedBarcode = jo.optString("FINISHEDBARCODE");
-                                    String groutingDate = jo.optString("GROUTINGDATE");
-                                    String billetDate = jo.optString("DELIVERTIME");
-                                    String mouldCode = jo.optString("GROUTINGMOULDCODE");
-                                    BarcodeInfo info = new BarcodeInfo();
-                                    info.setBarcode(barcode);
-                                    info.setFinishedBarCode(finishedBarcode);
-                                    info.setOrderNo(orderNo);
-                                    info.setGoodsCode(goodsCode);
-                                    info.setUserCode(groutingUserCode);
-                                    info.setLogoId(logoId);
-                                    info.setLogoCode(logoCode);
-                                    info.setLogoName(logoName);
-                                    if (jo.optString("BANMA") == "null") {
-                                        optString = "";
-                                    } else {
-                                        optString = jo.optString("BANMA");
-                                    }
-                                    info.setBanMa(optString);
-                                    if (!TextUtils.isEmpty(groutingDate)) {
-                                        if (groutingDate.contains("/")) {
-                                            groutingDate = CommonUtil.dateStringConverter(groutingDate);
-                                        } else if (groutingDate.contains("-")) {
-                                            groutingDate = CommonUtil.commonDateConverter(groutingDate);
-                                        }
-                                        info.setGroutingDate(groutingDate);
-                                    } else {
-                                        info.setGroutingDate("");
-                                    }
-                                    if (!TextUtils.isEmpty(billetDate)) {
-                                        if (billetDate.contains("/")) {
-                                            billetDate = CommonUtil.dateStringConverter(billetDate);
-                                        } else if (billetDate.contains("-")) {
-                                            billetDate = CommonUtil.commonDateConverter(billetDate);
-                                        }
-                                        info.setDeliverTime(billetDate);
-                                    } else {
-                                        info.setDeliverTime("");
-                                    }
-                                    info.setMouldCode(mouldCode);
-                                    LuociRevokeActivity.this.barcodeList.add(info);
-                                }
-                                LuociRevokeActivity.this.adapter = new CancelFinishedProductHandOverAdapter(LuociRevokeActivity.this, LuociRevokeActivity.this.barcodeList);
-                                LuociRevokeActivity.this.cancellstview.setAdapter(LuociRevokeActivity.this.adapter);
-                                LuociRevokeActivity.this.saveBtn.setText("保存(" + LuociRevokeActivity.this.barcodeList.size() + ")");
-                            }
-                            LuociRevokeActivity.this.barcodeEdt.setEnabled(true);
-                            LuociRevokeActivity.this.barcodeEdt.setText("");
-                            LuociRevokeActivity.this.barcodeEdt.setFocusable(true);
-                            LuociRevokeActivity.this.barcodeEdt.setFocusableInTouchMode(true);
-                            LuociRevokeActivity.this.barcodeEdt.requestFocus();
-                            LuociRevokeActivity.this.barcodeEdt.findFocus();
-                            LuociRevokeActivity.this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                                public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                                    return null;
-                                }
-                            }});
-                            CommonUtil.BarcodeMaxLength(LuociRevokeActivity.this.barcodeEdt, 50);
-                        } else {
-                            CommonUtil.setDefault(2, LuociRevokeActivity.this.getApplicationContext());
-                            CommonUtil.showBarCodeAlertDialog(status, message, LuociRevokeActivity.this, LuociRevokeActivity.this.barcodeEdt, (EditText) null, (EditText) null);
-                        }
-                        if (LuociRevokeActivity.this.mHandler != null) {
-                            LuociRevokeActivity.this.mHandler.removeCallbacksAndMessages((Object) null);
-                            LuociRevokeActivity.this.mHandler.getLooper().quit();
-                            return;
-                        }
-                        return;
-                    } catch (JSONException e1) {
-                        e1.printStackTrace();
-                        Toast.makeText(LuociRevokeActivity.this.getApplicationContext(), "json数据异常", 0).show();
-                        return;
-                    }
-                case 1:
-                    String json = msg.getData().getString("saveResult");
-                    ProcessDialogUtils.closeProgressDilog();
-                    if (LuociRevokeActivity.this.mHandler != null) {
-                        LuociRevokeActivity.this.mHandler.removeCallbacksAndMessages((Object) null);
-                        LuociRevokeActivity.this.mHandler.getLooper().quit();
-                    }
-                    LuociRevokeActivity.this.saveBtn.setEnabled(true);
-                    try {
-                        JSONObject jo1 = new JSONObject(json).optJSONObject("d");
-                        int status2 = jo1.optInt("Status");
-                        String message2 = jo1.optString("Message");
-                        if (LuociRevokeActivity.this.barcodeList != null && LuociRevokeActivity.this.barcodeList.size() > 0) {
-                            LuociRevokeActivity.this.barcodeList.removeAll(LuociRevokeActivity.this.barcodeList);
-                            if (LuociRevokeActivity.this.adapter != null) {
-                                LuociRevokeActivity.this.adapter.notifyDataSetChanged();
-                            }
-                        }
-                        LuociRevokeActivity.this.saveBtn.setText("保存(" + LuociRevokeActivity.this.barcodeList.size() + ")");
-                        if (status2 == 0) {
-                            LuociRevokeActivity.this.barcodeEdt.setEnabled(true);
-                            LuociRevokeActivity.this.barcodeEdt.setText("");
-                            LuociRevokeActivity.this.barcodeEdt.setFocusable(true);
-                            LuociRevokeActivity.this.barcodeEdt.setFocusableInTouchMode(true);
-                            LuociRevokeActivity.this.barcodeEdt.requestFocus();
-                            LuociRevokeActivity.this.barcodeEdt.findFocus();
-                            LuociRevokeActivity.this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                                public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                                    return null;
-                                }
-                            }});
-                            CommonUtil.BarcodeMaxLength(LuociRevokeActivity.this.barcodeEdt, 50);
-                            ((InputMethodManager) LuociRevokeActivity.this.barcodeEdt.getContext().getSystemService("input_method")).hideSoftInputFromWindow(LuociRevokeActivity.this.getCurrentFocus().getWindowToken(), 2);
-                            Toast.makeText(LuociRevokeActivity.this.getApplicationContext(), "上传成功", 0).show();
-                            CommonUtil.playSound(LuociRevokeActivity.this.getApplicationContext());
-                            return;
-                        }
-                        CommonUtil.showBarCodeAlertDialog(status2, message2, LuociRevokeActivity.this, LuociRevokeActivity.this.barcodeEdt, (EditText) null, (EditText) null);
-                        CommonUtil.setDefault(2, LuociRevokeActivity.this.getApplicationContext());
-                        return;
-                    } catch (JSONException e) {
-                        e.printStackTrace();
-                        Toast.makeText(LuociRevokeActivity.this.getApplicationContext(), "json数据异常", 0).show();
-                        return;
-                    }
-                default:
-                    return;
-            }
-        }
-    };
-    /* access modifiers changed from: private */
-    public Handler mHandler;
-    /* access modifiers changed from: private */
-    public Object obj = new Object();
-    /* access modifiers changed from: private */
-    public String password;
-    private SharedPreferences preferences;
-    private String procedureName;
-    /* access modifiers changed from: private */
-    public Button saveBtn;
-    /* access modifiers changed from: private */
-    public String sessionkey;
-    /* access modifiers changed from: private */
-    public HandlerThread thread;
-    private TextView title;
-
-    /* access modifiers changed from: protected */
-    public void onCreate(Bundle savedInstanceState) {
-        super.onCreate(savedInstanceState);
-        setContentView(R.layout.activity_cancel_finished_product_hand_over);
-        initView();
-        this.preferences = getSharedPreferences("user", 0);
-        this.ServerAddress_ip = this.preferences.getString("ServerAddress_ip", "");
-        this.ServerAddress_duankou = this.preferences.getString("ServerAddress_duankou", "");
-        this.accountCode = this.preferences.getString("AccountCode", "");
-        this.cancelPacking_userCode = this.preferences.getString("UserCode", "");
-        this.password = this.preferences.getString("UserPassword", "");
-        this.sessionkey = this.preferences.getString("SessionKey", "");
-        this.procedureName = getIntent().getExtras().getString("title");
-        this.title.setText(this.procedureName);
-        CommonUtil.BarcodeMaxLength(this.barcodeEdt, 50);
-        this.barcodeList = new ArrayList();
-        allListeners();
-    }
-
-    public void initView() {
-        this.title = (TextView) findViewById(R.id.title);
-        this.barcodeEdt = (EditText) findViewById(R.id.barcodeEdt);
-        this.barcodeEdt.setRawInputType(2);
-        this.backbtn = (ImageButton) findViewById(R.id.left_img);
-        this.backtext = (TextView) findViewById(R.id.back);
-        this.cancellstview = (ListView) findViewById(R.id.cancel_listview);
-        this.saveBtn = (Button) findViewById(R.id.saveBtn);
-    }
-
-    public void allListeners() {
-        this.saveBtn.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                if (LuociRevokeActivity.this.barcodeList == null) {
-                    Toast.makeText(LuociRevokeActivity.this.getApplicationContext(), "条码信息不能为空", 0).show();
-                } else if (LuociRevokeActivity.this.barcodeList.size() == 0) {
-                    Toast.makeText(LuociRevokeActivity.this.getApplicationContext(), "条码信息不能为空", 0).show();
-                } else {
-                    String barcode = ((BarcodeInfo) LuociRevokeActivity.this.barcodeList.get(0)).getBarcode();
-                    ProcessDialogUtils.showProcessDialog(LuociRevokeActivity.this);
-                    if (LuociRevokeActivity.this.saveBtn.isEnabled()) {
-                        LuociRevokeActivity.this.saveBtn.setEnabled(false);
-                        LuociRevokeActivity.this.thread = new HandlerThread("saveThread", 5);
-                        LuociRevokeActivity.this.thread.start();
-                        LuociRevokeActivity.this.mHandler = new Handler(LuociRevokeActivity.this.thread.getLooper());
-                        LuociRevokeActivity.this.mHandler.post(new SaveRunnable(barcode, LuociRevokeActivity.this.obj));
-                    }
-                }
-            }
-        });
-        this.backtext.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                LuociRevokeActivity.this.finish();
-            }
-        });
-        this.backbtn.setOnClickListener(new View.OnClickListener() {
-            public void onClick(View v) {
-                LuociRevokeActivity.this.finish();
-            }
-        });
-        this.barcodeEdt.addTextChangedListener(new TextWatcher() {
-            public void afterTextChanged(Editable arg0) {
-            }
-
-            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
-            }
-
-            public void onTextChanged(CharSequence s, int start, int before, int count) {
-                LuociRevokeActivity.this.barcodeUpper = LuociRevokeActivity.this.barcodeEdt.getText().toString().trim();
-                for (int i = 0; i < LuociRevokeActivity.this.barcodeUpper.length(); i++) {
-                    if (LuociRevokeActivity.this.barcodeUpper.charAt(i) + 0 >= 97 && LuociRevokeActivity.this.barcodeUpper.charAt(i) + 0 <= 122) {
-                        LuociRevokeActivity.this.barcodeUpperH.postDelayed(LuociRevokeActivity.this.UpperCase, 300);
-                    }
-                }
-                if (start == 0 && before == 0 && count > 1) {
-                    String barcode = LuociRevokeActivity.this.barcodeEdt.getText().toString().trim();
-                    if (TextUtils.isEmpty(barcode)) {
-                        return;
-                    }
-                    if (LuociRevokeActivity.this.barcodeList.size() <= 0 || !Removeduplicate.removeBarCode(barcode, LuociRevokeActivity.this.barcodeList)) {
-                        if (LuociRevokeActivity.this.barcodeList != null && LuociRevokeActivity.this.barcodeList.size() > 0) {
-                            LuociRevokeActivity.this.barcodeList.removeAll(LuociRevokeActivity.this.barcodeList);
-                            if (LuociRevokeActivity.this.adapter != null) {
-                                LuociRevokeActivity.this.adapter.notifyDataSetChanged();
-                            }
-                        }
-                        ProcessDialogUtils.showProcessDialog(LuociRevokeActivity.this);
-                        LuociRevokeActivity.this.barcodeEdt.setEnabled(false);
-                        LuociRevokeActivity.this.barcodeEdt.setFocusable(false);
-                        LuociRevokeActivity.this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                            public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                                if (source.length() < 1) {
-                                    return dest.subSequence(dstart, dend);
-                                }
-                                return "";
-                            }
-                        }});
-                        LuociRevokeActivity.this.thread = new HandlerThread("barcodeThread", 5);
-                        LuociRevokeActivity.this.thread.start();
-                        LuociRevokeActivity.this.mHandler = new Handler(LuociRevokeActivity.this.thread.getLooper());
-                        LuociRevokeActivity.this.mHandler.post(new BarcodeRunnable(barcode, LuociRevokeActivity.this.obj));
-                        return;
-                    }
-                    LuociRevokeActivity.this.barcodeEdt.setText("");
-                    LuociRevokeActivity.this.barcodeEdt.setFocusable(true);
-                    LuociRevokeActivity.this.barcodeEdt.requestFocus();
-                    CommonUtil.setDefault(2, LuociRevokeActivity.this.getApplicationContext());
-                    Toast.makeText(LuociRevokeActivity.this.getApplicationContext(), "条码" + barcode + "重复", 0).show();
-                }
-            }
-        });
-        this.barcodeEdt.setOnEditorActionListener(new TextView.OnEditorActionListener() {
-            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
-                if (actionId != 2) {
-                    return false;
-                }
-                String barcode = LuociRevokeActivity.this.barcodeEdt.getText().toString();
-                if (TextUtils.isEmpty(barcode)) {
-                    Toast.makeText(LuociRevokeActivity.this.getApplicationContext(), "产品条码不能为空", 0).show();
-                    return true;
-                } else if (LuociRevokeActivity.this.barcodeList.size() <= 0 || !Removeduplicate.removeBarCode(barcode, LuociRevokeActivity.this.barcodeList)) {
-                    if (LuociRevokeActivity.this.barcodeList != null && LuociRevokeActivity.this.barcodeList.size() > 0) {
-                        LuociRevokeActivity.this.barcodeList.removeAll(LuociRevokeActivity.this.barcodeList);
-                        if (LuociRevokeActivity.this.adapter != null) {
-                            LuociRevokeActivity.this.adapter.notifyDataSetChanged();
-                        }
-                    }
-                    ProcessDialogUtils.showProcessDialog(LuociRevokeActivity.this);
-                    LuociRevokeActivity.this.barcodeEdt.setEnabled(false);
-                    LuociRevokeActivity.this.barcodeEdt.setFocusable(false);
-                    LuociRevokeActivity.this.barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
-                        public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {
-                            if (source.length() < 1) {
-                                return dest.subSequence(dstart, dend);
-                            }
-                            return "";
-                        }
-                    }});
-                    LuociRevokeActivity.this.thread = new HandlerThread("barcodeThread", 5);
-                    LuociRevokeActivity.this.thread.start();
-                    LuociRevokeActivity.this.mHandler = new Handler(LuociRevokeActivity.this.thread.getLooper());
-                    LuociRevokeActivity.this.mHandler.post(new BarcodeRunnable(barcode, LuociRevokeActivity.this.obj));
-                    return true;
-                } else {
-                    LuociRevokeActivity.this.barcodeEdt.setText("");
-                    LuociRevokeActivity.this.barcodeEdt.setFocusable(true);
-                    LuociRevokeActivity.this.barcodeEdt.requestFocus();
-                    CommonUtil.setDefault(2, LuociRevokeActivity.this.getApplicationContext());
-                    Toast.makeText(LuociRevokeActivity.this.getApplicationContext(), "条码" + barcode + "重复", 0).show();
-                    return true;
-                }
-            }
-        });
-    }
-
-    public class SaveRunnable implements Runnable {
-        String barcode;
-        Object obj;
-
-        public SaveRunnable(String barcode2, Object obj2) {
-            this.barcode = barcode2;
-            this.obj = obj2;
-        }
-
-        public void run() {
-            synchronized (this.obj) {
-                try {
-                    LuociRevokeActivity.this.client = new WebClient();
-                    JSONObject js = new JSONObject();
-                    js.put("accountCode", LuociRevokeActivity.this.accountCode);
-                    js.put("userCode", LuociRevokeActivity.this.cancelPacking_userCode);
-                    js.put("userPassword", LuociRevokeActivity.this.password);
-                    js.put("sessionKey", LuociRevokeActivity.this.sessionkey);
-                    js.put("module", "LCFinishedProduct");
-                    js.put("action", "LCBackFinishedHandover");
-                    JSONArray barcodeArray = new JSONArray();
-                    for (int i = 0; i < LuociRevokeActivity.this.barcodeList.size(); i++) {
-                        BarcodeInfo barcodeInfo = (BarcodeInfo) LuociRevokeActivity.this.barcodeList.get(i);
-                        JSONObject jobj = new JSONObject();
-                        jobj.put("BarCode", barcodeInfo.getBarcode());
-                        jobj.put("GoodsModel", barcodeInfo.getGoodsCode());
-                        jobj.put("logoID", barcodeInfo.getLogoId());
-                        jobj.put("LogoName", barcodeInfo.getLogoName());
-                        barcodeArray.put(jobj);
-                    }
-                    JSONObject data = new JSONObject();
-                    data.put("Table", barcodeArray);
-                    js.put("jsonData", data.toString());
-                    String result = LuociRevokeActivity.this.client.doPost("http://" + LuociRevokeActivity.this.ServerAddress_ip + ":" + LuociRevokeActivity.this.ServerAddress_duankou + Constants.serverAction + "/DoAction", js.toString(), "application/json");
-                    Message m = new Message();
-                    m.what = 1;
-                    Bundle b = new Bundle();
-                    b.putString("saveResult", result);
-                    m.setData(b);
-                    LuociRevokeActivity.this.h.sendMessage(m);
-                } catch (Exception e) {
-                    e.printStackTrace();
-                    Message m2 = new Message();
-                    m2.what = 0;
-                    Bundle b2 = new Bundle();
-                    b2.putString("message", "网络连接异常");
-                    m2.setData(b2);
-                    LuociRevokeActivity.this.exceptionHandler.sendMessage(m2);
-                }
-            }
-        }
-    }
-
-    public class BarcodeRunnable implements Runnable {
-        String barcode;
-        Object obj;
-
-        public BarcodeRunnable(String barcode2, Object obj2) {
-            this.barcode = barcode2;
-            this.obj = obj2;
-        }
-
-        /* JADX WARNING: No exception handlers in catch block: Catch:{  } */
-        /* Code decompiled incorrectly, please refer to instructions dump. */
-        public void run() {
-            /*
-                r11 = this;
-                java.lang.Object r7 = r11.obj
-                monitor-enter(r7)
-                com.jiaju.activity.LuociRevokeActivity r6 = com.jiaju.activity.LuociRevokeActivity.this     // Catch:{ Exception -> 0x00c0 }
-                com.jiaju.net.WebClient r8 = new com.jiaju.net.WebClient     // Catch:{ Exception -> 0x00c0 }
-                r8.<init>()     // Catch:{ Exception -> 0x00c0 }
-                r6.client = r8     // Catch:{ Exception -> 0x00c0 }
-                org.json.JSONObject r3 = new org.json.JSONObject     // Catch:{ Exception -> 0x00c0 }
-                r3.<init>()     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r6 = "accountCode"
-                com.jiaju.activity.LuociRevokeActivity r8 = com.jiaju.activity.LuociRevokeActivity.this     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r8 = r8.accountCode     // Catch:{ Exception -> 0x00c0 }
-                r3.put(r6, r8)     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r6 = "userCode"
-                com.jiaju.activity.LuociRevokeActivity r8 = com.jiaju.activity.LuociRevokeActivity.this     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r8 = r8.cancelPacking_userCode     // Catch:{ Exception -> 0x00c0 }
-                r3.put(r6, r8)     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r6 = "userPassword"
-                com.jiaju.activity.LuociRevokeActivity r8 = com.jiaju.activity.LuociRevokeActivity.this     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r8 = r8.password     // Catch:{ Exception -> 0x00c0 }
-                r3.put(r6, r8)     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r6 = "sessionKey"
-                com.jiaju.activity.LuociRevokeActivity r8 = com.jiaju.activity.LuociRevokeActivity.this     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r8 = r8.sessionkey     // Catch:{ Exception -> 0x00c0 }
-                r3.put(r6, r8)     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r6 = "module"
-                java.lang.String r8 = "LCFinishedProduct"
-                r3.put(r6, r8)     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r6 = "action"
-                java.lang.String r8 = "LCBackFinishedHandoverCheck"
-                r3.put(r6, r8)     // Catch:{ Exception -> 0x00c0 }
-                org.json.JSONObject r1 = new org.json.JSONObject     // Catch:{ Exception -> 0x00c0 }
-                r1.<init>()     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r6 = "Barcode"
-                java.lang.String r8 = r11.barcode     // Catch:{ Exception -> 0x00c0 }
-                r1.put(r6, r8)     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r6 = "jsonData"
-                java.lang.String r8 = r1.toString()     // Catch:{ Exception -> 0x00c0 }
-                r3.put(r6, r8)     // Catch:{ Exception -> 0x00c0 }
-                com.jiaju.activity.LuociRevokeActivity r6 = com.jiaju.activity.LuociRevokeActivity.this     // Catch:{ Exception -> 0x00c0 }
-                com.jiaju.net.WebClient r6 = r6.client     // Catch:{ Exception -> 0x00c0 }
-                java.lang.StringBuilder r8 = new java.lang.StringBuilder     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r9 = "http://"
-                r8.<init>(r9)     // Catch:{ Exception -> 0x00c0 }
-                com.jiaju.activity.LuociRevokeActivity r9 = com.jiaju.activity.LuociRevokeActivity.this     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r9 = r9.ServerAddress_ip     // Catch:{ Exception -> 0x00c0 }
-                java.lang.StringBuilder r8 = r8.append(r9)     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r9 = ":"
-                java.lang.StringBuilder r8 = r8.append(r9)     // Catch:{ Exception -> 0x00c0 }
-                com.jiaju.activity.LuociRevokeActivity r9 = com.jiaju.activity.LuociRevokeActivity.this     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r9 = r9.ServerAddress_duankou     // Catch:{ Exception -> 0x00c0 }
-                java.lang.StringBuilder r8 = r8.append(r9)     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r9 = com.jiaju.utils.Constants.serverAction     // Catch:{ Exception -> 0x00c0 }
-                java.lang.StringBuilder r8 = r8.append(r9)     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r9 = "/DoAction"
-                java.lang.StringBuilder r8 = r8.append(r9)     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r8 = r8.toString()     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r9 = r3.toString()     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r10 = "application/json"
-                java.lang.String r5 = r6.doPost(r8, r9, r10)     // Catch:{ Exception -> 0x00c0 }
-                android.os.Message r4 = new android.os.Message     // Catch:{ Exception -> 0x00c0 }
-                r4.<init>()     // Catch:{ Exception -> 0x00c0 }
-                r6 = 0
-                r4.what = r6     // Catch:{ Exception -> 0x00c0 }
-                android.os.Bundle r0 = new android.os.Bundle     // Catch:{ Exception -> 0x00c0 }
-                r0.<init>()     // Catch:{ Exception -> 0x00c0 }
-                java.lang.String r6 = "barcodeResult"
-                r0.putString(r6, r5)     // Catch:{ Exception -> 0x00c0 }
-                r4.setData(r0)     // Catch:{ Exception -> 0x00c0 }
-                com.jiaju.activity.LuociRevokeActivity r6 = com.jiaju.activity.LuociRevokeActivity.this     // Catch:{ Exception -> 0x00c0 }
-                android.os.Handler r6 = r6.h     // Catch:{ Exception -> 0x00c0 }
-                r6.sendMessage(r4)     // Catch:{ Exception -> 0x00c0 }
-                monitor-exit(r7)     // Catch:{ all -> 0x00e6 }
-            L_0x00bf:
-                return
-            L_0x00c0:
-                r2 = move-exception
-                r2.printStackTrace()     // Catch:{ all -> 0x00e6 }
-                android.os.Message r4 = new android.os.Message     // Catch:{ all -> 0x00e6 }
-                r4.<init>()     // Catch:{ all -> 0x00e6 }
-                r6 = 0
-                r4.what = r6     // Catch:{ all -> 0x00e6 }
-                android.os.Bundle r0 = new android.os.Bundle     // Catch:{ all -> 0x00e6 }
-                r0.<init>()     // Catch:{ all -> 0x00e6 }
-                java.lang.String r6 = "message"
-                java.lang.String r8 = "网络连接异常"
-                r0.putString(r6, r8)     // Catch:{ all -> 0x00e6 }
-                r4.setData(r0)     // Catch:{ all -> 0x00e6 }
-                com.jiaju.activity.LuociRevokeActivity r6 = com.jiaju.activity.LuociRevokeActivity.this     // Catch:{ all -> 0x00e6 }
-                android.os.Handler r6 = r6.exceptionHandler     // Catch:{ all -> 0x00e6 }
-                r6.sendMessage(r4)     // Catch:{ all -> 0x00e6 }
-                monitor-exit(r7)     // Catch:{ all -> 0x00e6 }
-                goto L_0x00bf
-            L_0x00e6:
-                r6 = move-exception
-                monitor-exit(r7)     // Catch:{ all -> 0x00e6 }
-                throw r6
-            */
-            throw new UnsupportedOperationException("Method not decompiled: com.jiaju.activity.LuociRevokeActivity.BarcodeRunnable.run():void");
-        }
-    }
-
-    public boolean onCreateOptionsMenu(Menu menu) {
-        getMenuInflater().inflate(R.menu.cancel_packing, menu);
-        return true;
-    }
-}
+	private TextView title;
+	private EditText barcodeEdt;
+	private String accountCode;
+	private String cancelPacking_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 TextView backtext;
+	private ImageButton backbtn;
+	private Object obj = new Object();
+	private List<BarcodeInfo> barcodeList;
+	private CancelFinishedProductHandOverAdapter adapter = null;
+	private ListView cancellstview;
+	private Button saveBtn;
+	private String procedureName;
+	private Handler barcodeUpperH = new Handler();
+	private String barcodeUpper;
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.activity_cancel_finished_product_hand_over);
+		initView();
+		preferences = getSharedPreferences("user", Context.MODE_PRIVATE);
+		ServerAddress_ip = preferences.getString("ServerAddress_ip", "");
+		ServerAddress_duankou = preferences.getString("ServerAddress_duankou",
+				"");
+		accountCode = preferences.getString("AccountCode", "");
+		cancelPacking_userCode = preferences.getString("UserCode", "");
+		password = preferences.getString("UserPassword", "");
+		sessionkey = preferences.getString("SessionKey", "");
+		Bundle b = getIntent().getExtras();
+		procedureName = b.getString("title");
+		title.setText(procedureName);
+		CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
+		barcodeList = new ArrayList<BarcodeInfo>();
+		allListeners();
+	}
+	public void initView() {
+		title = (TextView) findViewById(R.id.title);
+		barcodeEdt = (EditText) findViewById(R.id.barcodeEdt);
+		barcodeEdt.setRawInputType(InputType.TYPE_CLASS_NUMBER);
+		backbtn = (ImageButton) findViewById(R.id.left_img);
+		backtext = (TextView) findViewById(R.id.back);
+		cancellstview = (ListView) findViewById(R.id.cancel_listview);
+		saveBtn = (Button) findViewById(R.id.saveBtn);
+	}
+	public void allListeners() {
+		saveBtn.setOnClickListener(new View.OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				if (barcodeList == null) {
+					Toast.makeText(getApplicationContext(), "条码信息不能为空",
+							Toast.LENGTH_SHORT).show();
+					return;
+				} else {
+					if (barcodeList.size() == 0) {
+						Toast.makeText(getApplicationContext(), "条码信息不能为空",
+								Toast.LENGTH_SHORT).show();
+						return;
+					}
+					BarcodeInfo info = barcodeList.get(0);
+					String barcode = info.getBarcode();
+					ProcessDialogUtils.showProcessDialog(
+							LuociRevokeActivity.this);
+					if (saveBtn.isEnabled()) {
+						saveBtn.setEnabled(false);
+						thread = new HandlerThread("saveThread", 5);
+						thread.start();
+						mHandler = new Handler(thread.getLooper());
+						SaveRunnable saveRunnable = new SaveRunnable(barcode,
+								obj);
+						mHandler.post(saveRunnable);
+					}
+				}
+			}
+		});
+		backtext.setOnClickListener(new OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				finish();
+			}
+		});
+		backbtn.setOnClickListener(new View.OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				finish();
+			}
+		});
+		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().trim();
+					if (!TextUtils.isEmpty(barcode)) {
+						if (barcodeList.size() > 0) {
+							boolean b = Removeduplicate.removeBarCode(barcode,
+									barcodeList);
+							if (b) {
+								barcodeEdt.setText("");
+								barcodeEdt.setFocusable(true);
+								barcodeEdt.requestFocus();
+								CommonUtil.setDefault(
+										Notification.DEFAULT_VIBRATE,
+										getApplicationContext());
+								Toast.makeText(getApplicationContext(),
+										"条码" + barcode + "重复",
+										Toast.LENGTH_SHORT).show();
+								return;
+							}
+						}
+						if (barcodeList != null && barcodeList.size() > 0) {
+							barcodeList.removeAll(barcodeList);
+							if (adapter != null) {
+								adapter.notifyDataSetChanged();
+							}
+						}
+						ProcessDialogUtils.showProcessDialog(
+								LuociRevokeActivity.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(
+								barcode, obj);
+						mHandler.post(barcodeRunnable);
+					}
+				}
+			}
+		});
+		barcodeEdt.setOnEditorActionListener(
+				new TextView.OnEditorActionListener() {
+					@Override
+					public boolean onEditorAction(TextView v, int actionId,
+							KeyEvent event) {
+						if (actionId == EditorInfo.IME_ACTION_GO) {
+							String barcode = barcodeEdt.getText().toString();
+							if (!TextUtils.isEmpty(barcode)) {
+								if (barcodeList.size() > 0) {
+									boolean b = Removeduplicate.removeBarCode(
+											barcode, barcodeList);
+									if (b) {
+										barcodeEdt.setText("");
+										barcodeEdt.setFocusable(true);
+										barcodeEdt.requestFocus();
+										CommonUtil.setDefault(
+												Notification.DEFAULT_VIBRATE,
+												getApplicationContext());
+										Toast.makeText(getApplicationContext(),
+												"条码" + barcode + "重复",
+												Toast.LENGTH_SHORT).show();
+										return true;
+									}
+								}
+								if (barcodeList != null
+										&& barcodeList.size() > 0) {
+									barcodeList.removeAll(barcodeList);
+									if (adapter != null) {
+										adapter.notifyDataSetChanged();
+									}
+								}
+								ProcessDialogUtils.showProcessDialog(
+										LuociRevokeActivity.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(
+										barcode, obj);
+								mHandler.post(barcodeRunnable);
+								return true;
+							} else {
+								Toast.makeText(getApplicationContext(),
+										"产品条码不能为空", Toast.LENGTH_SHORT).show();
+								return true;
+							}
+						}
+						return false;
+					}
+				});
+	}
+	Runnable BarcodeUpperCase = new Runnable() {
+		@Override
+		public void run() {
+			// 小写转大写
+			barcodeEdt.setText(barcodeUpper.toUpperCase());
+			// 设置EditText光标位置
+			barcodeEdt.setSelection(barcodeUpper.length());
+		}
+	};
+	Runnable UpperCase = new Runnable() {
+		@Override
+		public void run() {
+			// 小写转大写
+			barcodeEdt.setText(barcodeUpper.toUpperCase());
+			// 设置EditText光标位置
+			barcodeEdt.setSelection(barcodeUpper.length());
+		}
+	};
+	Handler h = new Handler() {
+		@Override
+		public void handleMessage(Message msg) {
+			switch (msg.what) {
+				case 0 :
+					Bundle b1 = msg.getData();
+					String json1 = b1.getString("barcodeResult");
+					ProcessDialogUtils.closeProgressDilog();
+					try {
+						JSONObject jo2 = new JSONObject(json1);
+						JSONObject jo3 = jo2.optJSONObject("d");
+						int status = jo3.optInt("Status");
+						String message = jo3.optString("Message");
+						if (status == 0) {
+							String result = jo3.optString("Result");
+							JSONObject resultObj = new JSONObject(result);
+							JSONArray jarray = resultObj.optJSONArray("Table");
+							if (jarray != null && jarray.length() > 0) {
+								for (int i = 0; i < jarray.length(); i++) {
+									JSONObject jo = jarray.optJSONObject(i);
+									String orderNo = jo.optString("ORDERNO");
+									String goodsCode = jo
+											.optString("GOODSCODE");
+									String groutingUserCode = jo
+											.optString("GROUTINGUSERCODE");
+									int logoId = jo.optInt("LOGOID");
+									String logoCode = jo.optString("LOGOCODE");
+									String logoName = jo.optString("LOGONAME");
+									String barcode = jo.optString("BARCODE");
+									String finishedBarcode = jo
+											.optString("FINISHEDBARCODE");
+									String groutingDate = jo
+											.optString("GROUTINGDATE");
+									String billetDate = jo
+											.optString("DELIVERTIME");
+									String mouldCode = jo
+											.optString("GROUTINGMOULDCODE");
+									BarcodeInfo info = new BarcodeInfo();
+									info.setBarcode(barcode);
+									info.setFinishedBarCode(finishedBarcode);
+									info.setOrderNo(orderNo);
+									info.setGoodsCode(goodsCode);
+									info.setUserCode(groutingUserCode);
+									info.setLogoId(logoId);
+									info.setLogoCode(logoCode);
+									info.setLogoName(logoName);
+									info.setBanMa(
+											(jo.optString("BANMA") == "null")
+													? ""
+													: jo.optString("BANMA"));
+									if (!TextUtils.isEmpty(groutingDate)) {
+										if (groutingDate.contains("/")) {
+											groutingDate = CommonUtil
+													.dateStringConverter(
+															groutingDate);
+										} else if (groutingDate.contains("-")) {
+											groutingDate = CommonUtil
+													.commonDateConverter(
+															groutingDate);
+										}
+										info.setGroutingDate(groutingDate);
+									} else {
+										info.setGroutingDate("");
+									}
+									if (!TextUtils.isEmpty(billetDate)) {
+										if (billetDate.contains("/")) {
+											billetDate = CommonUtil
+													.dateStringConverter(
+															billetDate);
+										} else if (billetDate.contains("-")) {
+											billetDate = CommonUtil
+													.commonDateConverter(
+															billetDate);
+										}
+										info.setDeliverTime(billetDate);
+									} else {
+										info.setDeliverTime("");
+									}
+									info.setMouldCode(mouldCode);
+									barcodeList.add(info);
+								}
+								adapter = new CancelFinishedProductHandOverAdapter(
+										LuociRevokeActivity.this,
+										barcodeList);
+								cancellstview.setAdapter(adapter);
+								saveBtn.setText(
+										"保存(" + barcodeList.size() + ")");
+							} else {
+								Toast.makeText(getApplicationContext(),
+										"此条码不存在", Toast.LENGTH_SHORT).show();
+							}
+							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 {
+							CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
+									getApplicationContext());
+							CommonUtil.showBarCodeAlertDialog(status, message,
+									LuociRevokeActivity.this,
+									barcodeEdt, null, null);
+						}
+						if (mHandler != null) {
+							mHandler.removeCallbacksAndMessages(null);
+							mHandler.getLooper().quit();
+						}
+					} catch (JSONException e1) {
+						e1.printStackTrace();
+						Toast.makeText(getApplicationContext(), "json数据异常",
+								Toast.LENGTH_SHORT).show();
+					}
+					break;
+				case 1 :
+					Bundle b = msg.getData();
+					String json = b.getString("saveResult");
+					ProcessDialogUtils.closeProgressDilog();
+					if (mHandler != null) {
+						mHandler.removeCallbacksAndMessages(null);
+						mHandler.getLooper().quit();
+					}
+					saveBtn.setEnabled(true);
+					try {
+						JSONObject jo = new JSONObject(json);
+						JSONObject jo1 = jo.optJSONObject("d");
+						int status = jo1.optInt("Status");
+						String message = jo1.optString("Message");
+						if (barcodeList != null && barcodeList.size() > 0) {
+							barcodeList.removeAll(barcodeList);
+							if (adapter != null) {
+								adapter.notifyDataSetChanged();
+							}
+						}
+						saveBtn.setText("保存(" + barcodeList.size() + ")");
+						if (status == 0) {
+							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);
+							InputMethodManager im = (InputMethodManager) barcodeEdt
+									.getContext().getSystemService(
+											Context.INPUT_METHOD_SERVICE);
+							im.hideSoftInputFromWindow(
+									LuociRevokeActivity.this
+											.getCurrentFocus().getWindowToken(),
+									InputMethodManager.HIDE_NOT_ALWAYS);
+							Toast.makeText(getApplicationContext(), "上传成功",
+									Toast.LENGTH_SHORT).show();
+							CommonUtil.playSound(getApplicationContext());
+						} else {
+							CommonUtil.showBarCodeAlertDialog(status, message,
+									LuociRevokeActivity.this,
+									barcodeEdt, null, null);
+							CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
+									getApplicationContext());
+						}
+					} catch (JSONException e) {
+						e.printStackTrace();
+						Toast.makeText(getApplicationContext(), "json数据异常",
+								Toast.LENGTH_SHORT).show();
+					}
+					break;
+			}
+		}
+	};
+	private Handler exceptionHandler = new Handler() {
+		@Override
+		public void handleMessage(Message msg) {
+			super.handleMessage(msg);
+			switch (msg.what) {
+				case 0 :
+					ProcessDialogUtils.closeProgressDilog();
+					saveBtn.setEnabled(true);
+					if (mHandler != null) {
+						mHandler.removeCallbacksAndMessages(null);
+						mHandler.getLooper().quit();
+					}
+					Bundle b = msg.getData();
+					String message = b.getString("message");
+					CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
+							getApplicationContext());
+					Toast.makeText(getApplicationContext(), message,
+							Toast.LENGTH_SHORT).show();
+					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;
+			}
+		}
+	};
+	public class SaveRunnable implements Runnable {
+		String barcode;
+		Object obj;
+		public SaveRunnable(String barcode, Object obj) {
+			this.barcode = barcode;
+			this.obj = obj;
+		}
+		@Override
+		public void run() {
+			synchronized (obj) {
+				try {
+					client = new WebClient();
+					JSONObject js = new JSONObject();
+					js.put("accountCode", accountCode);
+					js.put("userCode", cancelPacking_userCode);
+					js.put("userPassword", password);
+					js.put("sessionKey", sessionkey);
+					js.put("module", "LCFinishedProduct");
+					js.put("action", "LCBackFinishedHandover");
+					JSONArray barcodeArray = new JSONArray();
+					for (int i = 0; i < barcodeList.size(); i++) {
+						BarcodeInfo barcodeInfo = barcodeList.get(i);
+						JSONObject jobj = new JSONObject();
+						jobj.put("BarCode", barcodeInfo.getBarcode());
+						jobj.put("GoodsModel", barcodeInfo.getGoodsCode());
+						jobj.put("logoID", barcodeInfo.getLogoId());
+						jobj.put("LogoName", barcodeInfo.getLogoName());
+						barcodeArray.put(jobj);
+					}
+					JSONObject data = new JSONObject();
+					data.put("Table", barcodeArray);
+					js.put("jsonData", data.toString());
+					String result = client.doPost(
+							"http://" + ServerAddress_ip + ":"
+									+ ServerAddress_duankou
+									+ Constants.serverAction + "/DoAction",
+							js.toString(), "application/json");
+					Message m = new Message();
+					m.what = 1;
+					Bundle b = new Bundle();
+					b.putString("saveResult", result);
+					m.setData(b);
+					h.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);
+					return;
+				}
+			}
+		}
+	};
+	public 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 {
+					client = new WebClient();
+					JSONObject js = new JSONObject();
+					js.put("accountCode", accountCode);
+					js.put("userCode", cancelPacking_userCode);
+					js.put("userPassword", password);
+					js.put("sessionKey", sessionkey);
+					js.put("module", "LCFinishedProduct");
+					js.put("action", "LCBackFinishedHandoverCheck");
+					JSONObject data = new JSONObject();
+					data.put("Barcode", barcode);
+					js.put("jsonData", data.toString());
+					String result = client.doPost(
+							"http://" + ServerAddress_ip + ":"
+									+ ServerAddress_duankou
+									+ Constants.serverAction + "/DoAction",
+							js.toString(), "application/json");
+					Message m = new Message();
+					m.what = 0;
+					Bundle b = new Bundle();
+					b.putString("barcodeResult", result);
+					m.setData(b);
+					h.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);
+					return;
+				}
+			}
+		}
+	};
+	@Override
+	public boolean onCreateOptionsMenu(Menu menu) {
+		// Inflate the menu; this adds items to the action bar if it is present.
+		getMenuInflater().inflate(R.menu.cancel_packing, menu);
+		return true;
+	}
+}