李士越 1 anno fa
parent
commit
8d9699dd49

+ 3 - 0
AndroidManifest.xml

@@ -788,6 +788,9 @@
             android:name=".NakedPorcelainActivity"
             android:label="@string/title_activity_naked_porcelain" >
         </activity>
+         <activity
+            android:name=".DeliveryNoteInquiryActivity"  >
+        </activity>
     </application>
 
 </manifest>

+ 8 - 0
res/drawable/button_border.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<shape xmlns:android="http://schemas.android.com/apk/res/android">
+    <stroke
+        android:width="2dp"
+        android:color="#ffffff"/>
+    <solid android:color="@android:color/transparent"/>  
+    <corners android:radius="4dp"/>
+</shape>

+ 430 - 0
res/layout/activity_delivery_note_inquiry.xml

@@ -0,0 +1,430 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    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" /> 
+
+  <ScrollView
+        android:id="@+id/scrolllay"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_above="@id/bottom"
+        android:layout_below="@id/check_title" >
+    <LinearLayout
+        android:id="@+id/barcodelay"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:layout_below="@id/tile"
+        android:layout_marginTop="10dp"
+        android:orientation="vertical" >
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:id="@+id/ProductionID"
+                android:layout_width="80dp"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:text="生产工号:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_16" />
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="8dp"
+                android:orientation="vertical" >
+
+                <EditText
+                    android:id="@+id/edt_barcode"
+                    android:layout_width="fill_parent"
+                    android:layout_height="wrap_content"
+                    android:background="@null"
+                    android:imeOptions="actionGo"
+                    android:singleLine="true"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_24" />
+
+                <View
+                    android:layout_width="wrap_content"
+                    android:layout_height="1dp"
+                    android:background="@color/text_gray" />
+            </LinearLayout>
+        </LinearLayout>
+
+         
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:id="@+id/SendOutWarehouse"
+                android:layout_width="80dp"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:text="发出仓库:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_16" />
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="8dp"
+                android:orientation="vertical" >
+
+                <Spinner
+                    android:id="@+id/SendOutWarehouse_batchSp"
+                    android:layout_width="fill_parent"
+                    android:layout_height="40dp"
+                    android:layout_marginRight="5dp"
+                    android:background="@drawable/spinner_drop_down" />
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:id="@+id/ReceivingWarehouse"
+                android:layout_width="80dp"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:text="接收仓库:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_16" />
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="8dp"
+                android:orientation="vertical" >
+
+                <Spinner
+                    android:id="@+id/ReceivingWarehouse_batchSp"
+                    android:layout_width="fill_parent"
+                    android:layout_height="40dp"
+                    android:layout_marginRight="5dp"
+                    android:background="@drawable/spinner_drop_down" />
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:id="@+id/LicensePlateNumber"
+                android:layout_width="80dp"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:text="车牌号:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_16" />
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="8dp"
+                android:orientation="vertical" >
+
+                <Spinner
+                    android:id="@+id/LicensePlateNumber_batchSp"
+                    android:layout_width="fill_parent"
+                    android:layout_height="40dp"
+                    android:layout_marginRight="5dp"
+                    android:background="@drawable/spinner_drop_down" />
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/datelay"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="15dp"
+            android:orientation="horizontal" >
+
+            <com.jiaju.widget.JustifyTextView
+                android:id="@+id/PostingDate"
+                android:layout_width="80dp"
+                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="horizontal" >
+
+                <LinearLayout
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical" >
+
+                    <TextView
+                        android:id="@+id/PostingDate_TextView"
+                        android:layout_width="130dp"
+                        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="130dp"
+                        android:layout_height="1dp"
+                        android:background="@color/text_gray" />
+                </LinearLayout>
+
+                <ImageView
+                    android:id="@+id/PostingDateIv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_vertical"
+                    android:layout_marginLeft="5dp"
+                    android:background="@drawable/addzerenren" />
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout
+            android:id="@+id/datelay1"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="15dp"
+            android:orientation="horizontal" >
+
+            <com.jiaju.widget.JustifyTextView
+                android:id="@+id/DeliveryDate"
+                android:layout_width="80dp"
+                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="horizontal" >
+
+                <LinearLayout
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:orientation="vertical" >
+
+                    <TextView
+                        android:id="@+id/DeliveryDate_TextView"
+                        android:layout_width="130dp"
+                        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="130dp"
+                        android:layout_height="1dp"
+                        android:background="@color/text_gray" />
+                </LinearLayout>
+
+                <ImageView
+                    android:id="@+id/DeliveryDateIv"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:layout_gravity="center_vertical"
+                    android:layout_marginLeft="5dp"
+                    android:background="@drawable/addzerenren" />
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:id="@+id/SynchronizationStatus"
+                android:layout_width="80dp"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:text="同步状态:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_16" />
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="8dp"
+                android:orientation="vertical" >
+
+                <Spinner
+                    android:id="@+id/SynchronizationStatus_batchSp"
+                    android:layout_width="fill_parent"
+                    android:layout_height="40dp"
+                    android:layout_marginRight="5dp"
+                    android:background="@drawable/spinner_drop_down" />
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:gravity="center"
+            android:orientation="horizontal" >
+
+            <TextView
+                android:id="@+id/revoke"
+                android:layout_width="80dp"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="10dp"
+                android:text="撤销状态:"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_16" />
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginRight="8dp"
+                android:orientation="vertical" >
+
+                <Spinner
+                    android:id="@+id/revoke_batchSp"
+                    android:layout_width="fill_parent"
+                    android:layout_height="40dp"
+                    android:layout_marginRight="5dp"
+                    android:background="@drawable/spinner_drop_down" />
+            </LinearLayout>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="45dp"
+            android:layout_alignParentBottom="true"
+            android:background="#536370"
+            android:gravity="center_vertical"
+            android:orientation="horizontal" >
+
+            <Button
+                android:id="@+id/select_Button"
+                android:layout_width="0px"
+                android:layout_height="match_parent"
+                android:layout_weight="1"
+                android:background="@drawable/button_border"
+                android:text="查询"
+                android:textColor="@color/white"
+                android:textSize="@dimen/textsize_16" />
+        </LinearLayout>
+
+        <View
+            android:layout_width="fill_parent"
+            android:layout_height="1dp"
+            android:layout_marginTop="4dp"
+            android:background="@color/text_gray" />
+
+        <TextView
+            android:layout_width="100dp"
+            android:layout_height="wrap_content"
+            android:layout_marginLeft="10dp"
+            android:text="发货单信息:"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <LinearLayout
+            android:layout_width="fill_parent"
+            android:layout_height="fill_parent"
+            android:layout_below="@id/check_title"
+            android:layout_marginTop="12dp"
+            android:orientation="vertical" >
+
+            <com.jiaju.utils.CustomListView
+                android:id="@+id/Invoice_listview"
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginBottom="5dip"
+                android:cacheColorHint="#00000000"
+                android:divider="@color/text_gray"
+                android:dividerHeight="1dip"
+                android:footerDividersEnabled="true"
+                android:listSelector="@android:color/transparent" />
+        </LinearLayout>
+    </LinearLayout>
+    </ScrollView>
+    <LinearLayout
+         android:id="@+id/bottom"
+        android:layout_width="match_parent"
+        android:layout_height="45dp"
+        android:layout_alignParentBottom="true"
+        android:background="#536370"
+        android:gravity="center_vertical"
+        android:orientation="horizontal" >
+
+        <Button
+            android:id="@+id/revoke_Button"
+            android:layout_width="0px"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:background="@drawable/button_border"
+            android:text="撤销"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <Button
+            android:id="@+id/SupplementaryPush_Button"
+            android:layout_width="0px"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:background="@drawable/button_border"
+            android:text="补推"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+
+        <Button
+            android:id="@+id/Delete_Button"
+            android:layout_width="0px"
+            android:layout_height="match_parent"
+            android:layout_weight="1"
+            android:background="@drawable/button_border"
+            android:text="删除"
+            android:textColor="@color/white"
+            android:textSize="@dimen/textsize_16" />
+    </LinearLayout>
+
+</RelativeLayout>

+ 280 - 0
res/layout/activity_delivery_note_inquiry_item.xml

@@ -0,0 +1,280 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@+id/message_relative"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@color/background" >
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="fill_parent"
+        android:orientation="vertical" >
+    <LinearLayout
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal" > 
+       
+        <LinearLayout
+            android:id="@+id/lin_jump"
+            android:layout_width="fill_parent"
+            android:layout_height="wrap_content"
+            android:layout_weight="2"
+            android:orientation="vertical" >
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="8dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal" >
+
+                <com.jiaju.widget.JustifyTextView
+                    android:layout_width="70dp"
+                    android:layout_height="wrap_content"
+                    android:text="发货单号"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=":"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:id="@+id/ShippingOrderNumber"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="8dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal" >
+
+                <com.jiaju.widget.JustifyTextView
+                    android:layout_width="70dp"
+                    android:layout_height="wrap_content"
+                    android:text="发出仓库"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=":"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:id="@+id/SendOutWarehouse"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="8dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal" >
+
+                <com.jiaju.widget.JustifyTextView
+                    android:layout_width="70dp"
+                    android:layout_height="wrap_content"
+                    android:text="接收仓库"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=":"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:id="@+id/ReceivingWarehouse"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="8dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal" >
+
+                <com.jiaju.widget.JustifyTextView
+                    android:layout_width="70dp"
+                    android:layout_height="wrap_content"
+                    android:text="车牌号"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=":"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:id="@+id/LicensePlateNumber"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="8dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal" >
+
+                <com.jiaju.widget.JustifyTextView
+                    android:layout_width="70dp"
+                    android:layout_height="wrap_content"
+                    android:text="记账日期"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=":"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:id="@+id/PostingDate"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="8dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal" >
+
+                <com.jiaju.widget.JustifyTextView
+                    android:layout_width="70dp"
+                    android:layout_height="wrap_content"
+                    android:text="送货日期"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=":"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:id="@+id/DeliveryDate"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="8dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal" >
+
+                <com.jiaju.widget.JustifyTextView
+                    android:layout_width="70dp"
+                    android:layout_height="wrap_content"
+                    android:text="同步状态"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=":"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:id="@+id/SynchronizationStatus"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+            </LinearLayout>
+
+            <LinearLayout
+                android:layout_width="fill_parent"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="8dp"
+                android:layout_marginRight="8dp"
+                android:gravity="center_vertical"
+                android:orientation="horizontal" >
+
+                <com.jiaju.widget.JustifyTextView
+                    android:layout_width="70dp"
+                    android:layout_height="wrap_content"
+                    android:text="撤销状态"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:text=":"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+
+                <TextView
+                    android:id="@+id/revoke"
+                    android:layout_width="wrap_content"
+                    android:layout_height="wrap_content"
+                    android:textColor="@color/white"
+                    android:textSize="@dimen/textsize_14" />
+            </LinearLayout>
+    
+
+    
+       </LinearLayout>
+        <CheckBox
+        android:id="@+id/checkBox_detail"
+        android:layout_width="fill_parent"
+        android:layout_height="wrap_content" 
+        android:gravity="center_horizontal"
+        android:layout_gravity="center_vertical"
+        android:layout_weight="8" />
+    </LinearLayout>
+         <View
+            android:layout_width="fill_parent"
+            android:layout_height="1dp"
+            android:background="@color/text_gray" />
+       </LinearLayout>
+
+</RelativeLayout>

