姜永辉 5 сар өмнө
parent
commit
ea1c745854

+ 9 - 8
AndroidManifest.xml

@@ -787,19 +787,20 @@
         <activity
             android:name=".NakedPorcelainActivity"
             android:label="@string/title_activity_naked_porcelain" >
-        </activity> 
+        </activity>
         <activity
             android:name=".SendOutGoods"
             android:label="@string/title_activity_send_out_goods" >
-         </activity>
-         <activity
-            android:name=".DeliveryNoteInquiryActivity"  > 
         </activity>
-        <activity
-            android:name=".LuociRevokeActivity"  > 
+        <activity android:name=".DeliveryNoteInquiryActivity" >
+        </activity>
+        <activity android:name=".LuociRevokeActivity" >
         </activity>
-         <activity
-            android:name=".LuociPriceActivity"  > 
+        <activity android:name=".LuociPriceActivity" >
+        </activity>
+        <activity
+            android:name=".FactoryTransferInActivity"
+            android:label="@string/title_activity_factory_transfer_in" >
         </activity>
     </application>
 

+ 275 - 0
res/layout/activity_factory_transfer_in.xml

@@ -0,0 +1,275 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/parentRel"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/background" >
+
+    <include
+        android:id="@+id/check_title"
+        layout="@layout/fragment_title" />
+
+    <LinearLayout
+        android:id="@+id/sendLay"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_alignParentBottom="true"
+        android:background="@color/qingcolor"
+        android:gravity="center_horizontal"
+        android:orientation="horizontal" >
+
+        <Button
+            android:id="@+id/btnSave"
+            android:layout_width="0dp"
+            android:layout_height="50dp"
+            android:layout_weight="1"
+            android:background="@drawable/login_btn_selector"
+            android:enabled="true"
+            android:text="保存"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_24" />
+    </LinearLayout>
+
+    <ScrollView
+        android:id="@+id/scrollLay"
+        android:layout_width="match_parent"
+        android:layout_height="300dp"
+        android:layout_above="@id/sendLay"
+        android:layout_below="@id/check_title"
+        android:layout_marginBottom="3dp"
+        android:scrollbars="vertical" >
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:focusableInTouchMode="true" >
+
+            <LinearLayout
+                android:id="@+id/productlinelay"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:orientation="vertical" >
+
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal" >
+
+                    <com.jiaju.widget.JustifyTextView
+                        android:id="@+id/procedureTitle"
+                        android:layout_width="70dp"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dp"
+                        android:text="生产工号"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text=":"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
+
+                    <LinearLayout
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical" >
+
+                        <TextView
+                            android:id="@+id/procedureTv"
+                            android:layout_width="150dp"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_vertical"
+                            android:scrollHorizontally="true"
+                            android:singleLine="true"
+                            android:textColor="@color/white"
+                            android:textSize="@dimen/textsize_20" />
+
+                        <View
+                            android:layout_width="wrap_content"
+                            android:layout_height="1dp"
+                            android:layout_marginRight="10dp"
+                            android:layout_marginTop="1dp"
+                            android:background="@color/text_gray" />
+                    </LinearLayout>
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="3dp"
+                    android:orientation="horizontal" >
+
+                    <com.jiaju.widget.JustifyTextView
+                        android:id="@+id/descTitle1"
+                        android:layout_width="70dip"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:layout_marginLeft="10dip"
+                        android:text="调出工厂"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text=":"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
+
+                    <LinearLayout
+                        android:id="@+id/mouldCodeLay"
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="vertical" >
+
+                        <Spinner
+                            android:id="@+id/fatory_transfer_in"
+                            android:layout_width="fill_parent"
+                            android:layout_height="40dp"
+                            android:layout_marginRight="10dp"
+                            android:background="@drawable/spinner_drop_down" />
+
+                        <View
+                            android:layout_width="wrap_content"
+                            android:layout_height="1dp"
+                            android:layout_marginRight="10dp"
+                            android:layout_marginTop="1dp"
+                            android:background="@color/text_gray" />
+                    </LinearLayout>
+                </LinearLayout>
+
+                <LinearLayout
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="3dp"
+                    android:orientation="horizontal" >
+
+                    <com.jiaju.widget.JustifyTextView
+                        android:id="@+id/barcodeTitle"
+                        android:layout_width="70dp"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center"
+                        android:layout_marginLeft="10dp"
+                        android:text="板码"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
+
+                    <TextView
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:layout_gravity="center_vertical"
+                        android:text=":"
+                        android:textColor="@color/white"
+                        android:textSize="@dimen/textsize_16" />
+
+                    <LinearLayout
+                        android:id="@+id/groutingLineLay"
+                        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="wrap_content"
+                            android:layout_height="1dp"
+                            android:layout_marginRight="10dp"
+                            android:layout_marginTop="1dp"
+                            android:background="@color/text_gray" />
+                    </LinearLayout>
+                </LinearLayout>
+
+                <LinearLayout
+                    android:id="@+id/workerlay"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="15dp"
+                    android:orientation="vertical"
+                    android:visibility="visible" >
+
+                    <View
+                        android:layout_width="fill_parent"
+                        android:layout_height="1dp"
+                        android:background="@color/text_gray" />
+
+                    <LinearLayout
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:orientation="horizontal"
+                        android:visibility="visible" >
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_vertical"
+                            android:layout_marginLeft="10dp"
+                            android:text="产品信息"
+                            android:textColor="@color/white"
+                            android:textSize="@dimen/textsize_16" />
+
+                        <TextView
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center_vertical"
+                            android:text=":"
+                            android:textColor="@color/white"
+                            android:textSize="@dimen/textsize_16" />
+                    </LinearLayout>
+
+                    <View
+                        android:layout_width="fill_parent"
+                        android:layout_height="1dp"
+                        android:background="@color/text_gray" />
+
+                    <com.jiaju.widget.MyListView
+                        android:id="@+id/lstview"
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:cacheColorHint="#00000000"
+                        android:divider="@color/white"
+                        android:dividerHeight="1dp" />
+
+                    <View
+                        android:id="@+id/listlin"
+                        android:layout_width="fill_parent"
+                        android:layout_height="1dp"
+                        android:background="@color/white"
+                        android:visibility="gone" />
+                </LinearLayout>
+
+                <LinearLayout
+                    android:id="@+id/memoLay"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:layout_marginTop="5dp"
+                    android:orientation="horizontal"
+                    android:visibility="visible" >
+
+                    <ListView
+                        android:id="@+id/message_listview"
+                        android:layout_width="fill_parent"
+                        android:layout_height="wrap_content"
+                        android:cacheColorHint="#00000000"
+                        android:scrollbars="none" />
+                </LinearLayout>
+            </LinearLayout>
+        </RelativeLayout>
+    </ScrollView>
+
+</RelativeLayout>

