|
|
@@ -1,7 +1,7 @@
|
|
|
package com.jiaju.activity;
|
|
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
-import java.lang.reflect.Method;
|
|
|
+import java.lang.reflect.Method;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
@@ -22,7 +22,7 @@ import com.jiaju.utils.CommonUtil;
|
|
|
import com.jiaju.utils.Constants;
|
|
|
import com.jiaju.utils.CustomToast;
|
|
|
import com.jiaju.utils.MultiChoiceProcedurePopWindow;
|
|
|
-import com.jiaju.utils.ProcessDialogUtils;
|
|
|
+import com.jiaju.utils.ProcessDialogUtils;
|
|
|
import android.app.Activity;
|
|
|
import android.app.AlertDialog;
|
|
|
import android.app.Dialog;
|
|
|
@@ -50,11 +50,11 @@ import android.view.inputmethod.EditorInfo;
|
|
|
import android.widget.AdapterView;
|
|
|
import android.widget.Button;
|
|
|
import android.widget.EditText;
|
|
|
-import android.widget.ImageButton;
|
|
|
+import android.widget.ImageButton;
|
|
|
import android.widget.ListView;
|
|
|
import android.widget.Spinner;
|
|
|
import android.widget.TextView;
|
|
|
-import android.widget.Toast;
|
|
|
+import android.widget.Toast;
|
|
|
|
|
|
//
|
|
|
public class FactoryTransferInActivity extends Activity {
|
|
|
@@ -69,38 +69,31 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
private SharedPreferences preferences;
|
|
|
private HandlerThread thread;
|
|
|
private Handler mHandler;
|
|
|
- private List<Procedure> procedureList;
|
|
|
- private List<Procedure> checkedProcedureList;
|
|
|
+ private List<Procedure> procedureList;
|
|
|
private TextView title;
|
|
|
- private TextView backtext;
|
|
|
+ private TextView backtext;
|
|
|
private ImageButton backbtn;
|
|
|
private Object obj = new Object();
|
|
|
boolean booleans[];
|
|
|
boolean booleansTemp[];
|
|
|
- boolean[] selItems;
|
|
|
- private View mRootView;
|
|
|
- private MultiChoiceProcedurePopWindow mMultiChoicePopWindow;
|
|
|
- private EditText barcodeEdt;
|
|
|
- private EditText descEdt;
|
|
|
+ boolean[] selItems;
|
|
|
+ private EditText barcodeEdt;
|
|
|
private String barcodeUpper;
|
|
|
private String Lgort;// 发出仓
|
|
|
private TextView procedureTv;
|
|
|
private List<BarcodeInfo> barcodeList;
|
|
|
- private List<SendOutModel> sendOutList;
|
|
|
- private List<ReceiveModel> receiveList;
|
|
|
- private List<CarBrandModel> carBrandList;
|
|
|
+ private List<SendOutModel> sendOutList;
|
|
|
private JSONArray storageJArray;// 库存
|
|
|
private ListView messageLst;
|
|
|
- public Button saveBtn;
|
|
|
- private Spinner sendOutSpinner;
|
|
|
+ public Button saveBtn;
|
|
|
+ private Spinner sendOutSpinner;
|
|
|
private SendOutModel sendOutModel;
|
|
|
private SendOutModel lastSendOutModel;
|
|
|
- private String desc;
|
|
|
- private SendOutSpinnerAdapter sendOutAdapter;
|
|
|
+ private String desc;
|
|
|
+ private SendOutSpinnerAdapter sendOutAdapter;
|
|
|
private Handler barcodeUpperH = new Handler();
|
|
|
- private FactoryTransferInListMessageAdapter adapter;
|
|
|
- private boolean isCancel = false;
|
|
|
- private boolean isFirst = true;
|
|
|
+ private FactoryTransferInListMessageAdapter adapter;
|
|
|
+ private boolean isFirst = true;
|
|
|
private int Height = 188;
|
|
|
private String DATAKEY = "";
|
|
|
|
|
|
@@ -115,33 +108,17 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
send_userCode = preferences.getString("UserCode", "");
|
|
|
password = preferences.getString("UserPassword", "");
|
|
|
sessionkey = preferences.getString("SessionKey", "");
|
|
|
- barcodeList = new ArrayList<BarcodeInfo>();
|
|
|
- initView();
|
|
|
-
|
|
|
-
|
|
|
- procedureTv.setText(send_userCode);
|
|
|
+ barcodeList = new ArrayList<BarcodeInfo>();
|
|
|
+ initView();
|
|
|
+ procedureTv.setText(send_userCode);
|
|
|
allListeners();
|
|
|
-
|
|
|
- thread = new HandlerThread("sendOutThread3", 5);
|
|
|
+// updateDataKey();
|
|
|
+
|
|
|
+ thread = new HandlerThread("HandlerThread2", 5);
|
|
|
thread.start();
|
|
|
mHandler = new Handler(thread.getLooper());
|
|
|
SendOutRunnable glazeRunnable = new SendOutRunnable(obj);
|
|
|
- mHandler.post(glazeRunnable);
|
|
|
- updateDataKey();
|
|
|
- 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;
|
|
|
- }
|
|
|
- } });
|
|
|
+ mHandler.post(glazeRunnable);
|
|
|
}
|
|
|
|
|
|
/** 更新唯一标识 */
|
|
|
@@ -155,7 +132,7 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
// 拼接字符串
|
|
|
DATAKEY = timestamp + "-" + text;
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
private class SendOutRunnable implements Runnable {
|
|
|
private Object object;
|
|
|
|
|
|
@@ -167,7 +144,7 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
public void run() {
|
|
|
synchronized (object) {
|
|
|
try {
|
|
|
- ProcessDialogUtils.showProcessDialog(FactoryTransferInActivity.this);
|
|
|
+ //ProcessDialogUtils.showProcessDialog(FactoryTransferInActivity.this);
|
|
|
client = null;
|
|
|
client = new WebClient();
|
|
|
JSONObject js = new JSONObject();
|
|
|
@@ -200,7 +177,7 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
};
|
|
|
|
|
|
private void allListeners() {
|
|
|
-
|
|
|
+
|
|
|
backbtn.setOnClickListener(new View.OnClickListener() {
|
|
|
|
|
|
@Override
|
|
|
@@ -217,7 +194,6 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
|
|
|
saveBtn.setOnClickListener(new OnClickListener() {
|
|
|
|
|
|
@@ -391,12 +367,7 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
}
|
|
|
|
|
|
};
|
|
|
-
|
|
|
- public void showMultiChoiceWindow() {
|
|
|
- initProcedurePopWindow(booleans);
|
|
|
- mMultiChoicePopWindow.show(true);
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
public boolean removeFinishedBarCode(String code, List<BarcodeInfo> data) {
|
|
|
boolean rem = false;
|
|
|
@@ -407,7 +378,7 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
Method m = null;
|
|
|
Method mouldId = null;
|
|
|
try {
|
|
|
- m = clss.getMethod("getFinishedBarCode");
|
|
|
+ m = clss.getMethod("getBarcode");
|
|
|
} catch (NoSuchMethodException e) {
|
|
|
// TODO Auto-generated catch block
|
|
|
e.printStackTrace();
|
|
|
@@ -485,22 +456,26 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
backbtn = (ImageButton) findViewById(R.id.left_img);
|
|
|
backtext = (TextView) findViewById(R.id.back);
|
|
|
title.setText("工厂调入");
|
|
|
- procedureTv = (TextView) findViewById(R.id.procedureTvFt);
|
|
|
+ View head = View.inflate(this,
|
|
|
+ R.layout.factory_transferin_head, null);
|
|
|
+
|
|
|
+ procedureTv = (TextView) head.findViewById(R.id.procedureTvFt);
|
|
|
procedureTv.setMovementMethod(ScrollingMovementMethod.getInstance());
|
|
|
-
|
|
|
procedureTv.setEllipsize(TextUtils.TruncateAt.MARQUEE);
|
|
|
- procedureTv.setMarqueeRepeatLimit(6);
|
|
|
- mRootView = findViewById(R.id.parentRelF);
|
|
|
- barcodeEdt = (EditText) findViewById(R.id.barcodeEdtt);
|
|
|
+ procedureTv.setMarqueeRepeatLimit(6);
|
|
|
+ barcodeEdt = (EditText) head.findViewById(R.id.barcodeEdtt);
|
|
|
barcodeEdt.setRawInputType(InputType.TYPE_CLASS_NUMBER);
|
|
|
- CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
|
|
|
- descEdt = (EditText) findViewById(R.id.descEdt);
|
|
|
+ sendOutSpinner = (Spinner) head.findViewById(R.id.fatory_transfer_in);
|
|
|
+ CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
|
|
|
messageLst = (ListView) findViewById(R.id.message_listview_ft);
|
|
|
+ messageLst.addHeaderView(head, null, false);
|
|
|
+ adapter = new FactoryTransferInListMessageAdapter(FactoryTransferInActivity.this,
|
|
|
+ barcodeList);
|
|
|
+ messageLst.setAdapter(adapter);
|
|
|
saveBtn = (Button) findViewById(R.id.btnSaveFT);
|
|
|
- sendOutSpinner = (Spinner) findViewById(R.id.fatory_transfer_in);
|
|
|
+
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
private class SaveRunnable implements Runnable {
|
|
|
|
|
|
@Override
|
|
|
@@ -509,10 +484,9 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
try {
|
|
|
JSONObject js = new JSONObject();
|
|
|
|
|
|
- JSONObject js6 = new JSONObject();
|
|
|
+ JSONObject js6 = new JSONObject();
|
|
|
js6.put("USERCODE", send_userCode);
|
|
|
- js6.put("DATAKEY", DATAKEY);
|
|
|
-
|
|
|
+// js6.put("DATAKEY", DATAKEY);
|
|
|
if (sendOutSpinner.getSelectedItem() == null) {
|
|
|
CustomToast.showToast(getApplicationContext(), "调出工厂不能为空", 2000);
|
|
|
ProcessDialogUtils.closeProgressDilog();
|
|
|
@@ -528,23 +502,21 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
js6.put("WAREHOUSINGID", model.getSendOutId());
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
|
|
|
js.put("setEntity", js6);
|
|
|
- if (barcodeList != null && barcodeList.size() > 0) {
|
|
|
- JSONArray jarray6 = new JSONArray();
|
|
|
+ JSONArray jarrayDetails = new JSONArray();
|
|
|
+ if (barcodeList != null && barcodeList.size() > 0) {
|
|
|
for (BarcodeInfo bd : barcodeList) {
|
|
|
- JSONObject jo6 = new JSONObject();
|
|
|
- jo6.put("Banma", bd.getBanMa());
|
|
|
+ JSONObject jo6 = new JSONObject();
|
|
|
+ jo6.put("BARCODE", bd.getBarcode());
|
|
|
jo6.put("GOODSCODE", bd.getGoodsCode());
|
|
|
- jo6.put("MATERIALCODE", bd.getLogoCode());
|
|
|
- jo6.put("MATERIALREMARK", bd.getLogoName());
|
|
|
- jo6.put("BINDINGCount", bd.getOrderNo());
|
|
|
- jo6.put("FINISHEDLOADBATCHNO", bd.getFinishedBarCode());
|
|
|
- jarray6.put(jo6);
|
|
|
+ jo6.put("MATERIALCODE", bd.getMaterialCode());
|
|
|
+ jo6.put("GOODSID", bd.getGoodsId());
|
|
|
+ jo6.put("LOGOID", bd.getLogoId());
|
|
|
+ jo6.put("LOGONAME", bd.getLogoName());
|
|
|
+ jarrayDetails.put(jo6);
|
|
|
}
|
|
|
- js.put("setDetailEntity", jarray6);
|
|
|
+ js.put("setDetailEntity", jarrayDetails);
|
|
|
} else {
|
|
|
CustomToast.showToast(getApplicationContext(), "产品信息不能为空", 2000);
|
|
|
ProcessDialogUtils.closeProgressDilog();
|
|
|
@@ -557,7 +529,9 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
js5.put("sessionKey", sessionkey);
|
|
|
js5.put("module", "DockingLuoci");
|
|
|
js5.put("action", "SaveDockingLuoci");
|
|
|
- js5.put("jsonData", js.toString());
|
|
|
+ JSONObject data = new JSONObject();
|
|
|
+ data.put("Table", jarrayDetails);
|
|
|
+ js5.put("jsonData", data.toString());
|
|
|
String result = client.doPost(
|
|
|
"http://" + serverAddress_ip + ":" + serverAddress_port + Constants.serverAction + "/DoAction",
|
|
|
js5.toString(), "application/json");
|
|
|
@@ -603,8 +577,9 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
js.put("action", "CheckDockingLuoci");
|
|
|
JSONObject data = new JSONObject();
|
|
|
data.put("barcode", barcode);
|
|
|
- SendOutModel model = (SendOutModel) sendOutSpinner.getSelectedItem();
|
|
|
+ SendOutModel model = (SendOutModel) sendOutSpinner.getSelectedItem();
|
|
|
data.put("workshop", model.getSendOutId());
|
|
|
+// data.put("workshop", 154);
|
|
|
js.put("jsonData", data.toString());
|
|
|
|
|
|
String result = client.doPost(
|
|
|
@@ -631,7 +606,7 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
}
|
|
|
|
|
|
Handler handler = new Handler() {
|
|
|
-
|
|
|
+ @SuppressWarnings("unchecked")
|
|
|
@Override
|
|
|
public void handleMessage(Message msg) {
|
|
|
switch (msg.what) {
|
|
|
@@ -665,8 +640,7 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
procedureList.add(procedure);
|
|
|
}
|
|
|
|
|
|
- booleans = new boolean[procedureList.size()];
|
|
|
- initProcedurePopWindow(booleans);
|
|
|
+ booleans = new boolean[procedureList.size()];
|
|
|
|
|
|
}
|
|
|
} else {
|
|
|
@@ -695,82 +669,13 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
String message = object.optString("Message");
|
|
|
|
|
|
if (status == 0) {
|
|
|
-
|
|
|
- String result = object.optString("Result");
|
|
|
- JSONArray jArray = new JSONArray(result);
|
|
|
-
|
|
|
- String mCODE = ((JSONObject) jArray.opt(0)).optString("MATERIALCODE");
|
|
|
- String Count = ((JSONObject) jArray.opt(0)).optString("COUNT");
|
|
|
- int mcount = 0;
|
|
|
- for (BarcodeInfo bd : barcodeList) {
|
|
|
- if (bd.getLogoCode().equals(mCODE)) {
|
|
|
- mcount = mcount + Integer.parseInt(bd.getOrderNo());
|
|
|
- }
|
|
|
- }
|
|
|
- int storageConout = 0;
|
|
|
- if (storageJArray != null && storageJArray.length() > 0) {
|
|
|
- for (int i = 0; i < storageJArray.length(); i++) {
|
|
|
-
|
|
|
- JSONObject sobject = (JSONObject) storageJArray.opt(i);
|
|
|
- String MATERIALCODE = sobject.optString("MATNR");
|
|
|
- if (MATERIALCODE.equals(mCODE)) {
|
|
|
- storageConout = storageConout
|
|
|
- + (int) Double.parseDouble(sobject.optString("LABST"));// sap库存
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
- boolean a = false;
|
|
|
- if ((Double.parseDouble(Count)) > (double) (storageConout - mcount)) {
|
|
|
- a = !a;
|
|
|
- }
|
|
|
- if (status == 0) {
|
|
|
- for (int i = 0; i < jArray.length(); i++) {
|
|
|
- JSONObject object2 = (JSONObject) jArray.opt(i);
|
|
|
- String barcode = object2.optString("BANMA");
|
|
|
- String goodsCode = object2.optString("GOODSCODE");
|
|
|
- String LogoCode = object2.optString("MATERIALCODE");
|
|
|
- String LogoName = object2.optString("MATERIALREMARK");
|
|
|
- int orderNo = object2.optInt("COUNT");
|
|
|
- boolean isHas = removeFinishedBarCode(object2.optString("FINISHEDLOADBATCHNO"),
|
|
|
- barcodeList);
|
|
|
- if (isHas) {
|
|
|
- CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
|
|
|
-
|
|
|
- CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
|
|
|
-
|
|
|
- CustomToast.showToast(getApplicationContext(), "条码重复", 2000);
|
|
|
-
|
|
|
- break;
|
|
|
- }
|
|
|
- if (!a) {
|
|
|
- BarcodeInfo barcodeInfo = new BarcodeInfo();
|
|
|
- barcodeInfo.setBanMa(barcode == "null" ? "" : barcode);
|
|
|
- barcodeInfo.setGoodsCode(goodsCode);
|
|
|
- barcodeInfo.setLogoCode(LogoCode);
|
|
|
- barcodeInfo.setLogoName(LogoName);
|
|
|
- barcodeInfo.setOrderNo(String.valueOf(orderNo));
|
|
|
- barcodeInfo.setFinishedBarCode(object2.optString("FINISHEDLOADBATCHNO"));// 判断是否重复
|
|
|
- barcodeList.add(barcodeInfo);
|
|
|
- }
|
|
|
- }
|
|
|
- if (a) {
|
|
|
- // CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
|
|
|
- CommonUtil.showBarCodeAlertDialog(0, "库存不足", FactoryTransferInActivity.this, barcodeEdt,
|
|
|
- null, null);
|
|
|
- return;
|
|
|
- }
|
|
|
- if (adapter == null) {
|
|
|
- adapter = new FactoryTransferInListMessageAdapter(FactoryTransferInActivity.this,
|
|
|
- barcodeList);
|
|
|
- messageLst.setAdapter(adapter);
|
|
|
- } else {
|
|
|
- adapter.notifyDataSetChanged();
|
|
|
- // messageLst.getLayoutParams().height=(messageLst.getHeight()+Height);
|
|
|
- messageLst.getLayoutParams().height = (barcodeList.size() * Height);
|
|
|
- }
|
|
|
-
|
|
|
- saveBtn.setText("保存(" + barcodeList.size() + ")");
|
|
|
+
|
|
|
+ // barcodeList 必须先保存前面的板码信息,然后才能在扫描
|
|
|
+ if (barcodeList!=null && barcodeList.size() > 0) {
|
|
|
+ message = "必须先保存当前的产品信息,不能进行多板扫码操作";
|
|
|
+ CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
|
|
|
+ CommonUtil.showBarCodeAlertDialog(0, message, FactoryTransferInActivity.this, barcodeEdt, null,
|
|
|
+ null);
|
|
|
barcodeEdt.setEnabled(true);
|
|
|
barcodeEdt.setText("");
|
|
|
barcodeEdt.setFocusable(true);
|
|
|
@@ -786,17 +691,71 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
}
|
|
|
} });
|
|
|
CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
|
|
|
- // InputMethodManager im = (InputMethodManager) barcodeEdt
|
|
|
- // .getContext().getSystemService(
|
|
|
- // Context.INPUT_METHOD_SERVICE);
|
|
|
- // im.hideSoftInputFromWindow(ProductSuspendActivity.this
|
|
|
- // .getCurrentFocus().getWindowToken(),
|
|
|
- // InputMethodManager.HIDE_NOT_ALWAYS);
|
|
|
+
|
|
|
ProcessDialogUtils.closeProgressDilog();
|
|
|
-
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ String result = object.optString("Result");
|
|
|
+ JSONObject jobj4 = new JSONObject(result);
|
|
|
+ JSONArray jArray = jobj4.optJSONArray("Table");
|
|
|
+
|
|
|
+ for (int i = 0; i < jArray.length(); i++) {
|
|
|
+ JSONObject object2 = (JSONObject) jArray.opt(i);
|
|
|
+ String barcode = object2.optString("BARCODE");
|
|
|
+ String materialCode = object2.optString("MATERIALCODE");
|
|
|
+ String goodsCode = object2.optString("GOODSCODE");
|
|
|
+ int goodsId = object2.optInt("GOODSID");
|
|
|
+ String logoName = object2.optString("LOGONAME");
|
|
|
+ int logoId = object2.optInt("LOGOID");
|
|
|
+ boolean isHas = removeFinishedBarCode(object2.optString("BARCODE"),
|
|
|
+ barcodeList);
|
|
|
+ if (isHas) {
|
|
|
+ CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
|
|
|
+ CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
|
|
|
+ CustomToast.showToast(getApplicationContext(), "条码重复", 2000);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ BarcodeInfo barcodeInfo = new BarcodeInfo();
|
|
|
+ barcodeInfo.setBarcode( barcode);
|
|
|
+ barcodeInfo.setGoodsId(goodsId);
|
|
|
+ barcodeInfo.setGoodsCode(goodsCode);
|
|
|
+ barcodeInfo.setLogoId(logoId);
|
|
|
+ barcodeInfo.setLogoName(logoName);
|
|
|
+ barcodeInfo.setMaterialCode(materialCode);
|
|
|
+ barcodeList.add(barcodeInfo);
|
|
|
+ }
|
|
|
+ // messageLst.getLayoutParams().height = (barcodeList.size() * Height);
|
|
|
+ if (adapter == null) {
|
|
|
+ adapter = new FactoryTransferInListMessageAdapter(FactoryTransferInActivity.this,
|
|
|
+ barcodeList);
|
|
|
+ messageLst.setAdapter(adapter);
|
|
|
+ } else {
|
|
|
+ adapter.notifyDataSetChanged();
|
|
|
+ // messageLst.getLayoutParams().height=(messageLst.getHeight()+Height);
|
|
|
+ // messageLst.getLayoutParams().height = (barcodeList.size() * Height);
|
|
|
}
|
|
|
- } else if (status == -1) {
|
|
|
- message = message;
|
|
|
+
|
|
|
+ saveBtn.setText("保存(" + barcodeList.size() + ")");
|
|
|
+ barcodeEdt.setEnabled(true);
|
|
|
+ barcodeEdt.setText("");
|
|
|
+ barcodeEdt.setFocusable(true);
|
|
|
+ barcodeEdt.setFocusableInTouchMode(true);
|
|
|
+ barcodeEdt.requestFocus();
|
|
|
+ barcodeEdt.findFocus();
|
|
|
+ barcodeEdt.setFilters(new InputFilter[] { new InputFilter() {
|
|
|
+ @Override
|
|
|
+ public CharSequence filter(CharSequence source, int start, int end, Spanned dest,
|
|
|
+ int dstart, int dend) {
|
|
|
+
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ } });
|
|
|
+ CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
|
|
|
+
|
|
|
+ ProcessDialogUtils.closeProgressDilog();
|
|
|
+
|
|
|
+ } else if (status == -1) {
|
|
|
CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
|
|
|
CommonUtil.showBarCodeAlertDialog(0, message, FactoryTransferInActivity.this, barcodeEdt, null,
|
|
|
null);
|
|
|
@@ -867,13 +826,11 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
}).create();
|
|
|
alertDialog.setCanceledOnTouchOutside(false);
|
|
|
alertDialog.show();
|
|
|
-
|
|
|
-
|
|
|
|
|
|
} else {
|
|
|
CommonUtil.setDefault(Notification.DEFAULT_VIBRATE, getApplicationContext());
|
|
|
CommonUtil.showSaveAlertDialog(0, message, FactoryTransferInActivity.this, null, barcodeEdt, 2);
|
|
|
- updateDataKey();
|
|
|
+// updateDataKey();
|
|
|
|
|
|
}
|
|
|
} catch (JSONException e) {
|
|
|
@@ -919,8 +876,7 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
case 10:
|
|
|
ProcessDialogUtils.closeProgressDilog();
|
|
|
if (mHandler != null) {
|
|
|
@@ -987,7 +943,7 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
-
|
|
|
+
|
|
|
CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
|
|
|
// InputMethodManager im = (InputMethodManager) barcodeEdt
|
|
|
// .getContext().getSystemService(
|
|
|
@@ -1014,63 +970,7 @@ public class FactoryTransferInActivity extends Activity {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
- public void initProcedurePopWindow(boolean[] bool) {
|
|
|
-
|
|
|
- mMultiChoicePopWindow = new MultiChoiceProcedurePopWindow(this, mRootView, procedureList, bool);
|
|
|
-
|
|
|
- mMultiChoicePopWindow.setTitle("工序列表");
|
|
|
- mMultiChoicePopWindow.setOnOKButtonListener(new OnClickListener() {
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- selItems = mMultiChoicePopWindow.getSelectItem();
|
|
|
- booleansTemp = selItems.clone();
|
|
|
- checkedProcedureList = new ArrayList<Procedure>();
|
|
|
- StringBuffer stringBuffer = new StringBuffer();
|
|
|
- if (selItems != null && selItems.length > 0) {
|
|
|
- int size = selItems.length;
|
|
|
- stringBuffer.append("【");
|
|
|
- for (int i = 0; i < size; i++) {
|
|
|
- if (selItems[i]) {
|
|
|
- stringBuffer.append(procedureList.get(i).getProcedureName());
|
|
|
-
|
|
|
- stringBuffer.append("、");
|
|
|
- checkedProcedureList.add(procedureList.get(i));
|
|
|
- }
|
|
|
- }
|
|
|
- if (checkedProcedureList != null && checkedProcedureList.size() > 0) {
|
|
|
- String procedure = stringBuffer.toString();
|
|
|
-
|
|
|
- if (procedure.length() > 0) {
|
|
|
- procedure = procedure.substring(0, procedure.length() - 1);
|
|
|
- StringBuffer procedureStringBuffer = new StringBuffer();
|
|
|
- procedureStringBuffer.append(procedure);
|
|
|
- procedureStringBuffer.append("】");
|
|
|
- procedure = procedureStringBuffer.toString();
|
|
|
- procedureTv.setText(procedure);
|
|
|
- }
|
|
|
- } else {
|
|
|
- checkedProcedureList = null;
|
|
|
- procedureTv.setText("");
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
-
|
|
|
- mMultiChoicePopWindow.setOnCancelButtonListener(new OnClickListener() {
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onClick(View v) {
|
|
|
- if (booleansTemp != null && booleansTemp.length > 0) {
|
|
|
- booleans = booleansTemp.clone();
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- });
|
|
|
-
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public boolean onCreateOptionsMenu(Menu menu) {
|