|
|
@@ -119,8 +119,7 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
tvTitle.setText(title);
|
|
|
orderEdt.setFocusable(true);
|
|
|
orderEdt.requestFocus();
|
|
|
- orderEdt.findFocus();
|
|
|
- CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
|
|
|
+ orderEdt.findFocus();
|
|
|
allListeners();
|
|
|
thread = new HandlerThread("trademarkThread", 5);
|
|
|
thread.start();
|
|
|
@@ -362,7 +361,9 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
});
|
|
|
barcodeEdt.addTextChangedListener(new TextWatcher() {
|
|
|
@Override
|
|
|
- public void afterTextChanged(Editable arg0) {
|
|
|
+ public void afterTextChanged(Editable arg0) {
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
@Override
|
|
|
public void beforeTextChanged(CharSequence s, int start, int count,
|
|
|
@@ -372,6 +373,16 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
public void onTextChanged(CharSequence s, int start, int before,
|
|
|
int count) {
|
|
|
barcodeUpper = barcodeEdt.getText().toString().trim();
|
|
|
+ if(barcodeUpper.length() >= 73)
|
|
|
+ {
|
|
|
+ String[] parts = barcodeUpper.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2
|
|
|
+
|
|
|
+ if (parts.length == 2) {
|
|
|
+ //System.out.println("第一部分: " + parts[0]);
|
|
|
+ //System.out.println("第二部分: " + parts[1]);
|
|
|
+ barcodeUpper = parts[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
// 判断输入的文字是否是小写
|
|
|
for (int i = 0; i < barcodeUpper.length(); i++) {
|
|
|
if (barcodeUpper.charAt(i) - 0 >= 97
|
|
|
@@ -381,8 +392,22 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
}
|
|
|
if (start == 0 && before == 0 && count > 1) {
|
|
|
String barcode = barcodeEdt.getText().toString();
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
barcode = barcode.trim();
|
|
|
if (!TextUtils.isEmpty(barcode)) {
|
|
|
+
|
|
|
+ if(barcode.length() >= 73)
|
|
|
+ {
|
|
|
+ String[] parts = barcode.split("-", 2); // 第二个参数限制分割后的数组长度,这里为2
|
|
|
+
|
|
|
+ if (parts.length == 2) {
|
|
|
+ //System.out.println("第一部分: " + parts[0]);
|
|
|
+ //System.out.println("第二部分: " + parts[1]);
|
|
|
+ barcode = parts[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
ProcessDialogUtils.showProcessDialog(
|
|
|
FinishedProductHandOverActivity.this);
|
|
|
barcodeEdt.setEnabled(false);
|
|
|
@@ -399,6 +424,7 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
: "";
|
|
|
}
|
|
|
}});
|
|
|
+
|
|
|
thread = new HandlerThread("barcodeThread", 5);
|
|
|
thread.start();
|
|
|
mHandler = new Handler(thread.getLooper());
|
|
|
@@ -415,8 +441,18 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
public boolean onEditorAction(TextView v, int actionId,
|
|
|
KeyEvent event) {
|
|
|
if (actionId == EditorInfo.IME_ACTION_GO) {
|
|
|
- String barcode = barcodeEdt.getText().toString();
|
|
|
+ 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);
|
|
|
@@ -727,8 +763,7 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
int dend) {
|
|
|
return null;
|
|
|
}
|
|
|
- }});
|
|
|
- CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
|
|
|
+ }});
|
|
|
break;
|
|
|
case 1 :
|
|
|
Bundle b1 = msg.getData();
|
|
|
@@ -833,9 +868,7 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
int dend) {
|
|
|
return null;
|
|
|
}
|
|
|
- }});
|
|
|
- CommonUtil.BarcodeMaxLength(barcodeEdt,
|
|
|
- 50);
|
|
|
+ }});
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
@@ -885,137 +918,7 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
(jobj5.optString("BANMA") == "null")
|
|
|
? ""
|
|
|
: jobj5.optString("BANMA"));
|
|
|
- // info.setBarcodeLimitNum(limitNum);
|
|
|
- // if (trademarkSettingValue != null &&
|
|
|
- // trademarkSettingValue.equals("1")) {
|
|
|
- // if (barcodeInfoList != null &&
|
|
|
- // barcodeInfoList.size() > 0) {
|
|
|
- // BarcodeInfo barcodeInfo =
|
|
|
- // barcodeInfoList.get(0);
|
|
|
- // boolean logoFlag =
|
|
|
- // CompareLogoId(barcodeInfo, logoId);
|
|
|
- // if (!logoFlag) {
|
|
|
- //
|
|
|
- // String originalLogoName =
|
|
|
- // barcodeInfo.getLogoName();
|
|
|
- // String message = "此产品[" + barcode +
|
|
|
- // "]的商标[" + logoName + "]与此批次商标["
|
|
|
- // + originalLogoName + "]不同,不能进行该操作";
|
|
|
- // 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.BarcodeMaxLength(barcodeEdt,
|
|
|
- // 50);
|
|
|
- //
|
|
|
- // return;
|
|
|
- //
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (modelSettingValue != null &&
|
|
|
- // modelSettingValue.equals("1")) {
|
|
|
- // if (barcodeInfoList != null &&
|
|
|
- // barcodeInfoList.size() > 0) {
|
|
|
- // BarcodeInfo barcodeInfo =
|
|
|
- // barcodeInfoList.get(0);
|
|
|
- // boolean modelFlag =
|
|
|
- // CompareGoodsModel(barcodeInfo,
|
|
|
- // goodsModel);
|
|
|
- // if (!modelFlag) {
|
|
|
- // String goodsModel1=
|
|
|
- // barcodeInfo.getGoodsModel();
|
|
|
- // //String originalGoodsCode =
|
|
|
- // barcodeInfo.getGoodsCode();
|
|
|
- // String message = "此产品[" + barcode +
|
|
|
- // "]的型号[" + goodsModel + "]与此批次型号["
|
|
|
- // + goodsModel1 + "]不同,不能进行该操作";
|
|
|
- // 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.BarcodeMaxLength(barcodeEdt,
|
|
|
- // 50);
|
|
|
- // return;
|
|
|
- //
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (quantitySettingValue != null &&
|
|
|
- // quantitySettingValue.equals("1")) {
|
|
|
- // if (modelSettingValue.equals("1")) {
|
|
|
- // if (limitNum > 0) {
|
|
|
- // if (barcodeInfoList.size() == limitNum) {
|
|
|
- // String message = "超过最大装板数量[" + limitNum +
|
|
|
- // "]";
|
|
|
- // 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.BarcodeMaxLength(barcodeEdt,
|
|
|
- // 50);
|
|
|
- //
|
|
|
- // return;
|
|
|
- //
|
|
|
- // }
|
|
|
- // }
|
|
|
- // }
|
|
|
- //
|
|
|
- // }
|
|
|
+
|
|
|
barcodeInfoList.add(info);
|
|
|
}
|
|
|
if (handoverAdapter == null) {
|
|
|
@@ -1023,67 +926,11 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
FinishedProductHandOverActivity.this,
|
|
|
barcodeInfoList);
|
|
|
barcodeLst.setAdapter(handoverAdapter);
|
|
|
- // handoverAdapter.setOnRightItemClickListener(new
|
|
|
- // HandOverAdapter.onRightItemClickListener()
|
|
|
- // {
|
|
|
- //
|
|
|
- // @Override
|
|
|
- // public void onRightItemClick(View v, int
|
|
|
- // position) {
|
|
|
- // int pos = position -
|
|
|
- // barcodeLst.getFirstVisiblePosition() + 1;
|
|
|
- // barcodeLst.deleteItem(barcodeLst.getChildAt(pos));
|
|
|
- //
|
|
|
- // barcodeInfoList.remove(position);
|
|
|
- //
|
|
|
- // saveBtn.setText("保存(" +
|
|
|
- // barcodeInfoList.size() + ")");
|
|
|
- // handoverAdapter.notifyDataSetChanged();
|
|
|
- //// if (quantitySettingValue != null &&
|
|
|
- // quantitySettingValue.equals("1")) {
|
|
|
- //// if (modelSettingValue.equals("1")) {
|
|
|
- //// if (limitNum > 0) {
|
|
|
- //// if (barcodeInfoList.size() < limitNum)
|
|
|
- // {
|
|
|
- //// saveBtn.setEnabled(false);
|
|
|
- ////
|
|
|
- //// }
|
|
|
- ////
|
|
|
- //// }
|
|
|
- //// }
|
|
|
- //// }
|
|
|
- // }
|
|
|
- // }
|
|
|
- //
|
|
|
- // );
|
|
|
+
|
|
|
} else {
|
|
|
handoverAdapter.notifyDataSetChanged();
|
|
|
}
|
|
|
- // if (barcodeInfoList != null &&
|
|
|
- // barcodeInfoList.size() > 0) {
|
|
|
- // BarcodeInfo info1 = barcodeInfoList.get(0);
|
|
|
- // limitNum = info1.getBarcodeLimitNum();
|
|
|
- // if (quantitySettingValue != null &&
|
|
|
- // quantitySettingValue.equals("1")) {
|
|
|
- // if (modelSettingValue.equals("1")) {
|
|
|
- // if (limitNum > 0) {
|
|
|
- // if (barcodeInfoList.size() == limitNum) {
|
|
|
- // saveBtn.setEnabled(true);
|
|
|
- //
|
|
|
- // } else {
|
|
|
- // saveBtn.setEnabled(false);
|
|
|
- //
|
|
|
- // }
|
|
|
- // }
|
|
|
- //
|
|
|
- // else {
|
|
|
- // saveBtn.setEnabled(true);
|
|
|
- //
|
|
|
- // }
|
|
|
- // }
|
|
|
- //
|
|
|
- // }
|
|
|
- // }
|
|
|
+
|
|
|
barcodeEdt.setEnabled(true);
|
|
|
barcodeEdt.setText("");
|
|
|
barcodeEdt.setFocusable(true);
|
|
|
@@ -1100,8 +947,7 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
int dend) {
|
|
|
return null;
|
|
|
}
|
|
|
- }});
|
|
|
- CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
|
|
|
+ }});
|
|
|
}
|
|
|
} else {
|
|
|
String message = jobj3.optString("Message");
|
|
|
@@ -1233,8 +1079,7 @@ public class FinishedProductHandOverActivity extends Activity {
|
|
|
int end, Spanned dest, int dstart, int dend) {
|
|
|
return null;
|
|
|
}
|
|
|
- }});
|
|
|
- CommonUtil.BarcodeMaxLength(barcodeEdt, 50);
|
|
|
+ }});
|
|
|
}
|
|
|
}
|
|
|
@Override
|