+ 1 - 0
res/values/strings.xml

@@ -121,5 +121,6 @@
     <string name="title_activity_components_breakage_scan_ok">ComponentsBreakageScanOkActivity</string>
     <string name="title_activity_naked_porcelain">NakedPorcelainActivity</string>
     <string name="title_activity_send_out_goods">SendOutGoods</string>
+    <string name="title_activity_factory_transfer_in">FactoryTransferInActivity</string>
 
 </resources>

+ 1086 - 0
src/com/jiaju/activity/FactoryTransferInActivity.java

@@ -0,0 +1,1086 @@
+package com.jiaju.activity;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method; 
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+ 
+import com.jiaju.adapter.FactoryTransferInListMessageAdapter;
+import com.jiaju.adapter.SendOutSpinnerAdapter;
+import com.jiaju.model.BarcodeInfo;
+import com.jiaju.model.CarBrandModel;
+import com.jiaju.model.Procedure;
+import com.jiaju.model.ReceiveModel;
+import com.jiaju.model.SendOutModel;
+import com.jiaju.net.WebClient;
+import com.jiaju.utils.CommonUtil;
+import com.jiaju.utils.Constants;
+import com.jiaju.utils.CustomToast;
+import com.jiaju.utils.MultiChoiceProcedurePopWindow;
+import com.jiaju.utils.ProcessDialogUtils; 
+import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
+import android.app.Notification;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Message;
+import android.text.Editable;
+import android.text.InputFilter;
+import android.text.InputType;
+import android.text.Spanned;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.text.method.ScrollingMovementMethod;
+import android.view.KeyEvent;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.inputmethod.EditorInfo;
+import android.widget.AdapterView;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageButton; 
+import android.widget.ListView;
+import android.widget.Spinner;
+import android.widget.TextView;
+import android.widget.Toast; 
+
+// 
+public class FactoryTransferInActivity extends Activity {
+
+	private String serverAddress_ip;
+	private String serverAddress_port;
+	private String accountCode;
+	private String password;
+	private String sessionkey;
+	private WebClient client;
+	private String send_userCode;
+	private SharedPreferences preferences;
+	private HandlerThread thread;
+	private Handler mHandler;
+	private List<Procedure> procedureList;
+	private List<Procedure> checkedProcedureList;
+	private TextView title;
+	private TextView backtext; 
+	private ImageButton backbtn;
+	private Object obj = new Object();
+	boolean booleans[];
+	boolean booleansTemp[];
+	boolean[] selItems;
+	private View mRootView;
+	private MultiChoiceProcedurePopWindow mMultiChoicePopWindow;
+	private EditText barcodeEdt;
+	private EditText descEdt;
+	private String barcodeUpper;
+	private String Lgort;// 发出仓
+	private TextView procedureTv;
+	private List<BarcodeInfo> barcodeList;
+	private List<SendOutModel> sendOutList;
+	private List<ReceiveModel> receiveList;
+	private List<CarBrandModel> carBrandList;
+	private JSONArray storageJArray;// 库存
+	private ListView messageLst;
+	public Button saveBtn;  
+	private Spinner sendOutSpinner;  
+	private SendOutModel sendOutModel;
+	private SendOutModel lastSendOutModel;
+	private String desc; 
+	private SendOutSpinnerAdapter sendOutAdapter; 
+	private Handler barcodeUpperH = new Handler();
+	private FactoryTransferInListMessageAdapter adapter;
+	private boolean isCancel = false;
+	private boolean isFirst = true;
+	private String IsSYNCSTATUS = "0";
+	private int Height = 188;
+	private String DATAKEY = "";
+
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.activity_factory_transfer_in);
+		preferences = getSharedPreferences("user", Context.MODE_PRIVATE);
+		serverAddress_ip = preferences.getString("ServerAddress_ip", "");
+		serverAddress_port = preferences.getString("ServerAddress_duankou", "");
+		accountCode = preferences.getString("AccountCode", "");
+		send_userCode = preferences.getString("UserCode", "");
+		password = preferences.getString("UserPassword", "");
+		sessionkey = preferences.getString("SessionKey", "");
+		barcodeList = new ArrayList<BarcodeInfo>(); 
+		initView(); 
+		IsSYNCSTATUS = this.getIntent().getStringExtra("SYNCSTATUS");
+		if (IsSYNCSTATUS == null || IsSYNCSTATUS.equals("")) {
+			IsSYNCSTATUS = "0";
+		}
+		 
+		procedureTv.setText(send_userCode);  
+		allListeners();
+
+		thread = new HandlerThread("sendOutThread3", 5);
+		thread.start();
+		mHandler = new Handler(thread.getLooper());
+		SendOutRunnable glazeRunnable = new SendOutRunnable(obj);
+		mHandler.post(glazeRunnable); 
+		updateDataKey();
+	}
+
+	/** 更新唯一标识 */
+	private void updateDataKey() {
+		// 获取当前时间戳
+		long timestamp = new Date().getTime();
+
+		// 获取TextView文本内容
+		String text = procedureTv.getText().toString();
+
+		// 拼接字符串
+		DATAKEY = timestamp + "-" + text;
+	}
+ 
+	private class SendOutRunnable implements Runnable {
+		private Object object;
+
+		public SendOutRunnable(Object object) {
+			this.object = object;
+		}
+
+		@Override
+		public void run() {
+			synchronized (object) {
+				try {
+					ProcessDialogUtils.showProcessDialog(FactoryTransferInActivity.this);
+					client = null;
+					client = new WebClient();
+					JSONObject js = new JSONObject();
+					js.put("accountCode", accountCode);
+					js.put("userCode", send_userCode);
+					js.put("userPassword", password);
+					js.put("sessionKey", sessionkey);
+					js.put("dicType", "TPC033");
+					String result = client.doPost("http://" + serverAddress_ip + ":" + serverAddress_port
+							+ Constants.serverAction + "/GetDataDictionaryByType", js.toString(), "application/json");
+					Message m = new Message();
+					m.what = 3;
+					Bundle b = new Bundle();
+					b.putString("glazeResult", 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 void allListeners() {
+		 
+		backbtn.setOnClickListener(new View.OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+				finish();
+
+			}
+		});
+		backtext.setOnClickListener(new View.OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+				finish();
+
+			}
+		});
+ 
+
+		saveBtn.setOnClickListener(new OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+				String procedure = procedureTv.getText().toString().trim();
+				if (TextUtils.isEmpty(procedure)) {
+					Toast.makeText(getApplicationContext(), "请选择工序", Toast.LENGTH_SHORT).show();
+					return;
+				}
+
+				if (sendOutList == null || sendOutList.size() == 0) {
+					Toast.makeText(getApplicationContext(), "请选择发货仓库", Toast.LENGTH_SHORT).show();
+					return;
+				}
+				// if (barcodeList == null || barcodeList.size() == 0) {
+				// Toast.makeText(getApplicationContext(), "请添加产品信息",
+				// Toast.LENGTH_SHORT).show();
+				// return;
+				// }
+				ProcessDialogUtils.showProcessDialog(FactoryTransferInActivity.this);
+				SendOutModel sendOut = (SendOutModel) sendOutSpinner.getSelectedItem();
+				if (sendOut == null) {
+					CustomToast.showToast(getApplicationContext(), "不能为空", 2000);
+					return;
+				}
+				// desc = descEdt.getText().toString();
+
+				thread = new HandlerThread("SaveThread", 5);
+				thread.start();
+				mHandler = new Handler(thread.getLooper());
+				SaveRunnable saveRunnable = new SaveRunnable();
+				mHandler.post(saveRunnable);
+
+			}
+		});
+
+		barcodeEdt.addTextChangedListener(new TextWatcher() {
+
+			@Override
+			public void afterTextChanged(Editable arg0) {
+				if (barcodeEdt.getText().toString().contains("\n")) {
+					String barcode = barcodeEdt.getText().toString().trim().replaceAll("\\n", "");
+					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) : "";
+						}
+					} });
+					ProcessDialogUtils.showProcessDialog(FactoryTransferInActivity.this);
+					if (TextUtils.isEmpty(barcode)) {
+						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;
+							}
+						} });
+						CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
+
+						CustomToast.showToast(getApplicationContext(), "条码不能为空", 2000);
+						return;
+					}
+
+					else {
+
+						thread = new HandlerThread("BarCodeThread", 5);
+						thread.start();
+						mHandler = new Handler(thread.getLooper());
+						BarcodeRunnable barcodeRunnable = new BarcodeRunnable(barcode);
+						mHandler.post(barcodeRunnable);
+
+					}
+				}
+			}
+
+			@Override
+			public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+			}
+
+			@Override
+			public void onTextChanged(CharSequence s, int start, int before, int count) {
+				barcodeUpper = barcodeEdt.getText().toString();
+				// 判断输入的文字是否是小写
+				for (int i = 0; i < barcodeUpper.length(); i++) {
+					if (barcodeUpper.charAt(i) - 0 >= 97 && barcodeUpper.charAt(i) - 0 <= 122) {
+						barcodeUpperH.postDelayed(BarcodeUpperCase, 300);
+					}
+				}
+			}
+		});
+
+		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().trim();
+					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) : "";
+						}
+					} });
+					ProcessDialogUtils.showProcessDialog(FactoryTransferInActivity.this);
+					if (TextUtils.isEmpty(barcode)) {
+						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;
+							}
+						} });
+						CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
+
+						CustomToast.showToast(getApplicationContext(), "条码不能为空", 2000);
+						return true;
+					}
+
+					else {
+
+						thread = new HandlerThread("BarCodeThread", 5);
+						thread.start();
+						mHandler = new Handler(thread.getLooper());
+						BarcodeRunnable barcodeRunnable = new BarcodeRunnable(barcode);
+						mHandler.post(barcodeRunnable);
+					}
+
+				}
+				return true;
+			}
+		});
+
+	}
+
+	Runnable BarcodeUpperCase = new Runnable() {
+
+		@Override
+		public void run() {
+			// 小写转大写
+			barcodeEdt.setText(barcodeUpper.toUpperCase());
+			// 设置EditText光标位置
+			barcodeEdt.setSelection(barcodeUpper.length());
+
+		}
+
+	};
+
+	public void showMultiChoiceWindow() {
+		initProcedurePopWindow(booleans);
+		mMultiChoicePopWindow.show(true);
+
+	}
+
+	public boolean removeFinishedBarCode(String code, List<BarcodeInfo> data) {
+		boolean rem = false;
+		for (int i = 0; i < data.size(); i++) {
+			Object S = data.get(i);
+			Class<?> clss = S.getClass();
+			String clssName = clss.getName();
+			Method m = null;
+			Method mouldId = null;
+			try {
+				m = clss.getMethod("getFinishedBarCode");
+			} catch (NoSuchMethodException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+			String bar;
+			try {
+				bar = (String) m.invoke(S);
+				if (bar.equals(code)) {
+					rem = true;
+					return rem;
+
+				}
+			} catch (IllegalArgumentException e) {
+
+				e.printStackTrace();
+			} catch (IllegalAccessException e) {
+
+				e.printStackTrace();
+			} catch (InvocationTargetException e) {
+				// TODO Auto-generated catch block
+				e.printStackTrace();
+			}
+		}
+		return rem;
+	}
+
+	private Handler exceptionHandler = new Handler() {
+		@Override
+		public void handleMessage(Message msg) {
+			super.handleMessage(msg);
+			switch (msg.what) {
+			case 0:
+				ProcessDialogUtils.closeProgressDilog();
+				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_LONG).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;
+			case 1:// 关闭转圈
+				ProcessDialogUtils.closeProgressDilog();
+				if (mHandler != null) {
+					mHandler.removeCallbacksAndMessages(null);
+					mHandler.getLooper().quit();
+				}
+
+				Bundle b1 = msg.getData();
+				String message1 = b1.getString("message");
+				CommonUtil.showRepeatDialog(message1, FactoryTransferInActivity.this);
+				break;
+			}
+		}
+	};
+
+	private void initView() {
+		title = (TextView) findViewById(R.id.title);
+		backbtn = (ImageButton) findViewById(R.id.left_img);
+		backtext = (TextView) findViewById(R.id.back);
+		title.setText("工厂调入");
+		procedureTv = (TextView) findViewById(R.id.procedureTv);
+		procedureTv.setMovementMethod(ScrollingMovementMethod.getInstance());
+
+		procedureTv.setEllipsize(TextUtils.TruncateAt.MARQUEE);
+		procedureTv.setMarqueeRepeatLimit(6);
+		mRootView = findViewById(R.id.parentRel);
+		barcodeEdt = (EditText) findViewById(R.id.barcodeEdt);
+		barcodeEdt.setRawInputType(InputType.TYPE_CLASS_NUMBER);
+		CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
+		descEdt = (EditText) findViewById(R.id.descEdt);
+		messageLst = (ListView) findViewById(R.id.message_listview);
+		saveBtn = (Button) findViewById(R.id.btnSave);
+		sendOutSpinner = (Spinner) findViewById(R.id.fatory_transfer_in); 
+	}
+ 
+ 
+	private class SaveRunnable implements Runnable {
+
+		@Override
+		public void run() {
+			client = new WebClient();
+			try {
+				JSONObject js = new JSONObject();
+
+				JSONObject js6 = new JSONObject(); 
+				js6.put("USERCODE", send_userCode);
+				js6.put("DATAKEY", DATAKEY);			 
+
+				if (sendOutSpinner.getSelectedItem() == null) {
+					CustomToast.showToast(getApplicationContext(), "调出工厂不能为空", 2000);
+					ProcessDialogUtils.closeProgressDilog();
+					return;
+
+				} else if (sendOutSpinner.getSelectedItem() != null) {
+					SendOutModel model = (SendOutModel) sendOutSpinner.getSelectedItem();
+					if (model != null && model.getSendOutId() == "") {
+						CustomToast.showToast(getApplicationContext(), "调出工厂不能为空", 2000);
+						ProcessDialogUtils.closeProgressDilog();
+						return;
+					} else {
+						js6.put("WAREHOUSINGID", model.getSendOutId());
+					}
+				}
+				 
+				 
+
+				js.put("setEntity", js6);
+				if (barcodeList != null && barcodeList.size() > 0) {
+					JSONArray jarray6 = new JSONArray();
+					for (BarcodeInfo bd : barcodeList) {
+						JSONObject jo6 = new JSONObject();
+						jo6.put("Banma", bd.getBanMa());
+						jo6.put("GOODSCODE", bd.getGoodsCode());
+						jo6.put("MATERIALCODE", bd.getLogoCode());
+						jo6.put("MATERIALREMARK", bd.getLogoName());
+						jo6.put("BINDINGCount", bd.getOrderNo());
+						jo6.put("FINISHEDLOADBATCHNO", bd.getFinishedBarCode());
+						jarray6.put(jo6);
+					}
+					js.put("setDetailEntity", jarray6);
+				} else {
+					CustomToast.showToast(getApplicationContext(), "产品信息不能为空", 2000);
+					ProcessDialogUtils.closeProgressDilog();
+					return;
+				}
+				JSONObject js5 = new JSONObject();
+				js5.put("accountCode", accountCode);
+				js5.put("userCode", send_userCode);
+				js5.put("userPassword", password);
+				js5.put("sessionKey", sessionkey);
+				js5.put("module", "DockingLuoci");
+				js5.put("action", "SaveDockingLuoci");
+				js5.put("jsonData", js.toString());
+				String result = client.doPost(
+						"http://" + serverAddress_ip + ":" + serverAddress_port + Constants.serverAction + "/DoAction",
+						js5.toString(), "application/json");
+				Message m = new Message();
+				m.what = 2;
+				Bundle b = new Bundle();
+				b.putString("result", result);
+				m.setData(b);
+				handler.sendMessage(m);
+			} catch (Exception e) {
+				Message m = new Message();
+				m.what = 0;
+				Bundle b = new Bundle();
+				b.putString("message", "网络连接异常");
+				m.setData(b);
+				exceptionHandler.sendMessage(m);
+				e.printStackTrace();
+			}
+
+		}
+
+	}
+
+//扫码
+	private class BarcodeRunnable implements Runnable {
+		String barcode;
+
+		public BarcodeRunnable(String barcode) {
+			super();
+			this.barcode = barcode;
+		}
+
+		@Override
+		public void run() {
+			client = new WebClient();
+			try {
+				JSONObject js = new JSONObject();
+				js.put("accountCode", accountCode);
+				js.put("userCode", send_userCode);
+				js.put("userPassword", password);
+				js.put("sessionKey", sessionkey);
+				js.put("module", "DockingLuoci");
+				js.put("action", "CheckDockingLuoci");
+				JSONObject data = new JSONObject();
+				data.put("barcode", barcode);
+				SendOutModel model = (SendOutModel) sendOutSpinner.getSelectedItem();
+				data.put("workshop", model.getSendOutId());
+				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 = 1;
+				Bundle b = new Bundle();
+				b.putString("result", result);
+				m.setData(b);
+				handler.sendMessage(m);
+			} catch (Exception e) {
+				Message m = new Message();
+				m.what = 0;
+				Bundle b = new Bundle();
+				b.putString("message", "网络连接异常");
+				m.setData(b);
+				exceptionHandler.sendMessage(m);
+				e.printStackTrace();
+			}
+
+		}
+
+	}
+
+	Handler handler = new Handler() {
+
+		@Override
+		public void handleMessage(Message msg) {
+			switch (msg.what) {
+			case 0:
+				Bundle b = msg.getData();
+				String json = b.getString("result");
+				ProcessDialogUtils.closeProgressDilog();
+				if (mHandler != null) {
+					mHandler.removeCallbacksAndMessages(null);
+					mHandler.getLooper().quit();
+				}
+
+				try {
+					JSONObject jObject = new JSONObject(json);
+					JSONObject object = (JSONObject) jObject.opt("d");
+					int status = object.optInt("Status");
+					String message = object.optString("Message");
+					if (status == 0) {
+						String result = object.optString("Result");
+						JSONArray jArray = new JSONArray(result);
+						if (jArray != null && jArray.length() > 0) {
+							procedureList = new ArrayList<Procedure>();
+							for (int i = 0; i < jArray.length(); i++) {
+								JSONObject jObject1 = (JSONObject) jArray.opt(i);
+
+								int procedureId = jObject1.optInt("PROCEDUREID");
+								String procedureName = jObject1.optString("PROCEDURENAME");
+								Procedure procedure = new Procedure();
+								procedure.setProcedureId(String.valueOf(procedureId));
+								procedure.setProcedureName(procedureName);
+								procedureList.add(procedure);
+							}
+
+							booleans = new boolean[procedureList.size()];
+							initProcedurePopWindow(booleans);
+
+						}
+					} else {
+						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+						CommonUtil.showBarCodeAlertDialog(status, message, FactoryTransferInActivity.this, null, null,
+								null);
+					}
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+				break;
+
+			case 1:
+				ProcessDialogUtils.closeProgressDilog();
+				if (mHandler != null) {
+					mHandler.removeCallbacksAndMessages(null);
+					mHandler.getLooper().quit();
+				}
+				Bundle bundle = msg.getData();
+				String json1 = bundle.getString("result");
+
+				try {
+					JSONObject jObject = new JSONObject(json1);
+					JSONObject object = (JSONObject) jObject.opt("d");
+					int status = object.optInt("Status");
+					String message = object.optString("Message");
+
+					if (status == 0) {
+
+						String result = object.optString("Result");
+						JSONArray jArray = new JSONArray(result);
+
+						String mCODE = ((JSONObject) jArray.opt(0)).optString("MATERIALCODE");
+						String Count = ((JSONObject) jArray.opt(0)).optString("COUNT");
+						int mcount = 0;
+						for (BarcodeInfo bd : barcodeList) {
+							if (bd.getLogoCode().equals(mCODE)) {
+								mcount = mcount + Integer.parseInt(bd.getOrderNo());
+							}
+						}
+						int storageConout = 0;
+						if (storageJArray != null && storageJArray.length() > 0) {
+							for (int i = 0; i < storageJArray.length(); i++) {
+
+								JSONObject sobject = (JSONObject) storageJArray.opt(i);
+								String MATERIALCODE = sobject.optString("MATNR");
+								if (MATERIALCODE.equals(mCODE)) {
+									storageConout = storageConout
+											+ (int) Double.parseDouble(sobject.optString("LABST"));// sap库存
+								}
+
+							}
+						}
+						boolean a = false;
+						if ((Double.parseDouble(Count)) > (double) (storageConout - mcount)) {
+							a = !a;
+						}
+						if (status == 0) {
+							for (int i = 0; i < jArray.length(); i++) {
+								JSONObject object2 = (JSONObject) jArray.opt(i);
+								String barcode = object2.optString("BANMA");
+								String goodsCode = object2.optString("GOODSCODE");
+								String LogoCode = object2.optString("MATERIALCODE");
+								String LogoName = object2.optString("MATERIALREMARK");
+								int orderNo = object2.optInt("COUNT");
+								boolean isHas = removeFinishedBarCode(object2.optString("FINISHEDLOADBATCHNO"),
+										barcodeList);
+								if (isHas) {
+									CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
+
+									CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+
+									CustomToast.showToast(getApplicationContext(), "条码重复", 2000);
+
+									break;
+								}
+								if (!a) {
+									BarcodeInfo barcodeInfo = new BarcodeInfo();
+									barcodeInfo.setBanMa(barcode == "null" ? "" : barcode);
+									barcodeInfo.setGoodsCode(goodsCode);
+									barcodeInfo.setLogoCode(LogoCode);
+									barcodeInfo.setLogoName(LogoName);
+									barcodeInfo.setOrderNo(String.valueOf(orderNo));
+									barcodeInfo.setFinishedBarCode(object2.optString("FINISHEDLOADBATCHNO"));// 判断是否重复
+									barcodeList.add(barcodeInfo);
+								}
+							}
+							if (a) {
+								// CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+								CommonUtil.showBarCodeAlertDialog(0, "库存不足", FactoryTransferInActivity.this, barcodeEdt,
+										null, null);
+								return;
+							}
+							if (adapter == null) {
+								adapter = new FactoryTransferInListMessageAdapter(FactoryTransferInActivity.this,
+										barcodeList);
+								messageLst.setAdapter(adapter);
+							} else {
+								adapter.notifyDataSetChanged();
+								// messageLst.getLayoutParams().height=(messageLst.getHeight()+Height);
+								messageLst.getLayoutParams().height = (barcodeList.size() * Height);
+							}
+
+							saveBtn.setText("保存(" + barcodeList.size() + ")");
+							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(ProductSuspendActivity.this
+							// .getCurrentFocus().getWindowToken(),
+							// InputMethodManager.HIDE_NOT_ALWAYS);
+							ProcessDialogUtils.closeProgressDilog();
+
+						}
+					} else if (status == -1) {
+						message = message;
+						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+						CommonUtil.showBarCodeAlertDialog(0, message, FactoryTransferInActivity.this, barcodeEdt, null,
+								null);
+						return;
+					} else if (status == -102) {
+						message = "此产品未交接,不能进行该操作";
+						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+						CommonUtil.showBarCodeAlertDialog(0, message, FactoryTransferInActivity.this, barcodeEdt, null,
+								null);
+						return;
+					} else if (status == -100) {
+						message = "此产品已被废弃,不能进行该操作";
+						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+						CommonUtil.showBarCodeAlertDialog(0, message, FactoryTransferInActivity.this, barcodeEdt, null,
+								null);
+						return;
+					} else if (status == -999) {
+						message = "此产品无效条码,不能进行该操作";
+						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+						CommonUtil.showBarCodeAlertDialog(0, message, FactoryTransferInActivity.this, barcodeEdt, null,
+								null);
+						return;
+					}
+				} catch (JSONException e) {
+
+					e.printStackTrace();
+				}
+
+				break;
+
+			case 2:
+				if (mHandler != null) {
+					mHandler.removeCallbacksAndMessages(null);
+					mHandler.getLooper().quit();
+				}
+				ProcessDialogUtils.closeProgressDilog();
+				Bundle bundle2 = msg.getData();
+				String json2 = bundle2.getString("result");
+				JSONObject jObject;
+				try {
+					jObject = new JSONObject(json2);
+					JSONObject object = (JSONObject) jObject.opt("d");
+					int status = object.optInt("Status");
+					String message = object.optString("Message");
+					// JSONObject result3 =(JSONObject) object.opt("Result");
+					// JSONArray resArray = (JSONArray)result3.opt("Result");
+					if (status == 0) {
+						barcodeList.removeAll(barcodeList);
+						adapter.notifyDataSetChanged();
+						messageLst.getLayoutParams().height = (barcodeList.size() * Height);
+						saveBtn.setText("保存(" + barcodeList.size() + ")");
+						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+//						CommonUtil.showSaveAlertDialog(0,message , FactoryTransferInActivity.this, null, barcodeEdt, 2);
+//						CustomToast.showToast(getApplicationContext(), "成功", 2000);
+//						CommonUtil.playSound(getApplicationContext()); 
+						// checkedProcedureList.clear();
+						// procedureTv.setText("");
+						// descEdt.setText("");
+						// desc = "";
+						// booleans = new boolean[procedureList.size()];
+						Dialog alertDialog = new AlertDialog.Builder(FactoryTransferInActivity.this).setMessage(message)
+								.setPositiveButton("确定", new DialogInterface.OnClickListener() {
+									@Override
+									public void onClick(DialogInterface dialog, int which) {
+
+										finish();
+									}
+								}).create();
+						alertDialog.setCanceledOnTouchOutside(false);
+						alertDialog.show();
+ 
+						 
+
+					} else {
+						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+						CommonUtil.showSaveAlertDialog(0, message, FactoryTransferInActivity.this, null, barcodeEdt, 2);
+						updateDataKey();
+
+					}
+				} catch (JSONException e) {
+
+					e.printStackTrace();
+				}
+
+				break;
+			case 3:
+				Bundle b3 = msg.getData();
+				String json3 = b3.getString("glazeResult");
+				if (mHandler != null) {
+					mHandler.removeCallbacksAndMessages(null);
+					mHandler.getLooper().quit();
+				}
+				ProcessDialogUtils.closeProgressDilog();
+				JSONObject j2;
+				try {
+					j2 = new JSONObject(json3);
+					JSONObject j3 = j2.optJSONObject("d");
+					int status3 = j3.optInt("Status");
+					if (status3 == 0) {
+						String result3 = j3.optString("Result");
+						JSONArray resultArray = new JSONArray(result3);
+						if (resultArray != null && resultArray.length() > 0) {
+							sendOutList = new ArrayList<SendOutModel>();
+							for (int i = 0; i < resultArray.length(); i++) {
+								JSONObject resultObj = (JSONObject) resultArray.opt(i);
+								int dictionaryId = resultObj.optInt("DICTIONARYID");
+								String dictionaryValue = resultObj.optString("DICTIONARYVALUE");
+								SendOutModel sendOutModel = new SendOutModel();
+								sendOutModel.setSendOutId(String.valueOf(dictionaryId));
+								sendOutModel.setSendOutName(dictionaryValue);
+								sendOutList.add(sendOutModel);
+							}
+
+							sendOutAdapter = new SendOutSpinnerAdapter(FactoryTransferInActivity.this, sendOutList);
+							sendOutSpinner.setAdapter(sendOutAdapter);
+						}
+					}
+				} catch (JSONException e) {
+					e.printStackTrace();
+				}
+
+				break;
+			 
+			 
+			case 10:
+				ProcessDialogUtils.closeProgressDilog();
+				if (mHandler != null) {
+					mHandler.removeCallbacksAndMessages(null);
+					mHandler.getLooper().quit();
+				}
+				Bundle bundle10 = msg.getData();
+				String json10 = bundle10.getString("result");
+
+				try {
+					JSONObject jObject10 = new JSONObject(json10);
+					JSONObject object = (JSONObject) jObject10.opt("d");
+					int status = object.optInt("Status");
+					String message = object.optString("Message");
+					if (status == 0) {
+						String result = object.optString("Result");
+						JSONArray jArr = new JSONArray(result);
+						storageJArray = (JSONArray) jArr.opt(0);
+						JSONArray jArray = (JSONArray) jArr.opt(1);
+						barcodeList.removeAll(barcodeList);
+						if (jArray != null && jArray.length() > 0) {
+							for (int i = 0; i < jArray.length(); i++) {
+								JSONObject object2 = (JSONObject) jArray.opt(i);
+								String barcode = object2.optString("BANMA");
+								String goodsCode = object2.optString("GOODSCODE");
+								String LogoCode = object2.optString("MATERIALCODE");
+								// groutingDate = CommonUtil.commonDateConverter(groutingDate);
+								String LogoName = object2.optString("MATERIALREMARK");
+								// String userCode = object2.optString("USERCODE");
+								String orderNo = String.valueOf((int) Double.parseDouble(object2.optString("COUNT")));
+								BarcodeInfo barcodeInfo = new BarcodeInfo();
+								barcodeInfo.setBanMa(barcode == null || barcode.equals("null") ? "" : barcode);
+								barcodeInfo.setGoodsCode(goodsCode);
+								barcodeInfo.setLogoCode(LogoCode);
+								barcodeInfo.setLogoName(LogoName);
+								// barcodeInfo.setUserCode(userCode);
+								barcodeInfo.setOrderNo(orderNo);
+								barcodeInfo.setFinishedBarCode(object2.optString("FINISHEDLOADBATCHNO"));
+								barcodeList.add(barcodeInfo);
+							}
+						}
+						if (adapter == null) {
+							adapter = new FactoryTransferInListMessageAdapter(FactoryTransferInActivity.this,
+									barcodeList);
+							messageLst.setAdapter(adapter);
+						} else {
+							adapter.notifyDataSetChanged();
+						}
+						messageLst.getLayoutParams().height = (barcodeList.size() * Height);
+
+						saveBtn.setText("保存(" + barcodeList.size() + ")");
+						barcodeEdt.setEnabled(true);
+						barcodeEdt.setText("");
+						barcodeEdt.setFocusable(true);
+						barcodeEdt.setFocusableInTouchMode(true);
+						barcodeEdt.requestFocus();
+						barcodeEdt.findFocus();
+						isFirst = false;
+						barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
+							@Override
+							public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
+									int dstart, int dend) {
+
+								return null;
+							}
+						} });
+						if (IsSYNCSTATUS.equals("1")) {
+							barcodeEdt.setEnabled(false);
+							saveBtn.setEnabled(false);
+							// sendOutSpinner.setSpinnerMode(DialogFragment.MODE_DIALOG);
+						}
+						CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
+						// InputMethodManager im = (InputMethodManager) barcodeEdt
+						// .getContext().getSystemService(
+						// Context.INPUT_METHOD_SERVICE);
+						// im.hideSoftInputFromWindow(ProductSuspendActivity.this
+						// .getCurrentFocus().getWindowToken(),
+						// InputMethodManager.HIDE_NOT_ALWAYS);
+						ProcessDialogUtils.closeProgressDilog();
+
+					}
+					// else {
+					// CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+					// CommonUtil.showBarCodeAlertDialog(status, message,
+					// FactoryTransferInActivity.this, barcodeEdt, null, null);
+					// return;
+					// }
+				} catch (JSONException e) {
+
+					e.printStackTrace();
+				}
+
+				break;
+			}
+		}
+	};
+
+	public void initProcedurePopWindow(boolean[] bool) {
+
+		mMultiChoicePopWindow = new MultiChoiceProcedurePopWindow(this, mRootView, procedureList, bool);
+
+		mMultiChoicePopWindow.setTitle("工序列表");
+		mMultiChoicePopWindow.setOnOKButtonListener(new OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				selItems = mMultiChoicePopWindow.getSelectItem();
+				booleansTemp = selItems.clone();
+				checkedProcedureList = new ArrayList<Procedure>();
+				StringBuffer stringBuffer = new StringBuffer();
+				if (selItems != null && selItems.length > 0) {
+					int size = selItems.length;
+					stringBuffer.append("【");
+					for (int i = 0; i < size; i++) {
+						if (selItems[i]) {
+							stringBuffer.append(procedureList.get(i).getProcedureName());
+
+							stringBuffer.append("、");
+							checkedProcedureList.add(procedureList.get(i));
+						}
+					}
+					if (checkedProcedureList != null && checkedProcedureList.size() > 0) {
+						String procedure = stringBuffer.toString();
+
+						if (procedure.length() > 0) {
+							procedure = procedure.substring(0, procedure.length() - 1);
+							StringBuffer procedureStringBuffer = new StringBuffer();
+							procedureStringBuffer.append(procedure);
+							procedureStringBuffer.append("】");
+							procedure = procedureStringBuffer.toString();
+							procedureTv.setText(procedure);
+						}
+					} else {
+						checkedProcedureList = null;
+						procedureTv.setText("");
+					}
+
+				}
+
+			}
+
+		});
+
+		mMultiChoicePopWindow.setOnCancelButtonListener(new OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+				if (booleansTemp != null && booleansTemp.length > 0) {
+					booleans = booleansTemp.clone();
+				}
+
+			}
+		});
+
+	}
+
+	@Override
+	public boolean onCreateOptionsMenu(Menu menu) {
+
+		getMenuInflater().inflate(R.menu.product_suspend, menu);
+		return true;
+	}
+
+	@Override
+	public boolean onOptionsItemSelected(MenuItem item) {
+
+		int id = item.getItemId();
+		if (id == R.id.action_settings) {
+			return true;
+		}
+		return super.onOptionsItemSelected(item);
+	}
+
+}

