|
|
@@ -31,11 +31,7 @@ import com.uas.uaspda.tools.SharedPreUtil;
|
|
|
import com.uas.uaspda.tools.VolleyUtil;
|
|
|
import com.uas.uaspda.util.CommonUtil;
|
|
|
import com.uas.uaspda.util.Constants;
|
|
|
-import com.uas.uaspda.util.FastjsonUtil;
|
|
|
-import com.uas.uaspda.util.HttpCallback;
|
|
|
-import com.uas.uaspda.util.HttpParams;
|
|
|
import com.uas.uaspda.util.JsonUtils;
|
|
|
-import com.uas.uaspda.util.VolleyRequest;
|
|
|
import com.uas.uaspda.view.ClearableEditText;
|
|
|
import com.uas.uaspda.view.TextViewWithButton;
|
|
|
|
|
|
@@ -51,12 +47,12 @@ import java.util.Map;
|
|
|
* @note:SMTChild接料操作
|
|
|
*/
|
|
|
public class SCSMTJointFragment extends BaseFragment implements View.OnClickListener, TextViewWithButton.TvHintHelper {
|
|
|
- private static final String COLLECT_FEEDER = "请采集飞达编号";
|
|
|
- private static final String COLLECT_PRODCODE = "请采集料卷编号/物料编号";
|
|
|
- private static final String COLLECT_OLD_PRODCODE = "飞达采集成功,请采集原物料号";
|
|
|
+ private static final String COLLECT_LOCATION = "请录入站位编号";
|
|
|
+ private static final String COLLECT_PRODCODE = "请录入料卷编号/物料编号";
|
|
|
+ private static final String COLLECT_OLD_PRODCODE = "站位采集成功,请采集原物料号";
|
|
|
|
|
|
JSONObject makeCraft;
|
|
|
- TextViewWithButton tvLocation, tvBarcode, tvRemainqty, mLocationTextView, mFeederTextView;
|
|
|
+ TextViewWithButton tvLocation, tvBarcode, tvRemainqty, mLocationTextView;
|
|
|
TextView tvMsgNotice, tvMsgLocation, tvMsgProdcode, tvMsgQuantity, tvMsgBarcode, tvMsgSpec;
|
|
|
RelativeLayout rlCollect;
|
|
|
int wrongColor, rightColor;
|
|
|
@@ -71,8 +67,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
|
|
|
private String mSmtLocationCache;
|
|
|
private SmtDslBean mSmtDslBean = new SmtDslBean();
|
|
|
private StringRequest mStringRequest;
|
|
|
- private TextViewWithButton.OnTextClearListener mLocationClearListener;
|
|
|
- private TextViewWithButton.OnTextClearListener mFeederClearListener;
|
|
|
|
|
|
@Override
|
|
|
protected int getLayout() {
|
|
|
@@ -100,7 +94,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
|
|
|
mTableTextView = (TextView) root.findViewById(R.id.smt_change_table_tv);
|
|
|
mMacodeTextView = (TextView) root.findViewById(R.id.smt_change_macode_tv);
|
|
|
mLocationTextView = (TextViewWithButton) root.findViewById(R.id.smt_change_location_tv);
|
|
|
- mFeederTextView = root.findViewById(R.id.smt_change_feeder_tv);
|
|
|
mCollectEditText = (ClearableEditText) root.findViewById(R.id.smt_change_collect_et);
|
|
|
|
|
|
mCollectEditText.requestFocus();
|
|
|
@@ -155,38 +148,26 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
|
|
|
}
|
|
|
});
|
|
|
|
|
|
-
|
|
|
- mFeederClearListener = new TextViewWithButton.OnTextClearListener() {
|
|
|
+ mLocationTextView.setOnTextClearListener(new TextViewWithButton.OnTextClearListener() {
|
|
|
@Override
|
|
|
public void onTextClear() {
|
|
|
- mLocationTextView.setOnTextClearListener(null);
|
|
|
- mLocationTextView.setText("");
|
|
|
- mLocationTextView.setOnTextClearListener(mLocationClearListener);
|
|
|
- mCollectEditText.setHint(COLLECT_FEEDER);
|
|
|
+ mCollectEditText.setHint(COLLECT_LOCATION);
|
|
|
mCollectEditText.setText("");
|
|
|
- }
|
|
|
- };
|
|
|
|
|
|
- mLocationClearListener = new TextViewWithButton.OnTextClearListener() {
|
|
|
- @Override
|
|
|
- public void onTextClear() {
|
|
|
- mFeederTextView.setOnTextClearListener(null);
|
|
|
- mFeederTextView.setText("");
|
|
|
- mFeederTextView.setOnTextClearListener(mFeederClearListener);
|
|
|
- mCollectEditText.setHint(COLLECT_FEEDER);
|
|
|
- mCollectEditText.setText("");
|
|
|
+// tvMsgNotice.setText("");
|
|
|
+// tvMsgProdcode.setText("");
|
|
|
+// tvMsgLocation.setText("");
|
|
|
+// tvMsgBarcode.setText("");
|
|
|
+// tvMsgQuantity.setText("");
|
|
|
+// tvMsgSpec.setText("");
|
|
|
}
|
|
|
- };
|
|
|
-
|
|
|
- mLocationTextView.setOnTextClearListener(mLocationClearListener);
|
|
|
-
|
|
|
- mFeederTextView.setOnTextClearListener(mFeederClearListener);
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
private void confirmEvent(String collect) {
|
|
|
String location = mLocationTextView.getText().toString().trim();
|
|
|
if (TextUtils.isEmpty(location)) {
|
|
|
- feederGetLocation(collect);
|
|
|
+ locationCheck(collect);
|
|
|
} else {
|
|
|
mSmtDslBean.setDsl_barcode(collect);
|
|
|
|
|
|
@@ -199,50 +180,7 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- private void feederGetLocation(String collect) {
|
|
|
- progressDialog.show();
|
|
|
- VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
- .url(GloableParams.ADDRESS_SMT_GETFEEDERBARCODE)
|
|
|
- .method(Request.Method.POST)
|
|
|
- .addParam("fe_code", collect)
|
|
|
- .build(), new HttpCallback() {
|
|
|
- @Override
|
|
|
- public void onSuccess(int flag, Object o) throws Exception {
|
|
|
- try {
|
|
|
- progressDialog.dismiss();
|
|
|
- String result = o.toString();
|
|
|
- com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
|
|
|
- com.alibaba.fastjson.JSONObject dataObject = resultObject.getJSONObject("data");
|
|
|
- if (dataObject != null) {
|
|
|
- String fe_code = FastjsonUtil.getText(dataObject, "fe_code");
|
|
|
- String fe_location = FastjsonUtil.getText(dataObject, "fe_location");
|
|
|
-
|
|
|
- locationCheck(fe_location, fe_code);
|
|
|
- } else {
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
- tvMsgNotice.setText("数据为空");
|
|
|
- CommonUtil.makeNotice();
|
|
|
- mCollectEditText.setText("");
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void onFail(int flag, String failStr) throws Exception {
|
|
|
- progressDialog.dismiss();
|
|
|
- tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
- tvMsgNotice.setText(failStr);
|
|
|
- CommonUtil.makeNotice();
|
|
|
- mCollectEditText.setText("");
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- private void locationCheck(String collect, String feeder) {
|
|
|
+ private void locationCheck(String collect) {
|
|
|
tvMsgProdcode.setText("");
|
|
|
tvMsgLocation.setText("");
|
|
|
tvMsgBarcode.setText("");
|
|
|
@@ -258,7 +196,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
|
|
|
if (collect.equals(JsonUtils.optStringNotNull(locationObject, "PSL_LOCATION"))) {
|
|
|
isExist = true;
|
|
|
mLocationTextView.setText(collect);
|
|
|
- mFeederTextView.setText(feeder);
|
|
|
mCollectEditText.setText("");
|
|
|
|
|
|
String psl_prodcode = JsonUtils.optStringNotNull(locationObject, "PSL_PRODCODE");
|
|
|
@@ -347,9 +284,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
|
|
|
} else if ("barcode".equals(type)) {
|
|
|
tvMsgNotice.setText("请采集原料卷号:" + code);
|
|
|
}
|
|
|
- mCollectEditText.setText(code);
|
|
|
- String location = mLocationTextView.getText().toString().trim();
|
|
|
- joinDataCheck(code, location);
|
|
|
}
|
|
|
} catch (JSONException e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -548,7 +482,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
|
|
|
tvMsgSpec.setText("飞达规格:" + JsonUtils.optStringNotNull(dataObject, "DSL_FESPEC"));
|
|
|
|
|
|
mLocationTextView.setText("");
|
|
|
- mFeederTextView.setText("");
|
|
|
mCollectEditText.setText("");
|
|
|
|
|
|
mSmtDslBean = new SmtDslBean();
|
|
|
@@ -570,7 +503,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
|
|
|
tvMsgNotice.setText(errorToast);
|
|
|
if (errorToast.contains("站位已经有在线料卷号")) {
|
|
|
mLocationTextView.setText("");
|
|
|
- mFeederTextView.setText("");
|
|
|
mCollectEditText.setText("");
|
|
|
} else {
|
|
|
mCollectEditText.setText("");
|