+ 2 - 1
res/layout/activity_kilincar_patch.xml

@@ -7,7 +7,8 @@
 
       <include
           android:id="@+id/check_title"
-          android:layout_width="wrap_content"
+          android:layout_width="match_parent"
+          android:layout_height="wrap_content" 
           layout="@layout/fragment_title" />
       <LinearLayout 
            android:layout_width="fill_parent"

+ 377 - 397
src/com/jiaju/activity/ChangeBarcodeActivity.java

@@ -1,4 +1,5 @@
 package com.jiaju.activity;
+
 import org.json.JSONException;
 import org.json.JSONObject;
 import com.jiaju.net.WebClient;
@@ -33,46 +34,48 @@ import android.widget.LinearLayout;
 import android.widget.PopupWindow;
 import android.widget.TextView;
 import android.widget.Toast;
+
 public class ChangeBarcodeActivity extends Activity {
-private Button search;
-private TextView title;
-private EditText barcodeEdt;
-private String barcode=null;
-private ImageView productRecord;
-private LinearLayout parent;
-private PopupWindow mPopupWindow; // 弹出框
-private EditText memoEdt;
-private Button saveBtn;
-private EditText newBarCodeEdt;
-private String newBarCode;
-private String originalBarCode;
-private String memo;
-private HandlerThread thread;
-private Handler mHandler;
-private String accountCode;
-private String changeBarcode_userCode;
-private String password;
-private String sessionkey;
-private SharedPreferences preferences;
-private String ServerAddress_ip;
-private String ServerAddress_duankou;
-private ImageButton backbtn;
-private TextView backtext;
-private EditText worknoEdt;
-private String groutingWorkNo;
-private EditText goodsCodeEdt;
-private String goodsCode;
-private String user;
-private Handler h=new Handler();
-private String code;
-private Handler h1=new Handler();
+	private Button search;
+	private TextView title;
+	private EditText barcodeEdt;
+	private String barcode = null;
+	private ImageView productRecord;
+	private LinearLayout parent;
+	private PopupWindow mPopupWindow; // 弹出框
+	private EditText memoEdt;
+	private Button saveBtn;
+	private EditText newBarCodeEdt;
+	private String newBarCode;
+	private String originalBarCode;
+	private String memo;
+	private HandlerThread thread;
+	private Handler mHandler;
+	private String accountCode;
+	private String changeBarcode_userCode;
+	private String password;
+	private String sessionkey;
+	private SharedPreferences preferences;
+	private String ServerAddress_ip;
+	private String ServerAddress_duankou;
+	private ImageButton backbtn;
+	private TextView backtext;
+	private EditText worknoEdt;
+	private String groutingWorkNo;
+	private EditText goodsCodeEdt;
+	private String goodsCode;
+	private String user;
+	private Handler h = new Handler();
+	private String code;
+	private Handler h1 = new Handler();
 //private long saveStart;
 //private long saveEnd;
-private Object obj=new Object();
-private Handler newBarcodeUpperH = new Handler();
-private String newBarcodeUpper;
-private Handler originalBarcodeUpperH = new Handler();
-private String originalBarcodeUpper;
+	private Object obj = new Object();
+	private Handler newBarcodeUpperH = new Handler();
+	private String newBarcodeUpper;
+	private Handler originalBarcodeUpperH = new Handler();
+	private String originalBarcodeUpper;
+
 	@Override
 	protected void onCreate(Bundle savedInstanceState) {
 		super.onCreate(savedInstanceState);
@@ -80,160 +83,151 @@ private String originalBarcodeUpper;
 		initView();
 		preferences = getSharedPreferences("user", Context.MODE_PRIVATE);
 		ServerAddress_ip = preferences.getString("ServerAddress_ip", "");
-		ServerAddress_duankou = preferences.getString("ServerAddress_duankou","");
+		ServerAddress_duankou = preferences.getString("ServerAddress_duankou", "");
 		accountCode = preferences.getString("AccountCode", "");
 		changeBarcode_userCode = preferences.getString("UserCode", "");
 		password = preferences.getString("UserPassword", "");
 		sessionkey = preferences.getString("SessionKey", "");
 		title.setText("条码变更");
-		CommonUtil.BarcodeMaxLength(barcodeEdt,50);
-		CommonUtil.BarcodeMaxLength(newBarCodeEdt,50);
+		CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
+		CommonUtil.BarcodeMaxLength(newBarCodeEdt, 50);
 		allListener();
 	}
-	
+
 	private void initView() {
-		search=(Button) findViewById(R.id.barcodeSearch);
+		search = (Button) findViewById(R.id.barcodeSearch);
 		title = (TextView) findViewById(R.id.title);
-		barcodeEdt=(EditText) findViewById(R.id.barcodetxt);
+		barcodeEdt = (EditText) findViewById(R.id.barcodetxt);
 		barcodeEdt.setRawInputType(InputType.TYPE_CLASS_NUMBER);
-		productRecord=(ImageView) findViewById(R.id.search);
+		productRecord = (ImageView) findViewById(R.id.search);
 		productRecord.setVisibility(View.VISIBLE);
-		parent=(LinearLayout) findViewById(R.id.parentRel);
-		memoEdt=(EditText) findViewById(R.id.memotxt);
-		saveBtn=(Button) findViewById(R.id.saveBtn);
-		newBarCodeEdt=(EditText) findViewById(R.id.newbarcodetxt);
+		parent = (LinearLayout) findViewById(R.id.parentRel);
+		memoEdt = (EditText) findViewById(R.id.memotxt);
+		saveBtn = (Button) findViewById(R.id.saveBtn);
+		newBarCodeEdt = (EditText) findViewById(R.id.newbarcodetxt);
 		newBarCodeEdt.setRawInputType(InputType.TYPE_CLASS_NUMBER);
 		backbtn = (ImageButton) findViewById(R.id.left_img);
-		backtext=(TextView) findViewById(R.id.back);
-		worknoEdt=(EditText) findViewById(R.id.groutingworknotxt);
-		goodsCodeEdt=(EditText) findViewById(R.id.goodscodeEdt);
+		backtext = (TextView) findViewById(R.id.back);
+		worknoEdt = (EditText) findViewById(R.id.groutingworknotxt);
+		goodsCodeEdt = (EditText) findViewById(R.id.goodscodeEdt);
 	}
-	
+
 	private void allListener() {
-		worknoEdt.addTextChangedListener(new TextWatcher() {  
-			  
-            public void onTextChanged(CharSequence text, int start, int before,  
-                    int count) {  
-                user = 	worknoEdt.getText().toString();  
-                // 判断输入的文字是否是小写  
-                for (int i = 0; i < user.length(); i++) {  
-                    if (user.charAt(i) - 0 >= 97 && user.charAt(i) - 0 <= 122) {  
-                        h.postDelayed(UpperCase, 300);  
-                    }  
-                }  
-              
-  
-            }  
-  
-            @Override  
-            public void beforeTextChanged(CharSequence text, int start,  
-                    int count, int after) {  
-               
-            }  
-  
-            @Override  
-            public void afterTextChanged(Editable edit) {  
-              
-            }  
-        });  
-  
+		worknoEdt.addTextChangedListener(new TextWatcher() {
+
+			public void onTextChanged(CharSequence text, int start, int before, int count) {
+				user = worknoEdt.getText().toString();
+				// 判断输入的文字是否是小写
+				for (int i = 0; i < user.length(); i++) {
+					if (user.charAt(i) - 0 >= 97 && user.charAt(i) - 0 <= 122) {
+						h.postDelayed(UpperCase, 300);
+					}
+				}
+
+			}
+
+			@Override
+			public void beforeTextChanged(CharSequence text, int start, int count, int after) {
+
+			}
+
+			@Override
+			public void afterTextChanged(Editable edit) {
+
+			}
+		});
+
 		barcodeEdt.addTextChangedListener(new TextWatcher() {
 
 			@Override
 			public void afterTextChanged(Editable s) {
-				if(barcodeEdt.getText().toString().contains("\n")){
+				if (barcodeEdt.getText().toString().contains("\n")) {
 					newBarCodeEdt.setFocusable(true);
 					newBarCodeEdt.requestFocus();
 				}
-				
-				
+
 			}
 
 			@Override
-			public void beforeTextChanged(CharSequence s, int start, int count,
-					int after) {
+			public void beforeTextChanged(CharSequence s, int start, int count, int after) {
 				// TODO Auto-generated method stub
-				
+
 			}
 
 			@Override
-			public void onTextChanged(CharSequence s, int start, int before,
-					int count) {
+			public void onTextChanged(CharSequence s, int start, int before, int count) {
 				originalBarcodeUpper = barcodeEdt.getText().toString();
 				// 判断输入的文字是否是小写
 				for (int i = 0; i < originalBarcodeUpper.length(); i++) {
-					if (originalBarcodeUpper.charAt(i) - 0 >= 97
-							&& originalBarcodeUpper.charAt(i) - 0 <= 122) {
+					if (originalBarcodeUpper.charAt(i) - 0 >= 97 && originalBarcodeUpper.charAt(i) - 0 <= 122) {
 						originalBarcodeUpperH.postDelayed(OriginalBarcodeUpperCase, 300);
 					}
 				}
-				
-			}});
-		
+
+			}
+		});
+
 		newBarCodeEdt.addTextChangedListener(new TextWatcher() {
 
 			@Override
 			public void afterTextChanged(Editable s) {
-				if(newBarCodeEdt.getText().toString().contains("\n")){
-				//newBarCode = newBarCodeEdt.getText().toString().trim().replaceAll("\\n", "");
-				memoEdt.setFocusable(true);
-				memoEdt.requestFocus();
-				
-			}
+				if (newBarCodeEdt.getText().toString().contains("\n")) {
+					// newBarCode = newBarCodeEdt.getText().toString().trim().replaceAll("\\n", "");
+					memoEdt.setFocusable(true);
+					memoEdt.requestFocus();
+
+				}
 			}
 
 			@Override
-			public void beforeTextChanged(CharSequence s, int start, int count,
-					int after) {
+			public void beforeTextChanged(CharSequence s, int start, int count, int after) {
 				// TODO Auto-generated method stub
-				
+
 			}
 
 			@Override
-			public void onTextChanged(CharSequence s, int start, int before,
-					int count) {
+			public void onTextChanged(CharSequence s, int start, int before, int count) {
 				newBarcodeUpper = newBarCodeEdt.getText().toString();
 				// 判断输入的文字是否是小写
 				for (int i = 0; i < newBarcodeUpper.length(); i++) {
-					if (newBarcodeUpper.charAt(i) - 0 >= 97
-							&& newBarcodeUpper.charAt(i) - 0 <= 122) {
+					if (newBarcodeUpper.charAt(i) - 0 >= 97 && newBarcodeUpper.charAt(i) - 0 <= 122) {
 						newBarcodeUpperH.postDelayed(NewBarcodeUpperCase, 300);
 					}
 				}
-				
-			}});
+
+			}
+		});
 		backbtn.setOnClickListener(new View.OnClickListener() {
-			
+
 			@Override
 			public void onClick(View v) {
 				finish();
-				
+
 			}
 		});
 		backtext.setOnClickListener(new View.OnClickListener() {
-			
+
 			@Override
 			public void onClick(View v) {
-			finish();
-				
+				finish();
+
 			}
 		});
 		saveBtn.setOnClickListener(new View.OnClickListener() {
-			
+
 			@Override
 			public void onClick(View v) {
-				originalBarCode=barcodeEdt.getText().toString();
-				 if(originalBarCode.contains("\n")){
-					 originalBarCode = originalBarCode.trim().replaceAll("\\n", "");
-			     }
-				if(TextUtils.isEmpty(originalBarCode)){
+				originalBarCode = barcodeEdt.getText().toString();
+				if (originalBarCode.contains("\n")) {
+					originalBarCode = originalBarCode.trim().replaceAll("\\n", "");
+				}
+				if (TextUtils.isEmpty(originalBarCode)) {
 					barcodeEdt.setText("");
 					barcodeEdt.setFocusable(true);
 					barcodeEdt.requestFocus();
-					Toast.makeText(getApplicationContext(),"原条码不能为空",Toast.LENGTH_SHORT).show();
+					Toast.makeText(getApplicationContext(), "原条码不能为空", Toast.LENGTH_SHORT).show();
 					return;
-				}
-				else{
+				} else {
 //					if(!CommonUtil.isNumber(originalBarCode)){	
 //						//CommonUtil.showRepeatDialog(originalBarCode+"格式不匹配",ChangeBarcodeActivity.this);
 //						Toast.makeText(getApplicationContext(),originalBarCode+"格式不匹配",Toast.LENGTH_SHORT).show();		
@@ -243,17 +237,16 @@ private String originalBarcodeUpper;
 //						return ;
 //					}
 				}
-				 newBarCode=newBarCodeEdt.getText().toString();
-				 if(newBarCode.contains("\n")){
-					 newBarCode =  newBarCode.trim().replaceAll("\\n", "");
-			     }
-				 if(TextUtils.isEmpty(newBarCode)){
-						Toast.makeText(getApplicationContext(),"新条码不能为空",Toast.LENGTH_SHORT).show();
-						newBarCodeEdt.setFocusable(true);
-						newBarCodeEdt.requestFocus();
-						return;
-					}
-					else{
+				newBarCode = newBarCodeEdt.getText().toString();
+				if (newBarCode.contains("\n")) {
+					newBarCode = newBarCode.trim().replaceAll("\\n", "");
+				}
+				if (TextUtils.isEmpty(newBarCode)) {
+					Toast.makeText(getApplicationContext(), "新条码不能为空", Toast.LENGTH_SHORT).show();
+					newBarCodeEdt.setFocusable(true);
+					newBarCodeEdt.requestFocus();
+					return;
+				} else {
 //						if(!CommonUtil.isNumber(newBarCode)){	
 //							//CommonUtil.showRepeatDialog(newBarCode+"格式不匹配",ChangeBarcodeActivity.this);
 //							Toast.makeText(getApplicationContext(),newBarCode+"格式不匹配",Toast.LENGTH_SHORT).show();
@@ -262,208 +255,198 @@ private String originalBarcodeUpper;
 //							newBarCodeEdt.requestFocus();
 //							return ;
 //						}
-					}
-				 if(originalBarCode.equals( newBarCode)){
-						//Toast.makeText(getApplicationContext(),"新条码与原条码重复",Toast.LENGTH_SHORT).show();
-						CommonUtil.showRepeatDialog("新条码与原条码重复",ChangeBarcodeActivity.this);
-					 return;
-				 }
-				 
-				memo= memoEdt.getText().toString();
-				groutingWorkNo=worknoEdt.getText().toString();
-				if(TextUtils.isEmpty(groutingWorkNo)){
-					Toast.makeText(getApplicationContext(),"成型工号不能为空",Toast.LENGTH_SHORT).show();
+				}
+				if (originalBarCode.equals(newBarCode)) {
+					// Toast.makeText(getApplicationContext(),"新条码与原条码重复",Toast.LENGTH_SHORT).show();
+					CommonUtil.showRepeatDialog("新条码与原条码重复", ChangeBarcodeActivity.this);
+					return;
+				}
+
+				memo = memoEdt.getText().toString();
+				groutingWorkNo = worknoEdt.getText().toString();
+				if (TextUtils.isEmpty(groutingWorkNo)) {
+					Toast.makeText(getApplicationContext(), "成型工号不能为空", Toast.LENGTH_SHORT).show();
 					worknoEdt.setFocusable(true);
 					worknoEdt.requestFocus();
 					return;
 				}
-				
-			goodsCode=goodsCodeEdt.getText().toString();
-			if(TextUtils.isEmpty(goodsCode)){
-				Toast.makeText(getApplicationContext(),"产品编码不能为空",Toast.LENGTH_SHORT).show();
-				goodsCodeEdt.setFocusable(true);
-				goodsCodeEdt.requestFocus();
-				return;
-			}
-			
+
+				goodsCode = goodsCodeEdt.getText().toString();
+				if (TextUtils.isEmpty(goodsCode)) {
+					Toast.makeText(getApplicationContext(), "产品编码不能为空", Toast.LENGTH_SHORT).show();
+					goodsCodeEdt.setFocusable(true);
+					goodsCodeEdt.requestFocus();
+					return;
+				}
+
 				ProcessDialogUtils.showProcessDialog(ChangeBarcodeActivity.this);
-				if(saveBtn.isEnabled()){
-				saveBtn.setEnabled(false);
-				//saveStart=	System.currentTimeMillis();
-				 thread=new HandlerThread("saveThread",5);
+				if (saveBtn.isEnabled()) {
+					saveBtn.setEnabled(false);
+					// saveStart= System.currentTimeMillis();
+					thread = new HandlerThread("saveThread", 5);
 					thread.start();
-					mHandler=new Handler(thread.getLooper());
-					SaveRunnable saveRunnable=new SaveRunnable(obj);
-					 mHandler.post(saveRunnable);
+					mHandler = new Handler(thread.getLooper());
+					SaveRunnable saveRunnable = new SaveRunnable(obj);
+					mHandler.post(saveRunnable);
 				}
 			}
 		});
 		search.setOnClickListener(new View.OnClickListener() {
-			
+
 			@Override
 			public void onClick(View v) {
-		     barcode=barcodeEdt.getText().toString();
-		     if(barcode.contains("\n")){
+				barcode = barcodeEdt.getText().toString();
+				if (barcode.contains("\n")) {
 					barcode = barcode.trim().replaceAll("\\n", "");
-		     }
-		  groutingWorkNo=   worknoEdt.getText().toString();
-			Intent i=new Intent();
-			Bundle b=new Bundle();
-			b.putString("barcode",barcode);
-			b.putString("groutingWorkNo",groutingWorkNo);
-			i.putExtras(b);
-			i.setClass(ChangeBarcodeActivity.this,BarcodeSearchActivity.class);
-			startActivityForResult(i, 100);
-				
+				}
+				groutingWorkNo = worknoEdt.getText().toString();
+				Intent i = new Intent();
+				Bundle b = new Bundle();
+				b.putString("barcode", barcode);
+				b.putString("groutingWorkNo", groutingWorkNo);
+				i.putExtras(b);
+				i.setClass(ChangeBarcodeActivity.this, BarcodeSearchActivity.class);
+				startActivityForResult(i, 100);
+
 			}
 		});
-		
-		 productRecord.setOnClickListener(new View.OnClickListener() {		
-			    @Override
-			     public void onClick(View v) {
-						int height = parent.getHeight() - v.getHeight();
-						BarcodeChangePopMenu  recordPopMenu = new BarcodeChangePopMenu(ChangeBarcodeActivity.this,height);
-						mPopupWindow =recordPopMenu.getMenu();
-						if (mPopupWindow == null) {
-							return;
-						}
 
+		productRecord.setOnClickListener(new View.OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				int height = parent.getHeight() - v.getHeight();
+				BarcodeChangePopMenu recordPopMenu = new BarcodeChangePopMenu(ChangeBarcodeActivity.this, height);
+				mPopupWindow = recordPopMenu.getMenu();
+				if (mPopupWindow == null) {
+					return;
+				}
+
+				if (mPopupWindow.isShowing()) {
+					mPopupWindow.dismiss();
+					return;
+				}
+				mPopupWindow.showAtLocation(parent, Gravity.BOTTOM, 0, 0);
+				LinearLayout barcodeLay = (LinearLayout) recordPopMenu.menu.findViewById(R.id.barcodechangelay);
+				ImageView scanImg = (ImageView) recordPopMenu.menu.findViewById(R.id.scanimg);
+				TextView scanTitle = (TextView) recordPopMenu.menu.findViewById(R.id.scantitle);
+				scanTitle.setText("扫一扫");
+				scanImg.setBackgroundResource(R.drawable.scan);
+				barcodeLay.setOnClickListener(new View.OnClickListener() {
+
+					@Override
+					public void onClick(View v) {
+						Intent openCameraIntent = new Intent(ChangeBarcodeActivity.this, CaptureActivity.class);
+						startActivityForResult(openCameraIntent, 102);
 						if (mPopupWindow.isShowing()) {
 							mPopupWindow.dismiss();
-							return;
+
 						}
-						mPopupWindow.showAtLocation(parent, Gravity.BOTTOM, 0, 0);
-						LinearLayout barcodeLay=(LinearLayout) recordPopMenu.menu.findViewById(R.id.barcodechangelay);
-					ImageView scanImg=	 (ImageView) recordPopMenu.menu.findViewById(R.id.scanimg);
-					TextView scanTitle= (TextView) recordPopMenu.menu.findViewById(R.id.scantitle);
-					scanTitle.setText("扫一扫");
-					scanImg.setBackgroundResource(R.drawable.scan);
-						barcodeLay.setOnClickListener(new View.OnClickListener() {
-							
-							@Override
-							public void onClick(View v) {
-								Intent openCameraIntent = new Intent(ChangeBarcodeActivity.this,CaptureActivity.class);
-								startActivityForResult(openCameraIntent,102);
-								if (mPopupWindow.isShowing()) {
-									mPopupWindow.dismiss();
-									
-								}
-								
-							}
-						});
-						
-				
-					
-				
-			      }
-		    });
-		 
-		 goodsCodeEdt.addTextChangedListener(new TextWatcher() {
-
-				@Override
-				public void onTextChanged(CharSequence s, int start,
-						int before, int count) {
-					  code = goodsCodeEdt.getText().toString();  
-		                // 判断输入的文字是否是小写  
-		                for (int i = 0; i <code.length(); i++) {  
-		                    if (code.charAt(i) - 0 >= 97 && code.charAt(i) - 0 <= 122) {  
-		                        h1.postDelayed(GoodsCodeUpperCase, 300);  
-		                    }  
-		                }  
-		              
-				
-				}
 
-				@Override
-				public void beforeTextChanged(CharSequence s, int start,
-						int count, int after) {
-					// TODO Auto-generated method stub
+					}
+				});
 
-				}
+			}
+		});
 
-				@Override
-				public void afterTextChanged(Editable s) {
-					// TODO Auto-generated method stub
+		goodsCodeEdt.addTextChangedListener(new TextWatcher() {
 
+			@Override
+			public void onTextChanged(CharSequence s, int start, int before, int count) {
+				code = goodsCodeEdt.getText().toString();
+				// 判断输入的文字是否是小写
+				for (int i = 0; i < code.length(); i++) {
+					if (code.charAt(i) - 0 >= 97 && code.charAt(i) - 0 <= 122) {
+						h1.postDelayed(GoodsCodeUpperCase, 300);
+					}
 				}
-			});
-		 
-		
-		
+
+			}
+
+			@Override
+			public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+				// TODO Auto-generated method stub
+
+			}
+
+			@Override
+			public void afterTextChanged(Editable s) {
+				// TODO Auto-generated method stub
+
+			}
+		});
+
 	}
-	
-	
+
 	Handler exceptionHandler = new Handler() {
 		@Override
 		public void handleMessage(Message 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");
-		           saveBtn.setEnabled(true);
-		       	CustomToast.showToast(getApplicationContext(),message,
-						2000);	
-		           break;	
+				if (mHandler != null) {
+					mHandler.removeCallbacksAndMessages(null);
+					mHandler.getLooper().quit();
+				}
+				Bundle b = msg.getData();
+				String message = b.getString("message");
+				saveBtn.setEnabled(true);
+				CustomToast.showToast(getApplicationContext(), message, 2000);
+				break;
 			}
 		}
 	};
-	
+
 	Handler handler = new Handler() {
 		@Override
 		public void handleMessage(Message msg) {
 			switch (msg.what) {
 			case 0:
-			Bundle b=msg.getData();
-		String result=	b.getString("result");
-		ProcessDialogUtils.closeProgressDilog();
+				Bundle b = msg.getData();
+				String result = b.getString("result");
+				ProcessDialogUtils.closeProgressDilog();
 				try {
-					JSONObject jo=new JSONObject(result);
-				JSONObject jo1=	jo.optJSONObject("d");
-		    	int status=	jo1.optInt("Status");
-			   String message=jo1.optString("Message");
-			   goodsCodeEdt.setText("");
-			 barcodeEdt.setText("");
-			 newBarCodeEdt.setText("");
-			 memoEdt.setText("");
-			 saveBtn.setEnabled(true);
-			if(status==0){
-				CommonUtil.playSound(getApplicationContext());
-				 goodsCodeEdt.setFocusable(true);
-				 goodsCodeEdt.requestFocus();
-				// saveEnd=System.currentTimeMillis();
-					//long saveTime= saveEnd-saveStart;
-					//Toast.makeText(getApplicationContext(),saveTime+"save",Toast.LENGTH_LONG).show();
-					//System.out.println(saveTime+"save");
-				Toast.makeText(getApplicationContext(),"上传成功",Toast.LENGTH_SHORT).show();
-				 if(mHandler!=null){
-						mHandler.removeCallbacksAndMessages(null);
-						mHandler.getLooper().quit();
+					JSONObject jo = new JSONObject(result);
+					JSONObject jo1 = jo.optJSONObject("d");
+					int status = jo1.optInt("Status");
+					String message = jo1.optString("Message");
+					goodsCodeEdt.setText("");
+					barcodeEdt.setText("");
+					newBarCodeEdt.setText("");
+					memoEdt.setText("");
+					saveBtn.setEnabled(true);
+					if (status == 0) {
+						CommonUtil.playSound(getApplicationContext());
+						goodsCodeEdt.setFocusable(true);
+						goodsCodeEdt.requestFocus();
+						// saveEnd=System.currentTimeMillis();
+						// long saveTime= saveEnd-saveStart;
+						// Toast.makeText(getApplicationContext(),saveTime+"save",Toast.LENGTH_LONG).show();
+						// System.out.println(saveTime+"save");
+						Toast.makeText(getApplicationContext(), "上传成功", Toast.LENGTH_SHORT).show();
+						if (mHandler != null) {
+							mHandler.removeCallbacksAndMessages(null);
+							mHandler.getLooper().quit();
 						}
-						
-				return;
-			}
-			
-			else{
-				 goodsCodeEdt.setFocusable(true);
-				 goodsCodeEdt.requestFocus();
-				CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,getApplicationContext())	;				    
-				CommonUtil.showAlertDialog(status, message,ChangeBarcodeActivity.this);
-				 if(mHandler!=null){
-						mHandler.removeCallbacksAndMessages(null);
-						mHandler.getLooper().quit();
+
+						return;
+					}
+
+					else {
+						goodsCodeEdt.setFocusable(true);
+						goodsCodeEdt.requestFocus();
+						CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
+						CommonUtil.showAlertDialog(status, message, ChangeBarcodeActivity.this);
+						if (mHandler != null) {
+							mHandler.removeCallbacksAndMessages(null);
+							mHandler.getLooper().quit();
 						}
-				return;
-			}
-		
+						return;
+					}
+
 				} catch (JSONException e) {
 					e.printStackTrace();
 				}
-		
+
 				break;
 			}
 		}
@@ -471,132 +454,128 @@ private String originalBarcodeUpper;
 
 	private class SaveRunnable implements Runnable {
 		private Object obj;
-		public SaveRunnable(Object obj){
-			this.obj=obj;
+
+		public SaveRunnable(Object obj) {
+			this.obj = obj;
 		}
 
 		@Override
 		public void run() {
-		
-			synchronized(obj){
-			try {
-				// 生产条码检验请求数据
-				JSONObject	jsonObject = new JSONObject();
-				jsonObject.put("accountCode", accountCode);
-				jsonObject.put("userCode",changeBarcode_userCode);
-				jsonObject.put("userPassword",password);
-				jsonObject.put("sessionKey", sessionkey);
-				jsonObject.put("barcode",originalBarCode);// 条码
-				jsonObject.put("newBarcode",newBarCode);// 条码
-				jsonObject.put("remarks",memo);// 条码
-				jsonObject.put("groutingUserCode",groutingWorkNo);
-				jsonObject.put("goodsCode",goodsCode);
-			 WebClient	client = null;
-				client = new WebClient();
-				String result = client.doPost("http://" + ServerAddress_ip
-						+ ":" + ServerAddress_duankou
-						+ Constants.CHANGE_BARCODE, jsonObject.toString(),
-						"application/json");
-		       Message m=new Message();
-		       m.what=0;
-		       Bundle b=new Bundle();
-		       b.putString("result",result);
-		       m.setData(b);
-		       handler.sendMessage(m);
-			}
-	
-
-			catch (Exception e) {
-				e.printStackTrace(); 
-				Message m=new Message();
-				m.what=0;
-				Bundle b=new Bundle();
-				b.putString("message","网络连接异常");
-				m.setData(b);
-				exceptionHandler.sendMessage(m);
-			}
+
+			synchronized (obj) {
+				try {
+					// 生产条码检验请求数据
+					JSONObject jsonObject = new JSONObject();
+					jsonObject.put("accountCode", accountCode);
+					jsonObject.put("userCode", changeBarcode_userCode);
+					jsonObject.put("userPassword", password);
+					jsonObject.put("sessionKey", sessionkey);
+					jsonObject.put("barcode", originalBarCode);// 条码
+					jsonObject.put("newBarcode", newBarCode);// 条码
+					jsonObject.put("remarks", memo);// 条码
+					jsonObject.put("groutingUserCode", groutingWorkNo);
+					jsonObject.put("goodsCode", goodsCode);
+					WebClient client = null;
+					client = new WebClient();
+					String result = client.doPost(
+							"http://" + ServerAddress_ip + ":" + ServerAddress_duankou + Constants.CHANGE_BARCODE,
+							jsonObject.toString(), "application/json");
+					Message m = new Message();
+					m.what = 0;
+					Bundle b = new Bundle();
+					b.putString("result", result);
+					m.setData(b);
+					handler.sendMessage(m);
+				}
+
+				catch (Exception e) {
+					e.printStackTrace();
+					Message m = new Message();
+					m.what = 0;
+					Bundle b = new Bundle();
+					b.putString("message", "网络连接异常");
+					m.setData(b);
+					exceptionHandler.sendMessage(m);
+				}
 			}
 
 		}
 
 	};
-	
-	 Runnable UpperCase = new Runnable() {  
-		  
-	        @Override  
-	        public void run() {  
-	            // 小写转大写  
-	        	worknoEdt.setText(user.toUpperCase());  
-	            // 设置EditText光标位置  
-	        	worknoEdt.setSelection(user.length());  
-	  
-	        }  
-	  
-	    };  
-	    
-		 Runnable GoodsCodeUpperCase = new Runnable() {  
-			  
-		        @Override  
-		        public void run() {  
-		            // 小写转大写  
-		        	goodsCodeEdt.setText(code.toUpperCase());  
-		            // 设置EditText光标位置  
-		        	goodsCodeEdt.setSelection(code.length());  
-		  
-		        }  
-		  
-		    };  
-		    
-		    Runnable NewBarcodeUpperCase = new Runnable() {
-
-				@Override
-				public void run() {
-					// 小写转大写
-					 newBarCodeEdt.setText(newBarcodeUpper.toUpperCase());
-					// 设置EditText光标位置
-					 newBarCodeEdt.setSelection(newBarcodeUpper.length());
 
-				}
+	Runnable UpperCase = new Runnable() {
 
-			};
-			
-			   Runnable OriginalBarcodeUpperCase = new Runnable() {
+		@Override
+		public void run() {
+			// 小写转大写
+			worknoEdt.setText(user.toUpperCase());
+			// 设置EditText光标位置
+			worknoEdt.setSelection(user.length());
 
-					@Override
-					public void run() {
-						// 小写转大写
-						barcodeEdt.setText(newBarcodeUpper.toUpperCase());
-						// 设置EditText光标位置
-					    barcodeEdt.setSelection(newBarcodeUpper.length());
+		}
 
-					}
+	};
+
+	Runnable GoodsCodeUpperCase = new Runnable() {
+
+		@Override
+		public void run() {
+			// 小写转大写
+			goodsCodeEdt.setText(code.toUpperCase());
+			// 设置EditText光标位置
+			goodsCodeEdt.setSelection(code.length());
+
+		}
+
+	};
 
-				};
+	Runnable NewBarcodeUpperCase = new Runnable() {
+
+		@Override
+		public void run() {
+			// 小写转大写
+			newBarCodeEdt.setText(newBarcodeUpper.toUpperCase());
+			// 设置EditText光标位置
+			newBarCodeEdt.setSelection(newBarcodeUpper.length());
+
+		}
+
+	};
+
+	Runnable OriginalBarcodeUpperCase = new Runnable() {
+
+		@Override
+		public void run() {
+			// 小写转大写
+			barcodeEdt.setText(newBarcodeUpper.toUpperCase());
+			// 设置EditText光标位置
+			barcodeEdt.setSelection(newBarcodeUpper.length());
+
+		}
+
+	};
 
-	
 	@Override
 	protected void onActivityResult(int requestCode, int resultCode, Intent data) {
-	 if (requestCode == 100 && resultCode == 101) {
+		if (requestCode == 100 && resultCode == 101) {
 			// 图片放大删除选中图片
 			Bundle b = data.getExtras();
-			String goodscode=b.getString("goodscode");
+			String goodscode = b.getString("goodscode");
 			goodsCodeEdt.setText(goodscode);
-		    String barcode=	b.getString("barcode");
-		    barcodeEdt.setText(barcode);
-		   int size= barcode.length();
-		   barcodeEdt.setSelection(size);
-		
-		}
-	 else if (requestCode ==102&&resultCode == RESULT_OK) {
+			String barcode = b.getString("barcode");
+			barcodeEdt.setText(barcode);
+			int size = barcode.length();
+			barcodeEdt.setSelection(size);
+
+		} else if (requestCode == 102 && resultCode == RESULT_OK) {
 			Bundle bundle = data.getExtras();
 			String scanResult = bundle.getString("result");
 			View rootview = this.getWindow().getDecorView();
-			EditText v=(EditText) rootview.findFocus();
-		    v.setText(scanResult);
-		    v.setSelection(scanResult.length());
+			EditText v = (EditText) rootview.findFocus();
+			v.setText(scanResult);
+			v.setSelection(scanResult.length());
 		}
 	}
-  
 
 	@Override
 	public boolean onCreateOptionsMenu(Menu menu) {
@@ -604,13 +583,14 @@ private String originalBarcodeUpper;
 		getMenuInflater().inflate(R.menu.change_barcode, menu);
 		return true;
 	}
+
 	@Override
-    public Resources getResources() {
-        Resources res = super.getResources();  
-        Configuration config=new Configuration();  
-        config.setToDefaults();  
-        res.updateConfiguration(config,res.getDisplayMetrics() );
-        return res;
-    }
+	public Resources getResources() {
+		Resources res = super.getResources();
+		Configuration config = new Configuration();
+		config.setToDefaults();
+		res.updateConfiguration(config, res.getDisplayMetrics());
+		return res;
+	}
 
 }

+ 731 - 0
src/com/jiaju/activity/DeliveryNoteInquiryActivity.java

@@ -0,0 +1,731 @@
+package com.jiaju.activity;
+
+import java.text.SimpleDateFormat;
+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.DeliveryNoteInquiryItemAdapter;
+import com.jiaju.adapter.OrderSpinnerAdapter;
+import com.jiaju.model.DeliveryNoteInquiryItemModel;
+import com.jiaju.model.Order;
+import com.jiaju.net.WebClient;
+import com.jiaju.utils.CommonUtil;
+import com.jiaju.utils.Constants;
+import com.jiaju.utils.CustomListView;
+import com.jiaju.utils.ProcessDialogUtils;
+import com.jiaju.utils.TimePickerInfo;
+import android.annotation.SuppressLint;
+import android.app.Activity;
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.HandlerThread;
+import android.os.Message;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.ImageButton;
+import android.widget.ImageView;
+import android.widget.Spinner;
+import android.widget.TextView;
+
+public class DeliveryNoteInquiryActivity extends Activity {
+	/**返回*/
+	private ImageButton backbtn;
+	/**返回*/
+	private TextView backtext;
+	/**标题*/ 
+	private TextView tvTitle;
+	private CustomListView lstView;
+	private SharedPreferences preferences;
+	private DeliveryNoteInquiryItemAdapter adapter = null;
+	/** 同步状态控件 */
+	private Spinner spinnerSynchronizationStatus;
+	/** 撤销状态控件 */
+	private Spinner revoke;
+	/** 车牌号 */
+	private Spinner LicensePlateNumber;
+	/** 发出仓库 */
+	private Spinner SendOutWarehouse;
+	/** 接收仓库 */
+	private Spinner ReceivingWarehouse;
+	/** 状态数据 */
+	private OrderSpinnerAdapter orderspinnerAdapter;
+	private WebClient client;
+	private HandlerThread thread;
+	private Handler mHandler;
+	private String ServerAddress_ip;
+	private String ServerAddress_Port;
+	private String accountCode;
+	private String barcode_print_userCode;
+	private String password;
+	private String sessionkey;
+	/** 记账日期 */
+	private ImageView PostingDateWorker;
+	/** 记账日期文本控件 */
+	private TextView PostingDate_TextView;
+	/** 送货日期 */
+	private ImageView DeliveryDateWorker;
+	/** 送货日期文本控件 */
+	private TextView DeliveryDate_TextView;
+	private long timeMillis;
+	private TimePickerInfo mTimePickerInfo;
+	/** 记账日期控件标识 */
+	private boolean isPostingDateSelected = false;
+	/** 送货日期控件标识 */
+	private boolean isDeliveryDateSelected = false;
+	/** 生产工号输入框 */
+	private EditText edt_barcode;
+	/** 查询按钮 */
+	private Button select_Button;
+	/** 撤销按钮 */
+	private Button revoke_Button;
+	/** 补推按钮 */
+	private Button SupplementaryPush_Button;
+	/** 删除按钮 */
+	private Button Delete_Button;
+	private List<DeliveryNoteInquiryItemModel> detailList = new ArrayList<DeliveryNoteInquiryItemModel>();
+
+	@Override
+	protected void onCreate(Bundle savedInstanceState) {
+		super.onCreate(savedInstanceState);
+		setContentView(R.layout.activity_delivery_note_inquiry);
+		initview();
+		preferences = getSharedPreferences("user", Context.MODE_PRIVATE);
+		ServerAddress_ip = preferences.getString("ServerAddress_ip", "");
+		ServerAddress_Port = preferences.getString("ServerAddress_duankou", "");
+		accountCode = preferences.getString("AccountCode", "");
+		barcode_print_userCode = preferences.getString("UserCode", "");
+		password = preferences.getString("UserPassword", "");
+		sessionkey = preferences.getString("SessionKey", ""); 
+		tvTitle.setVisibility(View.VISIBLE);
+ 		tvTitle.setText("发货单一览");
+		// 同步状态下拉框赋值
+		initSynchronizationStatusData();
+		// 撤销状态下拉框赋值
+		initRevokeData();
+		// 调用车牌号下拉框
+		SendOutWarehouse("{\"type\":\"车牌号\"}", 0);
+		// 调用发出仓库下拉框
+		SendOutWarehouse("{\"type\":\"发出仓库\"}", 1);
+		// 调用接收仓库下拉框
+		SendOutWarehouse("{\"type\":\"接收仓库\"}", 2);
+		PostingDateWorker.setEnabled(true);
+		DeliveryDateWorker.setEnabled(true);
+		// 调用控件初始化逻辑
+		AllListeners();
+	}
+
+	private void initview() {
+	    tvTitle = (TextView) findViewById(R.id.title);
+		backbtn = (ImageButton) findViewById(R.id.left_img);
+		backtext = (TextView) findViewById(R.id.back); 
+		lstView = (CustomListView) findViewById(R.id.Invoice_listview);
+//		adapter = new DeliveryNoteInquiryItemAdapter(DeliveryNoteInquiryActivity.this, detailList);
+//		lstView.setAdapter(adapter);
+		spinnerSynchronizationStatus = (Spinner) findViewById(R.id.SynchronizationStatus_batchSp);
+		revoke = (Spinner) findViewById(R.id.revoke_batchSp);
+		LicensePlateNumber = (Spinner) findViewById(R.id.LicensePlateNumber_batchSp);
+		SendOutWarehouse = (Spinner) findViewById(R.id.SendOutWarehouse_batchSp);
+		ReceivingWarehouse = (Spinner) findViewById(R.id.ReceivingWarehouse_batchSp);
+		PostingDateWorker = (ImageView) findViewById(R.id.PostingDateIv);
+		DeliveryDateWorker = (ImageView) findViewById(R.id.DeliveryDateIv);
+		PostingDate_TextView = (TextView) findViewById(R.id.PostingDate_TextView);
+		DeliveryDate_TextView = (TextView) findViewById(R.id.DeliveryDate_TextView);
+		edt_barcode = (EditText) findViewById(R.id.edt_barcode);
+		select_Button = (Button) findViewById(R.id.select_Button);
+		revoke_Button = (Button) findViewById(R.id.revoke_Button);
+		SupplementaryPush_Button = (Button) findViewById(R.id.SupplementaryPush_Button);
+		Delete_Button = (Button) findViewById(R.id.Delete_Button);
+	}
+
+	/** 同步状态下拉框赋值 */
+	public void initSynchronizationStatusData() {
+		// 激活状态数据
+		List<Order> orderList = new ArrayList<Order>();
+		// 创建初始同步状态数据
+		List<String> OrderNoList = new ArrayList<String>();
+		OrderNoList.add("未同步");
+		OrderNoList.add("同步成功");
+		OrderNoList.add("同步失败");
+		// 赋值
+		for (int i = 0; i < OrderNoList.size(); i++) {
+			Order order = new Order();
+			order.setOrderId(i);
+			order.setOrderNo(OrderNoList.get(i));
+			orderList.add(order);
+		}
+		Order order = new Order();
+		order.setOrderId(4);
+		order.setOrderNo("请选择");
+		orderList.add(0, order);
+		// 控件赋值
+		orderspinnerAdapter = new OrderSpinnerAdapter(DeliveryNoteInquiryActivity.this, orderList);
+		spinnerSynchronizationStatus.setAdapter(orderspinnerAdapter);
+	}
+
+	/** 撤销状态下拉框赋值 */
+	public void initRevokeData() {
+		// 激活状态数据
+		List<Order> orderList = new ArrayList<Order>();
+		// 创建初始同步状态数据
+		List<String> OrderNoList = new ArrayList<String>();
+		OrderNoList.add("未撤销");
+		OrderNoList.add("撤销成功");
+		OrderNoList.add("撤销失败");
+		// 赋值
+		for (int i = 0; i < OrderNoList.size(); i++) {
+			Order order = new Order();
+			order.setOrderId(i);
+			order.setOrderNo(OrderNoList.get(i));
+			orderList.add(order);
+		}
+		Order order = new Order();
+		order.setOrderId(4);
+		order.setOrderNo("请选择");
+		orderList.add(0, order);
+		// 控件赋值
+		orderspinnerAdapter = new OrderSpinnerAdapter(DeliveryNoteInquiryActivity.this, orderList);
+		revoke.setAdapter(orderspinnerAdapter);
+	}
+
+	/**创建线程*/ 
+	Handler handler = new Handler() {
+		@Override
+		public void handleMessage(Message msg) {
+
+			switch (msg.what) {
+			// 车牌号
+			case 0:
+				List<Order> orderList0 = new ArrayList<Order>();
+				Order order0 = new Order();
+				order0.setOrderId(0);
+				order0.setOrderNo("请选择");
+				orderList0.add(order0);
+				Bundle b0 = msg.getData();
+				String result0 = b0.getString("result");
+				ObjectAssignment(result0, orderList0);
+				LicensePlateNumber.setAdapter(orderspinnerAdapter);
+				break;
+			// 发出仓库
+			case 1:
+				List<Order> orderList1 = new ArrayList<Order>();
+				Order order1 = new Order();
+				order1.setOrderId(0);
+				order1.setOrderNo("请选择");
+				orderList1.add(order1);
+				Bundle b1 = msg.getData();
+				String result1 = b1.getString("result");
+				ObjectAssignment(result1, orderList1);
+				SendOutWarehouse.setAdapter(orderspinnerAdapter);
+				break;
+			//接收仓库
+			case 2:
+				List<Order> orderList2 = new ArrayList<Order>();
+				Order order2 = new Order();
+				order2.setOrderId(0);
+				order2.setOrderNo("请选择");
+				orderList2.add(order2);
+				Bundle b2 = msg.getData();
+				String result2 = b2.getString("result");
+				ObjectAssignment(result2, orderList2);
+				ReceivingWarehouse.setAdapter(orderspinnerAdapter);
+				break;
+			// 发货单信息
+			case 3:
+				Bundle b3 = msg.getData();
+				String result3 = b3.getString("result");
+				detailList = ListObjectAssignment(result3);
+				adapter = new DeliveryNoteInquiryItemAdapter(DeliveryNoteInquiryActivity.this, detailList);
+				lstView.setAdapter(adapter);
+				break;
+			// 删除 撤销
+			case 4:
+				try {
+					Bundle b4 = msg.getData();
+					String result4 = b4.getString("result");
+					JSONObject jo = new JSONObject(result4);
+					JSONObject jobj = jo.optJSONObject("d");
+					int status = jobj.optInt("Status");
+					String message = jobj.optString("Message");
+					Message m = new Message();
+					m.what = 0;
+					Bundle b = new Bundle();
+					b.putString("message", message);
+					m.setData(b);
+					exceptionHandler.sendMessage(m); 
+					//重新查询发货单信息
+					QueryInformation();
+				} catch (Exception e) {
+					e.printStackTrace();
+				}
+				break;
+			}
+		}
+	};
+
+	/** 对象赋值 */
+	public void ObjectAssignment(String result, List<Order> orderList) {
+		try {
+			JSONObject jo = new JSONObject(result);
+			JSONObject jobj = jo.optJSONObject("d");
+			int status = jobj.optInt("Status"); 
+			if (status == 0) {
+
+				String result1 = jobj.optString("Result");
+				JSONArray jarray = new JSONArray(result1);
+				if (jarray != null && jarray.length() > 0) {
+					for (int i = 0; i < jarray.length(); i++) {
+						JSONObject jobj1 = jarray.optJSONObject(i);
+						Order order = new Order();
+						order.setOrderId(jobj1.optInt("数据ID"));
+						order.setOrderNo(jobj1.optString("数据名称"));
+						orderList.add(order);
+					}
+					// 控件赋值
+					orderspinnerAdapter = new OrderSpinnerAdapter(DeliveryNoteInquiryActivity.this, orderList);
+				}
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	/** 发货单信息列表数据处理 */
+	public List<DeliveryNoteInquiryItemModel> ListObjectAssignment(String result) {
+		List<DeliveryNoteInquiryItemModel> detailList = new ArrayList<DeliveryNoteInquiryItemModel>();
+		try {
+			JSONObject jo = new JSONObject(result);
+			JSONObject jobj = jo.optJSONObject("d");
+			int status = jobj.optInt("Status");
+			String message = jobj.optString("Message");
+			if (status == 0) {
+				String result1 = jobj.optString("Result");
+				JSONArray jarray = new JSONArray(result1);
+				if (jarray != null && jarray.length() > 0) {
+					for (int i = 0; i < jarray.length(); i++) {
+						JSONObject jobj1 = jarray.optJSONObject(i);
+						DeliveryNoteInquiryItemModel model = new DeliveryNoteInquiryItemModel();
+						model.setSenddoutgoodsLogID(String.valueOf(jobj1.optInt("总单ID")) );
+						model.setSendoutCode(jobj1.optString("发货单号")); 
+						model.setSendOutWarehouse(jobj1.optString("发出仓库"));
+						model.setReceivingWarehouse(jobj1.optString("接收仓库"));
+						model.setLicensePlateNumber(jobj1.optString("车牌号"));
+						model.setPostingDate(jobj1.optString("记账日期"));
+						model.setDeliveryDate(jobj1.optString("送货日期"));
+						model.setSynchronizationStatus(jobj1.optString("同步状态"));
+						model.setRevoke(jobj1.optString("撤销状态"));
+						model.setSyncstatusState(String.valueOf(jobj1.optInt("SYNCSTATUSSTATE")));
+						model.setRevokeState(String.valueOf(jobj1.optInt("REVOKESTATE")));
+						model.setAmendsState(String.valueOf(jobj1.optInt("AMENDSSTATE")));
+						detailList.add(model);
+					}
+				}
+			} else {
+				Bundle b = new Bundle();
+				Message m = new Message();
+				m.what = 0;
+				b.putString("message", message);
+				m.setData(b);
+				exceptionHandler.sendMessage(m);
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		return detailList;
+	}
+
+	/** 下拉框API */
+	public class ListAPIRunnable implements Runnable {
+		JSONObject js;
+		String API;
+		int what;
+
+		public ListAPIRunnable(JSONObject js, String API, int what) {
+			this.js = js;
+			this.API = API;
+			this.what = what;
+		}
+
+		@Override
+		public void run() {
+			Bundle b = new Bundle();
+			client = new WebClient();
+
+			try {
+				String result = client.doPost(API, js.toString(), "application/json");
+
+				Message m = new Message();
+				m.what = what;
+				b.putString("result", result);
+				m.setData(b);
+				handler.sendMessage(m);
+			} catch (Exception e) {
+				Message m = new Message();
+				// m.what = 2;
+				b.putString("message", "网络异常");
+				m.setData(b);
+				handler.sendMessage(m);
+				e.printStackTrace();
+			}
+		}
+	}
+
+	/** 初始化下拉框 */
+	public void SendOutWarehouse(String Data, int wath) {
+		JSONObject js = null;
+		try {
+			js = new JSONObject(Data);
+		} catch (JSONException e) {
+			// TODO 自动生成的 catch 块
+			e.printStackTrace();
+		}
+		thread = new HandlerThread("barcodeThread", 5);
+		thread.start();
+		mHandler = new Handler(thread.getLooper());
+		String API = "http://" + ServerAddress_ip + ":" + ServerAddress_Port + Constants.serverAction
+				+ "/SelectCARPLATENAMES";
+		ListAPIRunnable APIData = new ListAPIRunnable(js, API, wath);
+		mHandler.post(APIData);
+
+	}
+
+	/** 控件初始化逻辑 */
+	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();
+
+			}
+		});
+		
+		// 记账日期点击事件
+		PostingDateWorker.setOnClickListener(new View.OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				isPostingDateSelected = true;
+				initDate();
+				mTimePickerInfo.show(new Date(timeMillis));
+			}
+		});
+
+		// 送货日期点击事件
+		DeliveryDateWorker.setOnClickListener(new View.OnClickListener() {
+
+			@Override
+			public void onClick(View v) {
+				isDeliveryDateSelected = true;
+				initDate();
+				mTimePickerInfo.show(new Date(timeMillis));
+			}
+		});
+
+		// 查询按钮点击事件
+		select_Button.setOnClickListener(new View.OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				//发货单信息查询
+				QueryInformation();
+			}
+		});
+
+		// 撤销按钮点击事件
+		revoke_Button.setOnClickListener(new View.OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				// 锁
+				Boolean lock = true;
+				// 过滤出多选选中数据
+				List<DeliveryNoteInquiryItemModel> Wherelist = steamfilter();
+				// 总单id数据集合
+				List<String> ementy = new ArrayList<>();
+				// 遍历数据
+				for (DeliveryNoteInquiryItemModel item : Wherelist) {
+					ementy.add(item.getSenddoutgoodsLogID());
+					// 当同步状态不为1时
+					if (!item.getSyncstatusState().equals("1")) {
+						lock = false;
+						// 跳出循环
+						break;
+					}
+				}
+				if (!lock) {
+					Message m = new Message();
+					m.what = 0;
+					Bundle b = new Bundle();
+					b.putString("message", "选中含有未同步成功数据,不可以撤销");
+					m.setData(b);
+					exceptionHandler.sendMessage(m);
+					return;
+				}
+				try {
+					JSONObject js = new JSONObject();
+					js.put("accountCode", accountCode);
+					js.put("userCode", barcode_print_userCode);
+					js.put("userPassword", password);
+					js.put("sessionKey", sessionkey);
+					js.put("ementy", ementy.toString());
+					String API = "http://" + ServerAddress_ip + ":" + ServerAddress_Port + Constants.serverAction
+							+ "/RevokeInvoice";
+					thread = new HandlerThread("barcodeThread", 5);
+					thread.start();
+					mHandler = new Handler(thread.getLooper());
+					ButtonAPIRunnable Data = new ButtonAPIRunnable(js, API, 4);
+					mHandler.post(Data);
+				} 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();
+				} 
+			}
+		});
+
+		// 补推按钮点击事件
+		SupplementaryPush_Button.setOnClickListener(new View.OnClickListener() { 
+			@Override
+			public void onClick(View v) {
+				// 锁
+				Boolean lock = true;
+				// 过滤出多选选中数据
+				List<DeliveryNoteInquiryItemModel> Wherelist = steamfilter();
+				// 遍历数据
+				for (DeliveryNoteInquiryItemModel item : Wherelist) {
+					// 当同步状态为1时
+					if (item.getSyncstatusState().equals("1")) {
+						lock = false;
+						// 跳出循环
+						break;
+					}
+				}
+				if (!lock) {
+					Message m = new Message();
+					m.what = 0;
+					Bundle b = new Bundle();
+					b.putString("message", "选中含有同步成功数据,不可以补推");
+					m.setData(b);
+					exceptionHandler.sendMessage(m);
+					return;
+				}
+			}
+		});
+
+		// 删除按钮点击事件
+		Delete_Button.setOnClickListener(new View.OnClickListener() {
+			@Override
+			public void onClick(View v) {
+				// 锁
+				Boolean lock = true;
+				// 过滤出多选选中数据
+				List<DeliveryNoteInquiryItemModel> Wherelist = steamfilter();
+				// 总单id数据集合
+				List<String> ementy = new ArrayList<>();
+				// 遍历数据
+				for (DeliveryNoteInquiryItemModel item : Wherelist) {
+					ementy.add(item.getSenddoutgoodsLogID());
+					// 当同步状态为1时
+					if (item.getSyncstatusState().equals("1")) {
+						lock = false;
+						// 跳出循环
+						break;
+					}
+				}
+				if (!lock) {
+					Message m = new Message();
+					m.what = 0;
+					Bundle b = new Bundle();
+					b.putString("message", "选中含有同步成功数据,不可以删除");
+					m.setData(b);
+					exceptionHandler.sendMessage(m);
+					return;
+				}
+				try {
+					JSONObject js = new JSONObject();
+					js.put("accountCode", accountCode);
+					js.put("userCode", barcode_print_userCode);
+					js.put("userPassword", password);
+					js.put("sessionKey", sessionkey);
+					js.put("ementy", ementy.toString());
+					String API = "http://" + ServerAddress_ip + ":" + ServerAddress_Port + Constants.serverAction
+							+ "/DestroyInvoice";
+					thread = new HandlerThread("barcodeThread", 5);
+					thread.start();
+					mHandler = new Handler(thread.getLooper());
+					ButtonAPIRunnable Data = new ButtonAPIRunnable(js, API, 4);
+					mHandler.post(Data);
+				} 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();
+				}
+			}
+		});
+	}
+
+	/** 过滤多选框选中 */
+	public List<DeliveryNoteInquiryItemModel> steamfilter() {
+		List<DeliveryNoteInquiryItemModel> Wherelist = new ArrayList<DeliveryNoteInquiryItemModel>();
+		for (DeliveryNoteInquiryItemModel item : detailList) {
+			if (item.CheckBoxFlag.booleanValue()) {
+				Wherelist.add(item);
+			}
+		}
+		return Wherelist;
+	}
+
+	/** 初始化日期变量 */
+	private void initDate() {
+		timeMillis = System.currentTimeMillis();
+		mTimePickerInfo = new TimePickerInfo(DeliveryNoteInquiryActivity.this, TimePickerInfo.Type.YEAR_MONTH_DAY);
+		mTimePickerInfo.setCyclic(true);
+		mTimePickerInfo.setCancelable(true);
+		mTimePickerInfo.setOnTimeSelectListener(new TimePickerInfo.OnTimeSelectListener() {
+			@SuppressLint("SimpleDateFormat")
+			@Override
+			public void onTimeSelect(Date date) {
+				// 存储当前选中的date
+				SimpleDateFormat dateFormater = new SimpleDateFormat("yyyy-MM-dd");
+				Date mSelectedDate = date;
+				String selectedDate = dateFormater.format(mSelectedDate);
+				if (isPostingDateSelected) {
+					PostingDate_TextView.setText(selectedDate);
+					isPostingDateSelected = false;
+				}
+				if (isDeliveryDateSelected) {
+					DeliveryDate_TextView.setText(selectedDate);
+					isDeliveryDateSelected = false;
+				}
+			}
+		});
+
+	}
+
+	/** 按钮点击API */
+	public class ButtonAPIRunnable implements Runnable {
+		JSONObject js;
+		String API;
+		int what;
+
+		public ButtonAPIRunnable(JSONObject js, String API, int what) {
+			this.js = js;
+			this.API = API;
+			this.what = what;
+		}
+
+		@Override
+		public void run() {
+			Bundle b = new Bundle();
+			client = new WebClient();
+
+			try {
+				String result = client.doPost(API, js.toString(), "application/json");
+
+				Message m = new Message();
+				m.what = what;
+				b.putString("result", result);
+				m.setData(b);
+				handler.sendMessage(m);
+			} catch (Exception e) {
+				Message m = new Message();
+				m.what = 0;
+				b.putString("message", "网络异常");
+				m.setData(b);
+				exceptionHandler.sendMessage(m);
+				e.printStackTrace();
+			}
+		}
+	}
+
+	/**发货单信息查询*/
+	public void QueryInformation() {
+		try {
+			JSONObject js = new JSONObject();
+			js.put("accountCode", accountCode);
+			js.put("userCode", barcode_print_userCode);
+			js.put("userPassword", password);
+			js.put("sessionKey", sessionkey);
+			JSONObject ementy = new JSONObject();
+			// 生产工号
+			ementy.put("ProductionID", edt_barcode.getText().toString());
+			// 发出仓库
+			Order SendOutWarehouseInfo = (Order) SendOutWarehouse.getSelectedItem();
+			ementy.put("SendOutWarehouse", String.valueOf(SendOutWarehouseInfo.getOrderId()));
+			// 接受仓库
+			Order ReceivingWarehouseInfo = (Order) ReceivingWarehouse.getSelectedItem();
+			ementy.put("ReceivingWarehouse", String.valueOf(ReceivingWarehouseInfo.getOrderId()));
+			// 车牌号
+			Order LicensePlateNumberInfo = (Order) LicensePlateNumber.getSelectedItem();
+			ementy.put("LicensePlateNumber", String.valueOf(LicensePlateNumberInfo.getOrderId()));
+			// 记账日期
+			ementy.put("PostingDate", PostingDate_TextView.getText().toString());
+			// 送货日期
+			ementy.put("DeliveryDate", DeliveryDate_TextView.getText().toString());
+			// 同步状态
+			Order classifyInfo = (Order) spinnerSynchronizationStatus.getSelectedItem();
+			ementy.put("SynchronizationStatus", String.valueOf(classifyInfo.getOrderId()));
+			// 撤销状态
+			Order revokeInfo = (Order) revoke.getSelectedItem();
+			ementy.put("Revoke", String.valueOf(revokeInfo.getOrderId()));
+			js.put("ementy", ementy);
+			String API = "http://" + ServerAddress_ip + ":" + ServerAddress_Port + Constants.serverAction
+					+ "/SelectDeliveryNoteInquiry";
+			thread = new HandlerThread("barcodeThread", 5);
+			thread.start();
+			mHandler = new Handler(thread.getLooper());
+			ButtonAPIRunnable Data = new ButtonAPIRunnable(js, API, 3);
+			mHandler.post(Data);
+		} 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 exceptionHandler = new Handler() {
+		@Override
+		public void handleMessage(Message msg) {
+			switch (msg.what) {
+			case 0:
+				ProcessDialogUtils.closeProgressDilog();
+				if (mHandler != null) {
+					mHandler.removeCallbacksAndMessages(null);
+					mHandler.getLooper().quit();
+				}
+
+				Bundle b1 = msg.getData();
+				String message1 = b1.getString("message");
+				CommonUtil.showRepeatDialog(message1, DeliveryNoteInquiryActivity.this);
+				break;
+			}
+		}
+	};
+}

