|
|
@@ -53,10 +53,13 @@ import com.uas.uaspda.tools.VolleyUtil;
|
|
|
import com.uas.uaspda.util.CommonUtil;
|
|
|
import com.uas.uaspda.util.Constants;
|
|
|
import com.uas.uaspda.util.FragmentUtils;
|
|
|
+import com.uas.uaspda.util.HttpCallback;
|
|
|
+import com.uas.uaspda.util.HttpParams;
|
|
|
import com.uas.uaspda.util.JsonUtils;
|
|
|
import com.uas.uaspda.util.LogUtil;
|
|
|
import com.uas.uaspda.util.MyArrayAdapter;
|
|
|
import com.uas.uaspda.util.SoundUtil;
|
|
|
+import com.uas.uaspda.util.VolleyRequest;
|
|
|
import com.uas.uaspda.view.ClearableEditText;
|
|
|
import com.uas.uaspda.view.TextViewWithButton;
|
|
|
|
|
|
@@ -478,15 +481,72 @@ 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()))) {
|
|
|
+ /*if (mUpRadioButton.isChecked() || (mJoinRadioButton.isChecked() && COLLECT_PRODCODE.equals(mCollectEditText.getHint().toString()))) {
|
|
|
smtCheck(collect, location);
|
|
|
} else {
|
|
|
joinDataCheck(collect, location);
|
|
|
- }
|
|
|
+ }*/
|
|
|
|
|
|
+ if (mOrderSwitch) {
|
|
|
+ requestCheck(collect, location);
|
|
|
+ } else {
|
|
|
+ smtCheck(collect, location);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void requestCheck(String collect, String location) {
|
|
|
+ progressDialog.show();
|
|
|
+ Map<String, Object> dslMap = new HashMap<>();
|
|
|
+ dslMap.put("dsl_location", location);
|
|
|
+ dslMap.put("dsl_prodcode", collect);
|
|
|
+ dslMap.put("success", true);
|
|
|
+
|
|
|
+ VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
|
|
|
+ .url(GloableParams.ADDRESS_SMT_JOIN_FORECASTDATA_CHECK)
|
|
|
+ .method(Request.Method.POST)
|
|
|
+ .addParam("dsl", JSON.toJSONString(dslMap))
|
|
|
+ .addParam("deviceLineMake", JSON.toJSONString(mLineInfoBean))
|
|
|
+ .build(), new HttpCallback() {
|
|
|
+ @Override
|
|
|
+ public void onSuccess(int flag, Object o) throws Exception {
|
|
|
+ if (progressDialog.isShowing()) {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ }
|
|
|
+ successCheckData(collect, location);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void onFail(int flag, String failStr) throws Exception {
|
|
|
+ if (progressDialog.isShowing()) {
|
|
|
+ progressDialog.dismiss();
|
|
|
+ }
|
|
|
+ CommonUtil.toastNoRepeat(mActivity, failStr);
|
|
|
+
|
|
|
+ tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
|
|
|
+
|
|
|
+ String notice = failStr + "\n" + mNoticeStr;
|
|
|
+ SpannableString spannableString = CommonUtil.spanString(notice, mActivity, (failStr + "\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 joinDataCheck(final String collect, final String location) {
|
|
|
progressDialog.show();
|
|
|
|