Bladeren bron

调整SMT作业页面逻辑, 添加接口名Log日志

songw 2 weken geleden
bovenliggende
commit
ab2cf5bbef

+ 38 - 29
app/src/main/java/com/uas/baigang_workshop_workstation/fragment/SCSMTFragment.java

@@ -84,6 +84,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
     private boolean mIgnoreFocusChange = false;
     private boolean mIgnoreFocusChange = false;
     private String mCacheLine = "";
     private String mCacheLine = "";
     private String isPasteBarcode = "";
     private String isPasteBarcode = "";
+    private String line = "";  //线别
 
 
     @Override
     @Override
     protected int getLayout() {
     protected int getLayout() {
@@ -160,25 +161,27 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
             }
             }
         });
         });
 
 
-        etLineCode.setOnFocusChangeListener(new View.OnFocusChangeListener() {
-            @Override
-            public void onFocusChange(View v, boolean hasFocus) {
-                if (!hasFocus && isVisible() && !mIgnoreFocusChange) {
-                    String lineCode = etLineCode.getText().toString().trim();
-                    if (TextUtils.isEmpty(lineCode)) {
-                        CommonUtil.toastNoRepeat(mActivity, "请输入线别");
-                        etLineCode.postDelayed(new Runnable() {
-                            @Override
-                            public void run() {
-                                etLineCode.requestFocus();
-                            }
-                        }, 100);
-                    } else {
-                        getLineInfo(lineCode);
-                    }
-                }
-            }
-        });
+//        etLineCode.setOnFocusChangeListener(new View.OnFocusChangeListener() {
+//            @Override
+//            public void onFocusChange(View v, boolean hasFocus) {
+//                if (!hasFocus && isVisible() && !mIgnoreFocusChange) {
+//                    String lineCode = etLineCode.getText().toString().trim();
+//                    line = lineCode;
+//                    if (TextUtils.isEmpty(lineCode)) {
+//                        CommonUtil.toastNoRepeat(mActivity, "请输入线别");
+//                        etLineCode.postDelayed(new Runnable() {
+//                            @Override
+//                            public void run() {
+//                                etLineCode.requestFocus();
+//                            }
+//                        }, 100);
+//                    } else {
+//                        getLineInfo(lineCode);
+//                        getPasteBarcodeData(lineCode,"","");
+//                    }
+//                }
+//            }
+//        });
 
 
         etLineCode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
         etLineCode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
             @Override
             @Override
@@ -188,11 +191,13 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
                         || actionId == EditorInfo.IME_ACTION_GO
                         || actionId == EditorInfo.IME_ACTION_GO
                         || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
                         || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
                     String devCode = etLineCode.getText().toString().trim();
                     String devCode = etLineCode.getText().toString().trim();
+                    line = devCode;
                     if (TextUtils.isEmpty(devCode)) {
                     if (TextUtils.isEmpty(devCode)) {
                         CommonUtil.toastNoRepeat(mActivity, "请输入线别");
                         CommonUtil.toastNoRepeat(mActivity, "请输入线别");
                     } else {
                     } else {
                         mIgnoreFocusChange = true;
                         mIgnoreFocusChange = true;
                         getLineInfo(devCode);
                         getLineInfo(devCode);
+                        getPasteBarcodeData(devCode,"","");
                     }
                     }
                     return true;
                     return true;
                 }
                 }
@@ -209,7 +214,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
                         || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
                         || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
                     //disposeClick();
                     //disposeClick();
                     String trim = etJobCode.getText().toString().trim();
                     String trim = etJobCode.getText().toString().trim();
-                    getPasteBarcodeData(trim,isPasteBarcode);
+                    getPasteBarcodeData("",trim,"");
                     return true;
                     return true;
                 }
                 }
                 return false;
                 return false;
@@ -234,12 +239,13 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
         });
         });
     }
     }
 
 