File diff suppressed because it is too large
+ 838 - 822
src/com/jiaju/activity/HomeActivity.java


+ 128 - 0
src/com/jiaju/adapter/DeliveryNoteInquiryItemAdapter.java

@@ -0,0 +1,128 @@
+package com.jiaju.adapter;
+
+import java.util.List;
+
+import com.jiaju.activity.R; 
+import com.jiaju.model.DefectDataDetailModel;
+import com.jiaju.model.DeliveryNoteInquiryItemModel;
+
+import android.app.Activity;
+import android.content.Context;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.view.ViewGroup;
+import android.widget.BaseAdapter;
+import android.widget.CheckBox;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+import android.widget.Toast;
+
+public class DeliveryNoteInquiryItemAdapter extends BaseAdapter{ 
+	private List<DeliveryNoteInquiryItemModel> list = null;
+	private Context mContext; 
+	
+	@Override
+	public int getCount() {
+		return list.size();
+	}
+
+	@Override
+	public Object getItem(int position) {
+		return list.get(position);
+	}
+
+	@Override
+	public long getItemId(int position) {
+		return position;
+	}
+	
+	public DeliveryNoteInquiryItemAdapter(Context pContext,  List<DeliveryNoteInquiryItemModel> list) {
+		super(); 
+		this.list = list;
+		this.mContext = pContext;
+
+	}
+
+	@Override
+	public View getView(final int position, View convertView, ViewGroup parent) {
+		DeliveryNoteInquiryItemModel deliverynoteInquiryitemModel = null;
+		if (list.size() > 0) {
+			deliverynoteInquiryitemModel = list.get(position);
+		}
+		ViewHolder viewHolder = null;
+		viewHolder = new ViewHolder();
+
+		if (convertView == null) {
+			LayoutInflater _LayoutInflater = LayoutInflater.from(mContext);
+			convertView = _LayoutInflater.inflate(R.layout.activity_delivery_note_inquiry_item, null); 
+			viewHolder.SendoutCodeTv = (TextView) convertView.findViewById(R.id.ShippingOrderNumber);
+			viewHolder.SendOutWarehouseTv = (TextView) convertView.findViewById(R.id.SendOutWarehouse);
+			viewHolder.ReceivingWarehouseTv = (TextView) convertView.findViewById(R.id.ReceivingWarehouse);
+			viewHolder.LicensePlateNumberTv = (TextView) convertView.findViewById(R.id.LicensePlateNumber);
+			viewHolder.PostingDateTv = (TextView) convertView.findViewById(R.id.PostingDate);
+			viewHolder.DeliveryDateTv = (TextView) convertView.findViewById(R.id.DeliveryDate);
+			viewHolder.SynchronizationStatusTv = (TextView) convertView.findViewById(R.id.SynchronizationStatus);
+			viewHolder.RevokeTv = (TextView) convertView.findViewById(R.id.revoke); 
+			viewHolder.linQINQI = (LinearLayout) convertView.findViewById(R.id.lin_jump);
+			viewHolder.CheckBoxDetail = (CheckBox) convertView.findViewById(R.id.checkBox_detail);
+			convertView.setTag(viewHolder); 
+		} else {
+			viewHolder = (ViewHolder) convertView.getTag();
+		}
+		 
+		viewHolder.SendoutCodeTv.setText(deliverynoteInquiryitemModel.getSendoutCode());
+		viewHolder.SendOutWarehouseTv.setText(deliverynoteInquiryitemModel.getSendOutWarehouse());
+		viewHolder.ReceivingWarehouseTv.setText(deliverynoteInquiryitemModel.getReceivingWarehouse());
+		viewHolder.LicensePlateNumberTv.setText(deliverynoteInquiryitemModel.getLicensePlateNumber());
+		viewHolder.PostingDateTv.setText(deliverynoteInquiryitemModel.getPostingDate());
+		viewHolder.DeliveryDateTv.setText(deliverynoteInquiryitemModel.getDeliveryDate());
+		viewHolder.SynchronizationStatusTv.setText(deliverynoteInquiryitemModel.getSynchronizationStatus());
+		viewHolder.RevokeTv.setText(deliverynoteInquiryitemModel.getRevoke());
+		viewHolder.CheckBoxDetail.setOnClickListener(new View.OnClickListener() {
+	            @Override
+	            public void onClick(View v) {
+	                 ViewHolder holder = (ViewHolder) ((View) v.getParent()).getTag();
+	            	   
+	                // 获取数据集合
+	                List<DeliveryNoteInquiryItemModel> dataList = list ; 
+	                // 修改对应位置的数据的CheckBoxFlag属性值
+	                dataList.get(position).setCheckBoxFlag(((CheckBox) v).isChecked());
+	                // 通知ListView数据已更改,以便更新界面显示 
+	                  notifyDataSetChanged(); 
+//	                if (((CheckBox) v).isChecked()) {
+//	                    Toast.makeText(mContext, "复选框已选中", Toast.LENGTH_SHORT).show();
+//	                    
+//	                } else {
+//	                    Toast.makeText(mContext, "复选框已取消选中", Toast.LENGTH_SHORT).show();
+//	                }
+	            }
+	        });
+	 
+		return convertView;
+	} 
+	
+	private class ViewHolder {
+		/**发货单号*/
+		TextView SendoutCodeTv;
+		/**发出仓库*/
+		TextView SendOutWarehouseTv;
+		/**接收仓库*/
+		TextView ReceivingWarehouseTv;
+		/**车牌号*/
+		TextView LicensePlateNumberTv;
+		/**记账日期*/
+		TextView PostingDateTv;
+		/**送货日期*/
+		TextView DeliveryDateTv;
+		/**同步状态*/
+		TextView SynchronizationStatusTv;
+		/**撤销状态*/
+		TextView RevokeTv; 
+		/**多选按钮*/
+		CheckBox CheckBoxDetail; 
+		/**点击布局*/
+		LinearLayout linQINQI;
+		 
+	}
+	 
+}

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