+ 16 - 5
src/com/jiaju/activity/HomeActivity.java

@@ -61,7 +61,7 @@ public class HomeActivity extends Activity {
 	private ProductLineModel clockInPm;
 	private ProductLineModel mouldManagement;
 	private ProductLineModel productSuspend;
-	private ProductLineModel sendBoxOrder;// 发货单
+	private ProductLineModel sendBoxOrder;// 发货单 
 	private ProductLineModel groutingPm;
 	private ProductLineModel InvoicePm;// 发货单模块
 	private ProductLineModel securityCodePm;
@@ -305,7 +305,7 @@ public class HomeActivity extends Activity {
 						List<ProcedureModel> ptsList = new ArrayList<ProcedureModel>();
 						List<ProcedureModel> finishedProductList = new ArrayList<ProcedureModel>();
 						List<ProcedureModel> comBreakageList = new ArrayList<ProcedureModel>();
-						List<ProcedureModel> suibianList = new ArrayList<ProcedureModel>();
+						List<ProcedureModel> suibianList = new ArrayList<ProcedureModel>(); 
 						List<ProcedureModel> LCBZList = new ArrayList<ProcedureModel>();
 						for (int i = 0; i < jarray.length(); i++) {
 							JSONObject jo3 = jarray.optJSONObject(i);
@@ -403,7 +403,7 @@ public class HomeActivity extends Activity {
 								productSuspend.setProcedureList(null);
 								productLineList.add(productSuspend);
 							}
-
+							 
 							else if (functionCode.equals("0631")) { // 发货单
 								sendBoxOrder = new ProductLineModel();
 								sendBoxOrder.setProductLineMenuCode(functionCode);
@@ -621,7 +621,15 @@ public class HomeActivity extends Activity {
 								productLineList.add(pm19);
 
 							}
+							//工厂调入
+							else if (functionCode.equals("0635")) {
+								ProductLineModel pm0635 = new ProductLineModel();
+								pm0635.setProductLineMenuCode("0635");
+								pm0635.setProductionMenuName("工厂调入");
+								pm0635.setProcedureList(null);
+								productLineList.add(pm0635);
 
+							}
 							else if (functionCode.equals("060206")) {
 								ProductLineModel pm20 = new ProductLineModel();
 								pm20.setProductLineMenuCode(functionCode);
@@ -914,7 +922,8 @@ public class HomeActivity extends Activity {
 								pm19.setModelType(103);
 								pm19.setProcedureId(103);
 								Invoicelist.add(pm19);
-							}else if (functionCode.equals("063101")) // 
+							}
+							else if (functionCode.equals("063101")) // 
 							{
 								ProcedureModel pm19 = new ProcedureModel();
 								pm19.setProcedureMenuCode(functionCode);
@@ -932,7 +941,8 @@ public class HomeActivity extends Activity {
 								pm20.setModelType(103);
 								pm20.setProcedureId(103);
 								suibianList.add(pm20);
-							} else if (functionCode.equals("0634")) { //裸瓷交接
+							} 
+							else if (functionCode.equals("0634")) { //裸瓷交接
 								LCFinishedProduct = new ProductLineModel();
 								LCFinishedProduct.setProductLineMenuCode(functionCode);
 								LCFinishedProduct.setProductionMenuName("裸瓷交接");
@@ -1005,6 +1015,7 @@ public class HomeActivity extends Activity {
 
 							}
 						}
+						 
 						if (LCBZList != null && LCBZList.size() > 0) {
 							for (ProductLineModel model : productLineList) {
 								if (model.getProductLineMenuCode().equals("0634")) {

+ 235 - 0
src/com/jiaju/adapter/FactoryTransferInListMessageAdapter.java

@@ -0,0 +1,235 @@
+package com.jiaju.adapter;
+ 
+import java.util.List; 
+
+import android.app.Activity;
+import android.content.Context; 
+import android.graphics.Point; 
+import android.view.LayoutInflater;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.View.OnClickListener;
+import android.view.View.OnTouchListener;
+import android.view.ViewGroup;
+import android.view.animation.Animation;
+import android.view.animation.Animation.AnimationListener;
+import android.view.animation.AnimationUtils;
+import android.widget.BaseAdapter; 
+import android.widget.RelativeLayout;
+import android.widget.TextView; 
+
+import com.jiaju.activity.*;
+import com.jiaju.model.BarcodeInfo; 
+
+/**
+ * the adapter of the ListView
+ */
+public class FactoryTransferInListMessageAdapter extends BaseAdapter {
+	private String TAG = "ListMessageAdapter";
+	private Context context = null;
+	private Holder holder = null;
+	private LayoutInflater inflater = null;
+	// the last position clicked
+	private int mLastPosition = -1;
+	
+	// check whether a touch action is finish
+	private boolean loadFinish = false;
+
+	// the position of click and move, start and end point
+	private Point startPoint, endPoint;
+
+	// the animation of removing the item
+	private Animation animation = null;
+
+	// the children item is common
+	private final int TYPE_ITEM = 0;
+
+	// the children item is searching
+	private final int TYPE_SEARCH = 1;
+
+	// the count of children item's type
+	private final int TYPE_COUNT = TYPE_SEARCH + 1;
+
+    private List<BarcodeInfo> goodsList;
+	public FactoryTransferInListMessageAdapter(Context context,List<BarcodeInfo> goodsList) {
+		this.goodsList=goodsList;
+		this.context = context;
+		this.inflater = (LayoutInflater) context
+				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+		this.startPoint = new Point();
+		this.endPoint = new Point();
+		animation = AnimationUtils.loadAnimation(context, R.anim.push_out);
+	}
+
+	public int getCount() {
+
+		return goodsList.size();
+	}
+
+	@Override
+	public Object getItem(int position) {
+		BarcodeInfo barcodeInfo = null;
+		barcodeInfo	=goodsList.get(position);
+
+		return barcodeInfo;
+
+	}
+
+	@Override
+	public long getItemId(int position) {
+		return position;
+	}
+
+	@Override
+	public int getItemViewType(int position) {
+		return position == 0 ? TYPE_SEARCH : TYPE_ITEM;
+	}
+
+	@Override
+	public int getViewTypeCount() {
+		return TYPE_COUNT;
+	}
+
+	@Override
+	public View getView(final int position, View convertView, ViewGroup parent) {
+		if (null == convertView) {
+			holder = new Holder();
+			convertView = inflater.inflate(R.layout.send_out_goods, null);
+			holder.relativelayout = (RelativeLayout) convertView
+					.findViewById(R.id.parentLayout);
+			
+			holder.banmaTxt = (TextView) convertView.findViewById(R.id.banmaTxt);
+			holder.goodsCodeTxt = (TextView) convertView
+					.findViewById(R.id.goodsCodeTxt);
+			holder.logoNameTxt = (TextView) convertView
+					.findViewById(R.id.logoNameTxt);
+			holder.logoCodeTxt = (TextView) convertView.findViewById(R.id.logoCodeTxt);
+			holder.delete = (TextView) convertView
+					.findViewById(R.id.message_delete);
+			
+			holder.orderNoTxt=(TextView) convertView
+					.findViewById(R.id.orderNoTxt);
+			//holder.procedureNameTxt = (TextView) convertView
+			//		.findViewById(R.id.procedureNameTxt);
+			convertView.setTag(holder);
+		} else {
+			holder = (Holder) convertView.getTag();
+		}
+		
+		BarcodeInfo barcodeInfo=null;
+		
+		barcodeInfo=goodsList.get(position);
+	
+		holder.banmaTxt.setText(barcodeInfo.getBanMa());
+		holder.goodsCodeTxt.setText(barcodeInfo.getGoodsCode());
+		holder.orderNoTxt.setText(barcodeInfo.getOrderNo());
+		holder.logoCodeTxt.setText(barcodeInfo.getLogoCode());
+		holder.logoNameTxt.setText(barcodeInfo.getLogoName());
+		//holder.procedureNameTxt.setText(barcodeInfo.getProcedureName());
+		
+		final int chickPosition = position;
+		final int finalPosition = position;
+		if (position == mLastPosition) {
+			holder.delete.setVisibility(View.VISIBLE);
+		} else {
+			holder.delete.setVisibility(View.GONE);
+		}
+
+		final View view = holder.relativelayout;
+
+		holder.delete.setOnClickListener(new OnClickListener() {
+			@Override
+			public void onClick(View v) {
+
+				view.startAnimation(animation);
+				animation.setAnimationListener(new AnimationListener() {
+					@Override
+					public void onAnimationStart(Animation arg0) {
+					}
+
+					@Override
+					public void onAnimationRepeat(Animation arg0) {
+					}
+
+					@Override
+					public void onAnimationEnd(Animation arg0) {
+
+						Activity activity = (Activity) context;
+						if (activity.getClass().getName()
+								.equals("com.jiaju.activity.SendOutGoods")) {
+							goodsList.remove(chickPosition);
+							mLastPosition = -1;
+							notifyDataSetChanged();
+						((SendOutGoods) context).saveBtn.setText("±£´æ("
+									+ goodsList.size() + ")");
+						} 
+						
+					}
+				});
+			}
+		});
+
+		holder.relativelayout.setOnTouchListener(new OnTouchListener() {
+
+			public boolean onTouch(View v, MotionEvent event) {
+				switch (event.getAction()) {
+				case MotionEvent.ACTION_DOWN:
+					loadFinish = false;
+					startPoint.set((int) event.getX(), (int) event.getY());
+					break;
+				case MotionEvent.ACTION_MOVE:
+					endPoint.set((int) event.getX(), (int) event.getY());
+					if (Math.abs(endPoint.x - startPoint.x) > 30) {
+						if (loadFinish == false) {
+							loadFinish = true;
+							if (finalPosition != mLastPosition) {
+								mLastPosition = finalPosition;
+							} else {
+								mLastPosition = -1;
+							}
+							notifyDataSetChanged();
+						} else {
+							return true;
+						}
+						return true;
+					}
+					if (Math.abs(endPoint.y - startPoint.y) > 30) {
+						return false;
+					}
+					break;
+				case MotionEvent.ACTION_UP:
+					break;
+				}
+				return false;
+			}
+		});
+
+		holder.relativelayout.setOnClickListener(new OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				if (mLastPosition != -1) {
+					mLastPosition = -1;
+					notifyDataSetChanged();
+				}
+			}
+		});
+
+		return convertView;
+	}
+
+	private class Holder {
+		
+		TextView banmaTxt;
+		TextView goodsCodeTxt;
+		TextView logoCodeTxt;
+		//TextView procedureNameTxt;
+		TextView logoNameTxt;
+		TextView orderNoTxt;
+		TextView delete;
+		RelativeLayout relativelayout;
+		
+
+	}
+
+}
+

+ 8 - 2
src/com/jiaju/adapter/ProductLineExpandableListView.java

@@ -57,6 +57,7 @@ import com.jiaju.activity.MakeBilletActivity;
 import com.jiaju.activity.MolderMonthlySettlementReportActivity;
 import com.jiaju.activity.MouldAddActivity;
 import com.jiaju.activity.MouldInventoryActivity;
+import com.jiaju.activity.FactoryTransferInActivity;
 import com.jiaju.activity.MouldScrapActivity;
 import com.jiaju.activity.MouldTrackReportActivity;
 import com.jiaju.activity.NakedPorcelainActivity;
@@ -301,7 +302,7 @@ public class ProductLineExpandableListView extends ExpandableListView
 					|| productList.get(groupPosition).getProductionMenuName().equals("公坯设定")
 					|| productList.get(groupPosition).getProductionMenuName().equals("商标设定")
 					|| productList.get(groupPosition).getProductionMenuName().equals("条码恢复")
-
+					|| productList.get(groupPosition).getProductLineMenuCode().equals("0635")
 					|| productList.get(groupPosition).getProductLineMenuCode().equals("M0402")
 					|| productList.get(groupPosition).getProductLineMenuCode().equals("0402")
 					|| productList.get(groupPosition).getProductLineMenuCode().equals("060106")
@@ -993,7 +994,12 @@ public class ProductLineExpandableListView extends ExpandableListView
 			i.setClass(mContext, MouldInventoryActivity.class);
 			mContext.startActivity(i);
 		}
-
+		// 251022 工厂调入
+		else if (productList.get(groupPosition).getProductLineMenuCode().equals("0635")) {
+			Intent i = new Intent();
+			i.setClass(mContext, FactoryTransferInActivity.class);
+			mContext.startActivity(i);
+		}
 		else if (productList.get(groupPosition).getProductLineMenuCode().equals("0402")) {
 			Intent i = new Intent();
 			i.setClass(mContext, GroutingLineMouldManagementActivity.class);