Browse Source

新增飞达站位绑定页面功能,优化飞达站位绑定光标位置转移以及输入框字符限制问题,增加SMT备料页面及相关子页面功能

songw 3 months ago
parent
commit
2b35c6e027
45 changed files with 3784 additions and 498 deletions
  1. 37 2
      app/src/main/AndroidManifest.xml
  2. 10 0
      app/src/main/java/com/uas/pda_wps/activity/FunctionActivity.java
  3. 7 0
      app/src/main/java/com/uas/pda_wps/application/PdaApplication.java
  4. 17 3
      app/src/main/java/com/uas/pda_wps/bean/LineInfoBean.java
  5. 3 3
      app/src/main/java/com/uas/pda_wps/bean/SmtDslBean.java
  6. 301 0
      app/src/main/java/com/uas/pda_wps/fragment/FeidaStationBindingFra.java
  7. 6 0
      app/src/main/java/com/uas/pda_wps/fragment/IndexSettingFragment.java
  8. 32 39
      app/src/main/java/com/uas/pda_wps/fragment/QualityVerificationFra.java
  9. 0 3
      app/src/main/java/com/uas/pda_wps/fragment/SCSMTBindFragment.java
  10. 0 18
      app/src/main/java/com/uas/pda_wps/fragment/SCSMTChangeFragment.java
  11. 4 0
      app/src/main/java/com/uas/pda_wps/fragment/SCSMTCheckFragment.java
  12. 1 0
      app/src/main/java/com/uas/pda_wps/fragment/SCSMTInFragment.java
  13. 15 4
      app/src/main/java/com/uas/pda_wps/fragment/SCSMTIndexFragment.java
  14. 0 225
      app/src/main/java/com/uas/pda_wps/fragment/SCSMTInspectionFragment.java
  15. 2 26
      app/src/main/java/com/uas/pda_wps/fragment/SCSMTJointFragment.java
  16. 1 3
      app/src/main/java/com/uas/pda_wps/fragment/SCSMTUnBindFragment.java
  17. 783 0
      app/src/main/java/com/uas/pda_wps/fragment/SMTMaterialPreparation.java
  18. 1029 0
      app/src/main/java/com/uas/pda_wps/fragment/SMTStandbyFunction.java
  19. 283 0
      app/src/main/java/com/uas/pda_wps/fragment/VersionUpgradeFragment.java
  20. 92 5
      app/src/main/java/com/uas/pda_wps/global/GloableParams.java
  21. 18 0
      app/src/main/java/com/uas/pda_wps/tools/DataSourceManager.java
  22. 4 10
      app/src/main/java/com/uas/pda_wps/util/CommonUtil.java
  23. 11 0
      app/src/main/java/com/uas/pda_wps/util/Constants.java
  24. 62 2
      app/src/main/java/com/uas/pda_wps/util/FileUtils.java
  25. 244 143
      app/src/main/java/com/uas/pda_wps/util/MyLog.java
  26. 4 2
      app/src/main/java/com/uas/pda_wps/util/VolleyRequest.java
  27. 4 3
      app/src/main/java/com/uas/pda_wps/util/VollyRequest.java
  28. 72 0
      app/src/main/java/com/uas/pda_wps/util/down/CommonProgressPop.java
  29. 148 0
      app/src/main/java/com/uas/pda_wps/util/down/ProgressDownloader.java
  30. 74 0
      app/src/main/java/com/uas/pda_wps/util/down/ProgressResponseBody.java
  31. BIN
      app/src/main/res/drawable-xxhdpi/feidazhanweibangding.png
  32. BIN
      app/src/main/res/drawable-xxhdpi/shangxian.png
  33. BIN
      app/src/main/res/drawable-xxhdpi/smt_beiliao.png
  34. 35 0
      app/src/main/res/drawable/progressbar_diy.xml
  35. 115 0
      app/src/main/res/layout/fra_feida_station_binding.xml
  36. 0 0
      app/src/main/res/layout/fra_quality_verification.xml
  37. 75 0
      app/src/main/res/layout/fra_scmake_smtcontent.xml
  38. 148 0
      app/src/main/res/layout/fra_smt_material_preparation.xml
  39. 2 2
      app/src/main/res/layout/fragment_modify_barcode_quantity.xml
  40. 99 0
      app/src/main/res/layout/fragment_version_upgrade.xml
  41. 26 0
      app/src/main/res/layout/pop_common_progress.xml
  42. 4 1
      app/src/main/res/values/strings.xml
  43. 12 0
      app/src/main/res/values/styles.xml
  44. 1 1
      app/src/main/res/xml/file_paths.xml
  45. 3 3
      build.gradle

+ 37 - 2
app/src/main/AndroidManifest.xml

@@ -16,6 +16,12 @@
     <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
 
+    <!-- 安装未知来源应用的权限(Android 8.0以下) -->
+    <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
+
+    <!-- Android 11+ 查询已安装应用权限 -->
+    <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
+
     <application
         android:name="com.uas.pda_wps.application.PdaApplication"
         android:allowBackup="true"
@@ -44,7 +50,7 @@
             android:icon="@mipmap/icon"
             android:label="@string/title_activity_menu"
             android:screenOrientation="portrait"
-            android:windowSoftInputMode="adjustPan|stateHidden"></activity>
+            android:windowSoftInputMode="adjustPan|stateHidden"/>
         <activity
             android:name="com.uas.pda_wps.activity.IndexActivity"
             android:label="@string/title_activity_menu"
@@ -60,15 +66,44 @@
             android:label="@string/material_number_search"
             android:screenOrientation="portrait" />
 
+
+   <!--     <provider
+            android:name="android.support.v4.content.FileProvider"
+            android:authorities="com.uas.pda_wps.fileprovider"
+            android:exported="false"
+            android:grantUriPermissions="true"
+            tools:replace="android:authorities"
+            >
+            <meta-data
+                android:name="android.support.FILE_PROVIDER_PATHS"
+                android:resource="@xml/file_paths" />
+        </provider>
+-->
+
+        <!-- Android 7.0+ FileProvider 配置 -->
         <provider
             android:name="android.support.v4.content.FileProvider"
-            android:authorities="com.pda_wps.fileprovider"
+            android:authorities="com.uas.pda_wps.fileprovider"
             android:exported="false"
             android:grantUriPermissions="true">
             <meta-data
                 android:name="android.support.FILE_PROVIDER_PATHS"
                 android:resource="@xml/file_paths" />
         </provider>
+
+     <!--   &lt;!&ndash; 兼容 Android 11+ 的包可见性声明 &ndash;&gt;
+        <queries>
+            <intent>
+                <action android:name="android.intent.action.VIEW" />
+                <data android:scheme="content" />
+            </intent>
+            <intent>
+                <action android:name="android.intent.action.INSTALL_PACKAGE" />
+                <data android:scheme="file" />
+            </intent>
+        </queries>-->
+
+
     </application>
 
 </manifest>

+ 10 - 0
app/src/main/java/com/uas/pda_wps/activity/FunctionActivity.java

@@ -13,12 +13,14 @@ import android.widget.TextView;
 
 import com.uas.pda_wps.R;
 import com.uas.pda_wps.fragment.BaseFragment;
+import com.uas.pda_wps.fragment.FeidaStationBindingFra;
 import com.uas.pda_wps.fragment.IndexInOutContentFragment;
 import com.uas.pda_wps.fragment.IndexSettingFragment;
 import com.uas.pda_wps.fragment.IndexShopContentFragment;
 import com.uas.pda_wps.fragment.IndexWareHouseContentFragment;
 import com.uas.pda_wps.fragment.MSDManageFragment;
 import com.uas.pda_wps.fragment.SCSMTFragment;
+import com.uas.pda_wps.fragment.SMTMaterialPreparation;
 import com.uas.pda_wps.fragment.SolderPasteManageFragment;
 import com.uas.pda_wps.global.GloableParams;
 import com.uas.pda_wps.interfaces.BackHandlerInterface;
@@ -90,6 +92,14 @@ public class FunctionActivity extends BaseActivity implements View.OnClickListen
                 case GloableParams.GRIDNAME_SOLDER_MANAGER:
                     fragment = new SolderPasteManageFragment();
                     break;
+                //飞达站位绑定
+                case GloableParams.GRIDNAME_FEIDA_STATION_BINDING:
+                    fragment = new FeidaStationBindingFra();
+                    break;
+                //SMT备料
+                case GloableParams.LISTNAME_SMT_MATERIALPREPARATION:
+                    fragment = new SMTMaterialPreparation();
+                    break;
                 //设置
                 case GloableParams.GRIDNAME_SETTING:
                     fragment = new IndexSettingFragment();

+ 7 - 0
app/src/main/java/com/uas/pda_wps/application/PdaApplication.java

@@ -12,6 +12,7 @@ import com.facebook.stetho.Stetho;
 import com.uas.pda_wps.R;
 import com.uas.pda_wps.util.AndroidUtil;
 import com.uas.pda_wps.util.FakeX509TrustManager;
+import com.uas.pda_wps.util.MyLog;
 import com.uas.pda_wps.util.SoundUtil;
 import com.umeng.analytics.MobclickAgent;
 import com.umeng.commonsdk.UMConfigure;
@@ -87,6 +88,12 @@ public class PdaApplication extends Application {
         //友盟统计SDK
         initUmeng();
 
+        //删除非当天的Log日志, Android8.0以下用不了
+        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
+            MyLog.delNotDayFile();
+        }else {
+            MyLog.isFileCreatedTodayDel();
+        }
     }
 
     private void initUmeng() {

+ 17 - 3
app/src/main/java/com/uas/pda_wps/bean/LineInfoBean.java

@@ -12,15 +12,18 @@ public class LineInfoBean implements Serializable {
     /**
      * DL_ID : 1212
      * DL_DECODE : DEV001
-     * DL_LINECODE : DEV001
-     * DL_MACODE : DEV001
-     * DL_TABLE : A
+     * DL_LINECODE : DEV001  线别
+     * DL_MACODE : DEV001       工单号
+     * DL_TABLE : A     板面
      * DL_STATUSCODE : UNUSED
      * DL_STATUS : 未使用
      * PS_ID : 123
      * MA_ID : 123
      */
 
+    //DL_LINECODE(线别),DL_MAINLINE(实际线别),DL_TABLE (板面),
+    // DL_MACODE(工单号),DL_PRODCODE(产品编号)
+
     @JSONField(name = "DL_ID")
     private long DL_ID;
     @JSONField(name = "DL_DECODE")
@@ -40,6 +43,17 @@ public class LineInfoBean implements Serializable {
     @JSONField(name = "MA_ID")
     private long MA_ID;
 
+    @JSONField(name = "DL_MAINLINE")
+    private String DL_MAINLINE;     //实际线别
+
+    public String getDL_MAINLINE() {
+        return DL_MAINLINE;
+    }
+
+    public void setDL_MAINLINE(String DL_MAINLINE) {
+        this.DL_MAINLINE = DL_MAINLINE;
+    }
+
     public String getDL_PRODCODE() {
         return DL_PRODCODE;
     }

+ 3 - 3
app/src/main/java/com/uas/pda_wps/bean/SmtDslBean.java

@@ -7,15 +7,15 @@ import com.alibaba.fastjson.annotation.JSONField;
  */
 public class SmtDslBean {
     @JSONField(name = "dsl_location")
-    String dsl_location;
+    String dsl_location;        //站位
     @JSONField(name = "dsl_prodcode")
-    String dsl_prodcode;
+    String dsl_prodcode;        //物料编号
     @JSONField(name = "dsl_barcode")
     String dsl_barcode;
     @JSONField(name = "dsl_repcode")
     String dsl_repcode;
     @JSONField(name = "dsl_fecode")
-    String dsl_fecode;
+    String dsl_fecode;      //飞达规格,这个目前客户都没有维护值
 
     public String getDsl_repcode() {
         return dsl_repcode;

+ 301 - 0
app/src/main/java/com/uas/pda_wps/fragment/FeidaStationBindingFra.java

@@ -0,0 +1,301 @@
+package com.uas.pda_wps.fragment;
+
+import android.os.Bundle;
+import android.text.TextUtils;
+import android.view.KeyEvent;
+import android.view.View;
+import android.widget.Button;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.android.volley.Request;
+import com.android.volley.toolbox.StringRequest;
+import com.uas.pda_wps.R;
+import com.uas.pda_wps.activity.FunctionActivity;
+import com.uas.pda_wps.global.GloableParams;
+import com.uas.pda_wps.listener.MyEditorActionListener;
+import com.uas.pda_wps.util.CommonUtil;
+import com.uas.pda_wps.util.FastjsonUtil;
+import com.uas.pda_wps.util.HttpCallback;
+import com.uas.pda_wps.util.HttpParams;
+import com.uas.pda_wps.util.VolleyRequest;
+import com.uas.pda_wps.view.ClearableEditText;
+
+public
+        /**
+         * Created by sw on 2026-01-12
+         */
+class FeidaStationBindingFra extends BaseFragment {
+    private static final String TAG = "ModifyBarcodeQuantityFragment";
+    private static final int SCAN_BARCODE_CODE = 106;
+
+    private StringRequest mStringRequest;
+    private int mFocusId;
+    private boolean mIgnoreFocusChange = false;
+    private boolean isShop = false;
+
+    private RadioGroup rg_binding;
+    private ClearableEditText cet_feida,cet_zhanwei;
+    private Button bt_binding;
+    private TextView tv_result;
+    private String relieve = "绑定";
+
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fra_feida_station_binding;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle(getResources().getString(R.string.feida_station_binding));
+
+        rg_binding = root.findViewById(R.id.rg_binding);
+        cet_feida = root.findViewById(R.id.cet_feida);
+        cet_zhanwei =  root.findViewById(R.id.cet_zhanwei);
+        bt_binding = root.findViewById(R.id.bt_binding);
+        tv_result = root.findViewById(R.id.tv_result);
+
+        cet_feida.requestFocus();
+    }
+
+    @Override
+    protected void initEvents() {
+        rg_binding.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(RadioGroup group, int checkedId) {
+                if (checkedId == R.id.rb_binding) {
+                    relieve = "绑定";
+                    bt_binding.setText("绑定");
+                }else if (checkedId == R.id.rb_unbind) {
+                    relieve = "解绑";
+                    bt_binding.setText("解绑");
+                }
+            }
+        });
+
+        CommonUtil.setEditorActionListener(cet_feida, new MyEditorActionListener() {
+            @Override
+            public void MyEditorAction(String text, int actionId, KeyEvent event) {
+                String fecode = cet_feida.getText().toString().trim();
+                // 获取选中的RadioButton的ID
+                int selectedId = rg_binding.getCheckedRadioButtonId();
+                if (selectedId == -1) {
+                    CommonUtil.toastNoRepeat(mActivity, "请先选择绑定或解绑");
+                } else {
+                    RadioButton selectedRadioButton = root.findViewById(selectedId);
+                    // 获取选中RadioButton的文本
+                    String selectedText = selectedRadioButton.getText().toString();
+                    if (!TextUtils.isEmpty(selectedText)) {
+                        if (selectedText.equals("绑定")) {
+                            getFeiDaData(fecode,"bind");
+                        }else if (selectedText.equals("解绑")) {
+                            getFeiDaData(fecode,"unbind");
+                        }
+                    }
+                }
+            }
+        });
+
+        CommonUtil.setEditorActionListener(cet_zhanwei, new MyEditorActionListener() {
+            @Override
+            public void MyEditorAction(String text, int actionId, KeyEvent event) {
+                String fecode = cet_feida.getText().toString().trim();
+                String zhanwei = cet_zhanwei.getText().toString().trim();
+                if (!TextUtils.isEmpty(zhanwei) && !TextUtils.isEmpty(fecode)) {
+                    getZhanWeiData(fecode,zhanwei);
+                }
+            }
+        });
+
+        bt_binding.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String fecode = cet_feida.getText().toString().trim();
+                String zhanwei = cet_zhanwei.getText().toString().trim();
+                if (TextUtils.isEmpty(fecode)) {
+                    CommonUtil.toastNoRepeat(mActivity, "请输入飞达");
+                    return;
+                }
+                if (TextUtils.isEmpty(zhanwei)) {
+                    CommonUtil.toastNoRepeat(mActivity, "请输入站位");
+                    return;
+                }
+                if (relieve.equals("绑定")) {
+                    getZhanWeiData(fecode,zhanwei);
+                }else if (relieve.equals("解绑")) {
+                    getUnbindData(fecode,zhanwei);
+                }
+            }
+        });
+    }
+
+    private void getUnbindData(String fecode,String location)  {
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_FEEDER_UNBIND_LOCATION)
+                .method(Request.Method.POST)
+                .addParam("fecode",fecode)
+                .addParam("location",location)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                if (progressDialog.isShowing()) {
+                    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 fecode = FastjsonUtil.getText(dataObject, "fecode");
+                    String location = FastjsonUtil.getText(dataObject, "location");
+                    tv_result.setVisibility(View.VISIBLE);
+                    String text = "飞达: " + fecode + "\n" + "解除站位: " + location + " 成功!";
+                    tv_result.setText(text);
+                    cet_feida.setText("");
+                    cet_zhanwei.setText("");
+                    cet_feida.requestFocus();
+                }
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                if (progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+                tv_result.setText(failStr);
+                cet_feida.setText("");
+                cet_zhanwei.setText("");
+                cet_feida.requestFocus();
+            }
+        });
+    }
+
+    private void getZhanWeiData(String fecode,String location) {
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_FEEDER_BIND_LOCATION)
+                .method(Request.Method.POST)
+                .addParam("fecode",fecode)
+                .addParam("location",location)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                if (progressDialog.isShowing()) {
+                    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 fecode = FastjsonUtil.getText(dataObject, "fecode");
+                    String location = FastjsonUtil.getText(dataObject, "location");
+                    tv_result.setVisibility(View.VISIBLE);
+                    String text = "飞达: " + fecode + "\n" + "绑定站位: " + location + " 成功!";
+                    tv_result.setText(text);
+                    cet_feida.setText("");
+                    cet_zhanwei.setText("");
+                    cet_feida.requestFocus();
+                }
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                if (progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+                tv_result.setText(failStr);
+                cet_feida.setText("");
+                cet_zhanwei.setText("");
+                cet_feida.requestFocus();
+            }
+        });
+    }
+
+    private void getFeiDaData(String fecode,String type) {
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_GET_FEEDER_BIND_CHECK)
+                .method(Request.Method.GET)
+                .addParam("fecode",fecode)
+                .addParam("type",type)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                if (progressDialog.isShowing()) {
+                    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_FESTATUS = FastjsonUtil.getText(dataObject, "FE_FESTATUS");
+                    String FE_LOCATION = FastjsonUtil.getText(dataObject, "FE_LOCATION");
+                    String FE_BARCODE = FastjsonUtil.getText(dataObject, "FE_BARCODE");
+                    String FE_CODE = FastjsonUtil.getText(dataObject, "FE_CODE");
+
+                    tv_result.setVisibility(View.VISIBLE);
+                    if (!TextUtils.isEmpty(FastjsonUtil.getText(dataObject, "FE_LOCATION"))){
+                        String text = "飞达: " + FE_CODE + "\n" + "当前绑定站位: " + FE_LOCATION;
+                        tv_result.setText(text);
+                        cet_zhanwei.setText(FE_LOCATION);
+                        cet_feida.requestFocus();
+                    }else {
+                        String text = "飞达: " + FE_CODE + ",目前未绑定站位";
+                        tv_result.setText(text);
+                        cet_zhanwei.requestFocus();
+                    }
+
+                }
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                if (progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+                tv_result.setText(failStr);
+                cet_feida.setText("");
+                cet_zhanwei.setText("");
+                cet_feida.requestFocus();
+            }
+        });
+    }
+
+
+    @Override
+    protected void initDatas() {
+        Bundle bundle = getArguments();
+        if (bundle != null) {
+            isShop = bundle.getBoolean("isShop");
+        }
+    }
+
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        if (!hidden) {
+            FunctionActivity.setTitle("飞达站位绑定");
+        }
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+}

+ 6 - 0
app/src/main/java/com/uas/pda_wps/fragment/IndexSettingFragment.java

@@ -49,6 +49,7 @@ import com.uas.pda_wps.util.AndroidUtil;
 import com.uas.pda_wps.util.CommonUtil;
 import com.uas.pda_wps.util.Constants;
 import com.uas.pda_wps.util.FileUtils;
+import com.uas.pda_wps.util.FragmentUtils;
 import com.uas.pda_wps.util.JsonTools;
 import com.uas.pda_wps.util.LogUtil;
 
@@ -247,6 +248,7 @@ public class IndexSettingFragment extends BaseFragment implements View.OnClickLi
         root.findViewById(R.id.setting_style_rl).setOnClickListener(this);
         root.findViewById(R.id.setting_sound_rl).setOnClickListener(this);
         root.findViewById(R.id.setting_ip_address_rl).setOnClickListener(this);
+        root.findViewById(R.id.setting_check_update_ll).setOnClickListener(this);
     }
 
     @Override
@@ -459,6 +461,10 @@ public class IndexSettingFragment extends BaseFragment implements View.OnClickLi
                 mFragment = new SoundSettingFragment();
                 getFragmentManager().beginTransaction().addToBackStack(null).replace(R.id.container_function_fragment, mFragment).commit();
                 break;
+            case R.id.setting_check_update_ll:
+                mFragment = new VersionUpgradeFragment();
+                FragmentUtils.switchFragment(this, mFragment);
+                break;
         }
     }
 

+ 32 - 39
app/src/main/java/com/uas/pda_wps/fragment/FullStationVerificationFragment.java → app/src/main/java/com/uas/pda_wps/fragment/QualityVerificationFra.java

@@ -76,10 +76,9 @@ import java.util.Map;
 
 public
         /**
-         * Created by sw on 2025-12-19
+         * Created by sw on 2026-01-04   品质校验
          */