@@ -29,6 +29,7 @@ import com.jiaju.activity.ClockInActivity;
 import com.jiaju.activity.ComponentsBreakageQuantityOkActivity;
 import com.jiaju.activity.ComponentsBreakageScanOkActivity;
 import com.jiaju.activity.CoverPlateModelActivity;
+import com.jiaju.activity.DeliveryNoteInquiryActivity;
 import com.jiaju.activity.DryRepairActivity;
 import com.jiaju.activity.EditGroutingRegisterActivity;
 import com.jiaju.activity.ExternalPackingBarcodePrintActivity;
@@ -1143,6 +1144,14 @@ public class ProductLineExpandableListView extends ExpandableListView
 			i.setClass(mContext, CancelPackingActivity.class);
 			mContext.startActivity(i);
 
+		} else if (procedureName.equals("发货单一览")) {
+			Intent i = new Intent();
+			Bundle b = new Bundle();
+			b.putString("procedureName", procedureName);
+			i.putExtras(b);
+			i.setClass(mContext, DeliveryNoteInquiryActivity.class);
+			mContext.startActivity(i);
+
 		} else if (procedureName.equals("损坯撤销")) {
 			Intent i = new Intent();
 			Bundle b = new Bundle();

+ 139 - 0
src/com/jiaju/model/DeliveryNoteInquiryItemModel.java

@@ -0,0 +1,139 @@
+package com.jiaju.model;
+
+public class DeliveryNoteInquiryItemModel {
+	private static final long serialVersionUID = 1L;
+	/**
+	 * 总单ID
+	 * */
+	public String SenddoutgoodsLogID; 
+	/**
+	 * 发货单号
+	 * */
+	public String SendoutCode; 
+	/**
+	 * 发出仓库
+	 * */
+	public String SendOutWarehouse;
+	/**
+	 * 接收仓库
+	 * */
+	public String ReceivingWarehouse;
+	/**
+	 * 车牌号
+	 * */
+	public String LicensePlateNumber;
+	/**
+	 * 记账日期
+	 * */
+	public String PostingDate;
+	/**
+	 * 送货日期
+	 * */
+	public String DeliveryDate;
+	/**
+	 * 同步状态
+	 * */
+	public String SynchronizationStatus;
+	/**
+	 * 撤销状态
+	 * */
+	public String Revoke;
+	/**
+	 * 勾选标识
+	 * */
+	public Boolean CheckBoxFlag=false;
+	/**同步状态码*/
+	public String SyncstatusState;
+	/**撤销状态码*/
+	public String RevokeState;
+	/**补推状态码*/
+	public String AmendsState;
+	public String getSenddoutgoodsLogID() {
+		return SenddoutgoodsLogID;
+	}
+	public void setSenddoutgoodsLogID(String senddoutgoodsLogID) {
+		SenddoutgoodsLogID = senddoutgoodsLogID;
+	}
+	public String getSendoutCode() {
+		return SendoutCode;
+	}
+	public void setSendoutCode(String sendoutCode) {
+		SendoutCode = sendoutCode;
+	}
+	public String getSendOutWarehouse() {
+		return SendOutWarehouse;
+	}
+	public void setSendOutWarehouse(String sendOutWarehouse) {
+		SendOutWarehouse = sendOutWarehouse;
+	}
+	public String getReceivingWarehouse() {
+		return ReceivingWarehouse;
+	}
+	public void setReceivingWarehouse(String receivingWarehouse) {
+		ReceivingWarehouse = receivingWarehouse;
+	}
+	public String getLicensePlateNumber() {
+		return LicensePlateNumber;
+	}
+	public void setLicensePlateNumber(String licensePlateNumber) {
+		LicensePlateNumber = licensePlateNumber;
+	}
+	public String getPostingDate() {
+		return PostingDate;
+	}
+	public void setPostingDate(String postingDate) {
+		PostingDate = postingDate;
+	}
+	public String getDeliveryDate() {
+		return DeliveryDate;
+	}
+	public void setDeliveryDate(String deliveryDate) {
+		DeliveryDate = deliveryDate;
+	}
+	public String getSynchronizationStatus() {
+		return SynchronizationStatus;
+	}
+	public void setSynchronizationStatus(String synchronizationStatus) {
+		SynchronizationStatus = synchronizationStatus;
+	}
+	public String getRevoke() {
+		return Revoke;
+	}
+	public void setRevoke(String revoke) {
+		Revoke = revoke;
+	}
+	public Boolean getCheckBoxFlag() {
+		return CheckBoxFlag;
+	}
+	public void setCheckBoxFlag(Boolean checkBoxFlag) {
+		CheckBoxFlag = checkBoxFlag;
+	}
+	public String getSyncstatusState() {
+		return SyncstatusState;
+	}
+	public void setSyncstatusState(String syncstatusState) {
+		SyncstatusState = syncstatusState;
+	}
+	public String getRevokeState() {
+		return RevokeState;
+	}
+	public void setRevokeState(String revokeState) {
+		RevokeState = revokeState;
+	}
+	public String getAmendsState() {
+		return AmendsState;
+	}
+	public void setAmendsState(String amendsState) {
+		AmendsState = amendsState;
+	}
+	@Override
+	public String toString() {
+		return "DeliveryNoteInquiryItemModel [SenddoutgoodsLogID=" + SenddoutgoodsLogID + ", ShippingOrderNumber="
+				+ SendoutCode + ", SendOutWarehouse=" + SendOutWarehouse + ", ReceivingWarehouse="
+				+ ReceivingWarehouse + ", LicensePlateNumber=" + LicensePlateNumber + ", PostingDate=" + PostingDate
+				+ ", DeliveryDate=" + DeliveryDate + ", SynchronizationStatus=" + SynchronizationStatus + ", Revoke="
+				+ Revoke + ", CheckBoxFlag=" + CheckBoxFlag + ", SyncstatusState=" + SyncstatusState + ", RevokeState="
+				+ RevokeState + ", AmendsState=" + AmendsState + "]";
+	}
+	 
+}

Some files were not shown because too many files changed in this diff