-    private void getPasteBarcodeData(String wo,String isPasteBarcode) {
+    private void getPasteBarcodeData(String line,String wo,String isPasteBarcode) {
         progressDialog.show();
         progressDialog.show();
         VolleyRequest.getInstance().stringRequest(mStringRequest,
         VolleyRequest.getInstance().stringRequest(mStringRequest,
                 new HttpParams.Builder()
                 new HttpParams.Builder()
                         .url(GloableParams.ADDRESS_GET_PASTE_BARCODE)
                         .url(GloableParams.ADDRESS_GET_PASTE_BARCODE)
                         .method(Request.Method.POST)
                         .method(Request.Method.POST)
+                        .addParam("line",line)
                         .addParam("wo",wo)
                         .addParam("wo",wo)
                         .addParam("res", isPasteBarcode)
                         .addParam("res", isPasteBarcode)
                         .build(), new HttpCallback() {
                         .build(), new HttpCallback() {
@@ -249,8 +255,10 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
                         com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
                         com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
                         com.alibaba.fastjson.JSONObject dataObject = resultObject.getJSONObject("data");
                         com.alibaba.fastjson.JSONObject dataObject = resultObject.getJSONObject("data");
                         if (dataObject != null) {
                         if (dataObject != null) {
-                            String pr_tm_user = dataObject.getString("PR_TM_USER");
-                            if (pr_tm_user.equals("是")) {
+                            String pr_tm_user = dataObject.getString("pr_tm_user");
+                            if(TextUtils.isEmpty(pr_tm_user)) {
+                                rg_tietiaoma.check(R.id.rb_no);
+                            }else if (pr_tm_user.equals("是")) {
                                 rg_tietiaoma.check(R.id.rb_ok);
                                 rg_tietiaoma.check(R.id.rb_ok);
                             }else if (pr_tm_user.equals("否")){
                             }else if (pr_tm_user.equals("否")){
                                 rg_tietiaoma.check(R.id.rb_no);
                                 rg_tietiaoma.check(R.id.rb_no);
@@ -319,7 +327,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
                                     mLineInfo.setDL_PRODCODE(JsonUtils.optStringNotNull(dataObject, "DL_PRODCODE"));
                                     mLineInfo.setDL_PRODCODE(JsonUtils.optStringNotNull(dataObject, "DL_PRODCODE"));
 
 
                                     PdaApplication.putDataCache2Map(Constants.FLAG.SMT_DEVICE_LINE_CACHE, mLineInfo);
                                     PdaApplication.putDataCache2Map(Constants.FLAG.SMT_DEVICE_LINE_CACHE, mLineInfo);
-                                    gotoSMTContentFragment();
+                                    //gotoSMTContentFragment();
                                 } else {
                                 } else {
                                     CommonUtil.toastNoRepeat(mActivity, "请录入工单号或产品代码!");
                                     CommonUtil.toastNoRepeat(mActivity, "请录入工单号或产品代码!");
                                     etJobCode.requestFocus();
                                     etJobCode.requestFocus();
@@ -479,7 +487,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
         //如果prepare为null
         //如果prepare为null
         if (isPrepareNull) {
         if (isPrepareNull) {
             //跳转页面
             //跳转页面
-            gotoSMTContentFragment();
+//            gotoSMTContentFragment();
             return;
             return;
         }
         }
         //如果prepare不为null,获取备料单
         //如果prepare不为null,获取备料单
@@ -546,7 +554,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
                 return;
                 return;
             } else {
             } else {
                 //如果取消
                 //如果取消
-                gotoSMTContentFragment();
+//                gotoSMTContentFragment();
                 closeConfirmDialog();
                 closeConfirmDialog();
             }
             }
         }
         }
@@ -614,7 +622,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
             //导入备料单数据
             //导入备料单数据
             case VolleyUtil.FRAGMENT_SCMAKE_SMTMPDATA:
             case VolleyUtil.FRAGMENT_SCMAKE_SMTMPDATA:
                 closeConfirmDialog();
                 closeConfirmDialog();
-                gotoSMTContentFragment();
+//                gotoSMTContentFragment();
                 break;
                 break;
         }
         }
     }
     }
@@ -629,11 +637,12 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
     @Override
     @Override
     public void onClick(View v) {
     public void onClick(View v) {
         String trim = etJobCode.getText().toString().trim();
         String trim = etJobCode.getText().toString().trim();
-        getPasteBarcodeData(trim,isPasteBarcode);
+        getPasteBarcodeData(line,trim,isPasteBarcode);
 //        disposeClick();
 //        disposeClick();
 //        confirmDevice();
 //        confirmDevice();
         String lineCode = etLineCode.getText().toString().trim();
         String lineCode = etLineCode.getText().toString().trim();
         getLineInfo(lineCode);
         getLineInfo(lineCode);
+        gotoSMTContentFragment();
     }
     }
 
 
     private void confirmDevice() {
     private void confirmDevice() {
@@ -679,7 +688,7 @@ public class SCSMTFragment extends BaseFragment implements View.OnClickListener,
                                         mLineInfo.setDL_PRODCODE(JsonUtils.optStringNotNull(dataObject, "DL_PRODCODE"));
                                         mLineInfo.setDL_PRODCODE(JsonUtils.optStringNotNull(dataObject, "DL_PRODCODE"));
 
 
                                         PdaApplication.putDataCache2Map(Constants.FLAG.SMT_DEVICE_LINE_CACHE, mLineInfo);
                                         PdaApplication.putDataCache2Map(Constants.FLAG.SMT_DEVICE_LINE_CACHE, mLineInfo);
-                                        gotoSMTContentFragment();
+//                                        gotoSMTContentFragment();
                                     } else {
                                     } else {
                                         etJobCode.requestFocus();
                                         etJobCode.requestFocus();
                                     }
                                     }

+ 2 - 0
app/src/main/java/com/uas/baigang_workshop_workstation/util/VolleyRequest.java

@@ -11,6 +11,7 @@ import com.android.volley.toolbox.StringRequest;
 import com.uas.baigang_workshop_workstation.R;
 import com.uas.baigang_workshop_workstation.R;
 import com.uas.baigang_workshop_workstation.application.PdaApplication;
 import com.uas.baigang_workshop_workstation.application.PdaApplication;
 import com.uas.baigang_workshop_workstation.tools.VolleyUtil;
 import com.uas.baigang_workshop_workstation.tools.VolleyUtil;
+import com.uas.pda_wps.util.MyLog;
 
 
 import java.io.UnsupportedEncodingException;
 import java.io.UnsupportedEncodingException;
 import java.net.URLEncoder;
 import java.net.URLEncoder;
@@ -101,6 +102,7 @@ public class VolleyRequest {
             }
             }
         }
         }
 
 
+        MyLog.e("aaa","接口名:" + url);
         PdaApplication.mRequestQueue.cancelAll(httpParams.getUrl());
         PdaApplication.mRequestQueue.cancelAll(httpParams.getUrl());
 
 
         stringRequest = new StringRequest(httpParams.getMethod(), url,
         stringRequest = new StringRequest(httpParams.getMethod(), url,

+ 2 - 2
build.gradle

@@ -64,8 +64,8 @@ ext {
             targetSdkVersion : 28,
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
             buildToolsVersion: "28.0.3",
-            versionCode      : 20,
-            versionName      : "v1.1.9"
+            versionCode      : 22,
+            versionName      : "v1.2.1"
     ]
     ]
 
 
     depsVersion = [
     depsVersion = [