-class FullStationVerificationFragment extends BaseFragment implements View.OnClickListener {
-
+class QualityVerificationFra  extends BaseFragment implements View.OnClickListener {
     private static final String COLLECT_LOCATION = "请录入站位编号";
     private static final String COLLECT_PRODCODE = "请录入物料编号";
     private static final String COLLECT_OLD_PRODCODE = "站位采集成功,请采集原物料号";
@@ -92,24 +91,24 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
 
     //当前校验方式,默认为1
     private int curCheckStyle = FEEDER_WITH_LOCATION;
-    private JSONObject makeCraft;
-    private JSONArray makeSMTLocation;
-
-    private TextView tvMsgNotice;
-    private TextView tvMsgProdcode;
-    private TextView tvMsgLocation;
-    private TextView tvMsgBarcode;
-    private TextView tvMsgQuantity;
-    private TextView tvMsgSpec;
-
-    private ClearableEditText etFecode, etLocation, etOrder;
-    private LinearLayout llOrder, llDouble;
-    private RelativeLayout rlCollect, rlChange;
-    private View parentView;
-
-    private String TAG = "SMTCHECK:";
+    JSONObject makeCraft;
+    JSONArray makeSMTLocation;
+
+    TextView tvMsgNotice;
+    TextView tvMsgProdcode;
+    TextView tvMsgLocation;
+    TextView tvMsgBarcode;
+    TextView tvMsgQuantity;
+    TextView tvMsgSpec;
+
+    ClearableEditText etFecode, etLocation, etOrder;
+    LinearLayout llOrder, llDouble;
+    RelativeLayout rlCollect, rlChange;
+    View parentView;
+
+    String TAG = "SMTCHECK:";
     int wrongColor, rightColor;
-    private TextView tvCheckStyle;
+    TextView tvCheckStyle;
     int mcId = -1;
     private Button btnChange;
     private ImageView mCleanIv, mSmtQueryImageView;
@@ -132,11 +131,12 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
 
     @Override
     protected int getLayout() {
-        return R.layout.fra_full_station_verification;
+        return R.layout.fragment_scmake_smtfeederchild_check;
     }
 
     @Override
     protected void initViews() {
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(R.string.quality_verification);
         ((FunctionActivity) getActivity()).setSmtQueryIvVisible(true);
 
         mOrderSwitch = SharedPreUtil.getInt(mActivity, Constants.FLAG.CACHE_DEFAULT_ORDER_SWITCH + CommonUtil.getUserName(mActivity), 0) == 1;
@@ -183,13 +183,11 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
 
         mCollectEditText.requestFocus();
 
-
         //接口回调
         VolleyUtil.setVolleyHandler(handler);
 
         mLineInfoBean = (LineInfoBean) PdaApplication.getDataCacheFromMap(Constants.FLAG.SMT_DEVICE_LINE_CACHE);
 
-
         /*try {
             makeCraft = new JSONObject(makeCraftStr);
             mcId = makeCraft.getInt("mc_id");
@@ -281,7 +279,6 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
             }
         });
 
-
         mLocationTextView.setOnTextClearListener(new TextViewWithButton.OnTextClearListener() {
             @Override
             public void onTextClear() {
@@ -312,7 +309,7 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
             @Override
             public void onClick(View v) {
                 Fragment fragment = new SCSMTQueryFragment();
-                FragmentUtils.switchFragment(FullStationVerificationFragment.this, fragment);
+                FragmentUtils.switchFragment(QualityVerificationFra.this, fragment);
             }
         });
 
@@ -338,7 +335,7 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
      */
     private void startCheck() {
         progressDialog.show();
-        String url = GloableParams.ADDRESS_SMT_REPEATCHECK_DATA + "?linecode=" + (mLineInfoBean == null ? "" : mLineInfoBean.getDL_LINECODE());
+        String url = GloableParams.ADDRESS_QUA_START_CHECK + "?linecode=" + (mLineInfoBean == null ? "" : mLineInfoBean.getDL_LINECODE());
         PdaApplication.mRequestQueue.cancelAll(TAG + "startcheck");
 
         mStringRequest = new StringRequest(Request.Method.GET, url,
@@ -374,7 +371,7 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
                                                     confirmEvent(psl_location);
                                                 }
                                                 //notice = notice + psl_location + ",";
-                                                notice += "\n站位:" + psl_location + " 料号:" + psl_prodcode;
+                                                notice += "\n站位:"  + psl_location + " 料号:" + psl_prodcode;
                                             }
                                         }
                                         //notice = notice.substring(0, notice.length() - 1);
@@ -815,7 +812,7 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
     private void failCheckData(final String collect, final String location) {
         PdaApplication.mRequestQueue.cancelAll(TAG + "check");
 
-        mStringRequest = new StringRequest(Request.Method.POST, GloableParams.ADDRESS_CHECK_LOCATIONDATAREPEATCHECK,
+        mStringRequest = new StringRequest(Request.Method.POST, GloableParams.ADDRESS_QUA_CHECK_DATA,
                 new Response.Listener<String>() {
                     @Override
                     public void onResponse(String s) {
@@ -867,7 +864,7 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
         progressDialog.show();
         PdaApplication.mRequestQueue.cancelAll(TAG + "check");
 
-        mStringRequest = new StringRequest(Request.Method.POST, GloableParams.ADDRESS_CHECK_LOCATIONDATAREPEATCHECK,
+        mStringRequest = new StringRequest(Request.Method.POST, GloableParams.ADDRESS_QUA_CHECK_DATA,
                 new Response.Listener<String>() {
                     @Override
                     public void onResponse(String s) {
@@ -910,8 +907,8 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
                                                 }
                                                 //notice = notice + psl_location + ",";
                                                 //noticeStr = noticeStr + psl_location + ",";
-                                                notice += "\n站位:" + psl_location + " 料号:" + psl_prodcode;
-                                                noticeStr += "\n站位:" + psl_location + " 料号:" + psl_prodcode;
+                                                notice += "\n站位:"  + psl_location + " 料号:" + psl_prodcode;
+                                                noticeStr += "\n站位:"  + psl_location + " 料号:" + psl_prodcode;
                                             }
                                         }
                                         //notice = notice.substring(0, notice.length() - 1);
@@ -1050,8 +1047,6 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
 
     @Override
     protected void initDatas() {
-        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText("复检校验");
-
         mSmtLocationCache = SharedPreUtil.getString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, null);
         if (mLineInfoBean != null) {
             mLinecodeTextView.setText(mLineInfoBean.getDL_LINECODE());
@@ -1067,7 +1062,7 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
      */
     private void getUncheckLocation() {
         progressDialog.show();
-        String url = GloableParams.ADDRESS_SMT_GET_UNCHECK_LOCATION + "?linecode=" + (mLineInfoBean == null ? "" : mLineInfoBean.getDL_LINECODE());
+        String url = GloableParams.ADDRESS_QUA_GET_UN_CHECK_LOCATION + "?linecode=" + (mLineInfoBean == null ? "" : mLineInfoBean.getDL_LINECODE());
         PdaApplication.mRequestQueue.cancelAll(TAG + "uncheck");
 
         mStringRequest = new StringRequest(Request.Method.GET, url,
@@ -1103,7 +1098,7 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
                                                     confirmEvent(psl_location);
                                                 }
                                                 //notice = notice + psl_location + ",";
-                                                notice += "\n站位:" + psl_location + " 料号:" + psl_prodcode;
+                                                notice += "\n站位:"  + psl_location + " 料号:" + psl_prodcode;
                                             }
                                         }
                                         //notice = notice.substring(0, notice.length() - 1);
@@ -1114,9 +1109,8 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
                                     tvMsgNotice.setText(spannableString);
                                 }
                             }
-
                         } catch (Exception e) {
-
+                            e.printStackTrace();
                         }
 
                     }
@@ -1146,7 +1140,7 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
     public void onHiddenChanged(boolean hidden) {
         super.onHiddenChanged(hidden);
         if (!hidden) {
-            FunctionActivity.setTitle("复检校验");
+            FunctionActivity.setTitle(getString(R.string.quality_verification));
             ((FunctionActivity) getActivity()).setSmtQueryIvVisible(true);
         } else {
             ((FunctionActivity) getActivity()).setSmtQueryIvVisible(false);
@@ -1736,5 +1730,4 @@ class FullStationVerificationFragment extends BaseFragment implements View.OnCli
     public boolean onFragmentBackPressed() {
         return false;
     }
-
 }

+ 0 - 3
app/src/main/java/com/uas/pda_wps/fragment/SCSMTBindFragment.java

@@ -13,7 +13,6 @@ import com.uas.pda_wps.application.PdaApplication;
 import com.uas.pda_wps.bean.LineInfoBean;
 import com.uas.pda_wps.global.GloableParams;
 import com.uas.pda_wps.listener.MyEditorActionListener;
-import com.uas.pda_wps.tools.SharedPreUtil;
 import com.uas.pda_wps.util.CommonUtil;
 import com.uas.pda_wps.util.Constants;
 import com.uas.pda_wps.util.FastjsonUtil;
@@ -34,7 +33,6 @@ public class SCSMTBindFragment extends BaseFragment {
     private ClearableEditText mMaterialEt;
     private TextView mResultTv;
     private LineInfoBean mLineInfoBean;
-    private String mSmtLocationCache;
     private String prodcode;
 
     @Override
@@ -54,7 +52,6 @@ public class SCSMTBindFragment extends BaseFragment {
         mResultTv = (TextView) root.findViewById(R.id.smt_feeding_bind_result_tv);
 
         mLineInfoBean = (LineInfoBean) PdaApplication.getDataCacheFromMap(Constants.FLAG.SMT_DEVICE_LINE_CACHE);
-        mSmtLocationCache = SharedPreUtil.getString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, null);
     }
 
     @Override

+ 0 - 18
app/src/main/java/com/uas/pda_wps/fragment/SCSMTChangeFragment.java

@@ -107,24 +107,6 @@ public class SCSMTChangeFragment extends BaseFragment implements TextViewWithBut
         VolleyUtil.setVolleyHandler(volleyHandler);
 
         mLineInfoBean = (LineInfoBean) PdaApplication.getDataCacheFromMap(Constants.FLAG.SMT_DEVICE_LINE_CACHE);
-
-//        JSONObject paramJson = new JSONObject();
-//        try {
-//            makeCraft = new JSONObject(makeCraftStr);
-//            Log.e(TAG, "makeCraft" + makeCraft);
-//            String psId = makeCraft.getString("ps_id");
-//            String prodcode = makeCraft.getString("mc_prodcode");
-//            paramJson.put("ps_id", psId);
-//            paramJson.put("prodcode", prodcode);
-//        } catch (JSONException e) {
-//            e.printStackTrace();
-//        }
-        //if(jobCode.equals("")||jobCode == null||jobCode.equals("null")){jobCode = "无";}
-//
-//        //获取网络数据
-//        requestType = VolleyUtil.FRAGMENT_SCMAKE_SMTCHANGE_DETAIL;
-//        VolleyUtil.getVolleyUtil().requestJsonObject(getActivity(), GloableParams.ADDRESS_SMTDETAIL_APPLY, VolleyUtil.METHOD_POST,
-//                requestType, paramJson);
     }
 
     @Override

+ 4 - 0
app/src/main/java/com/uas/pda_wps/fragment/SCSMTCheckFragment.java

@@ -58,6 +58,7 @@ import com.uas.pda_wps.util.HttpParams;
 import com.uas.pda_wps.util.JsonUtils;
 import com.uas.pda_wps.util.LogUtil;
 import com.uas.pda_wps.util.MyArrayAdapter;
+import com.uas.pda_wps.util.MyLog;
 import com.uas.pda_wps.util.SoundUtil;
 import com.uas.pda_wps.util.VolleyRequest;
 import com.uas.pda_wps.view.ClearableEditText;
@@ -769,6 +770,8 @@ public class SCSMTCheckFragment extends BaseFragment implements View.OnClickList
     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 {
@@ -1075,6 +1078,7 @@ public class SCSMTCheckFragment extends BaseFragment implements View.OnClickList
                         try {
                             if (progressDialog.isShowing())
                                 progressDialog.dismiss();
+                            MyLog.e("aaa","进入校验调用接口,获取未校验站位:" + s);
                             JSONObject resultObject = new JSONObject(s);
                             JSONObject dataObject = resultObject.optJSONObject("data");
                             if (dataObject != null) {

+ 1 - 0
app/src/main/java/com/uas/pda_wps/fragment/SCSMTInFragment.java

@@ -170,6 +170,7 @@ public class SCSMTInFragment extends BaseFragment implements View.OnClickListene
         String location = mLocationTextView.getText().toString().trim();
         if (TextUtils.isEmpty(location)) {
             locationCheck(collect);
+            //mLocationTextView.setText(location);
         } else {
          /*   mSmtDslBean.setDsl_barcode(collect);
             String dsl_repcode = mSmtDslBean.getDsl_repcode();

+ 15 - 4
app/src/main/java/com/uas/pda_wps/fragment/SCSMTIndexFragment.java

@@ -52,6 +52,7 @@ import com.uas.pda_wps.util.FragmentUtils;
 import com.uas.pda_wps.util.JsonTools;
 import com.uas.pda_wps.util.JsonUtils;
 import com.uas.pda_wps.util.MyArrayAdapter;
+import com.uas.pda_wps.util.MyLog;
 import com.uas.pda_wps.view.ClearableEditText;
 import com.uas.pda_wps.view.ConfirmDialog;
 
@@ -177,10 +178,10 @@ public class SCSMTIndexFragment extends BaseFragment implements AdapterView.OnIt
                         if (progressDialog.isShowing())
                             progressDialog.dismiss();
                         try {
+                            MyLog.e("aaa","SMT站位全部信息是:"  + s);
                             JSONObject resultObject = new JSONObject(s);
                             if (resultObject.optBoolean("success")) {
                                 String smtLocation = resultObject.optString("data");
-                                Log.d("smtLocation", smtLocation);
                                 SharedPreUtil.saveString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, smtLocation);
                             }
                         } catch (JSONException e) {
@@ -308,9 +309,19 @@ public class SCSMTIndexFragment extends BaseFragment implements AdapterView.OnIt
                         fragment = new SCSMTUnBindFragment();
                         FragmentUtils.switchFragment(this, fragment);
                         break;
-                    //复检效验
-                    case GloableParams.LISTNAME_FEEDER_CHECKINSPECTION:
-                        fragment = new SCSMTInspectionFragment();
+//                    //复检效验
+//                    case GloableParams.LISTNAME_FEEDER_CHECKINSPECTION:
+//                        fragment = new SCSMTInspectionFragment();
+//                        FragmentUtils.switchFragment(this, fragment);
+//                        break;
+                    //品质校验
+                    case GloableParams.LISTNAME_QUALITY_VERIFICATION:
+                        fragment = new QualityVerificationFra();
+                        FragmentUtils.switchFragment(this, fragment);
+                        break;
+                    //SMT备料
+                    case GloableParams.LISTNAME_SMT_MATERIALPREPARATION:
+                        fragment = new SMTMaterialPreparation();
                         FragmentUtils.switchFragment(this, fragment);
                         break;
                 }

+ 0 - 225
app/src/main/java/com/uas/pda_wps/fragment/SCSMTInspectionFragment.java

@@ -181,32 +181,11 @@ public class SCSMTInspectionFragment extends BaseFragment implements View.OnClic
 
         mCollectEditText.requestFocus();
 
-
         //接口回调
         VolleyUtil.setVolleyHandler(handler);
 
         mLineInfoBean = (LineInfoBean) PdaApplication.getDataCacheFromMap(Constants.FLAG.SMT_DEVICE_LINE_CACHE);
 
-
-        /*try {
-            makeCraft = new JSONObject(makeCraftStr);
-            mcId = makeCraft.getInt("mc_id");
-            Log.e(TAG, "makeCraft:" + makeCraft.toString());
-        } catch (JSONException e) {
-            e.printStackTrace();
-        }
-        JSONObject paramJson = new JSONObject();
-        try {
-            paramJson.put("id", mcId);
-        } catch (JSONException e) {
-            e.printStackTrace();
-        }
-        showLoadingView();
-        //获取网络数据
-        requestType = VolleyUtil.FRAGMENT_SCMAKE_SMTCHECK_LOCATION;
-        VolleyUtil.getVolleyUtil().requestSMTCheckLocation(getActivity(), GloableParams.ADDRESS_SMTCHECK_LOCATION_APPLY, VolleyUtil.METHOD_GET,
-                requestType, mcId);*/
-
     }
 
     @Override
@@ -480,12 +459,6 @@ public class SCSMTInspectionFragment extends BaseFragment implements View.OnClic
             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 {
@@ -546,145 +519,6 @@ public class SCSMTInspectionFragment extends BaseFragment implements View.OnClic
         });
     }
 
-    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("");
         tvMsgLocation.setText("");
@@ -987,65 +821,6 @@ public class SCSMTInspectionFragment extends BaseFragment implements View.OnClic
         PdaApplication.mRequestQueue.add(mStringRequest);
     }
 
-//    private void verificationLocation() {
-//        String location = mLocationEditText.getText().toString().trim();
-//        if (TextUtils.isEmpty(location)) {
-//            CommonUtil.toastNoRepeat(mActivity, "请采集站位编号!");
-//        } else {
-//            if (!TextUtils.isEmpty(mSmtLocationCache)) {
-//                try {
-//                    mIgnoreFocusChange = true;
-//                    JSONArray locationArray = new JSONArray(mSmtLocationCache);
-//                    boolean isExist = false;
-//                    for (int i = 0; i < locationArray.length(); i++) {
-//                        JSONObject locationObject = locationArray.getJSONObject(i);
-//                        if (location.equals(JsonUtils.optStringNotNull(locationObject, "PSL_LOCATION"))) {
-//                            isExist = true;
-//                            mCollectEditText.postDelayed(new Runnable() {
-//                                @Override
-//                                public void run() {
-//                                    mCollectEditText.requestFocus();
-//                                }
-//                            }, 100);
-//
-//                            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);
-//
-//                        }
-//                    }
-//
-//                    if (!isExist) {
-//                        CommonUtil.toastNoRepeat(mActivity, "站位编号错误");
-//                        mLocationEditText.setText("");
-//                        mLocationEditText.postDelayed(new Runnable() {
-//                            @Override
-//                            public void run() {
-//                                mLocationEditText.requestFocus();
-//                            }
-//                        }, 100);
-//                    }
-//
-//                    mIgnoreFocusChange = false;
-//                } catch (JSONException e) {
-//                    e.printStackTrace();
-//                }
-//            } else {
-//                CommonUtil.toastNoRepeat(mActivity, "站位编号错误");
-//                mLocationEditText.setText("");
-//                mLocationEditText.postDelayed(new Runnable() {
-//                    @Override
-//                    public void run() {
-//                        mLocationEditText.requestFocus();
-//                    }
-//                }, 100);
-//            }
-//        }
-//    }
-
     @Override
     protected void initDatas() {
         ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText("复检校验");

+ 2 - 26
app/src/main/java/com/uas/pda_wps/fragment/SCSMTJointFragment.java

@@ -189,6 +189,7 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
         tvMsgQuantity.setText("");
         tvMsgSpec.setText("");
 
+        //joinForcast(collect);
         if (!TextUtils.isEmpty(mSmtLocationCache)) {
             try {
                 JSONArray locationArray = new JSONArray(mSmtLocationCache);
@@ -205,29 +206,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
                         mSmtDslBean = new SmtDslBean();
                         mSmtDslBean.setDsl_location(collect);
                         mSmtDslBean.setDsl_prodcode(psl_prodcode);
-
-                       /* mCollectEditText.setHint("请录入料卷编号/物料编号");
-                        if (!TextUtils.isEmpty(psl_repcode)) {
-//                                if (TextUtils.isEmpty(psl_repcode) || "null".equals(psl_repcode))
-//                                    tvMsgNotice.setText("站位采集成功,请采集首选料[" + psl_prodcode + "]的料卷编号");
-//                                else
-                            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("站位采集成功,物料编号获取失败");
-                        }*/
-
                         tvMsgNotice.setText("");
                         mCollectEditText.setHint(COLLECT_OLD_PRODCODE);
 
@@ -264,7 +242,7 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
                     + "&dsl_linecode=" + URLEncoder.encode(mLineInfoBean.getDL_LINECODE(), "utf-8")
                     + "&dsl_table=" + URLEncoder.encode(mLineInfoBean.getDL_TABLE(), "utf-8");
         } catch (Exception e) {
-
+            e.printStackTrace();
         }
         PdaApplication.mRequestQueue.cancelAll(TAG + "forcast");
         mStringRequest = new StringRequest(Request.Method.GET, url,
@@ -431,7 +409,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
                                 SpannableString spannableString = CommonUtil.spanString(dataCheckResult + "\n请采集物料\n" + psl_prodcode + "\n的料卷编号/物料编号", mActivity, 0, dataCheckResult.length(), R.color.red);
                                 tvMsgNotice.setText(spannableString);
                             }
-
                         } else {
                             tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
                             if (isSuccess) {
@@ -461,7 +438,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
         }
     }
 
-
     /**
      * SMT接料
      */

+ 1 - 3
app/src/main/java/com/uas/pda_wps/fragment/SCSMTUnBindFragment.java

@@ -14,7 +14,6 @@ import com.uas.pda_wps.application.PdaApplication;
 import com.uas.pda_wps.bean.LineInfoBean;
 import com.uas.pda_wps.global.GloableParams;
 import com.uas.pda_wps.listener.MyEditorActionListener;
-import com.uas.pda_wps.tools.SharedPreUtil;
 import com.uas.pda_wps.util.CommonUtil;
 import com.uas.pda_wps.util.Constants;
 import com.uas.pda_wps.util.FastjsonUtil;
@@ -35,7 +34,6 @@ public class SCSMTUnBindFragment extends BaseFragment {
     private TextView mMaterialEt;
     private TextView mResultTv;
     private LineInfoBean mLineInfoBean;
-    private String mSmtLocationCache;
     private Button mConfirmBtn;
 
     @Override
@@ -56,7 +54,7 @@ public class SCSMTUnBindFragment extends BaseFragment {
         mConfirmBtn = root.findViewById(R.id.smt_feeding_unbind_confirm_btn);
 
         mLineInfoBean = (LineInfoBean) PdaApplication.getDataCacheFromMap(Constants.FLAG.SMT_DEVICE_LINE_CACHE);
-        mSmtLocationCache = SharedPreUtil.getString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, null);
+
     }
 
     @Override

+ 783 - 0
app/src/main/java/com/uas/pda_wps/fragment/SMTMaterialPreparation.java

@@ -0,0 +1,783 @@
+package com.uas.pda_wps.fragment;
+
+import android.content.Context;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.v4.app.Fragment;
+import android.text.Editable;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.inputmethod.EditorInfo;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.AutoCompleteTextView;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.EditText;
+import android.widget.ImageView;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.TextView;
+
+import com.android.volley.AuthFailureError;
+import com.android.volley.DefaultRetryPolicy;
+import com.android.volley.Request;
+import com.android.volley.Response;
+import com.android.volley.VolleyError;
+import com.android.volley.toolbox.StringRequest;
+import com.uas.pda_wps.R;
+import com.uas.pda_wps.application.PdaApplication;
+import com.uas.pda_wps.bean.LineInfoBean;
+import com.uas.pda_wps.global.GloableParams;
+import com.uas.pda_wps.tools.DataSourceManager;
+import com.uas.pda_wps.tools.SharedPreUtil;
+import com.uas.pda_wps.tools.VolleyUtil;
+import com.uas.pda_wps.util.CommonUtil;
+import com.uas.pda_wps.util.Constants;
+import com.uas.pda_wps.util.JsonUtils;
+import com.uas.pda_wps.util.MyArrayAdapter;
+import com.uas.pda_wps.view.ClearableEditText;
+import com.uas.pda_wps.view.ConfirmDialog;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public
+        /**
+         * Created by sw on 2026-01-12
+         */
+class SMTMaterialPreparation extends BaseFragment implements View.OnClickListener, DataSourceManager.NotifyData, TextWatcher, RadioGroup.OnCheckedChangeListener {
+    private static final String TAG = "SCSMTFragment";
+    private static final int MACODE_FUZZY = 0;
+    private static final int PRODCODE_FUZZY = 1;
+
+    private ClearableEditText etLineCode;
+    private AutoCompleteTextView etJobCode;
+    private RadioGroup mBoardRadioGroup;
+    private RadioButton mARadioButton, mBRadioButton;
+    Context context;
+    private TextView tvNotice;
+    private CheckBox mOrderCheckBox;
+    private TextView mJobsTitleTextView;
+
+    private JSONObject makeCraft;
+    private Button mConfirmButton;
+    private StringRequest mStringRequest;
+    private LineInfoBean mLineInfo;
+    private String mDlTable = "A";
+    private ImageView mCleanIv;
+    private MyArrayAdapter<String> mAutoStringAdapter;
+    private boolean mIgnoreFocusChange = false;
+    private String mCacheLine = "";
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fra_smt_material_preparation;
+    }
+
+    @Override
+    protected void initViews() {
+        context = getActivity();
+        //界面配置
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(getString(R.string.smt_materia_preparation));
+
+        //获取组件
+        etLineCode = (ClearableEditText) root.findViewById(R.id.et_linecode_smt);
+        etJobCode = (AutoCompleteTextView) root.findViewById(R.id.et_jobcode_smt);
+        etJobCode.setThreshold(1);
+        mCleanIv = (ImageView) root.findViewById(R.id.iocout_smt_jobcode_clean_iv);
+        mBoardRadioGroup = (RadioGroup) root.findViewById(R.id.smt_feeder_board_rg);
+        mARadioButton = (RadioButton) root.findViewById(R.id.smt_feeder_A_rb);
+        mBRadioButton = (RadioButton) root.findViewById(R.id.smt_feeder_B_rb);
+        mOrderCheckBox = (CheckBox) root.findViewById(R.id.smt_feeder_order_cb);
+        mJobsTitleTextView = (TextView) root.findViewById(R.id.smt_feeder_job_title_tv);
+
+        etLineCode.requestFocus();
+
+        //信息提示
+        tvNotice = (TextView) root.findViewById(R.id.tv_notice_smt);
+        mConfirmButton = (Button) root.findViewById(R.id.btn_device_ok_smt);
+        makeCraft = new JSONObject();
+        mLineInfo = new LineInfoBean();
+    }
+
+    @Override
+    protected void initEvents() {
+        //配置监听
+        mConfirmButton.setOnClickListener(this);
+        etJobCode.addTextChangedListener(this);
+        mBoardRadioGroup.setOnCheckedChangeListener(this);
+        mCleanIv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                etJobCode.setText("");
+            }
+        });
+
+        etLineCode.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                if (s == null || s.length() == 0) {
+                    mConfirmButton.setEnabled(false);
+                } else {
+                    mConfirmButton.setEnabled(true);
+                }
+            }
+        });
+
+        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.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+            @Override
+            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+                if (actionId == EditorInfo.IME_ACTION_SEND
+                        || actionId == EditorInfo.IME_ACTION_DONE
+                        || actionId == EditorInfo.IME_ACTION_GO
+                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+                    String devCode = etLineCode.getText().toString().trim();
+                    if (TextUtils.isEmpty(devCode)) {
+                        CommonUtil.toastNoRepeat(mActivity, "请输入线别");
+                    } else {
+                        mIgnoreFocusChange = true;
+                        getLineInfo(devCode);
+                    }
+                    return true;
+                }
+                return false;
+            }
+        });
+
+        //        etJobCode.setOnEditorActionListener(new TextView.OnEditorActionListener() {
+        //            @Override
+        //            public boolean onEditorAction(TextView v, int actionId, KeyEvent event) {
+        //                if (actionId == EditorInfo.IME_ACTION_SEND
+        //                        || actionId == EditorInfo.IME_ACTION_DONE
+        //                        || actionId == EditorInfo.IME_ACTION_GO
+        //                        || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
+        //                    disposeClick();
+        //                    return true;
+        //                }
+        //                return false;
+        //            }
+        //        });
+
+        mOrderCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                if (isChecked) {
+                    mJobsTitleTextView.setText("产品");
+                    etJobCode.setHint("请输入产品代码");
+                    mAutoStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, new ArrayList<String>());
+                    etJobCode.setAdapter(mAutoStringAdapter);
+                } else {
+                    mJobsTitleTextView.setText("工单");
+                    etJobCode.setHint("请输入工单号");
+                    mAutoStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, new ArrayList<String>());
+                    etJobCode.setAdapter(mAutoStringAdapter);
+                }
+            }
+        });
+
+    }
+
+    /**
+     * 设备编号输入框回车事件以及失去焦点事件
+     * 获取线别信息
+     *
+     * @param lineCode
+     */
+    private void getLineInfo(String lineCode) {
+        final String maCode = etJobCode.getText().toString().trim();
+
+        progressDialog.show();
+        String url = null;
+        try {
+            if (!TextUtils.isEmpty(maCode)) {
+                url = GloableParams.ADDRESS_GET_PRE_DEVICE_LINE
+                        + "?li_code=" + URLEncoder.encode(lineCode, "utf-8")
+                        + "&dl_table=" + mDlTable + "&ma_code=" + URLEncoder.encode(maCode, "utf-8")
+                        + "&has_noma=" + mOrderCheckBox.isChecked();
+            } else {
+                url = GloableParams.ADDRESS_GET_PRE_DEVICE_LINE
+                        + "?li_code=" + URLEncoder.encode(lineCode, "utf-8");
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+        }
+        PdaApplication.mRequestQueue.cancelAll(TAG + "getLine");
+
+        mStringRequest = new StringRequest(Request.Method.GET, url,
+                new Response.Listener<String>() {
+                    @Override
+                    public void onResponse(String s) {
+                        if (progressDialog.isShowing())
+                            progressDialog.dismiss();
+                        try {
+                            Log.d("result", s);
+                            JSONObject resultObject = new JSONObject(s);
+                            if (resultObject.optBoolean("success")) {
+                                JSONObject dataObject = resultObject.optJSONObject("data");
+                                if (dataObject != null) {
+                                    //DL_LINECODE(线别),DL_MAINLINE(实际线别),DL_TABLE (板面),
+                                    //DL_MACODE(工单号), DL_PRODCODE(产品编号)
+                                    mLineInfo = new LineInfoBean();
+                                    mLineInfo.setDL_ID(JsonUtils.optLongNotNull(dataObject, "DL_ID"));
+                                    mLineInfo.setDL_LINECODE(JsonUtils.optStringNull(dataObject, "DL_LINECODE"));
+                                    mLineInfo.setDL_PRODCODE(JsonUtils.optStringNotNull(dataObject, "DL_PRODCODE"));
+                                    mLineInfo.setDL_TABLE(JsonUtils.optStringNull(dataObject, "DL_TABLE"));
+                                    mLineInfo.setDL_STATUSCODE(JsonUtils.optStringNull(dataObject, "DL_STATUSCODE"));
+                                    mLineInfo.setDL_MACODE(JsonUtils.optStringNull(dataObject, "DL_MACODE"));
+                                    mLineInfo.setDL_DECODE(JsonUtils.optStringNull(dataObject, "DL_DECODE"));
+                                    mLineInfo.setPS_ID(JsonUtils.optLongNotNull(dataObject, "PS_ID"));
+                                    mLineInfo.setMA_ID(JsonUtils.optLongNotNull(dataObject, "MA_ID"));
+                                    mLineInfo.setDL_STATUS(JsonUtils.optStringNull(dataObject, "DL_STATUS"));
+                                    mLineInfo.setDL_MAINLINE(JsonUtils.optStringNull(dataObject, "DL_MAINLINE"));
+
+                                    PdaApplication.putDataCache2Map(Constants.FLAG.SMT_DEVICE_LINE_CACHE, mLineInfo);
+                                    gotoSMTContentFragment();
+                                } else {
+                                    CommonUtil.toastNoRepeat(mActivity, "请录入工单号或产品代码!");
+                                    etJobCode.requestFocus();
+                                    CommonUtil.openKeybord(etJobCode, mActivity);
+                                    mIgnoreFocusChange = false;
+                                }
+
+                            }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                },
+                new Response.ErrorListener() {
+                    @Override
+                    public void onErrorResponse(VolleyError volleyError) {
+                        String errorToast = CommonUtil.showErrorToast(volleyError, true);
+                        if (progressDialog.isShowing())
+                            progressDialog.dismiss();
+                        mIgnoreFocusChange = false;
+                        etLineCode.setText("");
+                        etJobCode.setText("");
+                        if (TextUtils.isEmpty(maCode)) {
+                            etLineCode.setText("");
+                            etLineCode.requestFocus();
+                        } else {
+                            etJobCode.requestFocus();
+                        }
+                    }
+                }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+        };
+        mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        mStringRequest.setTag(TAG + "getLine");
+        PdaApplication.mRequestQueue.add(mStringRequest);
+    }
+
+    @Override
+    protected void initDatas() {
+        //回调配置
+        DataSourceManager.getDataSourceManager().setNotifyData(this);
+        VolleyUtil.getVolleyUtil().setVolleyHandler(handler);
+       //        editTextGetFocus(etLineCode);
+    }
+
+
+    @Override
+    public void onResume() {
+        super.onResume();
+        mIgnoreFocusChange = false;
+        mCacheLine = SharedPreUtil.getString(mActivity, Constants.FLAG.SMT_LINECODE_CACHE + CommonUtil.getUserName(mActivity) + CommonUtil.getFunMaster(mActivity), "");
+        etLineCode.setText(mCacheLine);
+        if (!TextUtils.isEmpty(mCacheLine))
+            etLineCode.setSelection(mCacheLine.length());
+    }
+
+    @Override
+    public void onPause() {
+        //销毁配置
+        //        hideKeyboard(etJobCode);
+        mIgnoreFocusChange = true;
+        super.onPause();
+        //        if (TextUtils.isEmpty(mCacheLine))
+        //            mCacheLine = etLineCode.getText().toString();
+    }
+
+    @Override
+    public void onDestroy() {
+        Log.e("SMT", "onDestroy");
+        //销毁配置
+        //        hideKeyboard(etJobCode);
+        VolleyUtil.distoryVolley();
+        mIgnoreFocusChange = true;
+        super.onDestroy();
+    }
+
+    //按钮点击事件,回车事件
+    private void disposeClick() {
+        //获取文本框文字内容
+        String deviceCode = etLineCode.getText().toString().trim();
+        String jobCode = etJobCode.getText().toString().trim();
+        //如果设备编号为空
+        if (deviceCode.equals("") || deviceCode == null) {
+            etLineCode.setWarnIconVisible();
+            return;
+        }
+        //设备不为空
+        Log.e("SMTDEVICE", "设备不为空");
+        requestType = VolleyUtil.FRAGMENT_SCMAKE_SMTDEVICE;
+        VolleyUtil.getVolleyUtil().requestCheckCode(context, GloableParams.ADDRESS_DEVICECODE_APPLY, VolleyUtil.METHOD_POST,
+                requestType, deviceCode, jobCode);
+    }
+
+    int requestType = -1;
+    String prepare;
+    JSONObject messageJson = null;
+
+    //处理从服务器获取的设备信息
+    private void disposeDevice(String result) {
+        showLoadingView();
+        Log.e("SMT:disDev", result);
+        JSONObject resultJson, craftJson = null;
+        String craftStr;
+        try {
+            resultJson = new JSONObject(result);
+            messageJson = resultJson.getJSONObject("message");
+            craftStr = messageJson.get("craft").toString().trim();
+            //如果craft是null,出现“请输入作业单号”
+            if (craftStr.equals("") || craftStr == null || craftStr.equals("null")) {
+                showErrorNotice(getString(R.string.notice_inputcode_smt));
+                editTextGetFocus(etJobCode);
+                return;
+            }
+            //如果craft不为null
+            craftJson = messageJson.getJSONObject("craft");
+            makeCraft = craftJson;
+            String userStr = etLineCode.getText().toString().trim();
+            //获得用户输入的设备号
+            String serverDev = makeCraft.getString("mc_devcode").trim();
+            if (!(serverDev.equals(userStr))) {
+                //弹出对话框让用户选择
+                Log.e("SCSMT", "1");
+                //弹出确认设备对话框
+                showConfirmDeviceDialog(userStr, serverDev);
+            } else {
+                disposeDeviceAfterConfirmDevice();
+            }
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+    }
+
+    //确认设备对话框
+    private void showConfirmDeviceDialog(String userDev, String aimDev) {
+        confirmDialog = new ConfirmDialog(getActivity());
+        confirmDialog.setHandler(deviceHandler);
+        CONFIRM_DIALOG_ISSHOWING = true;
+        String notice = "您输入的设备号(" + userDev + ")与作业单中的设备号(" + aimDev + ")不一致,是否更改作业单中的设备号?";
+        confirmDialog.show(notice, ConfirmDialog.CONFIRM);
+    }
+
+    //确认设备对话框后继续disposeDevice
+    private void disposeDeviceAfterConfirmDevice() {
+        Log.e("SCSMT", "2");
+        //将craft值存入缓存
+        //preapre是否为空
+        boolean isPrepareNull = messageJson.isNull("prepare");
+        Log.e("SMT:disDev", "prepare:" + isPrepareNull);
+        //如果prepare为null
+        if (isPrepareNull) {
+            //跳转页面
+            gotoSMTContentFragment();
+            return;
+        }
+        //如果prepare不为null,获取备料单
+        try {
+            prepare = messageJson.get("prepare").toString();
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+        //弹出对话框
+        confirmDialog = new ConfirmDialog(getActivity());
+        confirmDialog.setHandler(importHandler);
+        CONFIRM_DIALOG_ISSHOWING = true;
+        String notice = "是否导入对应备料单:" + prepare + "的数据?";
+        confirmDialog.show(notice, ConfirmDialog.CONFIRM);
+    }
+
+    //导入对应备料单的数据
+    private void importPrepareData() {
+        showLoadingView();
+        JSONObject paramJson = new JSONObject();
+        String decCode = null;
+        String mcCode = null;
+        try {
+            decCode = makeCraft.get("mc_devcode").toString();
+            decCode = etLineCode.getText().toString().trim();
+            mcCode = makeCraft.get("mc_code").toString();
+            mcCode = etJobCode.getText().toString().trim();
+            paramJson.put("mp_code", prepare);
+            paramJson.put("devCode", decCode);
+            paramJson.put("mc_code", mcCode);
+        } catch (JSONException e) {
+            e.printStackTrace();
+        }
+        requestType = VolleyUtil.FRAGMENT_SCMAKE_SMTMPDATA;
+        VolleyUtil.getVolleyUtil().requestMPData(getActivity(), GloableParams.ADDRESS_SMTMPDATA_APPLY, VolleyUtil.METHOD_POST,
+                requestType, paramJson);
+    }
+
+    //跳转到SMT采集页面 上料操作主页面
+    private void gotoSMTContentFragment() {
+        //        etLineCode.setText("");
+        SharedPreUtil.saveString(mActivity, Constants.FLAG.SMT_LINECODE_CACHE + CommonUtil.getUserName(mActivity) + CommonUtil.getFunMaster(mActivity), mLineInfo.getDL_LINECODE());
+        etJobCode.setText("");
+
+        Fragment smtStandbyFunction = new SMTStandbyFunction();
+        if (!TextUtils.isEmpty(mLineInfo.getDL_MAINLINE())) {
+            Bundle b = new Bundle();
+            b.putString("DL_LINECODE",mLineInfo.getDL_LINECODE());    //线别
+            b.putString("DL_MAINLINE",mLineInfo.getDL_MAINLINE());      //实际线别
+            b.putString("DL_TABLE",mLineInfo.getDL_TABLE());   //板面
+            b.putString("DL_MACODE",mLineInfo.getDL_MACODE());   //工单号
+            b.putString("DL_PRODCODE",mLineInfo.getDL_PRODCODE());   //产品编号
+            smtStandbyFunction.setArguments(b);
+        }
+        getActivity().getSupportFragmentManager().beginTransaction()
+                .add(R.id.container_function_fragment, smtStandbyFunction)
+                .commitAllowingStateLoss();
+
+//        getFragmentManager().beginTransaction().addToBackStack(null)
+//                .replace(R.id.container_function_fragment, tmpFragment, null)
+//                .commit();
+
+    }
+
+    /*======================ConfirmDialog==========================================*/
+    ConfirmDialog confirmDialog;
+    boolean isImport = false;
+    public static boolean CONFIRM_DIALOG_ISSHOWING = false;
+    //导入确认:对话框交互Handler,判断用户选择的是确定还是取消
+    Handler importHandler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            isImport = (boolean) msg.obj;
+            //如果点击确认
+            if (isImport) {
+                //如果确认导入
+                importPrepareData();
+                //closeConfirmDialog();
+                return;
+            } else {
+                //如果取消
+                gotoSMTContentFragment();
+                closeConfirmDialog();
+            }
+        }
+    };
+    //设备确认:对话框交互Handler,判断用户选择的是确定还是取消
+    Handler deviceHandler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            isImport = (boolean) msg.obj;
+            //如果点击确认
+            if (isImport) {
+                //如果确认设备,更改makeCraft中的devCode
+                String tmpDevCode = etLineCode.getText().toString().trim();
+                try {
+                    makeCraft.put("mc_devcode", tmpDevCode);
+                    disposeDeviceAfterConfirmDevice();
+                    closeConfirmDialog();
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+                return;
+            }
+            //如果取消
+            closeConfirmDialog();
+        }
+    };
+
+    //关闭确认对话框
+    public void closeConfirmDialog() {
+        CONFIRM_DIALOG_ISSHOWING = false;
+        confirmDialog.dismiss();
+        //menuPopWindow.setFocusable(true);
+    }
+
+    /*===========================Handler================================================*/
+    Handler handler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            Log.e("SMTFEEDER", "HANDLER");
+
+            String result;
+            switch (msg.what) {
+                case VolleyUtil.SUCCESS_SUCCESS:
+                    disposeVolleySuccess(msg);
+                    break;
+                case VolleyUtil.FAILED_FAILED:
+                    result = (String) msg.obj;
+                    showErrorNotice(result);
+                    break;
+            }
+            requestType = -1;
+            progressDialog.dismiss();
+        }
+    };
+
+    //处理服务器返回的错误信息
+    public void disposeVolleySuccess(Message msg) {
+        String result;
+        switch (requestType) {
+            //获取Device设备信息
+            case VolleyUtil.FRAGMENT_SCMAKE_SMTDEVICE:
+                result = (String) msg.obj;
+                disposeDevice(result);
+                break;
+            //导入备料单数据
+            case VolleyUtil.FRAGMENT_SCMAKE_SMTMPDATA:
+                closeConfirmDialog();
+                gotoSMTContentFragment();
+                break;
+        }
+    }
+
+    /*=============================公用函数======================================*/
+    //错误提示信息
+    private void showErrorNotice(String result) {
+        tvNotice.setText(result);
+        tvNotice.setTextColor(getResources().getColor(R.color.button_cautious_focus));
+    }
+
+    @Override
+    public void onClick(View v) {
+        //        disposeClick();
+        //        confirmDevice();
+        String lineCode = etLineCode.getText().toString().trim();
+        getLineInfo(lineCode);
+    }
+
+
+    @Override
+    public void NotifyDataChanged(int noticeType) {
+
+    }
+
+    /**
+     * 显示loadingView
+     */
+    private void showLoadingView() {
+        if (!progressDialog.isShowing()) {
+            progressDialog.show();
+        }
+    }
+
+    /**
+     * 输入框获取焦点
+     */
+    private void editTextGetFocus(EditText editText) {
+        editText.setFocusable(true);
+        editText.setFocusableInTouchMode(true);
+        editText.setEnabled(true);
+        editText.setClickable(true);
+        editText.requestFocus();
+    }
+
+    /**
+     * 键盘
+     */
+    InputMethodManager inputManager;
+
+    private void hideKeyboard(final EditText view) {
+        inputManager = (InputMethodManager) view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+        //获取键盘管理对象
+        inputManager.hideSoftInputFromWindow(view.getWindowToken(), 0);
+    }
+
+    /*=========================输入框文字变化==============================*/
+    @Override
+    public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+    }
+
+    @Override
+    public void onTextChanged(CharSequence s, int start, int before, int count) {
+        tvNotice.setText("");
+        if (!mOrderCheckBox.isChecked()) {
+            if (s.length() >= 3) {
+                if (!s.toString().matches(Constants.REGEX.NO_SYMBOL)) {
+                    CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.note_number_cannot_contain_special));
+                    etJobCode.setText(null);
+                    etJobCode.requestFocus();
+                } else {
+                    fuzzySearch(MACODE_FUZZY);
+                }
+
+            }
+        } else {
+            if (s.length() >= 3) {
+                if (!s.toString().matches(Constants.REGEX.NO_SYMBOL)) {
+                    CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.product_code_cannot_contain_special));
+                    etJobCode.setText(null);
+                    etJobCode.requestFocus();
+                } else {
+                    fuzzySearch(PRODCODE_FUZZY);
+                }
+
+            }
+        }
+
+    }
+
+    @Override
+    public void afterTextChanged(Editable s) {
+        if (s == null || s.length() == 0) {
+            mCleanIv.setVisibility(View.GONE);
+        } else {
+            mCleanIv.setVisibility(View.VISIBLE);
+        }
+    }
+
+    private void fuzzySearch(final int fuzzy) {
+        String url = null;
+        try {
+            if (fuzzy == MACODE_FUZZY) {
+                url = GloableParams.ADDRESS_SMT_FUZZY_SEARCH
+                        + "?inoutNo=" + URLEncoder.encode(etJobCode.getText().toString().toLowerCase(), "utf-8");
+            } else if (fuzzy == PRODCODE_FUZZY) {
+                url = GloableParams.ADDRESS_SMT_FUZZY_SEARCH_PRODUCT
+                        + "?pr_code=" + URLEncoder.encode(etJobCode.getText().toString().toLowerCase(), "utf-8");
+            }
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+            if (fuzzy == MACODE_FUZZY)
+                url = GloableParams.ADDRESS_SMT_FUZZY_SEARCH
+                        + "?inoutNo=" + etJobCode.getText().toString().toLowerCase();
+            else
+                url = GloableParams.ADDRESS_SMT_FUZZY_SEARCH_PRODUCT
+                        + "?pr_code=" + etJobCode.getText().toString().toLowerCase();
+        }
+
+        PdaApplication.mRequestQueue.cancelAll(TAG + "fuzzysearch");
+
+        mStringRequest = new StringRequest(Request.Method.GET, url,
+                new Response.Listener<String>() {
+                    @Override
+                    public void onResponse(String s) {
+                        Log.e("autoStrings", s);
+                        List<String> mAutoStrings = new ArrayList<String>();
+                        try {
+                            mAutoStrings.clear();
+                            mAutoStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, mAutoStrings);
+                            if (etJobCode != null) {
+                                etJobCode.setAdapter(mAutoStringAdapter);
+                            }
+
+                            JSONObject resultObject = new JSONObject(s);
+                            JSONArray dataArray = resultObject.optJSONArray("data");
+                            if (dataArray != null) {
+                                for (int i = 0; i < dataArray.length(); i++) {
+                                    JSONObject dataObject = dataArray.optJSONObject(i);
+                                    if (dataObject != null) {
+                                        String pi_inoutno = JsonUtils.optStringNotNull(dataObject, fuzzy == MACODE_FUZZY ? "MA_CODE" : "PR_CODE");
+                                        if (!TextUtils.isEmpty(pi_inoutno))
+                                            mAutoStringAdapter.add(pi_inoutno);
+                                    }
+                                }
+                            }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                },
+                new Response.ErrorListener() {
+                    @Override
+                    public void onErrorResponse(VolleyError volleyError) {
+                        CommonUtil.showErrorToast(volleyError);
+                        etJobCode.setText("");
+                        etJobCode.requestFocus();
+                        CommonUtil.openKeybord(etJobCode, mActivity);
+                    }
+                }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+        };
+        mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        mStringRequest.setTag(TAG + "fuzzysearch");
+        PdaApplication.mRequestQueue.add(mStringRequest);
+    }
+
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
+            if (progressDialog != null && progressDialog.isShowing()) {
+                //                loadingView.dismiss();
+                //                VolleyUtil.distoryVolley();
+                return true;
+            }
+            if (confirmDialog != null && confirmDialog.isShowing()) {
+                confirmDialog.dismiss();
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+
+    @Override
+    public void onCheckedChanged(RadioGroup group, int checkedId) {
+        if (checkedId == R.id.smt_feeder_A_rb) {
+            mDlTable = "A";
+        } else if (checkedId == R.id.smt_feeder_B_rb) {
+            mDlTable = "B";
+        }
+    }
+}
+

+ 1029 - 0
app/src/main/java/com/uas/pda_wps/fragment/SMTStandbyFunction.java

@@ -0,0 +1,1029 @@
+package com.uas.pda_wps.fragment;
+
+import android.content.Context;
+import android.content.DialogInterface;
+import android.graphics.drawable.BitmapDrawable;
+import android.os.AsyncTask;
+import android.os.Bundle;
+import android.os.Handler;
+import android.os.Message;
+import android.support.v4.app.Fragment;
+import android.support.v7.app.AlertDialog;
+import android.text.Editable;
+import android.text.TextUtils;
+import android.text.TextWatcher;
+import android.util.Log;
+import android.view.Gravity;
+import android.view.KeyEvent;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.AdapterView;
+import android.widget.AutoCompleteTextView;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.CompoundButton;
+import android.widget.GridView;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.RadioButton;
+import android.widget.RadioGroup;
+import android.widget.SimpleAdapter;
+import android.widget.TextView;
+
+import com.android.volley.AuthFailureError;
+import com.android.volley.DefaultRetryPolicy;
+import com.android.volley.Request;
+import com.android.volley.Response;
+import com.android.volley.VolleyError;
+import com.android.volley.toolbox.StringRequest;
+import com.uas.pda_wps.R;
+import com.uas.pda_wps.application.PdaApplication;
+import com.uas.pda_wps.bean.LineInfoBean;
+import com.uas.pda_wps.global.GloableParams;
+import com.uas.pda_wps.tools.DataSourceManager;
+import com.uas.pda_wps.tools.SharedPreUtil;
+import com.uas.pda_wps.tools.VolleyUtil;
+import com.uas.pda_wps.util.CommonUtil;
+import com.uas.pda_wps.util.Constants;
+import com.uas.pda_wps.util.FragmentUtils;
+import com.uas.pda_wps.util.HttpCallback;
+import com.uas.pda_wps.util.HttpParams;
+import com.uas.pda_wps.util.JsonUtils;
+import com.uas.pda_wps.util.MyArrayAdapter;
+import com.uas.pda_wps.util.VolleyRequest;
+import com.uas.pda_wps.view.ClearableEditText;
+import com.uas.pda_wps.view.ConfirmDialog;
+
+import org.json.JSONArray;
+import org.json.JSONException;
+import org.json.JSONObject;
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public
+        /**
+         * Created by sw on 2026-01-12
+         */
+class SMTStandbyFunction extends BaseFragment implements AdapterView.OnItemClickListener {
+    private static final String TAG = "SCSMTIndexFragment";
+    private static final int MACODE_FUZZY = 0;
+    private static final int PRODCODE_FUZZY = 1;
+
+    GridView lvIndex;
+    List<Map<String, Object>> operationIndexList;
+    private LineInfoBean mLineInfoBean;
+    private PopupWindow mPasswordPopupWindow, mMachinePopupWindow;
+    private ClearableEditText mPasswordEditText;
+    private StringRequest mStringRequest;
+    private int dl_madeqty, ma_qty;//产出数,工单数
+    private MyArrayAdapter mAutoStringAdapter;
+    View downAllView;
+    AlertDialog switchDialog;
+
+    private String dl_linecode;      //线别
+    private String dl_mainline;  //实际线别
+    private String dl_table;      //板面
+    private String dl_macode;    //工单号
+    private String dl_prodcode;  //产品编号
+
+    private TextView mCancelTextView;
+    private TextView mConfirmTextView;
+    private TextView tv_dl_linecode, tv_dl_mainline, tv_dl_table, tv_dl_macode, tv_dl_prodcode;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fra_scmake_smtcontent;
+    }
+
+    @Override
+    protected void initViews() {
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(R.string.smt_materia_preparation);
+        ((Button) (getActivity().findViewById(R.id.btn_actionbar_right))).setVisibility(View.GONE);
+
+        tv_dl_linecode = root.findViewById(R.id.tv_dl_linecode);
+        tv_dl_mainline = root.findViewById(R.id.tv_dl_mainline);
+        tv_dl_table = root.findViewById(R.id.tv_dl_table);
+        tv_dl_macode = root.findViewById(R.id.tv_dl_macode);
+        tv_dl_prodcode = root.findViewById(R.id.tv_dl_prodcode);
+
+        downAllView = View.inflate(getActivity(), R.layout.pop_smt_down_all, null);
+        switchDialog = new AlertDialog.Builder(getActivity()).setView(downAllView).create();
+
+        lvIndex = (GridView) root.findViewById(R.id.lv_index_smt);
+
+        //接口回调
+        VolleyUtil.setVolleyHandler(volleyHandler);
+        //获取数据
+        operationIndexList = DataSourceManager.getDataSourceManager().getFeederOperationIndex2();
+
+        mLineInfoBean = (LineInfoBean) PdaApplication.getDataCacheFromMap(Constants.FLAG.SMT_DEVICE_LINE_CACHE);
+    }
+
+    @Override
+    protected void initEvents() {
+        //配置监听
+        lvIndex.setOnItemClickListener(this);
+    }
+
+    @Override
+    protected void initDatas() {
+        SimpleAdapter adapter = new SimpleAdapter(mActivity, operationIndexList, R.layout.item_grid_first,
+                new String[]{DataSourceManager.KEY_GRID_ITEMIMG, DataSourceManager.KEY_GRID_ITEMNAME},
+                new int[]{R.id.first_griditem_img, R.id.first_griditem_name});
+        lvIndex.setAdapter(adapter);
+
+        if (mLineInfoBean != null) {
+            if (CommonUtil.isNetWorkConnected(mActivity)) {
+                getSmtLocation();
+            } else {
+                CommonUtil.toastNoRepeat(mActivity, getString(R.string.net_not_connect));
+                SharedPreUtil.saveString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, "");
+            }
+        }
+
+        Bundle arguments = getArguments();
+        if (arguments != null) {
+            dl_linecode = arguments.getString("DL_LINECODE") == null ? "" : arguments.getString("DL_LINECODE");
+            dl_mainline = arguments.getString("DL_MAINLINE") == null ? "" : arguments.getString("DL_MAINLINE");
+            dl_table = arguments.getString("DL_TABLE") == null ? "" : arguments.getString("DL_TABLE");
+            dl_macode = arguments.getString("DL_MACODE") == null ? "" : arguments.getString("DL_MACODE");
+            dl_prodcode = arguments.getString("DL_PRODCODE") == null ? "" : arguments.getString("DL_PRODCODE");
+        }
+
+        tv_dl_linecode.setText(dl_linecode);
+        tv_dl_mainline.setText(dl_mainline);
+        tv_dl_table.setText(dl_table + "面");
+        tv_dl_macode.setText(dl_macode);
+        tv_dl_prodcode.setText(dl_prodcode);
+    }
+
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        if (!hidden) {
+            VolleyUtil.setVolleyHandler(volleyHandler);
+            ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText(R.string.smt_materia_preparation);
+            ((Button) (getActivity().findViewById(R.id.btn_actionbar_right))).setVisibility(View.GONE);
+        }
+    }
+
+    /**
+     * 获取当前工单站位信息
+     */
+    private void getSmtLocation() {
+        progressDialog.show();
+        String url = GloableParams.ADDRESS_SMT_GET_SMT_LOCATION
+                + "?ps_id=" + mLineInfoBean.getPS_ID()
+                + "&dl_table=" + mLineInfoBean.getDL_TABLE();
+
+        PdaApplication.mRequestQueue.cancelAll(TAG + "location");
+
+        mStringRequest = new StringRequest(Request.Method.GET, url,
+                new Response.Listener<String>() {
+                    @Override
+                    public void onResponse(String s) {
+                        if (progressDialog.isShowing())
+                            progressDialog.dismiss();
+                        try {
+                            JSONObject resultObject = new JSONObject(s);
+                            if (resultObject.optBoolean("success")) {
+                                String smtLocation = resultObject.optString("data");
+                                Log.d("smtLocation", smtLocation);
+                                SharedPreUtil.saveString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, smtLocation);
+                            }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                },
+                new Response.ErrorListener() {
+                    @Override
+                    public void onErrorResponse(VolleyError volleyError) {
+                        if (progressDialog.isShowing())
+                            progressDialog.dismiss();
+                        CommonUtil.showErrorToast(volleyError, true);
+                        SharedPreUtil.saveString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, "");
+                    }
+                }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+        };
+        mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        mStringRequest.setTag(TAG + "location");
+        PdaApplication.mRequestQueue.add(mStringRequest);
+    }
+
+    @Override
+    public void onDestroy() {
+        VolleyUtil.distoryVolley();
+        PdaApplication.removeDataCacheFromMap(Constants.FLAG.SMT_REQUEST_CACHE);
+        super.onDestroy();
+    }
+
+    @Override
+    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
+        if (!CommonUtil.isRepeatClick()) {
+            String mSmtLocationCache = SharedPreUtil.getString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, null);
+            if (TextUtils.isEmpty(mSmtLocationCache)) {
+                new AlertDialog.Builder(mActivity).setTitle("提示")
+                        .setMessage("获取站位表失败,无法进行后续操作。点击确定重新获取站位表!")
+                        .setPositiveButton(R.string.confirm, new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(DialogInterface dialog, int which) {
+                                if (CommonUtil.isNetWorkConnected(mActivity)) {
+                                    getSmtLocation();
+                                } else {
+                                    CommonUtil.toastNoRepeat(mActivity, getString(R.string.net_not_connect));
+                                    SharedPreUtil.saveString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, "");
+                                }
+                            }
+                        })
+                        .setNegativeButton(R.string.cancel, null).create().show();
+            } else {
+                //获取选择的列表Name
+                String selectedName = operationIndexList.get(position).get(DataSourceManager.KEY_GRID_ITEMNAME).toString();
+                Fragment fragment;
+                switch (selectedName) {
+                    //上料
+                    case GloableParams.LISTNAME_FEEDER_IN2:
+                        fragment = new SCSMTInFragment();
+                        FragmentUtils.switchFragment(this, fragment);
+                        break;
+                    //下料
+                    case GloableParams.LISTNAME_FEEDER_DOWN2:
+                        fragment = new SCSMTDownFragment();
+                        FragmentUtils.switchFragment(this, fragment);
+                        break;
+                    //全部下料
+                    case GloableParams.LISTNAME_FEEDER_DOWNALL2:
+                        queryMakeqty(1);
+                        break;
+                    //料卷查询
+                    case GloableParams.LISTNAME_FEEDER_QUERY2:
+                        fragment = new SCSMTQueryFragment();
+                        FragmentUtils.switchFragment(this, fragment);
+                        break;
+                    //品质校验
+                    case GloableParams.LISTNAME_QUALITY_VERIFICATION2:
+                        fragment = new QualityVerificationFra();
+                        FragmentUtils.switchFragment(this, fragment);
+                        break;
+                    //上线
+                    case GloableParams.LISTNAME_GO_ONLINE:
+                        confirmOnline();
+                        break;
+                }
+            }
+        }
+    }
+
+    private void confirmOnline() {
+        String dl_mainline = "";
+        if (mLineInfoBean == null) {
+            dl_mainline = "";
+        }else {
+            dl_mainline = mLineInfoBean.getDL_MAINLINE();
+        }
+        new android.app.AlertDialog.Builder(mActivity).setTitle("提示")
+                .setMessage("是否确认上线到实际线别(" + dl_mainline + ")?")
+                .setPositiveButton("是", new DialogInterface.OnClickListener() {
+                    @Override
+                    public void onClick(DialogInterface dialog, int which) {
+                        setGoOnline();
+                    }
+                })
+                .setNegativeButton("否", null).create().show();
+    }
+
+    private void setGoOnline() {
+        String li_code = mLineInfoBean.getDL_LINECODE();   //线别
+        String ma_code = mLineInfoBean.getDL_MACODE();     //工单
+        String dl_table = mLineInfoBean.getDL_TABLE();     //板面
+
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_PRE_ONLINE)
+                .method(Request.Method.POST)
+                .addParam("li_code", li_code)
+                .addParam("ma_code", ma_code)
+                .addParam("dl_table", dl_table)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                if (progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                try {
+                    JSONObject resultObject = new JSONObject(o.toString());
+                    if (resultObject.optBoolean("success")) {
+                        CommonUtil.toastNoRepeat(mActivity, "上线成功");
+
+                        Fragment tmpFragment = new SMTMaterialPreparation();
+                        getFragmentManager().beginTransaction()
+                                .addToBackStack(null)
+                                .replace(R.id.container_function_fragment, tmpFragment, null)
+                                .commit();
+
+                        //                        SMTMaterialPreparation fragment = new SMTMaterialPreparation();
+                        //                        FragmentUtils.switchFragment(SMTStandbyFunction.this, fragment);
+
+                        String data = resultObject.optString("data");
+                    }
+                } catch (JSONException e) {
+                    e.printStackTrace();
+                }
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                if (progressDialog.isShowing()) {
+                    progressDialog.dismiss();
+                }
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+            }
+        });
+    }
+
+
+    /**
+     * 获取对应工单产出数
+     *
+     * @param i
+     */
+    private void queryMakeqty(final int i) {
+        progressDialog.show();
+
+        String url = GloableParams.ADDRESS_SMT_QUERY_MADEQTY + "?dl_macode=" + mLineInfoBean.getDL_MACODE()
+                + "&dl_linecode=" + mLineInfoBean.getDL_LINECODE();
+        PdaApplication.mRequestQueue.cancelAll(TAG + "downall");
+
+        mStringRequest = new StringRequest(Request.Method.GET, url,
+                new Response.Listener<String>() {
+                    @Override
+                    public void onResponse(String s) {
+                        if (progressDialog.isShowing())
+                            progressDialog.dismiss();
+                        if (s != null) {
+                            try {
+                                Log.d("madeqty", s);
+                                JSONObject resultObject = new JSONObject(s);
+                                if (!resultObject.isNull("data")) {
+                                    JSONObject dataObject = resultObject.optJSONObject("data");
+                                    if (dataObject != null) {
+                                        dl_madeqty = (int) JsonUtils.optLongNotNull(dataObject, "DL_MADEQTY");
+                                        ma_qty = (int) JsonUtils.optLongNotNull(dataObject, "MA_QTY");
+                                        showVerificationPop(i);
+                                    } else {
+                                        CommonUtil.toastNoRepeat(mActivity, "产出数获取失败,请重新获取");
+                                    }
+                                } else {
+                                    dl_madeqty = 0;
+                                    ma_qty = 0;
+                                    showVerificationPop(i);
+                                }
+                            } catch (JSONException e) {
+                                e.printStackTrace();
+                                CommonUtil.toastNoRepeat(mActivity, "产出数获取异常,请重新获取");
+                            }
+                        } else {
+                            CommonUtil.toastNoRepeat(mActivity, "产出数获取失败,请重新获取");
+                        }
+                    }
+                },
+                new Response.ErrorListener() {
+                    @Override
+                    public void onErrorResponse(VolleyError volleyError) {
+                        if (progressDialog.isShowing())
+                            progressDialog.dismiss();
+                        CommonUtil.showErrorToast(volleyError, true);
+                    }
+                }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+        };
+        mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        mStringRequest.setTag(TAG + "downall");
+        PdaApplication.mRequestQueue.add(mStringRequest);
+    }
+
+
+    /**
+     * 验证登录密码
+     *
+     * @param whichFunc 1:全部下料;2:工单切换
+     */
+    private void showVerificationPop(final int whichFunc) {
+        LayoutInflater layoutInflater = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
+        View popView = layoutInflater.inflate(R.layout.pop_password_verification, null);
+        mCancelTextView = (TextView) popView.findViewById(R.id.pop_password_verification_cancel_tv);
+        mConfirmTextView = (TextView) popView.findViewById(R.id.pop_password_verification_confirm_tv);
+        mPasswordEditText = (ClearableEditText) popView.findViewById(R.id.pop_password_verification_et);
+
+        mConfirmTextView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                verificationPassword(whichFunc);
+            }
+        });
+
+        mCancelTextView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closePasswordPopupWindow();
+            }
+        });
+
+        mPasswordPopupWindow = new PopupWindow(popView, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
+        mPasswordPopupWindow.setBackgroundDrawable(new BitmapDrawable());
+        mPasswordPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                closePasswordPopupWindow();
+            }
+        });
+        CommonUtil.setBackgroundAlpha(mActivity, 0.5f);
+        mPasswordPopupWindow.showAtLocation(mActivity.getWindow().getDecorView(), Gravity.CENTER, 0, -100);
+        CommonUtil.openKeybord(mPasswordEditText, mActivity);
+    }
+
+    /**
+     * 验证登录密码
+     *
+     * @param whichFunc
+     */
+    private void verificationPassword(int whichFunc) {
+        String input = mPasswordEditText.getText().toString().trim();
+        if (TextUtils.isEmpty(input)) {
+            CommonUtil.toastNoRepeat(mActivity, "请输入密码!");
+        } else {
+            String verificationPwd = SharedPreUtil.getString(mActivity, Constants.FLAG.VERIFICATION_PASSWORD, null);
+            if (TextUtils.isEmpty(verificationPwd)) {
+                CommonUtil.toastNoRepeat(mActivity, "密码丢失,请重新登录!");
+                CommonUtil.makeNotice();
+                closePasswordPopupWindow();
+            } else {
+                if (verificationPwd.equals(input)) {
+                    //                                CommonUtil.toastNoRepeat(mActivity, "验证通过!");
+                    closePasswordPopupWindow();
+
+                    if (whichFunc == 1)
+                        showConfirmAllDownDialog();
+                    else if (whichFunc == 2) {
+                        showWitchPopupWindow();
+                    }
+                } else {
+                    CommonUtil.toastNoRepeat(mActivity, "密码错误,请重新输入!");
+                    CommonUtil.makeNotice();
+                    mPasswordEditText.setText("");
+                    mPasswordEditText.requestFocus();
+                }
+            }
+        }
+    }
+
+    /**
+     * 切换工单
+     */
+    private void showWitchPopupWindow() {
+        View switchView = View.inflate(mActivity, R.layout.popupwindom_switch_jobs, null);
+        final AlertDialog switchDialog = new AlertDialog.Builder(mActivity).setView(switchView).create();
+
+        final AutoCompleteTextView jobsEditText = (AutoCompleteTextView) switchView.findViewById(R.id.pop_switch_jobs_number_et);
+        jobsEditText.setThreshold(1);
+        final ClearableEditText outputEditText = (ClearableEditText) switchView.findViewById(R.id.pop_switch_jobs_output_et);
+        final ImageView cleanIv = (ImageView) switchView.findViewById(R.id.pop_switch_jobs_clean_iv);
+        RadioGroup mTableRadioGroup = (RadioGroup) switchView.findViewById(R.id.pop_switch_jobs_table_rg);
+        final RadioButton mARadioButton = (RadioButton) switchView.findViewById(R.id.pop_switch_jobs_a_rb);
+        final RadioButton mBRadioButton = (RadioButton) switchView.findViewById(R.id.pop_switch_jobs_b_rb);
+        final TextView mConfirmTextView = (TextView) switchView.findViewById(R.id.pop_switch_jobs_confirm_tv);
+        TextView mCancelTextView = (TextView) switchView.findViewById(R.id.pop_switch_jobs_cancel_tv);
+        final CheckBox orderCheckBox = (CheckBox) switchView.findViewById(R.id.pop_switch_jobs_order_cb);
+        LinearLayout mOperationLinearLayout = (LinearLayout) switchView.findViewById(R.id.pop_switch_jobs_operation_ll);
+        final LinearLayout mExceptionLinearLayout = (LinearLayout) switchView.findViewById(R.id.pop_switch_jobs_exception_ll);
+        final TextView mExceptionTextView = (TextView) switchView.findViewById(R.id.pop_switch_jobs_exception_msg_tv);
+        final TextView mKnownTextView = (TextView) switchView.findViewById(R.id.pop_switch_jobs_exception_confirm_tv);
+
+        mOperationLinearLayout.setVisibility(View.VISIBLE);
+        mExceptionLinearLayout.setVisibility(View.GONE);
+        outputEditText.requestFocus();
+        outputEditText.setText(dl_madeqty + "");
+        outputEditText.setSelection(outputEditText.getText().toString().trim().length());
+
+        cleanIv.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                jobsEditText.setText("");
+            }
+        });
+
+        mKnownTextView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                mExceptionLinearLayout.setVisibility(View.GONE);
+                mExceptionTextView.setText("");
+            }
+        });
+
+        jobsEditText.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence s, int start, int before, int count) {
+                if (!orderCheckBox.isChecked()) {
+                    if (s.length() >= 3) {
+                        if (!s.toString().matches(Constants.REGEX.NO_SYMBOL)) {
+                            CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.note_number_cannot_contain_special));
+                            jobsEditText.setText(null);
+                            jobsEditText.requestFocus();
+                        } else {
+                            fuzzySearch(jobsEditText, MACODE_FUZZY);
+                        }
+                    }
+                } else {
+                    if (s.length() >= 3) {
+                        if (!s.toString().matches(Constants.REGEX.NO_SYMBOL)) {
+                            CommonUtil.toastNoRepeat(getActivity(), getResources().getString(R.string.product_code_cannot_contain_special));
+                            jobsEditText.setText(null);
+                            jobsEditText.requestFocus();
+                        } else {
+                            fuzzySearch(jobsEditText, PRODCODE_FUZZY);
+                        }
+                    }
+                }
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                if (s == null || s.length() == 0) {
+                    mConfirmTextView.setEnabled(false);
+                    cleanIv.setVisibility(View.GONE);
+                } else {
+                    mConfirmTextView.setEnabled(true);
+                    cleanIv.setVisibility(View.VISIBLE);
+                }
+            }
+        });
+
+        orderCheckBox.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
+            @Override
+            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
+                if (!isChecked) {
+                    jobsEditText.setHint("请输入新工单号");
+                    mAutoStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, new ArrayList<String>());
+                    jobsEditText.setAdapter(mAutoStringAdapter);
+                } else {
+                    jobsEditText.setHint("请输入产品代码");
+                    mAutoStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, new ArrayList<String>());
+                    jobsEditText.setAdapter(mAutoStringAdapter);
+                }
+            }
+        });
+
+
+        mConfirmTextView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                final String linecode = mLineInfoBean.getDL_LINECODE();
+                final String jobs = jobsEditText.getText().toString().trim();
+                String outputStr = outputEditText.getText().toString().trim();
+
+                String table = "A";
+                if (!TextUtils.isEmpty(jobs)) {
+                    if (mARadioButton.isChecked()) {
+                        table = "A";
+                    } else if (mBRadioButton.isChecked()) {
+                        table = "B";
+                    }
+                    if (jobs.equals(mLineInfoBean.getDL_MACODE()) && table.equals(mLineInfoBean.getDL_TABLE())) {
+                        if (!orderCheckBox.isChecked()) {
+                            CommonUtil.toastNoRepeat(mActivity, "无法切换至相同的工单号+板面!");
+                        } else {
+                            CommonUtil.toastNoRepeat(mActivity, "无法切换至相同的产品代码+板面!");
+                        }
+                        CommonUtil.makeNotice();
+                    } else {
+                        try {
+                            if (TextUtils.isEmpty(outputStr)) {
+                                CommonUtil.toastNoRepeat(mActivity, "请输入原工单产出数");
+                            } else {
+                                int quantity = (int) Long.parseLong(outputStr);
+                                if (quantity >= dl_madeqty && quantity <= ma_qty) {
+                                    switchJobs(linecode, jobs, table, jobsEditText, outputEditText, switchDialog, orderCheckBox.isChecked(), mExceptionLinearLayout, mExceptionTextView);
+                                } else {
+                                    CommonUtil.toastNoRepeat(mActivity, "数量必须介于产出数和工单数之间");
+                                    CommonUtil.makeNotice();
+                                }
+                            }
+
+                        } catch (Exception e) {
+                            outputEditText.setText(dl_madeqty + "");
+                            outputEditText.setSelection(outputEditText.getText().toString().trim().length());
+                            CommonUtil.toastNoRepeat(mActivity, "产出数应为正整数");
+                            CommonUtil.makeNotice();
+                        }
+                    }
+                }
+            }
+        });
+
+        mCancelTextView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                //                closeSwitchPopupWindow();
+                switchDialog.dismiss();
+            }
+        });
+
+        switchDialog.show();
+        CommonUtil.openKeybord(outputEditText, mActivity);
+    }
+
+    /**
+     * 模糊查询
+     *
+     * @param jobsEditText
+     * @param fuzzy
+     */
+    private void fuzzySearch(final AutoCompleteTextView jobsEditText, final int fuzzy) {
+        String url = null;
+        try {
+            if (fuzzy == MACODE_FUZZY)
+                url = GloableParams.ADDRESS_SMT_FUZZY_SEARCH
+                        + "?inoutNo=" + URLEncoder.encode(jobsEditText.getText().toString().toLowerCase(), "utf-8");
+            else if (fuzzy == PRODCODE_FUZZY)
+                url = GloableParams.ADDRESS_SMT_FUZZY_SEARCH_PRODUCT
+                        + "?pr_code=" + URLEncoder.encode(jobsEditText.getText().toString().toLowerCase(), "utf-8");
+        } catch (UnsupportedEncodingException e) {
+            e.printStackTrace();
+            if (fuzzy == MACODE_FUZZY)
+                url = GloableParams.ADDRESS_SMT_FUZZY_SEARCH
+                        + "?inoutNo=" + jobsEditText.getText().toString().toLowerCase();
+            else
+                url = GloableParams.ADDRESS_SMT_FUZZY_SEARCH_PRODUCT
+                        + "?pr_code=" + jobsEditText.getText().toString().toLowerCase();
+        }
+
+        PdaApplication.mRequestQueue.cancelAll(TAG + "fuzzysearch");
+
+        mStringRequest = new StringRequest(Request.Method.GET, url,
+                new Response.Listener<String>() {
+                    @Override
+                    public void onResponse(String s) {
+                        Log.e("autoStrings", s);
+                        List<String> mAutoStrings = new ArrayList<String>();
+                        try {
+                            mAutoStrings.clear();
+                            mAutoStringAdapter = new MyArrayAdapter<String>(mActivity, android.R.layout.simple_dropdown_item_1line, mAutoStrings);
+                            if (jobsEditText != null) {
+                                jobsEditText.setAdapter(mAutoStringAdapter);
+                            }
+
+                            JSONObject resultObject = new JSONObject(s);
+                            JSONArray dataArray = resultObject.optJSONArray("data");
+                            if (dataArray != null) {
+                                for (int i = 0; i < dataArray.length(); i++) {
+                                    JSONObject dataObject = dataArray.optJSONObject(i);
+                                    if (dataObject != null) {
+                                        String pi_inoutno = JsonUtils.optStringNotNull(dataObject, fuzzy == MACODE_FUZZY ? "MA_CODE" : "PR_CODE");
+                                        if (!TextUtils.isEmpty(pi_inoutno))
+                                            mAutoStringAdapter.add(pi_inoutno);
+                                    }
+                                }
+                            }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                },
+                new Response.ErrorListener() {
+                    @Override
+                    public void onErrorResponse(VolleyError volleyError) {
+                        CommonUtil.showErrorToast(volleyError);
+                        jobsEditText.setText("");
+                        jobsEditText.requestFocus();
+                        CommonUtil.openKeybord(jobsEditText, mActivity);
+                    }
+                }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+        };
+        mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        mStringRequest.setTag(TAG + "fuzzysearch");
+        PdaApplication.mRequestQueue.add(mStringRequest);
+    }
+
+
+    /**
+     * 切换工单
+     *
+     * @param linecode               线别
+     * @param jobs                   工单
+     * @param table                  板面
+     * @param jobsEditText           工单输入框
+     * @param outputEditText
+     * @param switchDialog           弹出框
+     * @param checked                是否被选中
+     * @param mExceptionLinearLayout
+     * @param mExceptionTextView
+     */
+    private void switchJobs(final String linecode, final String jobs, String table, final AutoCompleteTextView jobsEditText, final ClearableEditText outputEditText, final AlertDialog switchDialog, final boolean checked, final LinearLayout mExceptionLinearLayout, final TextView mExceptionTextView) {
+        progressDialog.show();
+        PdaApplication.mRequestQueue.cancelAll(TAG + "change");
+
+        final String finalTable = table;
+        mStringRequest = new StringRequest(Request.Method.POST, GloableParams.ADDRESS_SMT_CHANGE_MAKE,
+                new Response.Listener<String>() {
+                    @Override
+                    public void onResponse(String s) {
+                        switchDialog.dismiss();
+                        if (progressDialog.isShowing())
+                            progressDialog.dismiss();
+                        try {
+                            Log.d("result", s);
+                            JSONObject resultObject = new JSONObject(s);
+                            if (resultObject.optBoolean("success")) {
+                                JSONObject dataObject = resultObject.optJSONObject("data");
+                                if (dataObject != null) {
+                                    JSONObject devicelineObject = dataObject.optJSONObject("deviceline");
+                                    if (devicelineObject != null) {
+                                        mLineInfoBean = new LineInfoBean();
+                                        mLineInfoBean.setDL_ID(JsonUtils.optLongNotNull(devicelineObject, "DL_ID"));
+                                        mLineInfoBean.setDL_DECODE(JsonUtils.optStringNull(devicelineObject, "DL_DECODE"));
+                                        mLineInfoBean.setDL_LINECODE(JsonUtils.optStringNull(devicelineObject, "DL_LINECODE"));
+                                        mLineInfoBean.setDL_MACODE(JsonUtils.optStringNull(devicelineObject, "DL_MACODE"));
+                                        mLineInfoBean.setDL_TABLE(JsonUtils.optStringNull(devicelineObject, "DL_TABLE"));
+                                        mLineInfoBean.setDL_STATUSCODE(JsonUtils.optStringNull(devicelineObject, "DL_STATUSCODE"));
+                                        mLineInfoBean.setDL_STATUS(JsonUtils.optStringNull(devicelineObject, "DL_STATUS"));
+                                        mLineInfoBean.setPS_ID(JsonUtils.optLongNotNull(devicelineObject, "PS_ID"));
+                                        mLineInfoBean.setMA_ID(JsonUtils.optLongNotNull(devicelineObject, "MA_ID"));
+                                        mLineInfoBean.setDL_PRODCODE(JsonUtils.optStringNotNull(devicelineObject, "DL_PRODCODE"));
+
+                                        mLineInfoBean.setDL_MAINLINE(JsonUtils.optStringNotNull(devicelineObject, "DL_MAINLINE"));
+
+                                        PdaApplication.putDataCache2Map(Constants.FLAG.SMT_DEVICE_LINE_CACHE, mLineInfoBean);
+                                        CommonUtil.toastNoRepeat(mActivity, "工单切换成功!");
+
+                                        tv_dl_linecode.setText(mLineInfoBean.getDL_LINECODE());
+                                        tv_dl_mainline.setText(mLineInfoBean.getDL_MAINLINE());
+                                        tv_dl_table.setText(mLineInfoBean.getDL_TABLE() + "面");
+                                        tv_dl_macode.setText(mLineInfoBean.getDL_MACODE());
+                                        tv_dl_prodcode.setText(mLineInfoBean.getDL_PRODCODE());
+                                    }
+                                    String smtLocation = dataObject.optString("smtlocation");
+                                    Log.d("smtLocation", smtLocation);
+                                    if (!TextUtils.isEmpty(smtLocation))
+                                        SharedPreUtil.saveString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, smtLocation);
+                                }
+                            }
+                        } catch (JSONException e) {
+                            e.printStackTrace();
+                        }
+                    }
+                },
+                new Response.ErrorListener() {
+                    @Override
+                    public void onErrorResponse(VolleyError volleyError) {
+                        if (progressDialog.isShowing())
+                            progressDialog.dismiss();
+                        String errorToast = CommonUtil.showErrorToast(volleyError, false);
+                        mExceptionLinearLayout.setVisibility(View.VISIBLE);
+                        mExceptionTextView.setText(errorToast);
+                        jobsEditText.setText("");
+                        outputEditText.setText(dl_madeqty + "");
+                        outputEditText.setSelection(outputEditText.getText().toString().trim().length());
+                        outputEditText.requestFocus();
+                    }
+                }) {
+            @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<String, String>();
+                params.put("dl_linecode", linecode);
+                params.put("ma_code", jobs);
+                params.put("table", finalTable);
+                params.put("dl_actmadeqty", outputEditText.getText().toString().trim());
+                params.put("has_noma", checked + "");
+                return params;
+            }
+        };
+        mStringRequest.setRetryPolicy(new DefaultRetryPolicy(10 * 1000, 0, 1f));
+        mStringRequest.setTag(TAG + "change");
+        PdaApplication.mRequestQueue.add(mStringRequest);
+    }
+
+    private void closePasswordPopupWindow() {
+        if (mPasswordPopupWindow != null) {
+            mPasswordPopupWindow.dismiss();
+            CommonUtil.setBackgroundAlpha(mActivity, 1f);
+        }
+    }
+
+    /*=============================全部下料=========================================*/
+    //全部下料对话框
+
+    /**
+     * 弹出全部下料对话框
+     */
+    private void showConfirmAllDownDialog() {
+        final ClearableEditText quantityEditText = (ClearableEditText) downAllView.findViewById(R.id.pop_smt_down_all_et);
+        CheckBox unbindCheckBox = downAllView.findViewById(R.id.pop_smt_down_unbind_cb);
+        unbindCheckBox.setChecked(true);
+        final TextView mConfirmTextView = (TextView) downAllView.findViewById(R.id.pop_smt_down_all_confirm_tv);
+        TextView mCancelTextView = (TextView) downAllView.findViewById(R.id.pop_smt_down_all_cancel_tv);
+
+        quantityEditText.setText(dl_madeqty + "");
+        quantityEditText.setSelection(quantityEditText.getText().toString().trim().length());
+
+        mConfirmTextView.addTextChangedListener(new TextWatcher() {
+            @Override
+            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
+
+            }
+
+            @Override
+            public void onTextChanged(CharSequence s, int start, int before, int count) {
+
+            }
+
+            @Override
+            public void afterTextChanged(Editable s) {
+                if (s == null || s.length() == 0) {
+                    mConfirmTextView.setEnabled(false);
+                } else {
+                    mConfirmTextView.setEnabled(true);
+                }
+            }
+        });
+
+        mConfirmTextView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String quantityStr = quantityEditText.getText().toString().trim();
+                try {
+                    int quantity = (int) Long.parseLong(quantityStr);
+                    if (quantity >= dl_madeqty && quantity <= ma_qty) {
+                        disposeAllDown(quantity, unbindCheckBox.isChecked());
+                    } else {
+                        CommonUtil.toastNoRepeat(mActivity, "数量必须介于产出数和工单数之间");
+                        CommonUtil.makeNotice();
+                    }
+                } catch (Exception e) {
+                    quantityEditText.setText(dl_madeqty + "");
+                    quantityEditText.setSelection(quantityEditText.getText().toString().trim().length());
+                    CommonUtil.toastNoRepeat(mActivity, "产出数应为正整数");
+                    CommonUtil.makeNotice();
+                }
+            }
+        });
+
+        mCancelTextView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                //                closeDownAllPopupWindow();
+                switchDialog.dismiss();
+            }
+        });
+
+        switchDialog.show();
+        //
+        //        mDownAllPopupWindow = new PopupWindow(downAllView, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
+        //
+        //        mDownAllPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+        //            @Override
+        //            public void onDismiss() {
+        //                closeDownAllPopupWindow();
+        //            }
+        //        });
+        //        CommonUtil.setBackgroundAlpha(mActivity, 0.5f);
+        //        mDownAllPopupWindow.showAtLocation(mActivity.getWindow().getDecorView(), Gravity.CENTER, 0, -100);
+        CommonUtil.openKeybord(quantityEditText, mActivity);
+    }
+
+    //全部下料
+    private void disposeAllDown(int quantity, boolean unbind) {
+        showLoadingView();
+        VolleyUtil.getVolleyUtil().requestSMTAllDown(getActivity(),
+                GloableParams.ADDRESS_SMT_CUTTING_ALLSTOCK,
+                VolleyUtil.METHOD_POST,
+                VolleyUtil.FRAGMENT_SCMAKE_SMTALLDOWN,
+                mLineInfoBean.getDL_MACODE(),
+                mLineInfoBean.getDL_LINECODE(),
+                quantity,
+                unbind);
+    }
+
+    /*======================ConfirmDialog==========================================*/
+    ConfirmDialog confirmDialog;
+    boolean isOk = false;
+
+    //关闭确认对话框
+    public void closeConfirmDialog() {
+        confirmDialog.dismiss();
+    }
+
+    /*============================Volley Handler=========================================*/
+    Handler volleyHandler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            //            closeDownAllPopupWindow();
+            switchDialog.dismiss();
+            if (progressDialog.isShowing())
+                progressDialog.dismiss();
+            String noticeMsg = (String) msg.obj;
+            CommonUtil.toastNoRepeat(mActivity, noticeMsg);
+            if (msg.what == VolleyUtil.SUCCESS_SUCCESS) {
+                SharedPreUtil.saveString(mActivity, Constants.FLAG.SMT_LOCATION_CACHE, "");
+                getActivity().getSupportFragmentManager().popBackStack();
+            }
+        }
+    };
+
+
+    /*============================公用方法=========================================*/
+    /**
+     * @注释:显示错误提示
+     */
+    ConfirmDialog noticeDialog;
+
+    private void showNotice(String noticeMsg) {
+        noticeDialog = new ConfirmDialog(getActivity());
+        noticeDialog.show(noticeMsg, ConfirmDialog.NOTICE);
+
+        new AsyncTask<String, Void, Float>() {
+            @Override
+            protected Float doInBackground(String... params) {
+                try {
+                    //notice显示1.5s
+                    Thread.sleep(1500);
+                } catch (InterruptedException e) {
+                    e.printStackTrace();
+                }
+                return null;
+            }
+
+            @Override
+            protected void onPostExecute(Float aFloat) {
+                //notice退出
+                //noticeTextView.startAnimation(noticeOut);
+                //  noticeTextView.setVisibility(View.GONE);
+                noticeDialog.dismiss();
+            }
+        }.execute();
+    }
+
+    /**
+     * 显示loadingView
+     */
+    private void showLoadingView() {
+        if (!progressDialog.isShowing()) {
+            progressDialog.show();
+        }
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        Log.e("SMTINDEX", "onKeyDown");
+        if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
+            if (progressDialog != null && progressDialog.isShowing()) {
+                //                loadingView.dismiss();
+                //                VolleyUtil.distoryVolley();
+                return true;
+            }
+            if (confirmDialog != null && confirmDialog.isShowing()) {
+                Log.e("SMTINDEX", "confirmDialog");
+                closeConfirmDialog();
+                return true;
+            }
+            if (noticeDialog != null && noticeDialog.isShowing()) {
+                noticeDialog.dismiss();
+                return true;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+}

+ 283 - 0
app/src/main/java/com/uas/pda_wps/fragment/VersionUpgradeFragment.java

@@ -0,0 +1,283 @@
+package com.uas.pda_wps.fragment;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Environment;
+import android.os.Handler;
+import android.os.Message;
+import android.support.annotation.RequiresApi;
+import android.support.v4.content.FileProvider;
+import android.text.TextUtils;
+import android.view.KeyEvent;
+import android.view.View;
+import android.widget.Button;
+import android.widget.TextView;
+import android.widget.Toast;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.android.volley.Request;
+import com.android.volley.toolbox.StringRequest;
+import com.uas.pda_wps.R;
+import com.uas.pda_wps.global.GloableParams;
+import com.uas.pda_wps.util.AndroidUtil;
+import com.uas.pda_wps.util.CommonUtil;
+import com.uas.pda_wps.util.Constants;
+import com.uas.pda_wps.util.FastjsonUtil;
+import com.uas.pda_wps.util.FileUtils;
+import com.uas.pda_wps.util.HttpCallback;
+import com.uas.pda_wps.util.HttpParams;
+import com.uas.pda_wps.util.VollyRequest;
+import com.uas.pda_wps.util.down.CommonProgressPop;
+import com.uas.pda_wps.util.down.ProgressDownloader;
+import com.uas.pda_wps.util.down.ProgressResponseBody;
+
+import java.io.File;
+
+
+/**
+ * Created by RaoMeng on 2020/4/9
+ * Desc: 版本升级页面
+ */
+public class VersionUpgradeFragment extends BaseFragment implements ProgressResponseBody.ProgressListener {
+    private TextView mOldVersionTv, mNewVersionTv, mMsgTextView;
+    private Button mUpgradeButton;
+    private CommonProgressPop mProgressPop;
+    private ProgressDownloader mDownloader;
+    private long breakPoints, contentLength, totalBytes;
+    private File file;
+    private String mAttachId;
+    private StringRequest mStringRequest;
+    private File apkFile;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_version_upgrade;
+    }
+
+    @Override
+    protected void initViews() {
+        setTitle("版本升级");
+
+        mOldVersionTv = root.findViewById(R.id.version_upgrade_oldVersion_tv);
+        mNewVersionTv = root.findViewById(R.id.version_upgrade_newVersion_tv);
+        mMsgTextView = root.findViewById(R.id.version_upgrade_msg_tv);
+        mUpgradeButton = root.findViewById(R.id.version_upgrade_upgrade_btn);
+    }
+
+    @Override
+    protected void initEvents() {
+        mUpgradeButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (mProgressPop == null) {
+                    mProgressPop = new CommonProgressPop(mActivity, "正在下载新版本");
+                }
+                mProgressPop.showPopupWindow();
+
+                breakPoints = 0L;
+//                File directory = new File(Constants.CONSTANT.APK_FILE_PATH);
+//                if (!directory.exists() && !directory.isDirectory()) {
+//                    boolean mkdirs = directory.mkdirs();
+//                } else {
+//                    FileUtils.delAllFile(Constants.CONSTANT.APK_FILE_PATH);
+//                }
+//                file = new File(Constants.CONSTANT.APK_FILE_PATH, Constants.CONSTANT.APK_FILE_NAME);
+//                try {
+//                    file.createNewFile();
+//                } catch (IOException e) {
+//                    e.printStackTrace();
+//                }
+                String downloadUrl = GloableParams.ADDRESS_COMMON_DOWNLOADBYID + "?id=" + mAttachId;
+                //mDownloader = new ProgressDownloader(downloadUrl, file, VersionUpgradeFragment.this);
+                mDownloader = new ProgressDownloader(downloadUrl, apkFile, VersionUpgradeFragment.this);
+                mDownloader.download(0L);
+            }
+        });
+    }
+
+    @Override
+    protected void initDatas() {
+        mOldVersionTv.setText(AndroidUtil.getVersionName(mActivity));
+        getNewVersionMsg();
+
+        //不同版本分区处理
+        String fileName = "update_" + "APP" + ".apk";
+        File downloadDir;
+        if (Build.VERSION.SDK_INT >= 26) {
+            // Android 10+ 使用私有目录
+            downloadDir = getActivity().getExternalFilesDir(Environment.DIRECTORY_DOWNLOADS);
+        } else {
+            downloadDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
+        }
+        if (!downloadDir.exists() && !downloadDir.isDirectory()) {
+            downloadDir.mkdirs();
+        }else {
+            FileUtils.delAllFile(downloadDir.getAbsolutePath()+ fileName);
+        }
+        apkFile = new File(downloadDir, fileName);
+
+        //检查权限
+        if (Build.VERSION.SDK_INT >= 26) {
+            if (!isHasInstallPermissionWithO(getActivity())) {
+                startInstallPermissionSettingActivity(getActivity());
+            }
+        }
+    }
+
+    /**
+     * 检测是否拥有安装未知应用权限canRequestPackageInstalls
+     */
+    @RequiresApi(api = Build.VERSION_CODES.O)
+    private boolean isHasInstallPermissionWithO(Context context){
+        if (context == null){
+            return false;
+        }
+        return context.getPackageManager().canRequestPackageInstalls();
+    }
+
+    /**
+     * 如果没有权限,则申请安装未知应用权限(打开获取权限界面)
+     */
+    @RequiresApi(api = Build.VERSION_CODES.O)
+    private void startInstallPermissionSettingActivity(Context context) {
+        if (context == null) {
+            return;
+        }
+        Intent intent = new Intent();
+        //获取当前apk包URI,并设置到intent中(这一步设置,可让“未知应用权限设置界面”只显示当前应用的设置项)
+        Uri packageURI = Uri.parse("package:" + context.getPackageName());
+        intent.setData(packageURI);
+        //设置不同版本跳转未知应用的动作
+        if (Build.VERSION.SDK_INT >= 26) {
+            //intent = new Intent(android.provider.Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES,packageURI);
+            intent.setAction(android.provider.Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES);
+        } else {
+            intent.setAction(android.provider.Settings.ACTION_SECURITY_SETTINGS);
+        }
+        ((Activity) context).startActivity(intent);
+        Toast.makeText(getActivity(), "请打开未知应用安装权限", Toast.LENGTH_SHORT).show();
+    }
+
+    private void getNewVersionMsg() {
+        progressDialog.show();
+        VollyRequest.getInstance().stringRequest(mStringRequest,
+                new HttpParams.Builder()
+                      .url(GloableParams.ADDRESS_OUTMATERIAL_GETPDAVERSION)
+                       // .url("http://usoft.f3322.net:11769/ERP/api/pda/outMaterial/getPdaVersion.action")
+                        .method(Request.Method.GET)
+                        .tag(GloableParams.ADDRESS_OUTMATERIAL_GETPDAVERSION)
+                        .addParam("code","pda_weipu")
+                        .build(), new HttpCallback() {
+                    @Override
+                    public void onSuccess(int flag, Object o) throws Exception {
+                        progressDialog.dismiss();
+                        String result = o.toString();
+                        JSONObject resultObject = JSON.parseObject(result);
+                        JSONObject dataObject = resultObject.getJSONObject("data");
+                        if (dataObject != null) {
+                            mNewVersionTv.setText(FastjsonUtil.getText(dataObject, "pp_versionname"));
+                            mMsgTextView.setText(FastjsonUtil.getText(dataObject, "pp_remark"));
+
+                            mAttachId = FastjsonUtil.getText(dataObject, "pp_attach");
+                            if (!TextUtils.isEmpty(mAttachId)) {
+                                mUpgradeButton.setVisibility(View.VISIBLE);
+                            } else {
+                                mUpgradeButton.setVisibility(View.GONE);
+                            }
+                        }
+                    }
+
+                    @Override
+                    public void onFail(int flag, String failStr) throws Exception {
+                        progressDialog.dismiss();
+                        CommonUtil.toastNoRepeat(mActivity, failStr);
+                    }
+                });
+    }
+
+    @Override
+    public void onPreExecute(long contentLength) {
+        // 文件总长只需记录一次,要注意断点续传后的contentLength只是剩余部分的长度
+        if (this.contentLength == 0L) {
+            this.contentLength = contentLength;
+            if (mProgressPop != null) {
+                mProgressPop.setProgressMax((int) (contentLength / 1024));
+            }
+        }
+    }
+
+    @Override
+    public void update(long totalBytes, boolean done) {
+        // 注意加上断点的长度
+        this.totalBytes = totalBytes + breakPoints;
+        int progress = (int) (totalBytes + breakPoints) / 1024;
+        Message message = Message.obtain();
+        message.what = Constants.CONSTANT.DOWNLOAD_PROGRESS;
+        message.obj = progress;
+        mHandler.sendMessage(message);
+        if (done) {
+            mHandler.sendEmptyMessage(Constants.CONSTANT.DOWNLOAD_SUCCESS);
+        }
+    }
+
+    private Handler mHandler = new Handler() {
+        @Override
+        public void handleMessage(Message msg) {
+            switch (msg.what) {
+                case Constants.CONSTANT.DOWNLOAD_PROGRESS:
+                    try {
+                        int progress = (int) msg.obj;
+                        mProgressPop.setProgress(progress);
+//                        long remain = 100 - (((progress * 1024 * 100) / contentLength));
+//                        if (remain < 0) {
+//                            remain = 0;
+//                        }
+                    } catch (Exception e) {
+
+                    }
+                    break;
+                case Constants.CONSTANT.DOWNLOAD_SUCCESS:
+                    CommonUtil.toastNoRepeat(mActivity, "下载完成");
+                    mProgressPop.dismiss();
+                    try {
+                        //File apk = new File(Constants.CONSTANT.APK_FILE_PATH, Constants.CONSTANT.APK_FILE_NAME);
+                        Intent intent = new Intent(Intent.ACTION_VIEW);
+                        intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+                        if (Build.VERSION.SDK_INT >= 24) {
+                            //Uri apkUri = FileProvider.getUriForFile(mActivity, "com.uas.pda_wps.fileprovider", apk);
+                            Uri apkUri = FileProvider.getUriForFile(mActivity, "com.uas.pda_wps.fileprovider", apkFile);
+                            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+                            intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
+                        } else {
+                            intent.setDataAndType(Uri.fromFile(apkFile), "application/vnd.android.package-archive");
+                        }
+                        mActivity.startActivity(intent);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                    break;
+                case Constants.CONSTANT.DOWNLOAD_FAILED:
+                    mProgressPop.dismiss();
+                    CommonUtil.makeNotice();
+                    CommonUtil.toastNoRepeat(mActivity, "下载失败");
+                    break;
+                default:
+                    break;
+            }
+        }
+    };
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+}

