|
|
@@ -51,7 +51,7 @@ import android.widget.PopupWindow;
|
|
|
import android.widget.TextView;
|
|
|
import android.widget.TextView.OnEditorActionListener;
|
|
|
import android.widget.Toast;
|
|
|
-
|
|
|
+//点数装板
|
|
|
public class PieceActivity extends Activity {
|
|
|
private EditText met; // 工号
|
|
|
private EditText barcode; // 条码
|
|
|
@@ -121,7 +121,7 @@ public class PieceActivity extends Activity {
|
|
|
setContentView(R.layout.activity_pieces);
|
|
|
piecelist = new ArrayList<Piece>();
|
|
|
initview();
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
alllistener();
|
|
|
Intent intent = getIntent();
|
|
|
Bundle bundle = intent.getExtras();
|
|
|
@@ -303,7 +303,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
CommonUtil.setDefault(
|
|
|
Notification.DEFAULT_VIBRATE,
|
|
|
getApplicationContext());
|
|
|
@@ -660,6 +660,13 @@ public class PieceActivity extends Activity {
|
|
|
if (barcode.getText().toString().contains("\n")) {
|
|
|
String etcode = barcode.getText().toString().trim()
|
|
|
.replaceAll("\\n", "");
|
|
|
+ if(etcode.length() >= 73)
|
|
|
+ {
|
|
|
+ String[] parts = etcode.split("-", 2);
|
|
|
+ if (parts.length == 2) {
|
|
|
+ etcode = parts[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
String workno = met.getText().toString();
|
|
|
if (TextUtils.isEmpty(workno)) {
|
|
|
// Toast.makeText(getApplicationContext(), "生产工号不能为空",
|
|
|
@@ -778,7 +785,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
CommonUtil.setDefault(
|
|
|
Notification.DEFAULT_VIBRATE,
|
|
|
getApplicationContext());
|
|
|
@@ -833,6 +840,13 @@ public class PieceActivity extends Activity {
|
|
|
public void onTextChanged(CharSequence s, int start, int before,
|
|
|
int count) {
|
|
|
barcodeUpper = barcode.getText().toString();
|
|
|
+ if(barcodeUpper.length() >= 73)
|
|
|
+ {
|
|
|
+ String[] parts = barcodeUpper.split("-", 2);
|
|
|
+ if (parts.length == 2) {
|
|
|
+ barcodeUpper = parts[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
// 判断输入的文字是否是小写
|
|
|
for (int i = 0; i < barcodeUpper.length(); i++) {
|
|
|
if (barcodeUpper.charAt(i) - 0 >= 97
|
|
|
@@ -891,6 +905,13 @@ public class PieceActivity extends Activity {
|
|
|
}
|
|
|
|
|
|
String etcode = barcode.getText().toString().trim();
|
|
|
+ if(etcode.length() >= 73)
|
|
|
+ {
|
|
|
+ String[] parts = etcode.split("-", 2);
|
|
|
+ if (parts.length == 2) {
|
|
|
+ etcode = parts[1];
|
|
|
+ }
|
|
|
+ }
|
|
|
ProcessDialogUtils
|
|
|
.showProcessDialog(PieceActivity.this);
|
|
|
barcode.setEnabled(false);
|
|
|
@@ -967,7 +988,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
CommonUtil.setDefault(
|
|
|
Notification.DEFAULT_VIBRATE,
|
|
|
getApplicationContext());
|
|
|
@@ -1031,7 +1052,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
@@ -1079,7 +1100,7 @@ public class PieceActivity extends Activity {
|
|
|
}
|
|
|
} });
|
|
|
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
userID1 = object.getString("UserID");
|
|
|
userCode1 = object.getString("UserCode");
|
|
|
userName1 = object.getString("UserName");
|
|
|
@@ -1211,7 +1232,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
break;
|
|
|
case 1:
|
|
|
ProcessDialogUtils.closeProgressDilog();
|
|
|
@@ -1258,7 +1279,7 @@ public class PieceActivity extends Activity {
|
|
|
}
|
|
|
} });
|
|
|
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
break;
|
|
|
|
|
|
case 2:
|
|
|
@@ -1406,7 +1427,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -1577,7 +1598,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
}
|
|
|
// 如果是水校标识界面过来的 barcode成功返回后 直接关闭界面
|
|
|
if("wangyingjie".equals(NewWaterEfficiencyLabelActivity)) {
|
|
|
@@ -1676,7 +1697,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
InputMethodManager im = (InputMethodManager) barcode
|
|
|
.getContext().getSystemService(
|
|
|
Context.INPUT_METHOD_SERVICE);
|
|
|
@@ -2185,7 +2206,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
}
|
|
|
|
|
|
if(requestCode==103&&resultCode==104) {
|
|
|
@@ -2203,7 +2224,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
}
|
|
|
if (requestCode == 102 && resultCode == RESULT_OK) {
|
|
|
Bundle bundle = intent.getExtras();
|
|
|
@@ -2364,7 +2385,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
|
|
|
CommonUtil.setDefault(Notification.DEFAULT_VIBRATE,
|
|
|
getApplicationContext());
|
|
|
@@ -2422,7 +2443,7 @@ public class PieceActivity extends Activity {
|
|
|
return null;
|
|
|
}
|
|
|
} });
|
|
|
- CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
+ //CommonUtil.BarcodeMaxLength(barcode, 50);
|
|
|
return;
|
|
|
|
|
|
}
|