|
@@ -1,4 +1,5 @@
|
|
|
package com.jiaju.activity;
|
|
package com.jiaju.activity;
|
|
|
|
|
+
|
|
|
import java.io.Serializable;
|
|
import java.io.Serializable;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -6,6 +7,7 @@ import java.util.List;
|
|
|
import org.json.JSONArray;
|
|
import org.json.JSONArray;
|
|
|
import org.json.JSONException;
|
|
import org.json.JSONException;
|
|
|
import org.json.JSONObject;
|
|
import org.json.JSONObject;
|
|
|
|
|
+import org.w3c.dom.Text;
|
|
|
|
|
|
|
|
import com.jiaju.adapter.HandOverAdapter;
|
|
import com.jiaju.adapter.HandOverAdapter;
|
|
|
import com.jiaju.adapter.OrderSpinnerAdapter;
|
|
import com.jiaju.adapter.OrderSpinnerAdapter;
|
|
@@ -16,6 +18,7 @@ import com.jiaju.net.WebClient;
|
|
|
import com.jiaju.utils.CommonUtil;
|
|
import com.jiaju.utils.CommonUtil;
|
|
|
import com.jiaju.utils.Constants;
|
|
import com.jiaju.utils.Constants;
|
|
|
import com.jiaju.utils.CustomToast;
|
|
import com.jiaju.utils.CustomToast;
|
|
|
|
|
+import com.jiaju.utils.ExitAppDialog;
|
|
|
import com.jiaju.utils.ProcessDialogUtils;
|
|
import com.jiaju.utils.ProcessDialogUtils;
|
|
|
import com.jiaju.utils.Removeduplicate;
|
|
import com.jiaju.utils.Removeduplicate;
|
|
|
|
|
|
|
@@ -51,6 +54,7 @@ import android.widget.ListView;
|
|
|
import android.widget.RelativeLayout;
|
|
import android.widget.RelativeLayout;
|
|
|
import android.widget.Spinner;
|
|
import android.widget.Spinner;
|
|
|
import android.widget.TextView;
|
|
import android.widget.TextView;
|
|
|
|
|
+
|
|
|
//产成品交接
|
|
//产成品交接
|
|
|
public class FinishedProductHandOverActivity extends Activity {
|
|
public class FinishedProductHandOverActivity extends Activity {
|
|
|
private TextView tvTitle;
|
|
private TextView tvTitle;
|
|
@@ -86,11 +90,14 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
private boolean isBarcodeTextChange;
|
|
private boolean isBarcodeTextChange;
|
|
|
private RelativeLayout parent;
|
|
private RelativeLayout parent;
|
|
|
private TextView statisticsTv;
|
|
private TextView statisticsTv;
|
|
|
- private static final String[] m = {"APP1", "APP2", "APP3"};
|
|
|
|
|
|
|
+ private static final String[] m = { "APP1", "APP2", "APP3" };
|
|
|
private Spinner spinner;
|
|
private Spinner spinner;
|
|
|
private String spinnerName = "APP2";
|
|
private String spinnerName = "APP2";
|
|
|
private String spinner_ = "";
|
|
private String spinner_ = "";
|
|
|
private boolean first = true;
|
|
private boolean first = true;
|
|
|
|
|
+ private ExitAppDialog dialog;
|
|
|
|
|
+ private JSONArray arry4;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
|
super.onCreate(savedInstanceState);
|
|
super.onCreate(savedInstanceState);
|
|
@@ -119,7 +126,7 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
tvTitle.setText(title);
|
|
tvTitle.setText(title);
|
|
|
orderEdt.setFocusable(true);
|
|
orderEdt.setFocusable(true);
|
|
|
orderEdt.requestFocus();
|
|
orderEdt.requestFocus();
|
|
|
- orderEdt.findFocus();
|
|
|
|
|
|
|
+ orderEdt.findFocus();
|
|
|
allListeners();
|
|
allListeners();
|
|
|
thread = new HandlerThread("trademarkThread", 5);
|
|
thread = new HandlerThread("trademarkThread", 5);
|
|
|
thread.start();
|
|
thread.start();
|
|
@@ -127,10 +134,10 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
OrderListRunnable orderListRunnable = new OrderListRunnable(obj);
|
|
OrderListRunnable orderListRunnable = new OrderListRunnable(obj);
|
|
|
mHandler.post(orderListRunnable);
|
|
mHandler.post(orderListRunnable);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
// 使用数组形式操作
|
|
// 使用数组形式操作
|
|
|
class SpinnerSelectedListener implements OnItemSelectedListener {
|
|
class SpinnerSelectedListener implements OnItemSelectedListener {
|
|
|
- public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,
|
|
|
|
|
- long arg3) {
|
|
|
|
|
|
|
+ public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
|
|
|
if (first) {
|
|
if (first) {
|
|
|
first = false;
|
|
first = false;
|
|
|
} else {
|
|
} else {
|
|
@@ -144,37 +151,37 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
editor1.commit();
|
|
editor1.commit();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
public void onNothingSelected(AdapterView<?> arg0) {
|
|
public void onNothingSelected(AdapterView<?> arg0) {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
private void initView() {
|
|
private void initView() {
|
|
|
tvTitle = (TextView) findViewById(R.id.title);
|
|
tvTitle = (TextView) findViewById(R.id.title);
|
|
|
ivBack = (ImageButton) findViewById(R.id.left_img);
|
|
ivBack = (ImageButton) findViewById(R.id.left_img);
|
|
|
tvBack = (TextView) findViewById(R.id.back);
|
|
tvBack = (TextView) findViewById(R.id.back);
|
|
|
- View head = View.inflate(this,
|
|
|
|
|
- R.layout.finished_product_handover_head_view, null);
|
|
|
|
|
|
|
+ View head = View.inflate(this, R.layout.finished_product_handover_head_view, null);
|
|
|
orderSpinner = (Spinner) head.findViewById(R.id.orderSpinner);
|
|
orderSpinner = (Spinner) head.findViewById(R.id.orderSpinner);
|
|
|
statisticsTv = (TextView) findViewById(R.id.frequencyclearid);
|
|
statisticsTv = (TextView) findViewById(R.id.frequencyclearid);
|
|
|
barcodeEdt = (EditText) head.findViewById(R.id.barcodeEdt);
|
|
barcodeEdt = (EditText) head.findViewById(R.id.barcodeEdt);
|
|
|
barcodeEdt.setRawInputType(InputType.TYPE_CLASS_NUMBER);
|
|
barcodeEdt.setRawInputType(InputType.TYPE_CLASS_NUMBER);
|
|
|
barcodeLst = (ListView) findViewById(R.id.handoverlst);
|
|
barcodeLst = (ListView) findViewById(R.id.handoverlst);
|
|
|
barcodeLst.addHeaderView(head, null, false);
|
|
barcodeLst.addHeaderView(head, null, false);
|
|
|
- handoverAdapter = new HandOverAdapter(
|
|
|
|
|
- FinishedProductHandOverActivity.this, barcodeInfoList);
|
|
|
|
|
|
|
+ handoverAdapter = new HandOverAdapter(FinishedProductHandOverActivity.this, barcodeInfoList);
|
|
|
barcodeLst.setAdapter(handoverAdapter);
|
|
barcodeLst.setAdapter(handoverAdapter);
|
|
|
saveBtn = (Button) findViewById(R.id.saveBtn);
|
|
saveBtn = (Button) findViewById(R.id.saveBtn);
|
|
|
orderEdt = (EditText) head.findViewById(R.id.orderEdt);
|
|
orderEdt = (EditText) head.findViewById(R.id.orderEdt);
|
|
|
parent = (RelativeLayout) findViewById(R.id.parentRel);
|
|
parent = (RelativeLayout) findViewById(R.id.parentRel);
|
|
|
// view = (TextView) findViewById(R.id.spinnerText);
|
|
// view = (TextView) findViewById(R.id.spinnerText);
|
|
|
spinner = (Spinner) head.findViewById(R.id.Spinner01);
|
|
spinner = (Spinner) head.findViewById(R.id.Spinner01);
|
|
|
- adapter1 = new SapSpinnerAdapter(FinishedProductHandOverActivity.this,
|
|
|
|
|
- m);
|
|
|
|
|
|
|
+ adapter1 = new SapSpinnerAdapter(FinishedProductHandOverActivity.this, m);
|
|
|
spinner.setAdapter(adapter1);
|
|
spinner.setAdapter(adapter1);
|
|
|
// 添加事件Spinner事件监听
|
|
// 添加事件Spinner事件监听
|
|
|
spinner.setOnItemSelectedListener(new SpinnerSelectedListener());
|
|
spinner.setOnItemSelectedListener(new SpinnerSelectedListener());
|
|
|
// 设置默认值
|
|
// 设置默认值
|
|
|
spinner.setVisibility(View.VISIBLE);
|
|
spinner.setVisibility(View.VISIBLE);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
private void allListeners() {
|
|
private void allListeners() {
|
|
|
ivBack.setOnClickListener(new OnClickListener() {
|
|
ivBack.setOnClickListener(new OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
@@ -192,65 +199,58 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
Intent intent = new Intent();
|
|
Intent intent = new Intent();
|
|
|
- intent.setClass(FinishedProductHandOverActivity.this,
|
|
|
|
|
- FinishedProductHandOverSumReportActivity.class);
|
|
|
|
|
|
|
+ intent.setClass(FinishedProductHandOverActivity.this, FinishedProductHandOverSumReportActivity.class);
|
|
|
startActivity(intent);
|
|
startActivity(intent);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- orderSpinner.setOnItemSelectedListener(
|
|
|
|
|
- new Spinner.OnItemSelectedListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onItemSelected(AdapterView<?> arg0, View arg1,
|
|
|
|
|
- int arg2, long arg3) {
|
|
|
|
|
- Order order = (Order) arg0.getItemAtPosition(arg2);
|
|
|
|
|
- String orderNo = order.getOrderNo();
|
|
|
|
|
- int orderId = order.getOrderId();
|
|
|
|
|
- if (orderId == -1) {
|
|
|
|
|
- orderEdt.setText("");
|
|
|
|
|
- orderEdt.setFocusable(true);
|
|
|
|
|
- orderEdt.requestFocus();
|
|
|
|
|
- orderEdt.findFocus();
|
|
|
|
|
- } else {
|
|
|
|
|
- orderEdt.setText(orderNo);
|
|
|
|
|
- barcodeEdt.setFocusable(true);
|
|
|
|
|
- barcodeEdt.requestFocus();
|
|
|
|
|
- barcodeEdt.findFocus();
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- @Override
|
|
|
|
|
- public void onNothingSelected(AdapterView<?> arg0) {
|
|
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ orderSpinner.setOnItemSelectedListener(new Spinner.OnItemSelectedListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onItemSelected(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
|
|
|
|
|
+ Order order = (Order) arg0.getItemAtPosition(arg2);
|
|
|
|
|
+ String orderNo = order.getOrderNo();
|
|
|
|
|
+ int orderId = order.getOrderId();
|
|
|
|
|
+ if (orderId == -1) {
|
|
|
|
|
+ orderEdt.setText("");
|
|
|
|
|
+ orderEdt.setFocusable(true);
|
|
|
|
|
+ orderEdt.requestFocus();
|
|
|
|
|
+ orderEdt.findFocus();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ orderEdt.setText(orderNo);
|
|
|
|
|
+ barcodeEdt.setFocusable(true);
|
|
|
|
|
+ barcodeEdt.requestFocus();
|
|
|
|
|
+ barcodeEdt.findFocus();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onNothingSelected(AdapterView<?> arg0) {
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
saveBtn.setOnClickListener(new View.OnClickListener() {
|
|
saveBtn.setOnClickListener(new View.OnClickListener() {
|
|
|
@Override
|
|
@Override
|
|
|
public void onClick(View v) {
|
|
public void onClick(View v) {
|
|
|
Order order = (Order) orderSpinner.getSelectedItem();
|
|
Order order = (Order) orderSpinner.getSelectedItem();
|
|
|
int orderId;
|
|
int orderId;
|
|
|
if (order == null) {
|
|
if (order == null) {
|
|
|
- CustomToast.showToast(getApplicationContext(), "订单不能为空",
|
|
|
|
|
- 2000);
|
|
|
|
|
|
|
+ CustomToast.showToast(getApplicationContext(), "订单不能为空", 2000);
|
|
|
return;
|
|
return;
|
|
|
} else {
|
|
} else {
|
|
|
orderId = order.getOrderId();
|
|
orderId = order.getOrderId();
|
|
|
if (orderId == -1) {
|
|
if (orderId == -1) {
|
|
|
- CustomToast.showToast(getApplicationContext(), "请选择订单",
|
|
|
|
|
- 2000);
|
|
|
|
|
|
|
+ CustomToast.showToast(getApplicationContext(), "请选择订单", 2000);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (barcodeInfoList == null || barcodeInfoList.size() == 0) {
|
|
if (barcodeInfoList == null || barcodeInfoList.size() == 0) {
|
|
|
- CustomToast.showToast(getApplicationContext(), "条码信息不能为空",
|
|
|
|
|
- 2000);
|
|
|
|
|
|
|
+ CustomToast.showToast(getApplicationContext(), "条码信息不能为空", 2000);
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- ProcessDialogUtils.showProcessDialog(
|
|
|
|
|
- FinishedProductHandOverActivity.this);
|
|
|
|
|
|
|
+ ProcessDialogUtils.showProcessDialog(FinishedProductHandOverActivity.this);
|
|
|
thread = null;
|
|
thread = null;
|
|
|
thread = new HandlerThread("saveThread", 5);
|
|
thread = new HandlerThread("saveThread", 5);
|
|
|
thread.start();
|
|
thread.start();
|
|
|
mHandler = new Handler(thread.getLooper());
|
|
mHandler = new Handler(thread.getLooper());
|
|
|
- SaveRunnable saveRunnable = new SaveRunnable(obj,
|
|
|
|
|
- String.valueOf(orderId));
|
|
|
|
|
|
|
+ SaveRunnable saveRunnable = new SaveRunnable(obj, String.valueOf(orderId));
|
|
|
mHandler.post(saveRunnable);
|
|
mHandler.post(saveRunnable);
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
@@ -289,54 +289,48 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
//
|
|
//
|
|
|
// }
|
|
// }
|
|
|
// });
|
|
// });
|
|
|
- orderEdt.setOnEditorActionListener(
|
|
|
|
|
- new TextView.OnEditorActionListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean onEditorAction(TextView v, int actionId,
|
|
|
|
|
- KeyEvent event) {
|
|
|
|
|
- if (actionId == EditorInfo.IME_ACTION_GO) {
|
|
|
|
|
- String order = orderEdt.getText().toString();
|
|
|
|
|
- if (!TextUtils.isEmpty(order)) {
|
|
|
|
|
- if (orderList != null && orderList.size() > 0) {
|
|
|
|
|
- int orderIndex = getOrderIndex(order,
|
|
|
|
|
- orderList);
|
|
|
|
|
- if (orderSpinner != null) {
|
|
|
|
|
- if (orderIndex == -1) {
|
|
|
|
|
- orderSpinner.setSelection(0);
|
|
|
|
|
- orderEdt.setText("");
|
|
|
|
|
- orderEdt.setFocusable(true);
|
|
|
|
|
- orderEdt.requestFocus();
|
|
|
|
|
- orderEdt.findFocus();
|
|
|
|
|
- return true;
|
|
|
|
|
- } else {
|
|
|
|
|
- barcodeEdt.requestFocus();
|
|
|
|
|
- barcodeEdt.findFocus();
|
|
|
|
|
- orderSpinner
|
|
|
|
|
- .setSelection(orderIndex);
|
|
|
|
|
- Order orderModel = (Order) orderSpinner
|
|
|
|
|
- .getSelectedItem();
|
|
|
|
|
- orderEdt.setText(
|
|
|
|
|
- orderModel.getOrderNo());
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ orderEdt.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
|
|
+ if (actionId == EditorInfo.IME_ACTION_GO) {
|
|
|
|
|
+ String order = orderEdt.getText().toString();
|
|
|
|
|
+ if (!TextUtils.isEmpty(order)) {
|
|
|
|
|
+ if (orderList != null && orderList.size() > 0) {
|
|
|
|
|
+ int orderIndex = getOrderIndex(order, orderList);
|
|
|
|
|
+ if (orderSpinner != null) {
|
|
|
|
|
+ if (orderIndex == -1) {
|
|
|
|
|
+ orderSpinner.setSelection(0);
|
|
|
|
|
+ orderEdt.setText("");
|
|
|
|
|
+ orderEdt.setFocusable(true);
|
|
|
|
|
+ orderEdt.requestFocus();
|
|
|
|
|
+ orderEdt.findFocus();
|
|
|
|
|
+ return true;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ barcodeEdt.requestFocus();
|
|
|
|
|
+ barcodeEdt.findFocus();
|
|
|
|
|
+ orderSpinner.setSelection(orderIndex);
|
|
|
|
|
+ Order orderModel = (Order) orderSpinner.getSelectedItem();
|
|
|
|
|
+ orderEdt.setText(orderModel.getOrderNo());
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return false;
|
|
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
orderEdt.addTextChangedListener(new TextWatcher() {
|
|
orderEdt.addTextChangedListener(new TextWatcher() {
|
|
|
@Override
|
|
@Override
|
|
|
public void afterTextChanged(Editable arg0) {
|
|
public void afterTextChanged(Editable arg0) {
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- public void beforeTextChanged(CharSequence s, int start, int count,
|
|
|
|
|
- int after) {
|
|
|
|
|
|
|
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- public void onTextChanged(CharSequence s, int start, int before,
|
|
|
|
|
- int count) {
|
|
|
|
|
|
|
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
|
if (start == 0 && before == 0 && count > 1) {
|
|
if (start == 0 && before == 0 && count > 1) {
|
|
|
String order = orderEdt.getText().toString().trim();
|
|
String order = orderEdt.getText().toString().trim();
|
|
|
if (!TextUtils.isEmpty(order)) {
|
|
if (!TextUtils.isEmpty(order)) {
|
|
@@ -361,129 +355,105 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
});
|
|
});
|
|
|
barcodeEdt.addTextChangedListener(new TextWatcher() {
|
|
barcodeEdt.addTextChangedListener(new TextWatcher() {
|
|
|
@Override
|
|
@Override
|
|
|
- public void afterTextChanged(Editable arg0) {
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ public void afterTextChanged(Editable arg0) {
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- public void beforeTextChanged(CharSequence s, int start, int count,
|
|
|
|
|
- int after) {
|
|
|
|
|
|
|
+ public void beforeTextChanged(CharSequence s, int start, int count, int after) {
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- public void onTextChanged(CharSequence s, int start, int before,
|
|
|
|
|
- int count) {
|
|
|
|
|
|
|
+ public void onTextChanged(CharSequence s, int start, int before, int count) {
|
|
|
barcodeUpper = barcodeEdt.getText().toString().trim();
|
|
barcodeUpper = barcodeEdt.getText().toString().trim();
|
|
|
- if(barcodeUpper.length() >= 73)
|
|
|
|
|
- {
|
|
|
|
|
- String[] parts = barcodeUpper.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2
|
|
|
|
|
-
|
|
|
|
|
- if (parts.length == 2) {
|
|
|
|
|
- //System.out.println("第一部分: " + parts[0]);
|
|
|
|
|
- //System.out.println("第二部分: " + parts[1]);
|
|
|
|
|
- barcodeUpper = parts[1];
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if (barcodeUpper.length() >= 73) {
|
|
|
|
|
+ String[] parts = barcodeUpper.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2
|
|
|
|
|
+
|
|
|
|
|
+ if (parts.length == 2) {
|
|
|
|
|
+ // System.out.println("第一部分: " + parts[0]);
|
|
|
|
|
+ // System.out.println("第二部分: " + parts[1]);
|
|
|
|
|
+ barcodeUpper = parts[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
// 判断输入的文字是否是小写
|
|
// 判断输入的文字是否是小写
|
|
|
for (int i = 0; i < barcodeUpper.length(); i++) {
|
|
for (int i = 0; i < barcodeUpper.length(); i++) {
|
|
|
- if (barcodeUpper.charAt(i) - 0 >= 97
|
|
|
|
|
- && barcodeUpper.charAt(i) - 0 <= 122) {
|
|
|
|
|
|
|
+ if (barcodeUpper.charAt(i) - 0 >= 97 && barcodeUpper.charAt(i) - 0 <= 122) {
|
|
|
barcodeUpperH.postDelayed(UpperCase, 300);
|
|
barcodeUpperH.postDelayed(UpperCase, 300);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
if (start == 0 && before == 0 && count > 1) {
|
|
if (start == 0 && before == 0 && count > 1) {
|
|
|
String barcode = barcodeEdt.getText().toString();
|
|
String barcode = barcodeEdt.getText().toString();
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
barcode = barcode.trim();
|
|
barcode = barcode.trim();
|
|
|
if (!TextUtils.isEmpty(barcode)) {
|
|
if (!TextUtils.isEmpty(barcode)) {
|
|
|
-
|
|
|
|
|
- if(barcode.length() >= 73)
|
|
|
|
|
- {
|
|
|
|
|
- String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2
|
|
|
|
|
-
|
|
|
|
|
- if (parts.length == 2) {
|
|
|
|
|
- //System.out.println("第一部分: " + parts[0]);
|
|
|
|
|
- //System.out.println("第二部分: " + parts[1]);
|
|
|
|
|
- barcode = parts[1];
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- ProcessDialogUtils.showProcessDialog(
|
|
|
|
|
- FinishedProductHandOverActivity.this);
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if (barcode.length() >= 73) {
|
|
|
|
|
+ String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2
|
|
|
|
|
+
|
|
|
|
|
+ if (parts.length == 2) {
|
|
|
|
|
+ // System.out.println("第一部分: " + parts[0]);
|
|
|
|
|
+ // System.out.println("第二部分: " + parts[1]);
|
|
|
|
|
+ barcode = parts[1];
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ ProcessDialogUtils.showProcessDialog(FinishedProductHandOverActivity.this);
|
|
|
barcodeEdt.setEnabled(false);
|
|
barcodeEdt.setEnabled(false);
|
|
|
barcodeEdt.setFocusable(false);
|
|
barcodeEdt.setFocusable(false);
|
|
|
- barcodeEdt.setFilters(
|
|
|
|
|
- new InputFilter[]{new InputFilter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public CharSequence filter(
|
|
|
|
|
- CharSequence source, int start,
|
|
|
|
|
- int end, Spanned dest, int dstart,
|
|
|
|
|
- int dend) {
|
|
|
|
|
- return source.length() < 1
|
|
|
|
|
- ? dest.subSequence(dstart, dend)
|
|
|
|
|
- : "";
|
|
|
|
|
- }
|
|
|
|
|
- }});
|
|
|
|
|
-
|
|
|
|
|
|
|
+ barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
|
|
|
|
|
+ int dstart, int dend) {
|
|
|
|
|
+ return source.length() < 1 ? dest.subSequence(dstart, dend) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ } });
|
|
|
|
|
+
|
|
|
thread = new HandlerThread("barcodeThread", 5);
|
|
thread = new HandlerThread("barcodeThread", 5);
|
|
|
thread.start();
|
|
thread.start();
|
|
|
mHandler = new Handler(thread.getLooper());
|
|
mHandler = new Handler(thread.getLooper());
|
|
|
- BarcodeRunnable barcodeRunnable = new BarcodeRunnable(
|
|
|
|
|
- obj, barcode);
|
|
|
|
|
|
|
+ BarcodeRunnable barcodeRunnable = new BarcodeRunnable(obj, barcode);
|
|
|
mHandler.post(barcodeRunnable);
|
|
mHandler.post(barcodeRunnable);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
- barcodeEdt.setOnEditorActionListener(
|
|
|
|
|
- new TextView.OnEditorActionListener() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public boolean onEditorAction(TextView v, int actionId,
|
|
|
|
|
- KeyEvent event) {
|
|
|
|
|
- if (actionId == EditorInfo.IME_ACTION_GO) {
|
|
|
|
|
- String barcode = barcodeEdt.getText().toString();
|
|
|
|
|
- if (!TextUtils.isEmpty(barcode)) {
|
|
|
|
|
- if(barcode.length() >= 73)
|
|
|
|
|
- {
|
|
|
|
|
- String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2
|
|
|
|
|
-
|
|
|
|
|
- if (parts.length == 2) {
|
|
|
|
|
- //System.out.println("第一部分: " + parts[0]);
|
|
|
|
|
- //System.out.println("第二部分: " + parts[1]);
|
|
|
|
|
- barcode = parts[1];
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- ProcessDialogUtils.showProcessDialog(
|
|
|
|
|
- FinishedProductHandOverActivity.this);
|
|
|
|
|
- barcodeEdt.setEnabled(false);
|
|
|
|
|
- barcodeEdt.setFocusable(false);
|
|
|
|
|
- barcodeEdt.setFilters(
|
|
|
|
|
- new InputFilter[]{new InputFilter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public CharSequence filter(
|
|
|
|
|
- CharSequence source,
|
|
|
|
|
- int start, int end,
|
|
|
|
|
- Spanned dest, int dstart,
|
|
|
|
|
- int dend) {
|
|
|
|
|
- return source.length() < 1
|
|
|
|
|
- ? dest.subSequence(
|
|
|
|
|
- dstart, dend)
|
|
|
|
|
- : "";
|
|
|
|
|
- }
|
|
|
|
|
- }});
|
|
|
|
|
- thread = new HandlerThread("barcodeThread", 5);
|
|
|
|
|
- thread.start();
|
|
|
|
|
- mHandler = new Handler(thread.getLooper());
|
|
|
|
|
- BarcodeRunnable barcodeRunnable = new BarcodeRunnable(
|
|
|
|
|
- obj, barcode);
|
|
|
|
|
- mHandler.post(barcodeRunnable);
|
|
|
|
|
- return true;
|
|
|
|
|
|
|
+ barcodeEdt.setOnEditorActionListener(new TextView.OnEditorActionListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
|
|
|
|
|
+ if (actionId == EditorInfo.IME_ACTION_GO) {
|
|
|
|
|
+ String barcode = barcodeEdt.getText().toString();
|
|
|
|
|
+ if (!TextUtils.isEmpty(barcode)) {
|
|
|
|
|
+ if (barcode.length() >= 73) {
|
|
|
|
|
+ String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2
|
|
|
|
|
+
|
|
|
|
|
+ if (parts.length == 2) {
|
|
|
|
|
+ // System.out.println("第一部分: " + parts[0]);
|
|
|
|
|
+ // System.out.println("第二部分: " + parts[1]);
|
|
|
|
|
+ barcode = parts[1];
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- return false;
|
|
|
|
|
|
|
+ ProcessDialogUtils.showProcessDialog(FinishedProductHandOverActivity.this);
|
|
|
|
|
+ barcodeEdt.setEnabled(false);
|
|
|
|
|
+ barcodeEdt.setFocusable(false);
|
|
|
|
|
+ barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
|
|
|
|
|
+ int dstart, int dend) {
|
|
|
|
|
+ return source.length() < 1 ? dest.subSequence(dstart, dend) : "";
|
|
|
|
|
+ }
|
|
|
|
|
+ } });
|
|
|
|
|
+ thread = new HandlerThread("barcodeThread", 5);
|
|
|
|
|
+ thread.start();
|
|
|
|
|
+ mHandler = new Handler(thread.getLooper());
|
|
|
|
|
+ BarcodeRunnable barcodeRunnable = new BarcodeRunnable(obj, barcode);
|
|
|
|
|
+ mHandler.post(barcodeRunnable);
|
|
|
|
|
+ return true;
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
Runnable UpperCase = new Runnable() {
|
|
Runnable UpperCase = new Runnable() {
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
@@ -493,24 +463,27 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
barcodeEdt.setSelection(barcodeUpper.length());
|
|
barcodeEdt.setSelection(barcodeUpper.length());
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
public static int getOrderIndex(String order, List<Order> orderList) {
|
|
public static int getOrderIndex(String order, List<Order> orderList) {
|
|
|
int newposition = -1;
|
|
int newposition = -1;
|
|
|
for (int position = 0; position < orderList.size(); position++) {
|
|
for (int position = 0; position < orderList.size(); position++) {
|
|
|
- if (order
|
|
|
|
|
- .equalsIgnoreCase((orderList.get(position).getOrderNo()))) {
|
|
|
|
|
|
|
+ if (order.equalsIgnoreCase((orderList.get(position).getOrderNo()))) {
|
|
|
newposition = position;
|
|
newposition = position;
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return newposition;
|
|
return newposition;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
private class SaveRunnable implements Runnable {
|
|
private class SaveRunnable implements Runnable {
|
|
|
private Object object;
|
|
private Object object;
|
|
|
private String orderId;
|
|
private String orderId;
|
|
|
|
|
+
|
|
|
public SaveRunnable(Object object, String orderId) {
|
|
public SaveRunnable(Object object, String orderId) {
|
|
|
this.object = object;
|
|
this.object = object;
|
|
|
this.orderId = orderId;
|
|
this.orderId = orderId;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
|
synchronized (object) {
|
|
synchronized (object) {
|
|
@@ -526,6 +499,7 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
js.put("SPANAME", spinnerName);
|
|
js.put("SPANAME", spinnerName);
|
|
|
js.put("action", "SaveFinishedHandover");
|
|
js.put("action", "SaveFinishedHandover");
|
|
|
JSONArray orderEntity = new JSONArray();
|
|
JSONArray orderEntity = new JSONArray();
|
|
|
|
|
+ String temporarilyFlag = "";
|
|
|
for (BarcodeInfo info : barcodeInfoList) {
|
|
for (BarcodeInfo info : barcodeInfoList) {
|
|
|
JSONObject obj = new JSONObject();
|
|
JSONObject obj = new JSONObject();
|
|
|
obj.put("BarCode", info.getBarcode());
|
|
obj.put("BarCode", info.getBarcode());
|
|
@@ -533,18 +507,18 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
obj.put("SPANAME", spinnerName);
|
|
obj.put("SPANAME", spinnerName);
|
|
|
obj.put("logoID", info.getLogoId());
|
|
obj.put("logoID", info.getLogoId());
|
|
|
obj.put("LogoName", info.getLogoName());
|
|
obj.put("LogoName", info.getLogoName());
|
|
|
|
|
+// 暂存标识:【TemporarilyFlag】查询时候暂时用Remarks 赋值
|
|
|
|
|
+ temporarilyFlag = info.getRemarks();
|
|
|
orderEntity.put(obj);
|
|
orderEntity.put(obj);
|
|
|
}
|
|
}
|
|
|
JSONObject data = new JSONObject();
|
|
JSONObject data = new JSONObject();
|
|
|
- data.put("OrderID", orderId);
|
|
|
|
|
|
|
+ data.put("OrderID", orderId);
|
|
|
|
|
+ data.put("TemporarilyFlag", temporarilyFlag);
|
|
|
data.put("Table", orderEntity);
|
|
data.put("Table", orderEntity);
|
|
|
data.put("SPANAME", spinnerName);
|
|
data.put("SPANAME", spinnerName);
|
|
|
js.put("jsonData", data.toString());
|
|
js.put("jsonData", data.toString());
|
|
|
- String result = client.doPost(
|
|
|
|
|
- "http://" + ServerAddress_ip + ":"
|
|
|
|
|
- + ServerAddress_port
|
|
|
|
|
- + Constants.serverAction + "/DoAction",
|
|
|
|
|
- js.toString(), "application/json");
|
|
|
|
|
|
|
+ String result = client.doPost("http://" + ServerAddress_ip + ":" + ServerAddress_port
|
|
|
|
|
+ + Constants.serverAction + "/DoAction", js.toString(), "application/json");
|
|
|
Message m = new Message();
|
|
Message m = new Message();
|
|
|
m.what = 3;
|
|
m.what = 3;
|
|
|
Bundle b = new Bundle();
|
|
Bundle b = new Bundle();
|
|
@@ -563,13 +537,16 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
private class BarcodeRunnable implements Runnable {
|
|
private class BarcodeRunnable implements Runnable {
|
|
|
private Object object;
|
|
private Object object;
|
|
|
private String barcode;
|
|
private String barcode;
|
|
|
|
|
+
|
|
|
public BarcodeRunnable(Object object, String barcode) {
|
|
public BarcodeRunnable(Object object, String barcode) {
|
|
|
this.object = object;
|
|
this.object = object;
|
|
|
this.barcode = barcode;
|
|
this.barcode = barcode;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
|
synchronized (object) {
|
|
synchronized (object) {
|
|
@@ -586,11 +563,8 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
js1.put("jsonData", data.toString());
|
|
js1.put("jsonData", data.toString());
|
|
|
js1.put("module", "FinishedProduct");
|
|
js1.put("module", "FinishedProduct");
|
|
|
js1.put("action", "FinishedHandoverBarcode");
|
|
js1.put("action", "FinishedHandoverBarcode");
|
|
|
- String result2 = client.doPost(
|
|
|
|
|
- "http://" + ServerAddress_ip + ":"
|
|
|
|
|
- + ServerAddress_port
|
|
|
|
|
- + Constants.serverAction + "/DoAction",
|
|
|
|
|
- js1.toString(), "application/json");
|
|
|
|
|
|
|
+ String result2 = client.doPost("http://" + ServerAddress_ip + ":" + ServerAddress_port
|
|
|
|
|
+ + Constants.serverAction + "/DoAction", js1.toString(), "application/json");
|
|
|
Bundle b = new Bundle();
|
|
Bundle b = new Bundle();
|
|
|
Message message = new Message();
|
|
Message message = new Message();
|
|
|
message.what = 1;
|
|
message.what = 1;
|
|
@@ -610,11 +584,14 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
private class OrderListRunnable implements Runnable {
|
|
private class OrderListRunnable implements Runnable {
|
|
|
private Object object;
|
|
private Object object;
|
|
|
|
|
+
|
|
|
public OrderListRunnable(Object object) {
|
|
public OrderListRunnable(Object object) {
|
|
|
this.object = object;
|
|
this.object = object;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public void run() {
|
|
public void run() {
|
|
|
synchronized (object) {
|
|
synchronized (object) {
|
|
@@ -628,11 +605,8 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
js.put("sessionKey", sessionkey);
|
|
js.put("sessionKey", sessionkey);
|
|
|
JSONObject orderEntity = new JSONObject();
|
|
JSONObject orderEntity = new JSONObject();
|
|
|
js.put("order", orderEntity);
|
|
js.put("order", orderEntity);
|
|
|
- String result = client.doPost(
|
|
|
|
|
- "http://" + ServerAddress_ip + ":"
|
|
|
|
|
- + ServerAddress_port
|
|
|
|
|
- + Constants.serverAction + "/GetOrderList",
|
|
|
|
|
- js.toString(), "application/json");
|
|
|
|
|
|
|
+ String result = client.doPost("http://" + ServerAddress_ip + ":" + ServerAddress_port
|
|
|
|
|
+ + Constants.serverAction + "/GetOrderList", js.toString(), "application/json");
|
|
|
JSONObject j = new JSONObject(result);
|
|
JSONObject j = new JSONObject(result);
|
|
|
JSONObject j1 = j.optJSONObject("d");
|
|
JSONObject j1 = j.optJSONObject("d");
|
|
|
int status = j1.optInt("Status");
|
|
int status = j1.optInt("Status");
|
|
@@ -698,8 +672,7 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
Message m = new Message();
|
|
Message m = new Message();
|
|
|
m.what = 0;
|
|
m.what = 0;
|
|
|
Bundle b = new Bundle();
|
|
Bundle b = new Bundle();
|
|
|
- b.putSerializable("orderList",
|
|
|
|
|
- (Serializable) orderList);
|
|
|
|
|
|
|
+ b.putSerializable("orderList", (Serializable) orderList);
|
|
|
m.setData(b);
|
|
m.setData(b);
|
|
|
handler.sendMessage(m);
|
|
handler.sendMessage(m);
|
|
|
// } else {
|
|
// } else {
|
|
@@ -734,52 +707,48 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
Handler exceptionHandler = new Handler() {
|
|
Handler exceptionHandler = new Handler() {
|
|
|
@Override
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
public void handleMessage(Message msg) {
|
|
|
switch (msg.what) {
|
|
switch (msg.what) {
|
|
|
- case 0 :
|
|
|
|
|
- Bundle b = msg.getData();
|
|
|
|
|
- String message = b.getString("message");
|
|
|
|
|
- ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
- if (mHandler != null) {
|
|
|
|
|
- mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
- mHandler.getLooper().quit();
|
|
|
|
|
- }
|
|
|
|
|
- CustomToast.showToast(getApplicationContext(), message,
|
|
|
|
|
- 2000);
|
|
|
|
|
- CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
|
|
|
|
|
- getApplicationContext());
|
|
|
|
|
- barcodeEdt.setEnabled(true);
|
|
|
|
|
- barcodeEdt.setText("");
|
|
|
|
|
- barcodeEdt.setFocusable(true);
|
|
|
|
|
- barcodeEdt.setFocusableInTouchMode(true);
|
|
|
|
|
- barcodeEdt.requestFocus();
|
|
|
|
|
- barcodeEdt.findFocus();
|
|
|
|
|
- barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public CharSequence filter(CharSequence source,
|
|
|
|
|
- int start, int end, Spanned dest, int dstart,
|
|
|
|
|
- int dend) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- }});
|
|
|
|
|
- break;
|
|
|
|
|
- case 1 :
|
|
|
|
|
- Bundle b1 = msg.getData();
|
|
|
|
|
- int status1 = b1.getInt("status");
|
|
|
|
|
- String message1 = b1.getString("message");
|
|
|
|
|
- ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
- if (mHandler != null) {
|
|
|
|
|
- mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
- mHandler.getLooper().quit();
|
|
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ Bundle b = msg.getData();
|
|
|
|
|
+ String message = b.getString("message");
|
|
|
|
|
+ ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
+ if (mHandler != null) {
|
|
|
|
|
+ mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
+ mHandler.getLooper().quit();
|
|
|
|
|
+ }
|
|
|
|
|
+ CustomToast.showToast(getApplicationContext(), message, 2000);
|
|
|
|
|
+ CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
|
|
|
|
|
+ barcodeEdt.setEnabled(true);
|
|
|
|
|
+ barcodeEdt.setText("");
|
|
|
|
|
+ barcodeEdt.setFocusable(true);
|
|
|
|
|
+ barcodeEdt.setFocusableInTouchMode(true);
|
|
|
|
|
+ barcodeEdt.requestFocus();
|
|
|
|
|
+ barcodeEdt.findFocus();
|
|
|
|
|
+ barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
|
|
|
|
|
+ int dend) {
|
|
|
|
|
+ return null;
|
|
|
}
|
|
}
|
|
|
- CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
|
|
|
|
|
- getApplicationContext());
|
|
|
|
|
- CommonUtil.showBarCodeAlertDialog(status1, message1,
|
|
|
|
|
- FinishedProductHandOverActivity.this, barcodeEdt,
|
|
|
|
|
- null, null);
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ } });
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ Bundle b1 = msg.getData();
|
|
|
|
|
+ int status1 = b1.getInt("status");
|
|
|
|
|
+ String message1 = b1.getString("message");
|
|
|
|
|
+ ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
+ if (mHandler != null) {
|
|
|
|
|
+ mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
+ mHandler.getLooper().quit();
|
|
|
|
|
+ }
|
|
|
|
|
+ CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
|
|
|
|
|
+ CommonUtil.showBarCodeAlertDialog(status1, message1, FinishedProductHandOverActivity.this, barcodeEdt,
|
|
|
|
|
+ null, null);
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
@@ -788,300 +757,313 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
@Override
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
public void handleMessage(Message msg) {
|
|
|
switch (msg.what) {
|
|
switch (msg.what) {
|
|
|
- case 0 :
|
|
|
|
|
- Bundle b = msg.getData();
|
|
|
|
|
- orderList = (List<Order>) b.getSerializable("orderList");
|
|
|
|
|
- if (mHandler != null) {
|
|
|
|
|
- mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
- mHandler.getLooper().quit();
|
|
|
|
|
- }
|
|
|
|
|
- ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
- orderEdt.setEnabled(true);
|
|
|
|
|
- orderEdt.setFocusable(true);
|
|
|
|
|
- orderEdt.setFocusableInTouchMode(true);
|
|
|
|
|
- orderEdt.setFilters(new InputFilter[]{new InputFilter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public CharSequence filter(CharSequence source,
|
|
|
|
|
- int start, int end, Spanned dest, int dstart,
|
|
|
|
|
- int dend) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- }});
|
|
|
|
|
- if (orderList != null && orderList.size() > 0) {
|
|
|
|
|
- adapter = new OrderSpinnerAdapter(
|
|
|
|
|
- FinishedProductHandOverActivity.this,
|
|
|
|
|
- orderList);
|
|
|
|
|
- orderSpinner.setAdapter(adapter);
|
|
|
|
|
- }
|
|
|
|
|
- // if (quantitySettingValue.equals("0")) {
|
|
|
|
|
- // saveBtn.setEnabled(true);
|
|
|
|
|
- // }
|
|
|
|
|
- break;
|
|
|
|
|
- case 1 :
|
|
|
|
|
- ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
- if (mHandler != null) {
|
|
|
|
|
- mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
- mHandler.getLooper().quit();
|
|
|
|
|
|
|
+ case 0:
|
|
|
|
|
+ Bundle b = msg.getData();
|
|
|
|
|
+ orderList = (List<Order>) b.getSerializable("orderList");
|
|
|
|
|
+ if (mHandler != null) {
|
|
|
|
|
+ mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
+ mHandler.getLooper().quit();
|
|
|
|
|
+ }
|
|
|
|
|
+ ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
+ orderEdt.setEnabled(true);
|
|
|
|
|
+ orderEdt.setFocusable(true);
|
|
|
|
|
+ orderEdt.setFocusableInTouchMode(true);
|
|
|
|
|
+ orderEdt.setFilters(new InputFilter[] { new InputFilter() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
|
|
|
|
|
+ int dend) {
|
|
|
|
|
+ return null;
|
|
|
}
|
|
}
|
|
|
- Bundle b1 = msg.getData();
|
|
|
|
|
- String result1 = b1.getString("result");
|
|
|
|
|
- barcode = b1.getString("barcode");
|
|
|
|
|
- JSONObject jobj2;
|
|
|
|
|
- try {
|
|
|
|
|
- jobj2 = new JSONObject(result1);
|
|
|
|
|
- JSONObject jobj3 = jobj2.optJSONObject("d");
|
|
|
|
|
- int status3 = jobj3.optInt("Status");
|
|
|
|
|
- if (status3 == 0) {
|
|
|
|
|
- String result4 = jobj3.optString("Result");
|
|
|
|
|
- JSONObject jobj4 = new JSONObject(result4);
|
|
|
|
|
- JSONArray arry4 = jobj4.optJSONArray("Table");
|
|
|
|
|
- if (arry4 != null && arry4.length() > 0) {
|
|
|
|
|
- JSONObject jobj6 = arry4.optJSONObject(0);
|
|
|
|
|
- String outbarcode = jobj6.optString("BARCODE");
|
|
|
|
|
- if (barcodeInfoList.size() > 0) {
|
|
|
|
|
- boolean b2 = Removeduplicate.removeBarCode(
|
|
|
|
|
- outbarcode, barcodeInfoList);
|
|
|
|
|
- if (b2) {
|
|
|
|
|
- String message = "条码" + outbarcode
|
|
|
|
|
- + "重复";
|
|
|
|
|
- CustomToast.showToast(
|
|
|
|
|
- getApplicationContext(),
|
|
|
|
|
- message, 2000);
|
|
|
|
|
- CommonUtil.setDefault(
|
|
|
|
|
- Notification.DEFAULT_VIBRATE,
|
|
|
|
|
- getApplicationContext());
|
|
|
|
|
|
|
+ } });
|
|
|
|
|
+ if (orderList != null && orderList.size() > 0) {
|
|
|
|
|
+ adapter = new OrderSpinnerAdapter(FinishedProductHandOverActivity.this, orderList);
|
|
|
|
|
+ orderSpinner.setAdapter(adapter);
|
|
|
|
|
+ }
|
|
|
|
|
+ // if (quantitySettingValue.equals("0")) {
|
|
|
|
|
+ // saveBtn.setEnabled(true);
|
|
|
|
|
+ // }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 1:
|
|
|
|
|
+ ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
+ if (mHandler != null) {
|
|
|
|
|
+ mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
+ mHandler.getLooper().quit();
|
|
|
|
|
+ }
|
|
|
|
|
+ Bundle b1 = msg.getData();
|
|
|
|
|
+ String result1 = b1.getString("result");
|
|
|
|
|
+ barcode = b1.getString("barcode");
|
|
|
|
|
+ JSONObject jobj2;
|
|
|
|
|
+ try {
|
|
|
|
|
+ jobj2 = new JSONObject(result1);
|
|
|
|
|
+ JSONObject jobj3 = jobj2.optJSONObject("d");
|
|
|
|
|
+ int status3 = jobj3.optInt("Status");
|
|
|
|
|
+ if (status3 == 0) {
|
|
|
|
|
+ String result4 = jobj3.optString("Result");
|
|
|
|
|
+ JSONObject jobj4 = new JSONObject(result4);
|
|
|
|
|
+ arry4 = jobj4.optJSONArray("Table");
|
|
|
|
|
+ if (arry4 != null && arry4.length() > 0) {
|
|
|
|
|
+ // 251104 扫描条码返回成功,但是Message有数据的时候,提示Message(包含确定和取消按钮)
|
|
|
|
|
+ String message = jobj3.optString("Message");
|
|
|
|
|
+ if (!TextUtils.isEmpty(message)) {
|
|
|
|
|
+ dialog = new ExitAppDialog(FinishedProductHandOverActivity.this,
|
|
|
|
|
+ R.style.MyDialog);
|
|
|
|
|
+ dialog.setDialog(R.layout.exit_layout, FinishedProductHandOverActivity.this);
|
|
|
|
|
+ dialog.showDialog();
|
|
|
|
|
+ dialog.title.setText(message);
|
|
|
|
|
+ dialog.ok.setText("确定");
|
|
|
|
|
+ dialog.cancel.setText("取消");
|
|
|
|
|
+ dialog.ok.setOnClickListener(new OnClickListener() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
|
+ // 原来没有temporarilyFlag的逻辑
|
|
|
|
|
+ setbarcodeListData(arry4,"1");
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ dialog.cancel.setOnClickListener(new OnClickListener() {
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public void onClick(View v) {
|
|
|
|
|
+// 相当于没有查询信息,清空list和条码,可以重新扫描条码
|
|
|
|
|
+ barcodeInfoList.clear();
|
|
|
|
|
+ handoverAdapter = new HandOverAdapter(FinishedProductHandOverActivity.this,
|
|
|
|
|
+ barcodeInfoList);
|
|
|
|
|
+ barcodeLst.setAdapter(handoverAdapter);
|
|
|
barcodeEdt.setEnabled(true);
|
|
barcodeEdt.setEnabled(true);
|
|
|
barcodeEdt.setText("");
|
|
barcodeEdt.setText("");
|
|
|
barcodeEdt.setFocusable(true);
|
|
barcodeEdt.setFocusable(true);
|
|
|
- barcodeEdt
|
|
|
|
|
- .setFocusableInTouchMode(true);
|
|
|
|
|
|
|
+ barcodeEdt.setFocusableInTouchMode(true);
|
|
|
barcodeEdt.requestFocus();
|
|
barcodeEdt.requestFocus();
|
|
|
barcodeEdt.findFocus();
|
|
barcodeEdt.findFocus();
|
|
|
- barcodeEdt.setFilters(new InputFilter[]{
|
|
|
|
|
- new InputFilter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public CharSequence filter(
|
|
|
|
|
- CharSequence source,
|
|
|
|
|
- int start, int end,
|
|
|
|
|
- Spanned dest,
|
|
|
|
|
- int dstart,
|
|
|
|
|
- int dend) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- }});
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- for (int i = 0; i < arry4.length(); i++) {
|
|
|
|
|
- JSONObject jobj5 = arry4.optJSONObject(i);
|
|
|
|
|
- int logoId = jobj5.optInt("LOGOID");
|
|
|
|
|
- String logoCode = jobj5
|
|
|
|
|
- .optString("LOGOCODE");
|
|
|
|
|
- String logoName = jobj5
|
|
|
|
|
- .optString("LOGONAME");
|
|
|
|
|
- String goodsCode = jobj5
|
|
|
|
|
- .optString("GOODSCODE");
|
|
|
|
|
- String finishedBarCode = jobj5
|
|
|
|
|
- .optString("FINISHEDBARCODE");
|
|
|
|
|
- String outbarcode1 = jobj5
|
|
|
|
|
- .optString("BARCODE");
|
|
|
|
|
- int userId = jobj5.optInt("USERID");
|
|
|
|
|
- String groutingUserCode = jobj5
|
|
|
|
|
- .optString("GROUTINGUSERCODE");
|
|
|
|
|
- String mouldCode = jobj5
|
|
|
|
|
- .optString("MOULDCODE");
|
|
|
|
|
- String groutingDate = jobj5
|
|
|
|
|
- .optString("GROUTINGDATE");
|
|
|
|
|
- groutingDate = CommonUtil
|
|
|
|
|
- .commonDateConverter(groutingDate);
|
|
|
|
|
- String diliverTime = jobj5
|
|
|
|
|
- .optString("DELIVERTIME");
|
|
|
|
|
- String goodsModel = jobj5
|
|
|
|
|
- .optString("GOODSMODEL");
|
|
|
|
|
- diliverTime = CommonUtil
|
|
|
|
|
- .commonDateConverter(diliverTime);
|
|
|
|
|
- // limitNum = jobj5.optInt("PLATELIMITNUM");
|
|
|
|
|
- BarcodeInfo info = new BarcodeInfo();
|
|
|
|
|
- info.setBarcode(outbarcode1);
|
|
|
|
|
- info.setLogoId(logoId);
|
|
|
|
|
- info.setLogoCode(logoCode);
|
|
|
|
|
- info.setFinishedBarCode(finishedBarCode);
|
|
|
|
|
- info.setLogoName(logoName);
|
|
|
|
|
- info.setGoodsCode(goodsCode);
|
|
|
|
|
- info.setGoodsModel(goodsModel);
|
|
|
|
|
- info.setUserId(userId);
|
|
|
|
|
- info.setUserCode(groutingUserCode);
|
|
|
|
|
- info.setMouldCode(mouldCode);
|
|
|
|
|
- info.setGroutingDate(groutingDate);
|
|
|
|
|
- info.setDeliverTime(diliverTime);
|
|
|
|
|
- info.setBanMa(
|
|
|
|
|
- (jobj5.optString("BANMA") == "null")
|
|
|
|
|
- ? ""
|
|
|
|
|
- : jobj5.optString("BANMA"));
|
|
|
|
|
-
|
|
|
|
|
- barcodeInfoList.add(info);
|
|
|
|
|
- }
|
|
|
|
|
- if (handoverAdapter == null) {
|
|
|
|
|
- handoverAdapter = new HandOverAdapter(
|
|
|
|
|
- FinishedProductHandOverActivity.this,
|
|
|
|
|
- barcodeInfoList);
|
|
|
|
|
- barcodeLst.setAdapter(handoverAdapter);
|
|
|
|
|
-
|
|
|
|
|
- } else {
|
|
|
|
|
- handoverAdapter.notifyDataSetChanged();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- barcodeEdt.setEnabled(true);
|
|
|
|
|
- barcodeEdt.setText("");
|
|
|
|
|
- barcodeEdt.setFocusable(true);
|
|
|
|
|
- barcodeEdt.setFocusableInTouchMode(true);
|
|
|
|
|
- barcodeEdt.requestFocus();
|
|
|
|
|
- barcodeEdt.findFocus();
|
|
|
|
|
- barcodeEdt.setFilters(
|
|
|
|
|
- new InputFilter[]{new InputFilter() {
|
|
|
|
|
|
|
+ barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
|
|
|
@Override
|
|
@Override
|
|
|
- public CharSequence filter(
|
|
|
|
|
- CharSequence source,
|
|
|
|
|
- int start, int end,
|
|
|
|
|
- Spanned dest, int dstart,
|
|
|
|
|
|
|
+ public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
|
|
|
int dend) {
|
|
int dend) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- }});
|
|
|
|
|
- }
|
|
|
|
|
- } else {
|
|
|
|
|
- String message = jobj3.optString("Message");
|
|
|
|
|
- CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
|
|
|
|
|
- getApplicationContext());
|
|
|
|
|
- CommonUtil.showBarCodeAlertDialog(status3, message,
|
|
|
|
|
- FinishedProductHandOverActivity.this,
|
|
|
|
|
- barcodeEdt, null, null);
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ } });
|
|
|
|
|
+ dialog.Closedialog();
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 原来没有temporarilyFlag的逻辑
|
|
|
|
|
+ setbarcodeListData(arry4,null);
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- saveBtn.setText("保存(" + barcodeInfoList.size() + ")");
|
|
|
|
|
- } catch (JSONException e1) {
|
|
|
|
|
- e1.printStackTrace();
|
|
|
|
|
- }
|
|
|
|
|
- break;
|
|
|
|
|
- case 2 :
|
|
|
|
|
- ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
- if (mHandler != null) {
|
|
|
|
|
- mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
- mHandler.getLooper().quit();
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+ String message = jobj3.optString("Message");
|
|
|
|
|
+ CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
|
|
|
|
|
+ CommonUtil.showBarCodeAlertDialog(status3, message, FinishedProductHandOverActivity.this,
|
|
|
|
|
+ barcodeEdt, null, null);
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
- Bundle b2 = msg.getData();
|
|
|
|
|
- String errmsg = b2.getString("msg");
|
|
|
|
|
- String missFlag = b2.getString("missingFlag");
|
|
|
|
|
- Intent intent = new Intent();
|
|
|
|
|
- Bundle b3 = new Bundle();
|
|
|
|
|
- b3.putString("msg", errmsg);
|
|
|
|
|
- b3.putString("missingFlag", missFlag);
|
|
|
|
|
- intent.putExtras(b3);
|
|
|
|
|
- intent.setClass(FinishedProductHandOverActivity.this,
|
|
|
|
|
- MissingScanActivity.class);
|
|
|
|
|
- startActivityForResult(intent, 101);
|
|
|
|
|
- break;
|
|
|
|
|
- case 3 :
|
|
|
|
|
- Bundle b4 = msg.getData();
|
|
|
|
|
- String result3 = b4.getString("saveResult");
|
|
|
|
|
- if (mHandler != null) {
|
|
|
|
|
- mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
- mHandler.getLooper().quit();
|
|
|
|
|
|
|
+ saveBtn.setText("保存(" + barcodeInfoList.size() + ")");
|
|
|
|
|
+ } catch (JSONException e1) {
|
|
|
|
|
+ e1.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 2:
|
|
|
|
|
+ ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
+ if (mHandler != null) {
|
|
|
|
|
+ mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
+ mHandler.getLooper().quit();
|
|
|
|
|
+ }
|
|
|
|
|
+ Bundle b2 = msg.getData();
|
|
|
|
|
+ String errmsg = b2.getString("msg");
|
|
|
|
|
+ String missFlag = b2.getString("missingFlag");
|
|
|
|
|
+ Intent intent = new Intent();
|
|
|
|
|
+ Bundle b3 = new Bundle();
|
|
|
|
|
+ b3.putString("msg", errmsg);
|
|
|
|
|
+ b3.putString("missingFlag", missFlag);
|
|
|
|
|
+ intent.putExtras(b3);
|
|
|
|
|
+ intent.setClass(FinishedProductHandOverActivity.this, MissingScanActivity.class);
|
|
|
|
|
+ startActivityForResult(intent, 101);
|
|
|
|
|
+ break;
|
|
|
|
|
+ case 3:
|
|
|
|
|
+ Bundle b4 = msg.getData();
|
|
|
|
|
+ String result3 = b4.getString("saveResult");
|
|
|
|
|
+ if (mHandler != null) {
|
|
|
|
|
+ mHandler.removeCallbacksAndMessages(null);
|
|
|
|
|
+ mHandler.getLooper().quit();
|
|
|
|
|
+ }
|
|
|
|
|
+ ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
+ barcodeEdt.setEnabled(true);
|
|
|
|
|
+ barcodeEdt.setText("");
|
|
|
|
|
+ barcodeEdt.setFocusable(true);
|
|
|
|
|
+ barcodeEdt.setFocusableInTouchMode(true);
|
|
|
|
|
+ barcodeEdt.requestFocus();
|
|
|
|
|
+ barcodeEdt.findFocus();
|
|
|
|
|
+ barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
|
|
|
|
|
+ int dend) {
|
|
|
|
|
+ return null;
|
|
|
}
|
|
}
|
|
|
- ProcessDialogUtils.closeProgressDilog();
|
|
|
|
|
- barcodeEdt.setEnabled(true);
|
|
|
|
|
- barcodeEdt.setText("");
|
|
|
|
|
- barcodeEdt.setFocusable(true);
|
|
|
|
|
- barcodeEdt.setFocusableInTouchMode(true);
|
|
|
|
|
- barcodeEdt.requestFocus();
|
|
|
|
|
- barcodeEdt.findFocus();
|
|
|
|
|
- barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
|
|
|
|
|
- @Override
|
|
|
|
|
- public CharSequence filter(CharSequence source,
|
|
|
|
|
- int start, int end, Spanned dest, int dstart,
|
|
|
|
|
- int dend) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- }});
|
|
|
|
|
- try {
|
|
|
|
|
- JSONObject jo = new JSONObject(result3);
|
|
|
|
|
- JSONObject jo1 = jo.optJSONObject("d");
|
|
|
|
|
- int status = jo1.optInt("Status");
|
|
|
|
|
- String message = jo1.optString("Message");
|
|
|
|
|
- if (status == 0) {
|
|
|
|
|
- CustomToast.showToast(getApplicationContext(),
|
|
|
|
|
- "保存成功", 2000);
|
|
|
|
|
- // if (quantitySettingValue.equals("0")) {
|
|
|
|
|
- // saveBtn.setEnabled(true);
|
|
|
|
|
- //
|
|
|
|
|
- // } else {
|
|
|
|
|
- // saveBtn.setEnabled(false);
|
|
|
|
|
- //
|
|
|
|
|
- // }
|
|
|
|
|
- orderEdt.setText("");
|
|
|
|
|
- if (handoverAdapter != null) {
|
|
|
|
|
- barcodeInfoList.removeAll(barcodeInfoList);
|
|
|
|
|
- handoverAdapter.notifyDataSetChanged();
|
|
|
|
|
- saveBtn.setText(
|
|
|
|
|
- "保存(" + barcodeInfoList.size() + ")");
|
|
|
|
|
- }
|
|
|
|
|
- CommonUtil.playSound(getApplicationContext());
|
|
|
|
|
- } else {
|
|
|
|
|
- CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
|
|
|
|
|
- getApplicationContext());
|
|
|
|
|
- CommonUtil.showBarCodeAlertDialog(status, message,
|
|
|
|
|
- FinishedProductHandOverActivity.this,
|
|
|
|
|
- barcodeEdt, null, null);
|
|
|
|
|
|
|
+ } });
|
|
|
|
|
+ try {
|
|
|
|
|
+ JSONObject jo = new JSONObject(result3);
|
|
|
|
|
+ JSONObject jo1 = jo.optJSONObject("d");
|
|
|
|
|
+ int status = jo1.optInt("Status");
|
|
|
|
|
+ String message = jo1.optString("Message");
|
|
|
|
|
+ if (status == 0) {
|
|
|
|
|
+ CustomToast.showToast(getApplicationContext(), "保存成功", 2000);
|
|
|
|
|
+ // if (quantitySettingValue.equals("0")) {
|
|
|
|
|
+ // saveBtn.setEnabled(true);
|
|
|
|
|
+ //
|
|
|
|
|
+ // } else {
|
|
|
|
|
+ // saveBtn.setEnabled(false);
|
|
|
|
|
+ //
|
|
|
|
|
+ // }
|
|
|
|
|
+ orderEdt.setText("");
|
|
|
|
|
+ if (handoverAdapter != null) {
|
|
|
|
|
+ barcodeInfoList.removeAll(barcodeInfoList);
|
|
|
|
|
+ handoverAdapter.notifyDataSetChanged();
|
|
|
|
|
+ saveBtn.setText("保存(" + barcodeInfoList.size() + ")");
|
|
|
}
|
|
}
|
|
|
- } catch (JSONException e) {
|
|
|
|
|
- e.printStackTrace();
|
|
|
|
|
|
|
+ CommonUtil.playSound(getApplicationContext());
|
|
|
|
|
+ } else {
|
|
|
|
|
+ CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
|
|
|
|
|
+ CommonUtil.showBarCodeAlertDialog(status, message, FinishedProductHandOverActivity.this,
|
|
|
|
|
+ barcodeEdt, null, null);
|
|
|
}
|
|
}
|
|
|
- break;
|
|
|
|
|
|
|
+ } catch (JSONException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ }
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+ // PDA前台标识暂存标识(temporarilyFlag=1)
|
|
|
|
|
+ private void setbarcodeListData(JSONArray arry4,String temporarilyFlag) {
|
|
|
|
|
+ JSONObject jobj6 = arry4.optJSONObject(0);
|
|
|
|
|
+ String outbarcode = jobj6.optString("BARCODE");
|
|
|
|
|
+ if (barcodeInfoList.size() > 0) {
|
|
|
|
|
+ boolean b2 = Removeduplicate.removeBarCode(outbarcode, barcodeInfoList);
|
|
|
|
|
+ if (b2) {
|
|
|
|
|
+ String messageD = "条码" + outbarcode + "重复";
|
|
|
|
|
+ CustomToast.showToast(getApplicationContext(), messageD, 2000);
|
|
|
|
|
+ CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
|
|
|
|
|
+ barcodeEdt.setEnabled(true);
|
|
|
|
|
+ barcodeEdt.setText("");
|
|
|
|
|
+ barcodeEdt.setFocusable(true);
|
|
|
|
|
+ barcodeEdt.setFocusableInTouchMode(true);
|
|
|
|
|
+ barcodeEdt.requestFocus();
|
|
|
|
|
+ barcodeEdt.findFocus();
|
|
|
|
|
+ barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CharSequence filter(CharSequence source, int start, int end,
|
|
|
|
|
+ Spanned dest, int dstart, int dend) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ } });
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ for (int i = 0; i < arry4.length(); i++) {
|
|
|
|
|
+ JSONObject jobj5 = arry4.optJSONObject(i);
|
|
|
|
|
+ int logoId = jobj5.optInt("LOGOID");
|
|
|
|
|
+ String logoCode = jobj5.optString("LOGOCODE");
|
|
|
|
|
+ String logoName = jobj5.optString("LOGONAME");
|
|
|
|
|
+ String goodsCode = jobj5.optString("GOODSCODE");
|
|
|
|
|
+ String finishedBarCode = jobj5.optString("FINISHEDBARCODE");
|
|
|
|
|
+ String outbarcode1 = jobj5.optString("BARCODE");
|
|
|
|
|
+ int userId = jobj5.optInt("USERID");
|
|
|
|
|
+ String groutingUserCode = jobj5.optString("GROUTINGUSERCODE");
|
|
|
|
|
+ String mouldCode = jobj5.optString("MOULDCODE");
|
|
|
|
|
+ String groutingDate = jobj5.optString("GROUTINGDATE");
|
|
|
|
|
+ groutingDate = CommonUtil.commonDateConverter(groutingDate);
|
|
|
|
|
+ String diliverTime = jobj5.optString("DELIVERTIME");
|
|
|
|
|
+ String goodsModel = jobj5.optString("GOODSMODEL");
|
|
|
|
|
+ diliverTime = CommonUtil.commonDateConverter(diliverTime);
|
|
|
|
|
+ BarcodeInfo info = new BarcodeInfo();
|
|
|
|
|
+ info.setBarcode(outbarcode1);
|
|
|
|
|
+ info.setLogoId(logoId);
|
|
|
|
|
+ info.setLogoCode(logoCode);
|
|
|
|
|
+ info.setFinishedBarCode(finishedBarCode);
|
|
|
|
|
+ info.setLogoName(logoName);
|
|
|
|
|
+ info.setGoodsCode(goodsCode);
|
|
|
|
|
+ info.setGoodsModel(goodsModel);
|
|
|
|
|
+ info.setUserId(userId);
|
|
|
|
|
+ info.setUserCode(groutingUserCode);
|
|
|
|
|
+ info.setMouldCode(mouldCode);
|
|
|
|
|
+ info.setGroutingDate(groutingDate);
|
|
|
|
|
+ info.setDeliverTime(diliverTime);
|
|
|
|
|
+// temporarilyFlag 的值暂时用remark替代
|
|
|
|
|
+ if (!TextUtils.isEmpty(temporarilyFlag)) {
|
|
|
|
|
+ info.setRemarks("1");
|
|
|
|
|
+ }
|
|
|
|
|
+ info.setBanMa((jobj5.optString("BANMA") == "null") ? "" : jobj5.optString("BANMA"));
|
|
|
|
|
+
|
|
|
|
|
+ barcodeInfoList.add(info);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (handoverAdapter == null) {
|
|
|
|
|
+ handoverAdapter = new HandOverAdapter(FinishedProductHandOverActivity.this,
|
|
|
|
|
+ barcodeInfoList);
|
|
|
|
|
+ barcodeLst.setAdapter(handoverAdapter);
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+ handoverAdapter.notifyDataSetChanged();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ barcodeEdt.setEnabled(true);
|
|
|
|
|
+ barcodeEdt.setText("");
|
|
|
|
|
+ barcodeEdt.setFocusable(true);
|
|
|
|
|
+ barcodeEdt.setFocusableInTouchMode(true);
|
|
|
|
|
+ barcodeEdt.requestFocus();
|
|
|
|
|
+ barcodeEdt.findFocus();
|
|
|
|
|
+ barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
|
|
|
|
|
+ int dstart, int dend) {
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ } });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public boolean dispatchTouchEvent(MotionEvent ev) {
|
|
public boolean dispatchTouchEvent(MotionEvent ev) {
|
|
|
switch (ev.getAction()) {
|
|
switch (ev.getAction()) {
|
|
|
- case MotionEvent.ACTION_DOWN :
|
|
|
|
|
- View view = getCurrentFocus();
|
|
|
|
|
- CommonUtil.hideKeyboard(ev, view,
|
|
|
|
|
- FinishedProductHandOverActivity.this);// 调用方法判断是否需要隐藏键盘
|
|
|
|
|
- break;
|
|
|
|
|
- default :
|
|
|
|
|
- break;
|
|
|
|
|
|
|
+ case MotionEvent.ACTION_DOWN:
|
|
|
|
|
+ View view = getCurrentFocus();
|
|
|
|
|
+ CommonUtil.hideKeyboard(ev, view, FinishedProductHandOverActivity.this);// 调用方法判断是否需要隐藏键盘
|
|
|
|
|
+ break;
|
|
|
|
|
+ default:
|
|
|
|
|
+ break;
|
|
|
}
|
|
}
|
|
|
return super.dispatchTouchEvent(ev);
|
|
return super.dispatchTouchEvent(ev);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
- protected void onActivityResult(int requestCode, int resultCode,
|
|
|
|
|
- Intent intent) {
|
|
|
|
|
|
|
+ protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
|
|
|
if (requestCode == 101 && resultCode == 103) {
|
|
if (requestCode == 101 && resultCode == 103) {
|
|
|
orderEdt.setEnabled(true);
|
|
orderEdt.setEnabled(true);
|
|
|
orderEdt.setFocusable(true);
|
|
orderEdt.setFocusable(true);
|
|
|
orderEdt.setFocusableInTouchMode(true);
|
|
orderEdt.setFocusableInTouchMode(true);
|
|
|
- orderEdt.setFilters(new InputFilter[]{new InputFilter() {
|
|
|
|
|
|
|
+ orderEdt.setFilters(new InputFilter[] { new InputFilter() {
|
|
|
@Override
|
|
@Override
|
|
|
- public CharSequence filter(CharSequence source, int start,
|
|
|
|
|
- int end, Spanned dest, int dstart, int dend) {
|
|
|
|
|
|
|
+ public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
|
|
|
|
|
+ int dend) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- }});
|
|
|
|
|
|
|
+ } });
|
|
|
barcodeEdt.setEnabled(true);
|
|
barcodeEdt.setEnabled(true);
|
|
|
barcodeEdt.setText("");
|
|
barcodeEdt.setText("");
|
|
|
barcodeEdt.setFocusable(true);
|
|
barcodeEdt.setFocusable(true);
|
|
|
barcodeEdt.setFocusableInTouchMode(true);
|
|
barcodeEdt.setFocusableInTouchMode(true);
|
|
|
barcodeEdt.requestFocus();
|
|
barcodeEdt.requestFocus();
|
|
|
barcodeEdt.findFocus();
|
|
barcodeEdt.findFocus();
|
|
|
- barcodeEdt.setFilters(new InputFilter[]{new InputFilter() {
|
|
|
|
|
|
|
+ barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
|
|
|
@Override
|
|
@Override
|
|
|
- public CharSequence filter(CharSequence source, int start,
|
|
|
|
|
- int end, Spanned dest, int dstart, int dend) {
|
|
|
|
|
|
|
+ public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart,
|
|
|
|
|
+ int dend) {
|
|
|
return null;
|
|
return null;
|
|
|
}
|
|
}
|
|
|
- }});
|
|
|
|
|
|
|
+ } });
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public boolean onCreateOptionsMenu(Menu menu) {
|
|
public boolean onCreateOptionsMenu(Menu menu) {
|
|
|
getMenuInflater().inflate(R.menu.finished_product_handover, menu);
|
|
getMenuInflater().inflate(R.menu.finished_product_handover, menu);
|