+ 92 - 5
app/src/main/java/com/uas/pda_wps/global/GloableParams.java

@@ -241,6 +241,24 @@ public class GloableParams {
     public static String ADDRESS_JLT_RECEIVING_DELETEOUTBOX;
     public static String ADDRESS_JLT_RECEIVING_GETOUTBOXDATA;
 
+    public static String ADDRESS_QUA_GET_UN_CHECK_LOCATION;   //页面获取未校验站位请求
+    public static String ADDRESS_QUA_START_CHECK;   //重新校验按钮请求
+    public static String ADDRESS_QUA_CHECK_DATA;   //校验框输入料号请求
+
+    //获取版本信息
+    public static String ADDRESS_OUTMATERIAL_GETPDAVERSION;
+    //下载附件
+    public static String ADDRESS_COMMON_DOWNLOADBYID;
+
+    //飞达站位绑定
+    public static String ADDRESS_GET_FEEDER_BIND_CHECK;      //飞达Enter事件
+    public static String ADDRESS_FEEDER_BIND_LOCATION;      //站位enter事件 or 绑定事件
+    public static String ADDRESS_FEEDER_UNBIND_LOCATION;      //解绑事件
+
+    public static String ADDRESS_GET_PRE_DEVICE_LINE;      //SMT备料->确定事件
+
+    public static String ADDRESS_PRE_ONLINE;      //上线
+
 
     //连接服务器请求地址
     private static final String ADDRESSTAIL_CONNECT_SERVER = "/api/pda/getAllMasters.action";
@@ -503,8 +521,26 @@ public class GloableParams {
     private static final String ADDRESSTAIL_JLT_RECEIVING_DELETEOUTBOX = "/api/pda/receiving/deleteOutBox.action";
     private static final String ADDRESSTAIL_JLT_RECEIVING_GETOUTBOXDATA = "/api/pda/receiving/getOutBoxData.action";
 
+    //品质校验
+    private static final String ADDRESSTAIL_QUA_GET_UN_CHECK_LOCATION = "/api/pda/smt/quaGetUnCheckLocation.action";
+    private static final String ADDRESSTAIL_QUA_START_CHECK = "/api/pda/smt/quaStartCheck.action";
+    private static final String ADDRESSTAIL_QUA_CHECK_DATA = "/api/pda/smt/quaCheckData.action";
+
+    //下载附件
+    private static final String ADDRESSTAIL_COMMON_DOWNLOADBYID = "/common/downloadbyId.action";
+    //获取应用版本信息
+    //    private static final String ADDRESSTAIL_OUTMATERIAL_GETPDAVERSION = "/api/pda/outMaterial/getPdaVersion.action";
+    private static final String ADDRESSTAIL_OUTMATERIAL_GETPDAVERSION = "/api/pda/getPdaVersion.action";
 
+    //飞达站位绑定
+    private static final String ADDRESSTAIL_GET_FEEDER_BIND_CHECK = "/api/pda/smt/getFeederBindCheck.action";
+    private static final String ADDRESSTAIL_FEEDER_BIND_LOCATION = "/api/pda/smt/feederBindLocation.action";
+    private static final String ADDRESSTAIL_FEEDER_UNBIND_LOCATION = "/api/pda/smt/feederUnBindLocation.action";
 
+    //SMT备料
+    private static final String ADDRESSTAIL_GET_PRE_DEVICE_LINE = "/api/pda/smt/getPreDeviceLine.action";
+    //上线
+    private static final String ADDRESSTAIL_PRE_ONLINE = "/api/pda/smt/preOnline.action";
 
     /**
      * 材料入库
@@ -675,6 +711,8 @@ public class GloableParams {
     public static final String GRIDNAME_MSD_MANAGER = "MSD管理";
     public static final String GRIDNAME_SMTMATERIAL_ADD = "SMT上料";
     public static final String GRIDNAME_SOLDER_MANAGER = "锡膏管理";
+    public static final String GRIDNAME_FEIDA_STATION_BINDING = "飞达站位绑定";
+    public static final String LISTNAME_SMT_MATERIALPREPARATION = "SMT备料";
     public static final String GRIDNAME_SETTING = "设置";
 
     public static String[] indexMainGridNames = {
@@ -684,6 +722,8 @@ public class GloableParams {
             GRIDNAME_MSD_MANAGER,
             GRIDNAME_SMTMATERIAL_ADD,
             GRIDNAME_SOLDER_MANAGER,
+            GRIDNAME_FEIDA_STATION_BINDING,
+            LISTNAME_SMT_MATERIALPREPARATION,
             GRIDNAME_SETTING
     };
 
@@ -694,6 +734,8 @@ public class GloableParams {
             R.drawable.storage_msd_manager,
             R.drawable.ic_smt_feed,
             R.drawable.ic_solder_manage,
+            R.drawable.feidazhanweibangding,
+            R.drawable.smt_beiliao,
             R.drawable.mainmenu_usersetting
     };
 
@@ -754,13 +796,19 @@ public class GloableParams {
     public static final String LISTNAME_PREMATERIAL_QUERY = "备料查询";
     public static final String LISTNAME_FEEDER_BIND = "飞达料盘绑定";
     public static final String LISTNAME_FEEDER_UNBIND = "飞达料盘解绑";
-    public static final String LISTNAME_FEEDER_CHECKINSPECTION = "复检校验";
+//    public static final String LISTNAME_FEEDER_CHECKINSPECTION = "复检校验";
+    public static final String LISTNAME_QUALITY_VERIFICATION = "品质套料";
 
-    public static final String[] feederListNames = {LISTNAME_FEEDER_IN, LISTNAME_FEEDER_JOIN,  LISTNAME_FEEDER_DOWN,
+    public static final String[] feederListNames = {
+            LISTNAME_FEEDER_IN, LISTNAME_FEEDER_JOIN,  LISTNAME_FEEDER_DOWN,
             LISTNAME_FEEDER_DOWNALL, LISTNAME_FEEDER_QUERY, LISTNAME_FEEDER_SWITCH,
             LISTNAME_FEEDER_CHECK, LISTNAME_FEEDER_MACHINE, LISTNAME_REQUEST_MACHINE,
             LISTNAME_LOCATION_QUERY, LISTNAME_PREMATERIAL_QUERY, LISTNAME_FEEDER_BIND,
-            LISTNAME_FEEDER_UNBIND,LISTNAME_FEEDER_CHECKINSPECTION};
+            LISTNAME_FEEDER_UNBIND,
+//            LISTNAME_FEEDER_CHECKINSPECTION
+            LISTNAME_QUALITY_VERIFICATION,
+    };
+
     public static final int[] feederListImgs = {R.drawable.index_smt_up, R.drawable.index_smt_joint,
             R.drawable.index_smt_down,
             R.drawable.index_smt_downall, R.drawable.index_smt_query,
@@ -768,7 +816,35 @@ public class GloableParams {
             R.drawable.index_smt_machine, R.drawable.index_smt_request,
             R.drawable.index_location_query, R.drawable.index_prematerial_query,
             R.drawable.index_prematerial_query, R.drawable.index_smt_query,
-            R.drawable.index_smt_check};
+//            R.drawable.index_smt_check,
+            R.drawable.index_smt_check
+    };
+
+    //-->SMT备料
+    public static final String LISTNAME_FEEDER_IN2 = "上料";
+    public static final String LISTNAME_FEEDER_DOWN2 = "下料";
+    public static final String LISTNAME_FEEDER_DOWNALL2 = "全部下料";
+    public static final String LISTNAME_FEEDER_QUERY2 = "料卷查询";
+    public static final String LISTNAME_QUALITY_VERIFICATION2 = "品质套料";
+    public static final String LISTNAME_GO_ONLINE = "上线";
+
+    public static final String[] feederListNames2 = {
+            LISTNAME_FEEDER_IN2,
+            LISTNAME_FEEDER_DOWN2,
+            LISTNAME_FEEDER_DOWNALL2,
+            LISTNAME_FEEDER_QUERY2,
+            LISTNAME_QUALITY_VERIFICATION2,
+            LISTNAME_GO_ONLINE
+    };
+
+    public static final int[] feederListImgs2 = {
+            R.drawable.index_smt_up,
+            R.drawable.index_smt_down,
+            R.drawable.index_smt_downall,
+            R.drawable.index_smt_query,
+            R.drawable.index_smt_check,
+            R.drawable.shangxian
+    };
 
     //-->入库管理
     public static final String MENU_STORAGE_RECHARGE = "收料";
@@ -1077,11 +1153,22 @@ public class GloableParams {
         GloableParams.ADDRESS_JLT_RECEIVING_DELETEOUTBOX = uriHead + GloableParams.ADDRESSTAIL_JLT_RECEIVING_DELETEOUTBOX;
         GloableParams.ADDRESS_JLT_RECEIVING_GETOUTBOXDATA = uriHead + GloableParams.ADDRESSTAIL_JLT_RECEIVING_GETOUTBOXDATA;
 
+        GloableParams.ADDRESS_QUA_GET_UN_CHECK_LOCATION = uriHead + GloableParams.ADDRESSTAIL_QUA_GET_UN_CHECK_LOCATION;
+        GloableParams.ADDRESS_QUA_START_CHECK = uriHead + GloableParams.ADDRESSTAIL_QUA_START_CHECK;
+        GloableParams.ADDRESS_QUA_CHECK_DATA = uriHead + GloableParams.ADDRESSTAIL_QUA_CHECK_DATA;
 
+        //下载
+        GloableParams.ADDRESS_COMMON_DOWNLOADBYID = uriHead + GloableParams.ADDRESSTAIL_COMMON_DOWNLOADBYID;
+        //获取应用版本信息
+        GloableParams.ADDRESS_OUTMATERIAL_GETPDAVERSION = uriHead + GloableParams.ADDRESSTAIL_OUTMATERIAL_GETPDAVERSION;
 
+        GloableParams.ADDRESS_GET_FEEDER_BIND_CHECK = uriHead + GloableParams.ADDRESSTAIL_GET_FEEDER_BIND_CHECK;
+        GloableParams.ADDRESS_FEEDER_BIND_LOCATION = uriHead + GloableParams.ADDRESSTAIL_FEEDER_BIND_LOCATION;
+        GloableParams.ADDRESS_FEEDER_UNBIND_LOCATION = uriHead + GloableParams.ADDRESSTAIL_FEEDER_UNBIND_LOCATION;
 
+        GloableParams.ADDRESS_GET_PRE_DEVICE_LINE = uriHead + GloableParams.ADDRESSTAIL_GET_PRE_DEVICE_LINE;
 
-
+        GloableParams.ADDRESS_PRE_ONLINE = uriHead + GloableParams.ADDRESSTAIL_PRE_ONLINE;
 
 
     }

+ 18 - 0
app/src/main/java/com/uas/pda_wps/tools/DataSourceManager.java

@@ -164,6 +164,24 @@ public class DataSourceManager {
         return feederIndexList;
     }
 
+    /*********
+     * SMT上料子模块导航2
+     ***************/
+    public List getFeederOperationIndex2() {
+        List feederIndexList = new ArrayList();
+        String[] itemNames = GloableParams.feederListNames2;
+        int[] itemImgs = GloableParams.feederListImgs2;
+        Map<String, Object> tmpMap;
+        for (int i = 0; i < itemImgs.length; i++) {
+            tmpMap = new HashMap();
+            tmpMap.put(KEY_GRID_ITEMNAME, itemNames[i]);
+            tmpMap.put(KEY_GRID_ITEMIMG, itemImgs[i]);
+            feederIndexList.add(tmpMap);
+        }
+        return feederIndexList;
+    }
+
+
     /*********
      * 入库管理子模块导航
      ***************/

+ 4 - 10
app/src/main/java/com/uas/pda_wps/util/CommonUtil.java

@@ -577,9 +577,11 @@ public class CommonUtil {
             if (errorMsg != null && errorMsg.exceptionInfo != null) {
                 errorStr = errorMsg.exceptionInfo;
             } else {
-                errorStr = "系统错误";
+                //errorStr = "系统错误";
+                errorStr = new String(volleyError.networkResponse.data);
             }
         }
+        MyLog.d("aaa","响应失败:" + errorStr);
         //振动提示
         makeNotice();
         /*MediaPlayer mp = new MediaPlayer();
@@ -699,7 +701,6 @@ public class CommonUtil {
 
     /**
      * double 相比较大小
-     *
      * @param d1
      * @param d2
      * @return 小于:-1;等于:0;大于:1
@@ -713,7 +714,6 @@ public class CommonUtil {
 
     /**
      * double值小数点后为0则不显示,保留四位小数
-     *
      * @param v
      * @return
      */
@@ -724,12 +724,10 @@ public class CommonUtil {
         } catch (Exception e) {
             return "";
         }
-
     }
 
     /**
      * 判断APP是否安装
-     *
      * @param context
      * @param packName
      * @return
@@ -870,7 +868,6 @@ public class CommonUtil {
     /**
      * 全角转半角的函数(DBC case) 全角空格为12288,半角空格为32
      * 其他字符半角(33-126)与全角(65281-65374)的对应关系是:均相差65248
-     *
      * @param input 任意字符串
      * @return
      */
@@ -893,7 +890,6 @@ public class CommonUtil {
     /**
      * 半角转转全角的函数(SBC case) 全角空格为12288,半角空格为32
      * 其他字符半角(33-126)与全角(65281-65374)的对应关系是:均相差65248
-     *
      * @param input
      * @return
      */
@@ -912,7 +908,6 @@ public class CommonUtil {
 
     /**
      * 获取当前账套的中文名
-     *
      * @param context
      * @return
      */
@@ -939,7 +934,6 @@ public class CommonUtil {
 
     /**
      * 开启扫描
-     *
      * @param context
      * @param fragment
      * @param requestCode
@@ -959,7 +953,6 @@ public class CommonUtil {
 
     /**
      * 获取扫描结果
-     *
      * @param data
      * @return
      */
@@ -970,6 +963,7 @@ public class CommonUtil {
         }
         return result;
     }
+
     public static void getDefaultTable(Activity mActivity, SmartTable mSmartTable) {
         WindowManager wm = mActivity.getWindowManager();
         int screenWith = wm.getDefaultDisplay().getWidth();

+ 11 - 0
app/src/main/java/com/uas/pda_wps/util/Constants.java

@@ -15,6 +15,9 @@ public interface Constants {
 
         String APP_ICON_URL = "http://zhbj.qianlong.com/logo.png";
 
+        String APK_FILE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/uas_mes/apk";
+        String APK_FILE_NAME = "weipu_mes.apk";
+
         String AUTHORITY_SHOP = "Shop";
         String AUTHORITY_PRODINOUT = "ProdInOut";
 
@@ -33,6 +36,14 @@ public interface Constants {
         int BARCODE_SUPPLE_CHECK = 101;
 
         String EXTRA_WHICH_PAGE = "extra_which_page";
+
+        //下载成功
+        int DOWNLOAD_SUCCESS = 11;
+        //下载失败
+        int DOWNLOAD_FAILED = 12;
+        //下载进度
+        int DOWNLOAD_PROGRESS = 13;
+
     }
 
     /**

+ 62 - 2
app/src/main/java/com/uas/pda_wps/util/FileUtils.java

@@ -15,6 +15,7 @@ import java.io.InputStream;
 import java.security.SecureRandom;
 import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
+import java.util.Calendar;
 
 import javax.net.ssl.HostnameVerifier;
 import javax.net.ssl.SSLContext;
@@ -272,8 +273,6 @@ public class FileUtils {
         public X509Certificate[] getAcceptedIssuers() {
             return new X509Certificate[0];
         }
-
-
     }
 
     public static class TrustAllHostnameVerifier implements HostnameVerifier {
@@ -282,4 +281,65 @@ public class FileUtils {
             return true;
         }
     }
+
+    /**
+     * 判断文件是否为当天创建(使用最后修改时间)
+     * Android 7.0推荐使用此方法
+     */
+    public static boolean isFileCreatedToday(File file) {
+        if (file == null || !file.exists()) {
+            return false;
+        }
+
+        // 获取文件的最后修改时间
+        long lastModified = file.lastModified();
+
+        // 获取当前时间的Calendar
+        Calendar today = Calendar.getInstance();
+
+        // 获取文件时间的Calendar
+        Calendar fileDate = Calendar.getInstance();
+        fileDate.setTimeInMillis(lastModified);
+
+        // 比较年、月、日是否相同
+        return today.get(Calendar.YEAR) == fileDate.get(Calendar.YEAR) &&
+                today.get(Calendar.MONTH) == fileDate.get(Calendar.MONTH) &&
+                today.get(Calendar.DAY_OF_MONTH) == fileDate.get(Calendar.DAY_OF_MONTH);
+    }
+
+    /**
+     * 获取文件创建时间的字符串表示
+     */
+    public static String getFileCreationTimeString(File file) {
+        if (file == null || !file.exists()) {
+            return "文件不存在";
+        }
+
+        long lastModified = file.lastModified();
+        Calendar cal = Calendar.getInstance();
+        cal.setTimeInMillis(lastModified);
+
+        return String.format("%04d-%02d-%02d %02d:%02d:%02d",
+                cal.get(Calendar.YEAR),
+                cal.get(Calendar.MONTH) + 1, // 月份从0开始
+                cal.get(Calendar.DAY_OF_MONTH),
+                cal.get(Calendar.HOUR_OF_DAY),
+                cal.get(Calendar.MINUTE),
+                cal.get(Calendar.SECOND));
+    }
+
+    /**
+     * 格式化文件大小
+     */
+    public static String formatFileSize(long size) {
+        if (size < 1024) {
+            return size + " B";
+        } else if (size < 1024 * 1024) {
+            return String.format("%.2f KB", size / 1024.0);
+        } else if (size < 1024 * 1024 * 1024) {
+            return String.format("%.2f MB", size / (1024.0 * 1024));
+        } else {
+            return String.format("%.2f GB", size / (1024.0 * 1024 * 1024));
+        }
+    }
 }

+ 244 - 143
app/src/main/java/com/uas/pda_wps/util/MyLog.java

@@ -1,13 +1,25 @@
 package com.uas.pda_wps.util;
 
 import android.annotation.SuppressLint;
+import android.os.Build;
+import android.support.annotation.RequiresApi;
 import android.util.Log;
 
+import com.uas.pda_wps.application.PdaApplication;
+
 import java.io.BufferedWriter;
 import java.io.File;
 import java.io.FileWriter;
 import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.nio.file.attribute.BasicFileAttributes;
+import java.nio.file.attribute.FileTime;
 import java.text.SimpleDateFormat;
+import java.time.LocalDate;
+import java.time.LocalDateTime;
+import java.time.ZoneId;
 import java.util.Date;
 
 /**
@@ -15,147 +27,236 @@ import java.util.Date;
  */
 @SuppressLint("SimpleDateFormat")
 public class MyLog {
-	public static Boolean MYLOG_SWITCH = true; // 日志文件总开关
-	private static Boolean MYLOG_WRITE_TO_FILE = true;// 日志写入文件开关
-	private static char MYLOG_TYPE = 'v';// 输入日志类型,w代表只输出告警信息等,v代表输出所有信息
-	@SuppressLint("SdCardPath")
-	private static String MYLOG_PATH_SDCARD_DIR1 = "/sdcard/MSShow";    // 日志文件在sdcard中的路径
-	private static String MYLOG_PATH_SDCARD_DIR2 = "/Log";
-	private static String MYLOG_PATH_SDCARD_DIR = MYLOG_PATH_SDCARD_DIR1+MYLOG_PATH_SDCARD_DIR2;
-	private static String MYLOGFILEName = "Log.txt";// 本类输出的日志文件名称
-
-	@SuppressLint("SimpleDateFormat")
-	private static SimpleDateFormat myLogSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 日志的输出格式
-
-	private static boolean isDebug = true;		//普通log的开关
-	private static String TAG = "英唐" +"-----------";
-
-	public static void e(String msg){
-		if(isDebug){
-			Log.e(TAG, msg);
-		}
-	}
-
-	public static void w(String msg){
-		if(isDebug){
-			Log.w(TAG, msg);
-		}
-	}
-
-	public static void d(String msg){
-		if(isDebug){
-			Log.d(TAG, msg);
-		}
-	}
-
-	public static void i(String msg){
-		if(isDebug){
-			Log.i(TAG, msg);
-		}
-	}
-
-	public static void w(String tag, Object msg) { // 警告信息
-		log(tag, msg.toString(), 'w');
-	}
-
-	public static void e(String tag, Object msg) { // 错误信息
-		log(tag, msg.toString(), 'e');
-	}
-
-	public static void d(String tag, Object msg) {// 调试信息
-		log(tag, msg.toString(), 'd');
-	}
-
-	public static void i(String tag, Object msg) {//
-		log(tag, msg.toString(), 'i');
-	}
-
-	public static void v(String tag, Object msg) {
-		log(tag, msg.toString(), 'v');
-	}
-
-	public static void w(String tag, String text) {
-		log(tag, text, 'w');
-	}
-
-	public static void e(String tag, String text) {
-		log(tag, text, 'e');
-	}
-
-	public static void d(String tag, String text) {
-		log(tag, text, 'd');
-	}
-
-	public static void i(String tag, String text) {
-		log(tag, text, 'i');
-	}
-
-	public static void v(String tag, String text) {
-		log(tag, text, 'v');
-	}
-
-	/**
-	 * 根据tag, msg和等级,输出日志
-	 */
-	private static void log(String tag, String msg, char level) {
-		msg = "\r\n"+msg;
-		if (MYLOG_SWITCH) {
-			if ('e' == level && ('e' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) { // 输出错误信息
-				Log.e(tag, msg);
-			} else if ('w' == level && ('w' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
-				Log.w(tag, msg);
-			} else if ('d' == level && ('d' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
-				Log.d(tag, msg);
-			} else if ('i' == level && ('d' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
-				Log.i(tag, msg);
-			} else {
-				Log.v(tag, msg);
-			}
-			if (MYLOG_WRITE_TO_FILE) {
-				writeLogtoFile(String.valueOf(level), tag, msg);
-			}
-		}
-	}
-
-	/**
-	 * 打开日志文件并写入日志
-	 * **/
-	private static void writeLogtoFile(String mylogtype, String tag, String text) {// 新建或打开日志文件
-		isExist(MYLOG_PATH_SDCARD_DIR1);
-		isExist(MYLOG_PATH_SDCARD_DIR);
-		Date nowtime = new Date();
-//		String needWriteFiel = logfile.format(nowtime);
-		String needWriteMessage = myLogSdf.format(nowtime) + "    " + mylogtype
-				+ "    " + tag + "    " + text;
-		File file = new File(MYLOG_PATH_SDCARD_DIR, MYLOGFILEName);
-		try {
-			FileWriter filerWriter = new FileWriter(file, true);// 后面这个参数代表是不是要接上文件中原来的数据,不进行覆盖
-			BufferedWriter bufWriter = new BufferedWriter(filerWriter);
-			bufWriter.write(needWriteMessage);
-			bufWriter.newLine();
-			bufWriter.close();
-			filerWriter.close();
-		} catch (IOException e) {
-			e.printStackTrace();
-		}
-	}
-
-	/**
-	 * 删除制定的日志文件
-	 * */
-	public static void delFile() {// 删除日志文件
-		File file = new File(MYLOG_PATH_SDCARD_DIR, MYLOGFILEName);
-		if (file.exists()) {
-			file.delete();
-		}
-	}
-
-	public static void isExist(String path) {
-		File file = new File(path);
-		// 判断文件夹是否存在,如果不存在则创建文件夹
-		if (!file.exists()) {
-			file.mkdir();
-		}
-
-	}
+    public static Boolean MYLOG_SWITCH = true; // 日志文件总开关
+    private static Boolean MYLOG_WRITE_TO_FILE = true;// 日志写入文件开关
+    private static char MYLOG_TYPE = 'v';// 输入日志类型,w代表只输出告警信息等,v代表输出所有信息
+    @SuppressLint("SdCardPath")
+//    private static String MYLOG_PATH_SDCARD_DIR1 = "/sdcard/MSShow";    // 日志文件在sdcard中的路径
+//    private static String MYLOG_PATH_SDCARD_DIR1 = "/data/data/" + PdaApplication.getmContext().getPackageName();  //APP包下创建的文件不需要权限
+    private static String MYLOG_PATH_SDCARD_DIR1 = "/sdcard/Android/data/" + PdaApplication.getmContext().getPackageName();  //模拟器的APP包下创建的文件
+    private static String MYLOG_PATH_SDCARD_DIR2 = "/Log";
+    private static String MYLOG_PATH_SDCARD_DIR = MYLOG_PATH_SDCARD_DIR1 + MYLOG_PATH_SDCARD_DIR2;
+    private static String MYLOGFILEName = "Log.txt";// 本类输出的日志文件名称
+
+    @SuppressLint("SimpleDateFormat")
+    private static SimpleDateFormat myLogSdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");// 日志的输出格式
+
+    private static boolean isDebug = true;        //普通log的开关
+    private static String TAG = "英唐" + "-----------";
+
+    public static void e(String msg) {
+        if (isDebug) {
+            Log.e(TAG, msg);
+        }
+    }
+
+    public static void w(String msg) {
+        if (isDebug) {
+            Log.w(TAG, msg);
+        }
+    }
+
+    public static void d(String msg) {
+        if (isDebug) {
+            Log.d(TAG, msg);
+        }
+    }
+
+    public static void i(String msg) {
+        if (isDebug) {
+            Log.i(TAG, msg);
+        }
+    }
+
+    public static void w(String tag, Object msg) { // 警告信息
+        log(tag, msg.toString(), 'w');
+    }
+
+    public static void e(String tag, Object msg) { // 错误信息
+        log(tag, msg.toString(), 'e');
+    }
+
+    public static void d(String tag, Object msg) {// 调试信息
+        log(tag, msg.toString(), 'd');
+    }
+
+    public static void i(String tag, Object msg) {//
+        log(tag, msg.toString(), 'i');
+    }
+
+    public static void v(String tag, Object msg) {
+        log(tag, msg.toString(), 'v');
+    }
+
+    public static void w(String tag, String text) {
+        log(tag, text, 'w');
+    }
+
+    public static void e(String tag, String text) {
+        log(tag, text, 'e');
+    }
+
+    public static void d(String tag, String text) {
+        log(tag, text, 'd');
+    }
+
+    public static void i(String tag, String text) {
+        log(tag, text, 'i');
+    }
+
+    public static void v(String tag, String text) {
+        log(tag, text, 'v');
+    }
+
+    /**
+     * 根据tag, msg和等级,输出日志
+     */
+    private static void log(String tag, String msg, char level) {
+        msg = "\r\n" + msg;
+        if (MYLOG_SWITCH) {
+            if ('e' == level && ('e' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) { // 输出错误信息
+                //Log.e(tag, msg);
+                if (msg.length() > 4000) {
+                    // 因为Logcat一次最多能输出4000个字符左右,所以我们按4000字符分段
+                    int chunkCount = msg.length() / 4000; // 分割成多少段
+                    for (int i = 0; i <= chunkCount; i++) {
+                        int max = 4000 * (i + 1);
+                        if (max >= msg.length()) {
+                            Log.e(tag, msg.substring(4000 * i));
+                        } else {
+                            Log.e(tag, msg.substring(4000 * i, max));
+                        }
+                    }
+                } else {
+                    Log.d(tag, msg);
+                }
+            } else if ('w' == level && ('w' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
+                Log.w(tag, msg);
+            } else if ('d' == level && ('d' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
+                Log.d(tag, msg);
+            } else if ('i' == level && ('d' == MYLOG_TYPE || 'v' == MYLOG_TYPE)) {
+                Log.i(tag, msg);
+            } else {
+                Log.v(tag, msg);
+            }
+            if (MYLOG_WRITE_TO_FILE && 'd' == level) {
+                writeLogtoFile(String.valueOf(level), tag, msg);
+            }
+        }
+    }
+
+    public static void logLongMessage(String tag, String message) {
+        if (message.length() > 4000) {
+            // 因为Logcat一次最多能输出4000个字符左右,所以我们按4000字符分段
+            int chunkCount = message.length() / 4000; // 分割成多少段
+            for (int i = 0; i <= chunkCount; i++) {
+                int max = 4000 * (i + 1);
+                if (max >= message.length()) {
+                    Log.d(tag, message.substring(4000 * i));
+                } else {
+                    Log.d(tag, message.substring(4000 * i, max));
+                }
+            }
+        } else {
+            Log.d(tag, message);
+        }
+    }
+
+    /**
+     * 打开日志文件并写入日志,
+     **/
+    private static void writeLogtoFile(String mylogtype, String tag, String text) {
+    	// 新建或打开日志文件
+        isExist(MYLOG_PATH_SDCARD_DIR1);
+        isExist(MYLOG_PATH_SDCARD_DIR);
+        Date nowtime = new Date();
+        //		String needWriteFiel = logfile.format(nowtime);
+        String needWriteMessage = myLogSdf.format(nowtime) + "    " + mylogtype
+                + "    " + tag + "    " + text;
+        File file = new File(MYLOG_PATH_SDCARD_DIR, MYLOGFILEName);
+        try {
+            FileWriter filerWriter = new FileWriter(file, true);// 后面这个参数代表是不是要接上文件中原来的数据,不进行覆盖
+            BufferedWriter bufWriter = new BufferedWriter(filerWriter);
+            bufWriter.write(needWriteMessage);
+            bufWriter.newLine();
+            bufWriter.close();
+            filerWriter.close();
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    /**
+     * 删除制定的日志文件
+     */
+    public static void delFile() {// 删除日志文件
+        File file = new File(MYLOG_PATH_SDCARD_DIR, MYLOGFILEName);
+        if (file.exists()) {
+            file.delete();
+        }
+    }
+
+    public static void isExist(String path) {
+        File file = new File(path);
+        // 判断文件夹是否存在,如果不存在则创建文件夹
+        if (!file.exists()) {
+            file.mkdir();
+        }
+    }
+
+    /**
+     * 取消Android8.0的提示限制
+     */
+    @RequiresApi(api = Build.VERSION_CODES.O)
+    public static void delNotDayFile(){
+        File fileP = new File(MYLOG_PATH_SDCARD_DIR, MYLOGFILEName);
+        if (fileP.exists()) {
+            Path path = Paths.get(MYLOG_PATH_SDCARD_DIR + "/" + MYLOGFILEName); //文件路径
+            try {
+                // 获取文件的属性
+                BasicFileAttributes attrs = Files.readAttributes(path, BasicFileAttributes.class);
+                // 获取文件的创建时间
+                FileTime creationTime = attrs.creationTime();
+                // 转换为LocalDateTime以便于比较
+                //将FileTime对象转换为LocalDateTime以便于与当前日期进行比较。这里使用了系统的默认时区(ZoneId.systemDefault())。如果需要特定时区,可以替换为相应的ZoneId。
+                //通过LocalDateTime 的 toLocalDate()方法将时间转换为仅包含日期(忽略时间),然后与当前日期进行比较。
+                LocalDateTime creationDateTime = creationTime.toInstant().atZone(ZoneId.systemDefault()).toLocalDateTime();
+                LocalDateTime now = LocalDateTime.now();
+
+                // 比较是否为当天创建
+                if (isToday(creationDateTime)) {
+                    //System.out.println("文件是今天创建的。");
+                } else {
+                    //System.out.println("文件不是今天创建的。");
+                    delFile();  //删除不是当天日期
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    // 辅助方法,检查日期是否为今天
+    @RequiresApi(api = Build.VERSION_CODES.O)
+    private static boolean isToday(LocalDateTime dateTime) {
+        LocalDate today = LocalDate.now();
+        LocalDate fileDate = dateTime.toLocalDate();
+        return today.equals(fileDate);
+    }
+
+    /**
+     * 判断文件是否为当天创建(使用最后修改时间),不同则删除
+     * Android 7.0推荐使用此方法
+     */
+    public static void isFileCreatedTodayDel() {
+        File fileP = new File(MYLOG_PATH_SDCARD_DIR, MYLOGFILEName);
+        if (fileP.exists()) {
+            if (!FileUtils.isFileCreatedToday(fileP)) {
+                delFile();  //删除不是当天创建的日期
+            }
+        }
+    }
+
+
+
 }

+ 4 - 2
app/src/main/java/com/uas/pda_wps/util/VolleyRequest.java

@@ -97,6 +97,7 @@ public class VolleyRequest {
             }
         }
 
+        MyLog.d("aaa","*************************" + "\n" + "接口地址:" + url);
         PdaApplication.mRequestQueue.cancelAll(httpParams.getUrl());
 
         stringRequest = new StringRequest(httpParams.getMethod(), url,
@@ -104,7 +105,8 @@ public class VolleyRequest {
                     @Override
                     public void onResponse(String s) {
                         try {
-                            LogUtil.prinlnLongMsg("responseSucc", s);
+                            //LogUtil.prinlnLongMsg("responseSucc", s);
+                            MyLog.d("aaa","响应成功:" + s);
                             httpCallback.onSuccess(httpParams.getFlag(), s);
                         } catch (Exception e) {
                             e.printStackTrace();
@@ -116,7 +118,7 @@ public class VolleyRequest {
                     public void onErrorResponse(VolleyError volleyError) {
                         String errorToast = CommonUtil.showErrorToast(volleyError, false);
                         try {
-                            LogUtil.e("responErr", errorToast);
+                            //LogUtil.e("responErr", errorToast);
                             if (errorToast.length() >= 500) {
                                 httpCallback.onFail(httpParams.getFlag(), "请求异常");
                             } else {

+ 4 - 3
app/src/main/java/com/uas/pda_wps/util/VollyRequest.java

@@ -92,15 +92,16 @@ public class VollyRequest {
                 index++;
             }
         }
-
-        PdaApplication.mRequestQueue.cancelAll(httpParams.getTag());
+        MyLog.d("aaa","*************************" + "\n" + "接口地址:" + url);
+        PdaApplication.mRequestQueue.cancelAll(httpParams.getUrl());
 
         stringRequest = new StringRequest(httpParams.getMethod(), url,
                 new Response.Listener<String>() {
                     @Override
                     public void onResponse(String s) {
                         try {
-                            LogUtil.prinlnLongMsg("responseSucc", s);
+                            //LogUtil.prinlnLongMsg("responseSucc", s);
+                            MyLog.d("aaa","响应成功:" + s);
                             httpCallback.onSuccess(httpParams.getFlag(), s);
                         } catch (Exception e) {
                             e.printStackTrace();

+ 72 - 0
app/src/main/java/com/uas/pda_wps/util/down/CommonProgressPop.java

@@ -0,0 +1,72 @@
+package com.uas.pda_wps.util.down;
+
+import android.content.Context;
+import android.view.View;
+import android.view.animation.Animation;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+
+import com.uas.pda_wps.R;
+
+import razerdp.basepopup.BasePopupWindow;
+
+/**
+ * Created by RaoMeng on 2020/4/9
+ * Desc: 公共进度条弹框
+ */
+public class CommonProgressPop extends BasePopupWindow {
+    private TextView mTitleTextView;
+    private ProgressBar mProgressBar;
+    private String mTitle;
+    private int mProgress = 0, mProgressMax = 100;
+
+    public CommonProgressPop(Context context) {
+        this(context, "正在下载新版本");
+    }
+
+    public CommonProgressPop(Context context, String title) {
+        super(context);
+        setAllowDismissWhenTouchOutside(false);
+
+        mTitleTextView = findViewById(R.id.common_progress_title_tv);
+        mProgressBar = findViewById(R.id.common_progress_progress_pb);
+        mTitleTextView.setText(title);
+    }
+
+    public int getProgress() {
+        return mProgress;
+    }
+
+    public void setProgress(int progress) {
+        mProgress = progress;
+        mProgressBar.setProgress(mProgress);
+    }
+
+    public void setProgressMax(int progressMax) {
+        mProgressMax = progressMax;
+        mProgressBar.setMax(mProgressMax);
+    }
+
+    @Override
+    public void showPopupWindow() {
+        mProgress = 0;
+        mProgressBar.setProgress(mProgress);
+        super.showPopupWindow();
+    }
+
+    @Override
+    public View onCreateContentView() {
+        return createPopupById(R.layout.pop_common_progress);
+    }
+
+    @Override
+    protected Animation onCreateShowAnimation() {
+        return getDefaultScaleAnimation(true);
+    }
+
+    @Override
+    protected Animation onCreateDismissAnimation() {
+        return getDefaultScaleAnimation(false);
+    }
+
+}

+ 148 - 0
app/src/main/java/com/uas/pda_wps/util/down/ProgressDownloader.java

@@ -0,0 +1,148 @@
+package com.uas.pda_wps.util.down;
+
+import com.uas.pda_wps.application.PdaApplication;
+import com.uas.pda_wps.tools.SharedPreUtil;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.RandomAccessFile;
+import java.nio.MappedByteBuffer;
+import java.nio.channels.FileChannel;
+
+import okhttp3.Call;
+import okhttp3.Callback;
+import okhttp3.Interceptor;
+import okhttp3.OkHttpClient;
+import okhttp3.Request;
+import okhttp3.Response;
+import okhttp3.ResponseBody;
+
+/**
+ * Created by RaoMeng on 2017/9/25.
+ * okhttp实现的下载工具类
+ * 支持下载暂停以及断电续传
+ */
+
+public class ProgressDownloader {
+    private ProgressResponseBody.ProgressListener progressListener;
+    private String url;
+    private OkHttpClient client;
+    private File destination;
+    private Call call;
+
+    public ProgressDownloader(String url, File destination, ProgressResponseBody.ProgressListener progressListener) {
+        this.url = url;
+        this.destination = destination;
+        this.progressListener = progressListener;
+        //在下载、暂停后的继续下载中可复用同一个client对象
+        client = getProgressClient();
+    }
+
+    //每次下载需要新建新的Call对象
+    private Call newCall(long startPoints) {
+        String cookieCache = SharedPreUtil.getString(PdaApplication.getmContext(), "cookie", "");
+        Request request = new Request.Builder()
+                .url(url)
+                .header("RANGE", "bytes=" + startPoints + "-")//断点续传要用到的,指示下载的区间
+                .header("Cookie", cookieCache)
+                .build();
+        return client.newCall(request);
+    }
+
+    public OkHttpClient getProgressClient() {
+        // 拦截器,用上ProgressResponseBody
+        Interceptor interceptor = new Interceptor() {
+            @Override
+            public Response intercept(Chain chain) throws IOException {
+                Response originalResponse = chain.proceed(chain.request());
+                return originalResponse.newBuilder()
+                        .body(new ProgressResponseBody(originalResponse.body(), progressListener))
+                        .build();
+            }
+        };
+
+        return new OkHttpClient.Builder()
+                .addNetworkInterceptor(interceptor)
+                .build();
+    }
+
+    // startsPoint指定开始下载的点
+    public void download(final long startsPoint) {
+        call = newCall(startsPoint);
+        call.enqueue(new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                save(response, startsPoint);
+            }
+        });
+    }
+
+    public void download(final long startsPoint, final DownloadCallBack downloadCallBack) {
+        call = newCall(startsPoint);
+        call.enqueue(new Callback() {
+            @Override
+            public void onFailure(Call call, IOException e) {
+                downloadCallBack.onFailure(call, e);
+            }
+
+            @Override
+            public void onResponse(Call call, Response response) throws IOException {
+                downloadCallBack.onResponse(call, response);
+                save(response, startsPoint);
+            }
+        });
+    }
+
+    public void pause() {
+        if (call != null) {
+            call.cancel();
+        }
+    }
+
+    protected void save(Response response, long startsPoint) {
+        String fileName = response.headers().get("Content-Disposition");
+        ResponseBody body = response.body();
+        InputStream in = body.byteStream();
+        FileChannel channelOut = null;
+        // 随机访问文件,可以指定断点续传的起始位置
+        RandomAccessFile randomAccessFile = null;
+        try {
+            randomAccessFile = new RandomAccessFile(destination, "rwd");
+            //Chanel NIO中的用法,由于RandomAccessFile没有使用缓存策略,直接使用会使得下载速度变慢,亲测缓存下载3.3秒的文件,用普通的RandomAccessFile需要20多秒。
+            channelOut = randomAccessFile.getChannel();
+            // 内存映射,直接使用RandomAccessFile,是用其seek方法指定下载的起始位置,使用缓存下载,在这里指定下载位置。
+            MappedByteBuffer mappedBuffer = channelOut.map(FileChannel.MapMode.READ_WRITE, startsPoint, body.contentLength());
+            byte[] buffer = new byte[1024];
+            int len;
+            while ((len = in.read(buffer)) != -1) {
+                mappedBuffer.put(buffer, 0, len);
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+        } finally {
+            try {
+                in.close();
+                if (channelOut != null) {
+                    channelOut.close();
+                }
+                if (randomAccessFile != null) {
+                    randomAccessFile.close();
+                }
+            } catch (IOException e) {
+                e.printStackTrace();
+            }
+        }
+    }
+
+    public interface DownloadCallBack {
+        void onFailure(Call call, IOException e);
+
+        void onResponse(Call call, Response response);
+    }
+}

+ 74 - 0
app/src/main/java/com/uas/pda_wps/util/down/ProgressResponseBody.java

@@ -0,0 +1,74 @@
+package com.uas.pda_wps.util.down;
+
+import java.io.IOException;
+
+import okhttp3.MediaType;
+import okhttp3.ResponseBody;
+import okio.Buffer;
+import okio.BufferedSource;
+import okio.ForwardingSource;
+import okio.Okio;
+import okio.Source;
+
+/**
+ * Created by RaoMeng on 2017/9/25.
+ * okhttp下载返回体
+ */
+
+public class ProgressResponseBody extends ResponseBody {
+
+    private final ResponseBody responseBody;
+    private final ProgressListener progressListener;
+    private BufferedSource bufferedSource;
+
+    public ProgressResponseBody(ResponseBody responseBody,
+                                ProgressListener progressListener) {
+        this.responseBody = responseBody;
+        this.progressListener = progressListener;
+        if (progressListener != null) {
+            progressListener.onPreExecute(contentLength());
+        }
+    }
+
+    @Override
+    public MediaType contentType() {
+        return responseBody.contentType();
+    }
+
+    @Override
+    public long contentLength() {
+        return responseBody.contentLength();
+    }
+
+    @Override
+    public BufferedSource source() {
+        if (bufferedSource == null) {
+            bufferedSource = Okio.buffer(source(responseBody.source()));
+        }
+        return bufferedSource;
+    }
+
+    private Source source(Source source) {
+        return new ForwardingSource(source) {
+            long totalBytes = 0L;
+
+            @Override
+            public long read(Buffer sink, long byteCount) throws IOException {
+                long bytesRead = super.read(sink, byteCount);
+                // read() returns the number of bytes read, or -1 if this source is exhausted.
+                totalBytes += bytesRead != -1 ? bytesRead : 0;
+                if (null != progressListener) {
+                    progressListener.update(totalBytes, bytesRead == -1);
+                }
+                return bytesRead;
+            }
+        };
+    }
+
+    public interface ProgressListener {
+        void onPreExecute(long contentLength);
+
+        void update(long totalBytes, boolean done);
+    }
+
+}

BIN
app/src/main/res/drawable-xxhdpi/feidazhanweibangding.png


BIN
app/src/main/res/drawable-xxhdpi/shangxian.png


BIN
app/src/main/res/drawable-xxhdpi/smt_beiliao.png


+ 35 - 0
app/src/main/res/drawable/progressbar_diy.xml

@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="utf-8"?>
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
+
+    <item android:id="@android:id/background">
+        <shape>
+            <corners android:radius="10dip" />
+            <solid android:color="#8083a4ae"/>
+        </shape>
+    </item>
+
+    <item android:id="@android:id/secondaryProgress">
+        <clip>
+            <shape>
+                <corners android:radius="10dip" />
+                <gradient
+                    android:startColor="#804d62b3"
+                    android:centerColor="#804360a4"
+                    android:centerY="0.75"
+                    android:endColor="#a0485aa1"
+                    android:angle="270"
+                    />
+            </shape>
+        </clip>
+    </item>
+
+    <item android:id="@android:id/progress">
+        <clip>
+            <shape>
+                <corners android:radius="10dip" />
+                <solid android:color="@android:color/holo_blue_light"/>
+            </shape>
+        </clip>
+    </item>
+
+</layer-list>

+ 115 - 0
app/src/main/res/layout/fra_feida_station_binding.xml

@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical"
+    android:padding="@dimen/root_layout_padding">
+
+    <RadioGroup
+        android:id="@+id/rg_binding"
+        android:layout_width="match_parent"
+        android:layout_height="40dp"
+        android:gravity="center"
+        android:layout_marginTop="5dp"
+        android:orientation="horizontal"
+       >
+
+        <RadioButton
+            android:id="@+id/rb_binding"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_marginEnd="30dp"
+            android:checked="true"
+            android:text="绑定" />
+
+        <RadioButton
+            android:id="@+id/rb_unbind"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:layout_marginStart="30dp"
+            android:text="解绑" />
+
+    </RadioGroup>
+
+    <TableLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:stretchColumns="1">
+
+
+        <TableRow
+            android:id="@+id/material_in_collect_num_tr"
+            android:layout_marginTop="10dp">
+
+            <TextView
+                style="@style/tl_tv_style"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:padding="8dp"
+                android:text="飞达"
+                android:textColor="@color/red"
+                android:textSize="16sp"/>
+
+            <com.uas.pda_wps.view.ClearableEditText
+                android:id="@+id/cet_feida"
+                android:layout_marginStart="3dp"
+                android:layout_marginEnd="10dp"
+                style="@style/EditTextStyle"
+                android:layout_width="0dp"
+                android:layout_weight="1"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:hint="请输入飞达"
+                android:imeOptions="actionSend"
+                android:textColor="@color/black"/>
+        </TableRow>
+
+
+        <TableRow
+            android:id="@+id/material_in_collect_lotno_tr"
+            android:layout_marginTop="10dp">
+
+            <TextView
+                style="@style/tl_tv_style"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:padding="8dp"
+                android:text="站位"
+                android:textColor="@color/red"
+                android:textSize="16sp"/>
+
+            <com.uas.pda_wps.view.ClearableEditText
+                android:id="@+id/cet_zhanwei"
+                android:layout_marginStart="3dp"
+                android:layout_marginEnd="10dp"
+                style="@style/EditTextStyle"
+                android:layout_width="0dp"
+                android:layout_weight="1"
+                android:focusable="true"
+                android:focusableInTouchMode="true"
+                android:hint="请输入站位"
+                android:imeOptions="actionSend"
+                android:textColor="@color/black"/>
+        </TableRow>
+    </TableLayout>
+
+    <Button
+        android:id="@+id/bt_binding"
+        android:layout_marginTop="10dp"
+        style="@style/ButtonStyle"
+        android:text="@string/binding"/>
+
+
+    <TextView
+        android:id="@+id/tv_result"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/spacing_big"
+        android:background="@drawable/shape_msg_block"
+        android:padding="10dp"
+        android:visibility="gone"
+        tools:text=""/>
+
+</LinearLayout>

+ 0 - 0
app/src/main/res/layout/fra_full_station_verification.xml → app/src/main/res/layout/fra_quality_verification.xml


+ 75 - 0
app/src/main/res/layout/fra_scmake_smtcontent.xml

@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:orientation="vertical">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="10dp"
+        android:padding="10dp">
+
+        <TextView
+            android:id="@+id/tv_dl_linecode"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:textSize="@dimen/textsize_16"
+            tools:text="线别" />
+
+        <TextView
+            android:id="@+id/tv_dl_mainline"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:textSize="@dimen/textsize_16"
+            tools:text="实际线别" />
+
+        <TextView
+            android:id="@+id/tv_dl_table"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:textSize="@dimen/textsize_16"
+            tools:text="板面" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="10dp"
+        android:padding="10dp">
+
+        <TextView
+            android:id="@+id/tv_dl_macode"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:textSize="@dimen/textsize_16"
+            tools:text="工单号" />
+
+        <TextView
+            android:id="@+id/tv_dl_prodcode"
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_marginRight="5dp"
+            android:layout_weight="1"
+            android:textSize="@dimen/textsize_16"
+            tools:text="产品编码" />
+
+    </LinearLayout>
+
+    <View style="@style/view_gray_line" />
+
+    <GridView
+        android:id="@+id/lv_index_smt"
+        style="@style/MenuGridViewStyle"
+        android:layout_marginTop="10dp"
+        android:numColumns="3"
+        android:padding="16dp" />
+</LinearLayout>

+ 148 - 0
app/src/main/res/layout/fra_smt_material_preparation.xml

@@ -0,0 +1,148 @@
+<?xml version="1.0" encoding="utf-8"?><!--SMT上料-->
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:background="@drawable/bg_main"
+    android:padding="@dimen/padding_normal">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical">
+
+        <TableLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:stretchColumns="1">
+
+            <TableRow android:background="@color/white">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:paddingLeft="20dp"
+                    android:paddingRight="20dp"
+                    android:text="线别"
+                    android:textColor="@color/body_text_1"
+                    android:textSize="16sp" />
+
+                <com.uas.pda_wps.view.ClearableEditText
+                    android:id="@+id/et_linecode_smt"
+                    style="@style/EditTextLineStyle"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:hint="请输入线别"
+                    android:imeOptions="actionSend" />
+            </TableRow>
+
+            <TableRow
+                android:layout_marginTop="5dp"
+                android:background="@color/white">
+
+                <TextView
+                    android:id="@+id/smt_feeder_job_title_tv"
+                    style="@style/tl_tv_style"
+                    android:layout_height="match_parent"
+                    android:gravity="center"
+                    android:paddingLeft="20dp"
+                    android:paddingRight="20dp"
+                    android:text="工单"
+                    android:textColor="@color/body_text_1"
+                    android:textSize="16sp" />
+
+                <LinearLayout
+                    android:layout_width="0dp"
+                    android:layout_height="wrap_content"
+                    android:layout_weight="1"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal">
+
+                    <FrameLayout
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1">
+
+                        <AutoCompleteTextView
+                            android:id="@+id/et_jobcode_smt"
+                            style="@style/EditTextLineStyle"
+                            android:hint="请输入工单号" />
+
+                        <ImageView
+                            android:id="@+id/iocout_smt_jobcode_clean_iv"
+                            android:layout_width="wrap_content"
+                            android:layout_height="wrap_content"
+                            android:layout_gravity="center|right"
+                            android:layout_marginRight="13dp"
+                            android:src="@drawable/wrong"
+                            android:visibility="gone" />
+                    </FrameLayout>
+
+                    <CheckBox
+                        android:id="@+id/smt_feeder_order_cb"
+                        android:layout_width="wrap_content"
+                        android:layout_height="wrap_content"
+                        android:text="无工单"
+                        android:visibility="gone" />
+                </LinearLayout>
+
+
+            </TableRow>
+
+            <TableRow
+                android:layout_marginTop="5dp"
+                android:background="@color/white">
+
+                <TextView
+                    style="@style/tl_tv_style"
+                    android:layout_height="43dp"
+                    android:gravity="center"
+                    android:paddingLeft="20dp"
+                    android:paddingRight="20dp"
+                    android:text="板面"
+                    android:textColor="@color/body_text_1"
+                    android:textSize="16sp" />
+
+                <RadioGroup
+                    android:id="@+id/smt_feeder_board_rg"
+                    android:layout_width="0dp"
+                    android:layout_height="match_parent"
+                    android:layout_weight="1"
+                    android:gravity="center_vertical"
+                    android:orientation="horizontal">
+
+                    <RadioButton
+                        android:id="@+id/smt_feeder_A_rb"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:checked="true"
+                        android:text="A面" />
+
+                    <RadioButton
+                        android:id="@+id/smt_feeder_B_rb"
+                        android:layout_width="0dp"
+                        android:layout_height="wrap_content"
+                        android:layout_weight="1"
+                        android:text="B面" />
+                </RadioGroup>
+            </TableRow>
+        </TableLayout>
+
+        <TextView
+            android:id="@+id/tv_notice_smt"
+            style="@style/CardContentTextStyle"
+            android:layout_marginLeft="@dimen/space_left_16"
+            android:visibility="gone"
+            tools:text="Result Result Result Result Result Result Result Result Result ResultResult ResultResult ResultResult Result"
+            tools:visibility="visible"
+            />
+
+        <Button
+            android:id="@+id/btn_device_ok_smt"
+            style="@style/ButtonStyle"
+            android:enabled="false"
+            android:text="@string/btn_ok_smt" />
+    </LinearLayout>
+</RelativeLayout>

+ 2 - 2
app/src/main/res/layout/fragment_modify_barcode_quantity.xml

@@ -21,7 +21,7 @@
                 style="@style/tl_tv_style"
                 android:layout_height="match_parent"
                 android:gravity="center"
-                android:padding="10dp"
+                android:padding="8dp"
                 android:text="条码"
                 android:textColor="@color/body_text_1"
                 android:textSize="16sp"/>
@@ -47,7 +47,7 @@
                 style="@style/tl_tv_style"
                 android:layout_height="match_parent"
                 android:gravity="center"
-                android:padding="10dp"
+                android:padding="8dp"
                 android:text="数量"
                 android:textColor="@color/body_text_1"
                 android:textSize="16sp"/>

+ 99 - 0
app/src/main/res/layout/fragment_version_upgrade.xml

@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    android:gravity="center_horizontal"
+    android:orientation="vertical">
+
+    <ImageView
+        android:layout_width="64dp"
+        android:layout_height="64dp"
+        android:layout_marginTop="50dp"
+        android:src="@mipmap/icon" />
+
+    <TextView
+        android:id="@+id/version_upgrade_oldVersion_tv"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:padding="10dp"
+        android:textColor="#333333"
+        android:textSize="16sp"
+        tools:text="Version 1.0.0" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="16dp"
+        android:layout_marginRight="16dp"
+        android:orientation="horizontal"
+        android:padding="16dp">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="最新版本:"
+            android:textColor="#666666"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/version_upgrade_newVersion_tv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:textColor="#333333"
+            android:textSize="14sp"
+            tools:text="V1.1.1" />
+    </LinearLayout>
+
+    <View
+        style="@style/view_gray_line"
+        android:layout_marginLeft="26dp"
+        android:layout_marginRight="26dp"
+        android:background="#cccccc" />
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginLeft="16dp"
+        android:layout_marginRight="16dp"
+        android:orientation="horizontal"
+        android:padding="16dp">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:text="更新内容:"
+            android:textColor="#666666"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/version_upgrade_msg_tv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:lineSpacingExtra="4dp"
+            android:maxHeight="240dp"
+            android:textColor="#333333"
+            android:textSize="14sp"
+            tools:text="解决已知bug解决已知bug解决已知bug
+            解决已知bug解决已知bug解决已知bug解决
+            已知bug解决已知bug解决已知bug解决已知bug解决已知bug解决已知bug" />
+    </LinearLayout>
+
+    <View
+        style="@style/view_gray_line"
+        android:layout_marginLeft="26dp"
+        android:layout_marginRight="26dp"
+        android:background="#cccccc" />
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="0dp"
+        android:layout_weight="1" />
+
+    <Button
+        android:id="@+id/version_upgrade_upgrade_btn"
+        style="@style/ButtonStyle"
+        android:layout_margin="32dp"
+        android:visibility="visible"
+        android:text="下载新版本 " />
+</LinearLayout>

+ 26 - 0
app/src/main/res/layout/pop_common_progress.xml

@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:tools="http://schemas.android.com/tools"
+    style="@style/commonPopStyle">
+
+    <TextView
+        android:id="@+id/common_progress_title_tv"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:gravity="center"
+        android:padding="8dp"
+        android:textColor="#333"
+        android:textSize="14sp"
+        tools:text="正在下载新版本" />
+
+    <ProgressBar
+        android:id="@+id/common_progress_progress_pb"
+        style="@style/progressbar_download"
+        android:layout_width="match_parent"
+        android:layout_height="10dp"
+        android:layout_marginLeft="20dp"
+        android:layout_marginTop="12dp"
+        android:layout_marginRight="20dp"
+        android:layout_marginBottom="20dp"
+        android:progress="0" />
+</LinearLayout>

+ 4 - 1
app/src/main/res/values/strings.xml

@@ -429,7 +429,10 @@
         <item>未提交列表</item>
     </string-array>
 
-    <string name="full_station_verification">全站位校验</string>
+    <string name="quality_verification">品质套料</string>
+    <string name="feida_station_binding">飞达站位绑定</string>
+    <string name="smt_materia_preparation">SMT备料</string>
+    <string name="binding">绑定</string>
 
 
 </resources>

+ 12 - 0
app/src/main/res/values/styles.xml

@@ -760,4 +760,16 @@
         <!--        <item name="android:singleLine">true</item>-->
         <item name="android:imeOptions">flagNoExtractUi</item>
     </style>
+
+    <style name="progressbar_download">
+        <item name="android:indeterminateOnly">false</item>
+        <item name="android:progressDrawable">@drawable/progressbar_diy
+        </item><!-- progress_horizontal -->
+        <item name="android:indeterminateDrawable">
+            @android:drawable/progress_indeterminate_horizontal
+        </item>
+        <item name="android:minHeight">20dip</item>
+        <item name="android:maxHeight">20dip</item>
+    </style>
+
 </resources>

+ 1 - 1
app/src/main/res/xml/file_paths.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
 <paths xmlns:android="http://schemas.android.com/apk/res/android">
-    <external-path path="Android/data/com.uas.pda_wp/"        name="files_root" />
+    <external-path path="Android/data/com.uas.pda_wps/"        name="files_root" />
     <external-path path="." name="external_storage_root" />
 </paths>

+ 3 - 3
build.gradle

@@ -46,12 +46,12 @@ task clean(type: Delete) {
 
 ext {
     android = [
-            minSdkVersion    : 16,
+            minSdkVersion    : 17,
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 15,
-            versionName      : "v1.0.5"
+            versionCode      : 11,
+            versionName      : "v1.1.1"
     ]
 
     depsVersion = [