|
|
@@ -117,7 +117,7 @@ public class SCSMTCheckFragment extends BaseFragment implements View.OnClickList
|
|
|
private LineInfoBean mLineInfoBean;
|
|
|
private AutoCompleteTextView mCollectEditText;
|
|
|
private Button mConfirmButton;
|
|
|
- private String mSmtLocationCache;
|
|
|
+// private String mSmtLocationCache;
|
|
|
private boolean mIgnoreFocusChange = false;
|
|
|
private SmtDslBean mSmtDslBean = new SmtDslBean();
|
|
|
private TextViewWithButton mLocationTextView;
|
|
|
@@ -481,17 +481,7 @@ public class SCSMTCheckFragment extends BaseFragment implements View.OnClickList
|
|
|
locationCheck(collect, location);
|
|
|
} else {
|
|
|
mSmtDslBean.setDsl_barcode(collect);
|
|
|
- /*if (mUpRadioButton.isChecked() || (mJoinRadioButton.isChecked() && COLLECT_PRODCODE.equals(mCollectEditText.getHint().toString()))) {
|
|
|
- smtCheck(collect, location);
|
|
|
- } else {
|
|
|
- joinDataCheck(collect, location);
|
|
|
- }*/
|
|
|
-
|
|
|
- if (mMaterialSwitch) {
|
|
|
- requestCheck(collect, location);
|
|
|
- } else {
|
|
|
- smtCheck(collect, location);
|
|
|
- }
|
|
|
+ requestCheck(collect, location);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -547,144 +537,144 @@ public class SCSMTCheckFragment extends BaseFragment implements View.OnClickList
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- private void joinDataCheck(final String collect, final String location) {
|
|
|
- progressDialog.show();
|
|
|
-
|
|
|
- PdaApplication.mRequestQueue.cancelAll(TAG + "datacheck");
|
|
|
-
|
|
|
- mStringRequest = new StringRequest(Request.Method.POST, GloableParams.ADDRESS_SMT_JOIN_FORECASTDATA_CHECK,
|
|
|
- new Response.Listener<String>() {
|
|
|
- @Override
|
|
|
- public void onResponse(String s) {
|
|
|
- if (progressDialog.isShowing())
|
|
|
- progressDialog.dismiss();
|
|
|
- joinDataCheck(collect, location, "原物料号校验正确", true);
|
|
|
- }
|
|
|
- },
|
|
|
- new Response.ErrorListener() {
|
|
|
- @Override
|
|
|
- public void onErrorResponse(VolleyError volleyError) {
|
|
|
- if (progressDialog.isShowing())
|
|
|
- progressDialog.dismiss();
|
|
|
- String errorToast = CommonUtil.showErrorToast(volleyError, false);
|
|
|
- joinDataCheck(collect, location, errorToast, false);
|
|
|
- }
|
|
|
- }) {
|
|
|
- @Override
|
|
|
- public Map<String, String> getHeaders() throws AuthFailureError {
|
|
|
- return VolleyUtil.getVolleyUtil().setCookies();
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- protected Map<String, String> getParams() throws AuthFailureError {
|
|
|
- Map<String, String> params = new HashMap<>();
|
|
|
- Map<String, Object> dslMap = new HashMap<>();
|
|
|
- if (mUpRadioButton.isChecked()) {
|
|
|
- dslMap.put("type", "loading");
|
|
|
- } else if (mJoinRadioButton.isChecked()) {
|
|
|
- dslMap.put("type", "join");
|
|
|
- }
|
|
|
- dslMap.put("dsl_location", location);
|
|
|
- dslMap.put("dsl_prodcode", collect);
|
|
|
- dslMap.put("success", true);
|
|
|
-
|
|
|
- params.put("dsl", JSON.toJSONString(dslMap));
|
|
|
- params.put("deviceLineMake", JSON.toJSONString(mLineInfoBean));
|
|
|
- Log.d("paramjson", params.toString());
|
|
|
- return params;
|
|
|
- }
|
|
|
- };
|
|
|
- mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
|
|
|
- mStringRequest.setTag(TAG + "datacheck");
|
|
|
- PdaApplication.mRequestQueue.add(mStringRequest);
|
|
|
- }
|
|
|
-
|
|
|
- private void joinDataCheck(String collect, String location, String dataCheckResult, boolean isSuccess) {
|
|
|
- tvMsgProdcode.setText("");
|
|
|
- tvMsgLocation.setText("");
|
|
|
- tvMsgBarcode.setText("");
|
|
|
- tvMsgQuantity.setText("");
|
|
|
- tvMsgSpec.setText("");
|
|
|
-
|
|
|
- collect = mLocationTextView.getText().toString().trim();
|
|
|
-
|
|
|
- if (!TextUtils.isEmpty(mSmtLocationCache)) {
|
|
|
- try {
|
|
|
- JSONArray locationArray = new JSONArray(mSmtLocationCache);
|
|
|
- boolean isExist = false;
|
|
|
- for (int i = 0; i < locationArray.length(); i++) {
|
|
|
- JSONObject locationObject = locationArray.getJSONObject(i);
|
|
|
- if (collect.equals(JsonUtils.optStringNotNull(locationObject, "PSL_LOCATION"))) {
|
|
|
- isExist = true;
|
|
|
- mLocationTextView.setText(collect);
|
|
|
- mCollectEditText.setText("");
|
|
|
-
|
|
|
- String psl_prodcode = JsonUtils.optStringNotNull(locationObject, "PSL_PRODCODE");
|
|
|
- String psl_repcode = JsonUtils.optStringNotNull(locationObject, "PSL_REPCODE");
|
|
|
- mSmtDslBean = new SmtDslBean();
|
|
|
- mSmtDslBean.setDsl_location(location);
|
|
|
- mSmtDslBean.setDsl_prodcode(psl_prodcode);
|
|
|
- mSmtDslBean.setDsl_repcode(psl_repcode);
|
|
|
-
|
|
|
- mAutoStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, new ArrayList<String>());
|
|
|
- mCollectEditText.setAdapter(mAutoStringAdapter);
|
|
|
-
|
|
|
- mCollectEditText.setHint(COLLECT_PRODCODE);
|
|
|
- if (!TextUtils.isEmpty(psl_repcode)) {
|
|
|
- String[] repcodes = psl_repcode.split(",");
|
|
|
- String notice = dataCheckResult + "\n请采集接料的物料号";
|
|
|
- for (int j = 0; j < repcodes.length; j++) {
|
|
|
- String repcode = repcodes[j];
|
|
|
- notice = notice + "\n" + repcode;
|
|
|
- }
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.green));
|
|
|
- if (isSuccess) {
|
|
|
- tvMsgNotice.setText(notice);
|
|
|
- } else {
|
|
|
- SpannableString spannableString = CommonUtil.spanString(notice, mActivity, 0, dataCheckResult.length(), R.color.red);
|
|
|
- tvMsgNotice.setText(spannableString);
|
|
|
- }
|
|
|
- } else if (!TextUtils.isEmpty(psl_prodcode)) {
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.green));
|
|
|
- if (isSuccess) {
|
|
|
- tvMsgNotice.setText(dataCheckResult + "\n请采集接料的物料号\n" + psl_prodcode);
|
|
|
- } else {
|
|
|
- SpannableString spannableString = CommonUtil.spanString(dataCheckResult + "\n请采集接料的物料号\n" + psl_prodcode, mActivity, 0, dataCheckResult.length(), R.color.red);
|
|
|
- tvMsgNotice.setText(spannableString);
|
|
|
- }
|
|
|
-
|
|
|
- } else {
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
- if (isSuccess) {
|
|
|
- CommonUtil.spanString(dataCheckResult + "\n物料编号获取失败", mActivity, 0, dataCheckResult.length(), R.color.green);
|
|
|
- tvMsgNotice.setText(dataCheckResult + "\n物料编号获取失败");
|
|
|
- } else {
|
|
|
- tvMsgNotice.setText(dataCheckResult + "\n物料编号获取失败");
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!isExist) {
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
- String notice = "站位编号错误\n" + mNoticeStr;
|
|
|
- SpannableString spannableString = CommonUtil.spanString(notice, mActivity, "站位编号错误\n".length(), notice.length(), R.color.green);
|
|
|
- tvMsgNotice.setText(spannableString);
|
|
|
- CommonUtil.makeNotice();
|
|
|
- mCollectEditText.setText("");
|
|
|
- }
|
|
|
- } catch (JSONException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- } else {
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
- String notice = "站位编号错误\n" + mNoticeStr;
|
|
|
- SpannableString spannableString = CommonUtil.spanString(notice, mActivity, "站位编号错误\n".length(), notice.length(), R.color.green);
|
|
|
- tvMsgNotice.setText(spannableString);
|
|
|
- CommonUtil.makeNotice();
|
|
|
- mCollectEditText.setText("");
|
|
|
- }
|
|
|
- }
|
|
|
+// private void joinDataCheck(final String collect, final String location) {
|
|
|
+// progressDialog.show();
|
|
|
+//
|
|
|
+// PdaApplication.mRequestQueue.cancelAll(TAG + "datacheck");
|
|
|
+//
|
|
|
+// mStringRequest = new StringRequest(Request.Method.POST, GloableParams.ADDRESS_SMT_JOIN_FORECASTDATA_CHECK,
|
|
|
+// new Response.Listener<String>() {
|
|
|
+// @Override
|
|
|
+// public void onResponse(String s) {
|
|
|
+// if (progressDialog.isShowing())
|
|
|
+// progressDialog.dismiss();
|
|
|
+// joinDataCheck(collect, location, "原物料号校验正确", true);
|
|
|
+// }
|
|
|
+// },
|
|
|
+// new Response.ErrorListener() {
|
|
|
+// @Override
|
|
|
+// public void onErrorResponse(VolleyError volleyError) {
|
|
|
+// if (progressDialog.isShowing())
|
|
|
+// progressDialog.dismiss();
|
|
|
+// String errorToast = CommonUtil.showErrorToast(volleyError, false);
|
|
|
+// joinDataCheck(collect, location, errorToast, false);
|
|
|
+// }
|
|
|
+// }) {
|
|
|
+// @Override
|
|
|
+// public Map<String, String> getHeaders() throws AuthFailureError {
|
|
|
+// return VolleyUtil.getVolleyUtil().setCookies();
|
|
|
+// }
|
|
|
+//
|
|
|
+// @Override
|
|
|
+// protected Map<String, String> getParams() throws AuthFailureError {
|
|
|
+// Map<String, String> params = new HashMap<>();
|
|
|
+// Map<String, Object> dslMap = new HashMap<>();
|
|
|
+// if (mUpRadioButton.isChecked()) {
|
|
|
+// dslMap.put("type", "loading");
|
|
|
+// } else if (mJoinRadioButton.isChecked()) {
|
|
|
+// dslMap.put("type", "join");
|
|
|
+// }
|
|
|
+// dslMap.put("dsl_location", location);
|
|
|
+// dslMap.put("dsl_prodcode", collect);
|
|
|
+// dslMap.put("success", true);
|
|
|
+//
|
|
|
+// params.put("dsl", JSON.toJSONString(dslMap));
|
|
|
+// params.put("deviceLineMake", JSON.toJSONString(mLineInfoBean));
|
|
|
+// Log.d("paramjson", params.toString());
|
|
|
+// return params;
|
|
|
+// }
|
|
|
+// };
|
|
|
+// mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
|
|
|
+// mStringRequest.setTag(TAG + "datacheck");
|
|
|
+// PdaApplication.mRequestQueue.add(mStringRequest);
|
|
|
+// }
|
|
|
+//
|
|
|
+// private void joinDataCheck(String collect, String location, String dataCheckResult, boolean isSuccess) {
|
|
|
+// tvMsgProdcode.setText("");
|
|
|
+// tvMsgLocation.setText("");
|
|
|
+// tvMsgBarcode.setText("");
|
|
|
+// tvMsgQuantity.setText("");
|
|
|
+// tvMsgSpec.setText("");
|
|
|
+//
|
|
|
+// collect = mLocationTextView.getText().toString().trim();
|
|
|
+//
|
|
|
+// if (!TextUtils.isEmpty(mSmtLocationCache)) {
|
|
|
+// try {
|
|
|
+// JSONArray locationArray = new JSONArray(mSmtLocationCache);
|
|
|
+// boolean isExist = false;
|
|
|
+// for (int i = 0; i < locationArray.length(); i++) {
|
|
|
+// JSONObject locationObject = locationArray.getJSONObject(i);
|
|
|
+// if (collect.equals(JsonUtils.optStringNotNull(locationObject, "PSL_LOCATION"))) {
|
|
|
+// isExist = true;
|
|
|
+// mLocationTextView.setText(collect);
|
|
|
+// mCollectEditText.setText("");
|
|
|
+//
|
|
|
+// String psl_prodcode = JsonUtils.optStringNotNull(locationObject, "PSL_PRODCODE");
|
|
|
+// String psl_repcode = JsonUtils.optStringNotNull(locationObject, "PSL_REPCODE");
|
|
|
+// mSmtDslBean = new SmtDslBean();
|
|
|
+// mSmtDslBean.setDsl_location(location);
|
|
|
+// mSmtDslBean.setDsl_prodcode(psl_prodcode);
|
|
|
+// mSmtDslBean.setDsl_repcode(psl_repcode);
|
|
|
+//
|
|
|
+// mAutoStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, new ArrayList<String>());
|
|
|
+// mCollectEditText.setAdapter(mAutoStringAdapter);
|
|
|
+//
|
|
|
+// mCollectEditText.setHint(COLLECT_PRODCODE);
|
|
|
+// if (!TextUtils.isEmpty(psl_repcode)) {
|
|
|
+// String[] repcodes = psl_repcode.split(",");
|
|
|
+// String notice = dataCheckResult + "\n请采集接料的物料号";
|
|
|
+// for (int j = 0; j < repcodes.length; j++) {
|
|
|
+// String repcode = repcodes[j];
|
|
|
+// notice = notice + "\n" + repcode;
|
|
|
+// }
|
|
|
+// tvMsgNotice.setTextColor(getResources().getColor(R.color.green));
|
|
|
+// if (isSuccess) {
|
|
|
+// tvMsgNotice.setText(notice);
|
|
|
+// } else {
|
|
|
+// SpannableString spannableString = CommonUtil.spanString(notice, mActivity, 0, dataCheckResult.length(), R.color.red);
|
|
|
+// tvMsgNotice.setText(spannableString);
|
|
|
+// }
|
|
|
+// } else if (!TextUtils.isEmpty(psl_prodcode)) {
|
|
|
+// tvMsgNotice.setTextColor(getResources().getColor(R.color.green));
|
|
|
+// if (isSuccess) {
|
|
|
+// tvMsgNotice.setText(dataCheckResult + "\n请采集接料的物料号\n" + psl_prodcode);
|
|
|
+// } else {
|
|
|
+// SpannableString spannableString = CommonUtil.spanString(dataCheckResult + "\n请采集接料的物料号\n" + psl_prodcode, mActivity, 0, dataCheckResult.length(), R.color.red);
|
|
|
+// tvMsgNotice.setText(spannableString);
|
|
|
+// }
|
|
|
+//
|
|
|
+// } else {
|
|
|
+// tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
+// if (isSuccess) {
|
|
|
+// CommonUtil.spanString(dataCheckResult + "\n物料编号获取失败", mActivity, 0, dataCheckResult.length(), R.color.green);
|
|
|
+// tvMsgNotice.setText(dataCheckResult + "\n物料编号获取失败");
|
|
|
+// } else {
|
|
|
+// tvMsgNotice.setText(dataCheckResult + "\n物料编号获取失败");
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (!isExist) {
|
|
|
+// tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
+// String notice = "站位编号错误\n" + mNoticeStr;
|
|
|
+// SpannableString spannableString = CommonUtil.spanString(notice, mActivity, "站位编号错误\n".length(), notice.length(), R.color.green);
|
|
|
+// tvMsgNotice.setText(spannableString);
|
|
|
+// CommonUtil.makeNotice();
|
|
|
+// mCollectEditText.setText("");
|
|
|
+// }
|
|
|
+// } catch (JSONException e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
+// String notice = "站位编号错误\n" + mNoticeStr;
|
|
|
+// SpannableString spannableString = CommonUtil.spanString(notice, mActivity, "站位编号错误\n".length(), notice.length(), R.color.green);
|
|
|
+// tvMsgNotice.setText(spannableString);
|
|
|
+// CommonUtil.makeNotice();
|
|
|
+// mCollectEditText.setText("");
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
private void locationCheck(String collect, String location) {
|
|
|
tvMsgProdcode.setText("");
|
|
|
@@ -693,125 +683,135 @@ public class SCSMTCheckFragment extends BaseFragment implements View.OnClickList
|
|
|
tvMsgQuantity.setText("");
|
|
|
tvMsgSpec.setText("");
|
|
|
|
|
|
- if (!TextUtils.isEmpty(mSmtLocationCache)) {
|
|
|
- try {
|
|
|
- JSONArray locationArray = new JSONArray(mSmtLocationCache);
|
|
|
- boolean isExist = false;
|
|
|
- for (int i = 0; i < locationArray.length(); i++) {
|
|
|
- JSONObject locationObject = locationArray.getJSONObject(i);
|
|
|
- if (collect.equals(JsonUtils.optStringNotNull(locationObject, "PSL_LOCATION"))) {
|
|
|
- isExist = true;
|
|
|
- mLocationTextView.setText(collect);
|
|
|
- mCollectEditText.setText("");
|
|
|
-
|
|
|
- String psl_prodcode = JsonUtils.optStringNotNull(locationObject, "PSL_PRODCODE");
|
|
|
- String psl_repcode = JsonUtils.optStringNotNull(locationObject, "PSL_REPCODE");
|
|
|
- mSmtDslBean = new SmtDslBean();
|
|
|
- mSmtDslBean.setDsl_location(location);
|
|
|
- mSmtDslBean.setDsl_prodcode(psl_prodcode);
|
|
|
- mSmtDslBean.setDsl_repcode(psl_repcode);
|
|
|
-
|
|
|
- mAutoStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, new ArrayList<String>());
|
|
|
- mCollectEditText.setAdapter(mAutoStringAdapter);
|
|
|
- //no use
|
|
|
- if (mUpRadioButton.isChecked()) {
|
|
|
- mCollectEditText.setHint(COLLECT_PRODCODE);
|
|
|
- if (!TextUtils.isEmpty(psl_repcode)) {
|
|
|
- String[] repcodes = psl_repcode.split(",");
|
|
|
- String notice = "站位采集成功,请采集物料\n";
|
|
|
- for (int j = 0; j < repcodes.length; j++) {
|
|
|
- String repcode = repcodes[j];
|
|
|
- notice = notice + repcode + "\n";
|
|
|
- }
|
|
|
- notice = notice + "的物料编号";
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.green));
|
|
|
- tvMsgNotice.setText(notice);
|
|
|
- } else if (!TextUtils.isEmpty(psl_prodcode)) {
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.green));
|
|
|
- tvMsgNotice.setText("站位采集成功,请采集物料\n" + psl_prodcode + "\n的物料编号");
|
|
|
- } else {
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.green));
|
|
|
- tvMsgNotice.setText("站位采集成功,物料编号获取失败");
|
|
|
- }
|
|
|
- } else {
|
|
|
- tvMsgNotice.setText("");
|
|
|
- mCollectEditText.setHint(COLLECT_OLD_PRODCODE);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!isExist) {
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
- String notice = "站位编号错误\n" + mNoticeStr;
|
|
|
- SpannableString spannableString = CommonUtil.spanString(notice, mActivity, "站位编号错误\n".length(), notice.length(), R.color.green);
|
|
|
- tvMsgNotice.setText(spannableString);
|
|
|
- CommonUtil.makeNotice();
|
|
|
- mCollectEditText.setText("");
|
|
|
- }
|
|
|
- } catch (JSONException e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- } else {
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
- String notice = "站位编号错误\n" + mNoticeStr;
|
|
|
- SpannableString spannableString = CommonUtil.spanString(notice, mActivity, "站位编号错误\n".length(), notice.length(), R.color.green);
|
|
|
- tvMsgNotice.setText(spannableString);
|
|
|
- CommonUtil.makeNotice();
|
|
|
- mCollectEditText.setText("");
|
|
|
- }
|
|
|
+ mLocationTextView.setText(collect);
|
|
|
+ mCollectEditText.setText("");
|
|
|
+
|
|
|
+ mSmtDslBean = new SmtDslBean();
|
|
|
+ mSmtDslBean.setDsl_location(location);
|
|
|
+ mSmtDslBean.setDsl_prodcode("");
|
|
|
+ mSmtDslBean.setDsl_repcode("");
|
|
|
+
|
|
|
+ mAutoStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, new ArrayList<String>());
|
|
|
+ mCollectEditText.setAdapter(mAutoStringAdapter);
|
|
|
+
|
|
|
+// if (!TextUtils.isEmpty(mSmtLocationCache)) {
|
|
|
+// try {
|
|
|
+// JSONArray locationArray = new JSONArray(mSmtLocationCache);
|
|
|
+// boolean isExist = false;
|
|
|
+// for (int i = 0; i < locationArray.length(); i++) {
|
|
|
+// JSONObject locationObject = locationArray.getJSONObject(i);
|
|
|
+// if (collect.equals(JsonUtils.optStringNotNull(locationObject, "PSL_LOCATION"))) {
|
|
|
+// isExist = true;
|
|
|
+// mLocationTextView.setText(collect);
|
|
|
+// mCollectEditText.setText("");
|
|
|
+//
|
|
|
+// String psl_prodcode = JsonUtils.optStringNotNull(locationObject, "PSL_PRODCODE");
|
|
|
+// String psl_repcode = JsonUtils.optStringNotNull(locationObject, "PSL_REPCODE");
|
|
|
+// mSmtDslBean = new SmtDslBean();
|
|
|
+// mSmtDslBean.setDsl_location(location);
|
|
|
+// mSmtDslBean.setDsl_prodcode(psl_prodcode);
|
|
|
+// mSmtDslBean.setDsl_repcode(psl_repcode);
|
|
|
+//
|
|
|
+// mAutoStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, new ArrayList<String>());
|
|
|
+// mCollectEditText.setAdapter(mAutoStringAdapter);
|
|
|
+// //no use
|
|
|
+// if (mUpRadioButton.isChecked()) {
|
|
|
+// mCollectEditText.setHint(COLLECT_PRODCODE);
|
|
|
+// if (!TextUtils.isEmpty(psl_repcode)) {
|
|
|
+// String[] repcodes = psl_repcode.split(",");
|
|
|
+// String notice = "站位采集成功,请采集物料\n";
|
|
|
+// for (int j = 0; j < repcodes.length; j++) {
|
|
|
+// String repcode = repcodes[j];
|
|
|
+// notice = notice + repcode + "\n";
|
|
|
+// }
|
|
|
+// notice = notice + "的物料编号";
|
|
|
+// tvMsgNotice.setTextColor(getResources().getColor(R.color.green));
|
|
|
+// tvMsgNotice.setText(notice);
|
|
|
+// } else if (!TextUtils.isEmpty(psl_prodcode)) {
|
|
|
+// tvMsgNotice.setTextColor(getResources().getColor(R.color.green));
|
|
|
+// tvMsgNotice.setText("站位采集成功,请采集物料\n" + psl_prodcode + "\n的物料编号");
|
|
|
+// } else {
|
|
|
+// tvMsgNotice.setTextColor(getResources().getColor(R.color.green));
|
|
|
+// tvMsgNotice.setText("站位采集成功,物料编号获取失败");
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// tvMsgNotice.setText("");
|
|
|
+// mCollectEditText.setHint(COLLECT_OLD_PRODCODE);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (!isExist) {
|
|
|
+// tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
+// String notice = "站位编号错误\n" + mNoticeStr;
|
|
|
+// SpannableString spannableString = CommonUtil.spanString(notice, mActivity, "站位编号错误\n".length(), notice.length(), R.color.green);
|
|
|
+// tvMsgNotice.setText(spannableString);
|
|
|
+// CommonUtil.makeNotice();
|
|
|
+// mCollectEditText.setText("");
|
|
|
+// }
|
|
|
+// } catch (JSONException e) {
|
|
|
+// e.printStackTrace();
|
|
|
+// }
|
|
|
+// } else {
|
|
|
+// tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
+// String notice = "站位编号错误\n" + mNoticeStr;
|
|
|
+// SpannableString spannableString = CommonUtil.spanString(notice, mActivity, "站位编号错误\n".length(), notice.length(), R.color.green);
|
|
|
+// tvMsgNotice.setText(spannableString);
|
|
|
+// CommonUtil.makeNotice();
|
|
|
+// mCollectEditText.setText("");
|
|
|
+// }
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 物料号本地校验
|
|
|
- *
|
|
|
- * @param collect 采集的物料号
|
|
|
- * @param location 站位编号
|
|
|
- */
|
|
|
- private void smtCheck(final String collect, final String location) {
|
|
|
- boolean isExist = false;
|
|
|
- String repcode = mSmtDslBean.getDsl_repcode();
|
|
|
- MyLog.e("aaa","采集的物料号:" + collect + ",站位编号:" + location);
|
|
|
- MyLog.e("aaa","数据:repcode:" + repcode + ",数据:mSmtDslBean.getDsl_prodcode()" + mSmtDslBean.getDsl_prodcode());
|
|
|
- if (collect.contains(mSmtDslBean.getDsl_prodcode())) {
|
|
|
- isExist = true;
|
|
|
- } else {
|
|
|
- if (!TextUtils.isEmpty(repcode)) {
|
|
|
- String[] repcodes = repcode.split(",");
|
|
|
- if (repcodes != null && repcodes.length != 0) {
|
|
|
- for (int i = 0; i < repcodes.length; i++) {
|
|
|
- if (collect.contains(repcodes[i])) {
|
|
|
- isExist = true;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (isExist) {
|
|
|
- successCheckData(collect, location);
|
|
|
- } else {
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
-
|
|
|
- String notice = "校验失败,物料号错误!\n" + mNoticeStr;
|
|
|
- SpannableString spannableString = CommonUtil.spanString(notice, mActivity, "校验失败,物料号错误!\n".length(), notice.length(), R.color.green);
|
|
|
- tvMsgNotice.setText(spannableString);
|
|
|
-
|
|
|
- CommonUtil.makeNotice();
|
|
|
- mCollectEditText.setText("");
|
|
|
- mCollectEditText.postDelayed(new Runnable() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- mCollectEditText.requestFocus();
|
|
|
- }
|
|
|
- }, 100);
|
|
|
-
|
|
|
- int smtCheckErr = SharedPreUtil.getInt(mActivity, Constants.FLAG.SMT_CHECK_ERROR, 0);
|
|
|
- if (smtCheckErr == 1) {
|
|
|
- failCheckData(collect, location);
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- }
|
|
|
+// /**
|
|
|
+// * 物料号本地校验
|
|
|
+// * @param collect 采集的物料号
|
|
|
+// * @param location 站位编号
|
|
|
+// */
|
|
|
+// private void smtCheck(final String collect, final String location) {
|
|
|
+// boolean isExist = false;
|
|
|
+// String repcode = mSmtDslBean.getDsl_repcode();
|
|
|
+// MyLog.e("aaa","采集的物料号:" + collect + ",站位编号:" + location);
|
|
|
+// MyLog.e("aaa","数据:repcode:" + repcode + ",数据:mSmtDslBean.getDsl_prodcode()" + mSmtDslBean.getDsl_prodcode());
|
|
|
+// if (collect.contains(mSmtDslBean.getDsl_prodcode())) {
|
|
|
+// isExist = true;
|
|
|
+// } else {
|
|
|
+// if (!TextUtils.isEmpty(repcode)) {
|
|
|
+// String[] repcodes = repcode.split(",");
|
|
|
+// if (repcodes != null && repcodes.length != 0) {
|
|
|
+// for (int i = 0; i < repcodes.length; i++) {
|
|
|
+// if (collect.contains(repcodes[i])) {
|
|
|
+// isExist = true;
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+// }
|
|
|
+//
|
|
|
+// if (isExist) {
|
|
|
+// successCheckData(collect, location);
|
|
|
+// } else {
|
|
|
+// tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
+//
|
|
|
+// String notice = "校验失败,物料号错误!\n" + mNoticeStr;
|
|
|
+// SpannableString spannableString = CommonUtil.spanString(notice, mActivity, "校验失败,物料号错误!\n".length(), notice.length(), R.color.green);
|
|
|
+// tvMsgNotice.setText(spannableString);
|
|
|
+//
|
|
|
+// CommonUtil.makeNotice();
|
|
|
+// mCollectEditText.setText("");
|
|
|
+// mCollectEditText.postDelayed(new Runnable() {
|
|
|
+// @Override
|
|
|
+// public void run() {
|
|
|
+// mCollectEditText.requestFocus();
|
|
|
+// }
|
|
|
+// }, 100);
|
|
|
+//
|
|
|
+// int smtCheckErr = SharedPreUtil.getInt(mActivity, Constants.FLAG.SMT_CHECK_ERROR, 0);
|
|
|
+// if (smtCheckErr == 1) {
|
|
|
+// failCheckData(collect, location);
|
|
|
+// }
|
|
|
+//
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
private void failCheckData(final String collect, final String location) {
|
|
|
PdaApplication.mRequestQueue.cancelAll(TAG + "check");
|
|
|
@@ -1053,7 +1053,7 @@ public class SCSMTCheckFragment extends BaseFragment implements View.OnClickList
|
|
|
protected void initDatas() {
|
|
|
((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(R.string.title_feedercheck_smt);
|
|
|
|
|
|
- mSmtLocationCache = SharedPreUtil.getString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, null);
|
|
|
+// mSmtLocationCache = SharedPreUtil.getString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, null);
|
|
|
if (mLineInfoBean != null) {
|
|
|
mLinecodeTextView.setText(mLineInfoBean.getDL_LINECODE());
|
|
|
mTableTextView.setText(mLineInfoBean.getDL_TABLE() + "面");
|