Преглед на файлове

修改采集栏enter接口参数逻辑, 修改其他页面采集栏错误信息, 修复更新问题, 增加本地日志, 增加解除报警功能, 首页增加自由上架功能, 取消权限控制 ,出库采集增加切换箱号功能及接口

songw преди 1 година
родител
ревизия
31ccc1ab96
променени са 42 файла, в които са добавени 2679 реда и са изтрити 59 реда
  1. 15 5
      app/build.gradle
  2. 6 1
      app/src/main/AndroidManifest.xml
  3. 8 0
      app/src/main/java/com/uas/xzc_productionline/activity/FunctionActivity.java
  4. 7 2
      app/src/main/java/com/uas/xzc_productionline/activity/IndexActivity.java
  5. 33 0
      app/src/main/java/com/uas/xzc_productionline/adapter/ReportDetailAdapter.java
  6. 16 1
      app/src/main/java/com/uas/xzc_productionline/application/PdaApplication.java
  7. 64 0
      app/src/main/java/com/uas/xzc_productionline/bean/GroundingBean.java
  8. 2 2
      app/src/main/java/com/uas/xzc_productionline/fragment/ConnectServerFragment.java
  9. 444 0
      app/src/main/java/com/uas/xzc_productionline/fragment/FreeListingFragment.java
  10. 8 0
      app/src/main/java/com/uas/xzc_productionline/fragment/IndexSettingFragment.java
  11. 5 0
      app/src/main/java/com/uas/xzc_productionline/fragment/IndexWareHouseContentFragment.java
  12. 1 0
      app/src/main/java/com/uas/xzc_productionline/fragment/LoginFragment.java
  13. 169 0
      app/src/main/java/com/uas/xzc_productionline/fragment/PositionInquiryFragment.java
  14. 140 0
      app/src/main/java/com/uas/xzc_productionline/fragment/ReleaseAlarmFragment.java
  15. 3 3
      app/src/main/java/com/uas/xzc_productionline/fragment/SCSMTChangeFragment.java
  16. 12 8
      app/src/main/java/com/uas/xzc_productionline/fragment/SCSMTCheckFragment.java
  17. 7 5
      app/src/main/java/com/uas/xzc_productionline/fragment/SCSMTInFragment.java
  18. 12 8
      app/src/main/java/com/uas/xzc_productionline/fragment/SCSMTInspectionFragment.java
  19. 75 9
      app/src/main/java/com/uas/xzc_productionline/fragment/SCSMTJointFragment.java
  20. 221 0
      app/src/main/java/com/uas/xzc_productionline/fragment/VersionUpgradeFragment.java
  21. 66 7
      app/src/main/java/com/uas/xzc_productionline/global/GloableParams.java
  22. 2 1
      app/src/main/java/com/uas/xzc_productionline/tools/SharedPreUtil.java
  23. 9 0
      app/src/main/java/com/uas/xzc_productionline/util/Constants.java
  24. 231 0
      app/src/main/java/com/uas/xzc_productionline/util/CrashHandler.java
  25. 149 0
      app/src/main/java/com/uas/xzc_productionline/util/download/ProgressDownloader.java
  26. 74 0
      app/src/main/java/com/uas/xzc_productionline/util/download/ProgressResponseBody.java
  27. 71 0
      app/src/main/java/com/uas/xzc_productionline/view/business/CommonProgressPop.java
  28. BIN
      app/src/main/res/drawable-xhdpi/iv_shelves.png
  29. BIN
      app/src/main/res/drawable-xhdpi/jiechubaojing.png
  30. 35 0
      app/src/main/res/drawable/progressbar_diy.xml
  31. 387 0
      app/src/main/res/layout/fragment_free_listing.xml
  32. 16 0
      app/src/main/res/layout/fragment_position_inquiry.xml
  33. 94 0
      app/src/main/res/layout/fragment_release_aliarm.xml
  34. 99 0
      app/src/main/res/layout/fragment_version_upgrade.xml
  35. 137 0
      app/src/main/res/layout/item_report_detail.xml
  36. 26 0
      app/src/main/res/layout/pop_common_progress.xml
  37. 0 1
      app/src/main/res/layout/popwin_whbatch_breakpackage.xml
  38. 3 0
      app/src/main/res/values/color.xml
  39. 17 1
      app/src/main/res/values/strings.xml
  40. 11 0
      app/src/main/res/values/styles.xml
  41. 3 3
      build.gradle
  42. 1 2
      pda_libs/pulltoreflashlibrary/src/main/AndroidManifest.xml

+ 15 - 5
app/build.gradle

@@ -41,7 +41,7 @@ android {
             if (outputFile != null && outputFile.name.endsWith('.apk')) {
                 if (variant.buildType.name.equals('release')) {
                     def releaseInfo = getVersionName()
-                    fileName = "UAS_XZC_RELEASE_${releaseInfo}.apk"
+                    fileName = "行之成_产线UAS_RELEASE_${releaseInfo}.apk"
                 } else if (variant.buildType.name.equals('debug')) {
                     def debugInfo = getVersionName()
                     fileName = "UAS_PDA_XZC_PRODUCTIONLINE_DEBUG_${debugInfo}.apk"
@@ -56,10 +56,20 @@ android {
         sourceCompatibility 1.8
     }
 
-    lintOptions {
-        checkReleaseBuilds false
-        abortOnError false
-    }
+//    lintOptions {
+//        checkReleaseBuilds false
+//        abortOnError false
+//    }
+
+//    //虚拟机安装错误  解决
+//    splits {
+//        abi {
+//            enable true
+//            reset()
+//            include 'x86', 'armeabi-v7a', 'x86_64'
+//            universalApk true
+//        }
+//    }
 }
 
 dependencies {

+ 6 - 1
app/src/main/AndroidManifest.xml

@@ -29,6 +29,7 @@
         <activity
             android:name="com.uas.xzc_productionline.activity.SplashActivity"
             android:icon="@mipmap/icon"
+            android:exported="true"
             android:screenOrientation="portrait"
             android:theme="@style/NoOverLayStyle">
             <intent-filter>
@@ -42,26 +43,30 @@
             android:name="com.uas.xzc_productionline.activity.MainActivity"
             android:icon="@mipmap/icon"
             android:label="@string/title_activity_menu"
+            android:exported="true"
             android:screenOrientation="portrait"
             android:windowSoftInputMode="adjustPan|stateHidden"></activity>
         <activity
             android:name="com.uas.xzc_productionline.activity.IndexActivity"
             android:label="@string/title_activity_menu"
+            android:exported="false"
             android:screenOrientation="portrait" />
         <activity
             android:name="com.uas.xzc_productionline.activity.FunctionActivity"
             android:label="@string/title_activity_function"
             android:screenOrientation="portrait"
+            android:exported="false"
             android:windowSoftInputMode="adjustUnspecified|stateHidden" />
 
         <activity
             android:name="com.uas.xzc_productionline.activity.SearchMaterialActivity"
             android:label="@string/material_number_search"
+            android:exported="false"
             android:screenOrientation="portrait" />
 
         <provider
             android:name="android.support.v4.content.FileProvider"
-            android:authorities="com.yitao_productionline.fileprovider"
+            android:authorities="com.uas.xzc_productionline"
             android:exported="false"
             android:grantUriPermissions="true">
             <meta-data

+ 8 - 0
app/src/main/java/com/uas/xzc_productionline/activity/FunctionActivity.java

@@ -13,6 +13,7 @@ import android.widget.TextView;
 
 import com.uas.xzc_productionline.R;
 import com.uas.xzc_productionline.fragment.BaseFragment;
+import com.uas.xzc_productionline.fragment.FreeListingFragment;
 import com.uas.xzc_productionline.fragment.IndexInOutContentFragment;
 import com.uas.xzc_productionline.fragment.IndexSettingFragment;
 import com.uas.xzc_productionline.fragment.IndexShopContentFragment;
@@ -20,6 +21,7 @@ import com.uas.xzc_productionline.fragment.IndexWareHouseContentFragment;
 import com.uas.xzc_productionline.fragment.MSDManageFragment;
 import com.uas.xzc_productionline.fragment.ModifyBarcodeQuantityFragment;
 import com.uas.xzc_productionline.fragment.PostStockFragment;
+import com.uas.xzc_productionline.fragment.ReleaseAlarmFragment;
 import com.uas.xzc_productionline.fragment.SCSMTFragment;
 import com.uas.xzc_productionline.fragment.SolderPasteManageFragment;
 import com.uas.xzc_productionline.global.GloableParams;
@@ -103,6 +105,12 @@ public class FunctionActivity extends BaseActivity implements View.OnClickListen
                     fragment = new IndexSettingFragment();
 //                    fragment = new BlueToothPrintFragment();
                     break;
+                case GloableParams.GRIDNAME_SMART_SHELVES:
+                    fragment = new FreeListingFragment();
+                    break;
+                case GloableParams.LIGHT_RELEASE_THE_ALARM:     //解除警报
+                    fragment = new ReleaseAlarmFragment();
+                    break;
             }
 
             //添加Fragment

+ 7 - 2
app/src/main/java/com/uas/xzc_productionline/activity/IndexActivity.java

@@ -119,7 +119,6 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
                 new int[]{R.id.griditem_img, R.id.griditem_name});
         menuGridView.setAdapter(adapter);
 
-
         View view = View.inflate(this, R.layout.pop_exit_application, null);
         mCancelTextView = (TextView) view.findViewById(R.id.pop_exit_cancel_tv);
         mMinimizeTextView = (TextView) view.findViewById(R.id.pop_exit_minimize_tv);
@@ -133,6 +132,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
                 closeExitPopupWindow();
             }
         });
+
     }
 
     @Override
@@ -198,7 +198,9 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
         boolean isPower = false;
         if (itemName.equals(GloableParams.GRIDNAME_SETTING)) {
             isPower = true;
-        } else if(itemName.equals(GloableParams.GRIDNAME_MODIFY_QUANTITY2)){
+        }else if(itemName.equals(GloableParams.GRIDNAME_MODIFY_QUANTITY2)){
+            isPower = true;
+        }else if(itemName.equals(GloableParams.GRIDNAME_SMART_SHELVES)){
             isPower = true;
         }else if(itemName.equals(GloableParams.GRIDNAME_POST_STOCK)){
             isPower = true;
@@ -228,6 +230,9 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
                 }
             }
         }
+        if (GloableParams.LIGHT_RELEASE_THE_ALARM.equals("解除报警")) {
+            isPower = true;
+        }
         //isPower所有权限
         if (isPower) {
             Intent intent = new Intent(IndexActivity.this, FunctionActivity.class);

+ 33 - 0
app/src/main/java/com/uas/xzc_productionline/adapter/ReportDetailAdapter.java

@@ -0,0 +1,33 @@
+package com.uas.xzc_productionline.adapter;
+
+import android.widget.TextView;
+
+import com.chad.library.adapter.base.BaseQuickAdapter;
+import com.chad.library.adapter.base.BaseViewHolder;
+import com.uas.xzc_productionline.R;
+import com.uas.xzc_productionline.bean.GroundingBean;
+
+
+public class ReportDetailAdapter extends BaseQuickAdapter<GroundingBean, BaseViewHolder> {
+
+    public ReportDetailAdapter() {
+        super(R.layout.item_report_detail, null);
+    }
+    @Override
+    protected void convert(BaseViewHolder helper, GroundingBean item) {
+        TextView tv_tiaomahao=helper.getView(R.id.tv_tiaomahao);    //条码号
+//        TextView tv_qty=helper.getView(R.id.tv_qty);    //仓位
+        TextView tv_qty=helper.getView(R.id.tv_qty);    //料架
+        TextView tv_pichi=helper.getView(R.id.tv_pichi);
+        TextView tv_report_num=helper.getView(R.id.tv_report_num);
+        TextView tv_report_man=helper.getView(R.id.tv_report_man);
+
+        tv_tiaomahao.setText(item.getPB_BARCODE());
+//        tv_qty.setText(item.getPB_LOCATION());
+        tv_qty.setText(item.getPB_SHELFCODE());
+        tv_pichi.setText(item.getPB_PRODCODE());
+        tv_report_num.setText(item.getPR_DETAIL());
+        tv_report_man.setText(item.getPR_SPEC());
+        tv_report_man.setText(item.getPR_SPEC());
+    }
+}

+ 16 - 1
app/src/main/java/com/uas/xzc_productionline/application/PdaApplication.java

@@ -11,6 +11,7 @@ import com.android.volley.toolbox.Volley;
 import com.facebook.stetho.Stetho;
 import com.uas.xzc_productionline.R;
 import com.uas.xzc_productionline.util.AndroidUtil;
+import com.uas.xzc_productionline.util.CrashHandler;
 import com.uas.xzc_productionline.util.FakeX509TrustManager;
 import com.uas.xzc_productionline.util.SoundUtil;
 import com.umeng.analytics.MobclickAgent;
@@ -45,10 +46,17 @@ public class PdaApplication extends Application {
     public static HashMap<Integer, Integer> mSoundMap;
     public static int mVersionCode = 1;
 
+    private static PdaApplication mInstance;
+
     @Override
     public void onCreate() {
         super.onCreate();
+        mInstance = this;
         mContext = getApplicationContext();
+
+        CrashHandler crashHandler = CrashHandler.getInstance();
+        crashHandler.init(mContext);
+
         FakeX509TrustManager.allowAllSSL();//去掉SSL证书验证
         if (mRequestQueue == null)
             mRequestQueue = Volley.newRequestQueue(this);
@@ -85,7 +93,7 @@ public class PdaApplication extends Application {
         mSoundMap.put(SoundUtil.SOUND_TETHYS, mSoundPool.load(this, R.raw.tethys, 1));
         mSoundMap.put(SoundUtil.SOUND_TITAN, mSoundPool.load(this, R.raw.titan, 1));
         //友盟统计SDK
-        initUmeng();
+        //initUmeng();
 
     }
 
@@ -223,5 +231,12 @@ public class PdaApplication extends Application {
         return factory;
     }
 
+    public Context getContext() {
+        return mContext;
+    }
+
+    public static PdaApplication getInstance() {
+        return mInstance;
+    }
 
 }

+ 64 - 0
app/src/main/java/com/uas/xzc_productionline/bean/GroundingBean.java

@@ -0,0 +1,64 @@
+package com.uas.xzc_productionline.bean;
+
+public class GroundingBean {
+    //"PB_BARCODE": "0001-0011",  //条码号
+    //            "PB_LOCATION": "0001-0011",  //仓位编号
+    //            "PB_PRODCODE": "4-001-01-0346",  /物料编号
+    //            "PR_DETAIL": "贴片电阻",    //物料名称
+    //            "PR_SPEC": "1206/0.002R/2mR/1W/±1%/高精度/合金电阻/RALEC",   //物料规格
+
+    private String PB_BARCODE;
+    private String PB_LOCATION;
+    private String PB_PRODCODE;
+    private String PR_DETAIL;
+    private String PR_SPEC;
+    private String PB_SHELFCODE;
+
+    public String getPB_SHELFCODE() {
+        return PB_SHELFCODE;
+    }
+
+    public void setPB_SHELFCODE(String PB_SHELFCODE) {
+        this.PB_SHELFCODE = PB_SHELFCODE;
+    }
+
+    public String getPB_BARCODE() {
+        return PB_BARCODE;
+    }
+
+    public void setPB_BARCODE(String PB_BARCODE) {
+        this.PB_BARCODE = PB_BARCODE;
+    }
+
+    public String getPB_LOCATION() {
+        return PB_LOCATION;
+    }
+
+    public void setPB_LOCATION(String PB_LOCATION) {
+        this.PB_LOCATION = PB_LOCATION;
+    }
+
+    public String getPB_PRODCODE() {
+        return PB_PRODCODE;
+    }
+
+    public void setPB_PRODCODE(String PB_PRODCODE) {
+        this.PB_PRODCODE = PB_PRODCODE;
+    }
+
+    public String getPR_DETAIL() {
+        return PR_DETAIL;
+    }
+
+    public void setPR_DETAIL(String PR_DETAIL) {
+        this.PR_DETAIL = PR_DETAIL;
+    }
+
+    public String getPR_SPEC() {
+        return PR_SPEC;
+    }
+
+    public void setPR_SPEC(String PR_SPEC) {
+        this.PR_SPEC = PR_SPEC;
+    }
+}

+ 2 - 2
app/src/main/java/com/uas/xzc_productionline/fragment/ConnectServerFragment.java

@@ -441,8 +441,8 @@ public class ConnectServerFragment extends BaseFragment implements View.OnClickL
         String port = portEditText.getText().toString().trim();
 
         //判断是否是正确的port地址
-        boolean portRight = RegexUtil.checkString(port, RegexUtil.PORT_FORMAT);
-
+//        boolean portRight = RegexUtil.checkString(port, RegexUtil.PORT_FORMAT);
+        boolean portRight = true;
         if (!portRight) {
             //Prot不正确,文字变红
             portEditText.setTextColor(getResources().getColor(R.color.red));

+ 444 - 0
app/src/main/java/com/uas/xzc_productionline/fragment/FreeListingFragment.java

@@ -0,0 +1,444 @@
+package com.uas.xzc_productionline.fragment;
+
+import android.app.Activity;
+import android.content.DialogInterface;
+import android.content.Intent;
+import android.graphics.Color;
+import android.graphics.drawable.BitmapDrawable;
+import android.support.v4.app.Fragment;
+import android.support.v7.app.AlertDialog;
+import android.text.TextUtils;
+import android.view.KeyEvent;
+import android.view.View;
+import android.widget.Button;
+import android.widget.CheckBox;
+import android.widget.ImageView;
+import android.widget.LinearLayout;
+import android.widget.PopupWindow;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSONObject;
+import com.android.volley.Request;
+import com.uas.xzc_productionline.R;
+import com.uas.xzc_productionline.activity.FunctionActivity;
+import com.uas.xzc_productionline.global.GloableParams;
+import com.uas.xzc_productionline.listener.MyEditorActionListener;
+import com.uas.xzc_productionline.tools.SharedPreUtil;
+import com.uas.xzc_productionline.util.CameraUtil;
+import com.uas.xzc_productionline.util.CommonUtil;
+import com.uas.xzc_productionline.util.FastjsonUtil;
+import com.uas.xzc_productionline.util.FragmentUtils;
+import com.uas.xzc_productionline.util.HttpCallback;
+import com.uas.xzc_productionline.util.HttpParams;
+import com.uas.xzc_productionline.util.VolleyRequest;
+import com.uas.xzc_productionline.view.ClearableEditText;
+import com.uuzuche.lib_zxing.activity.CaptureActivity;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+public class FreeListingFragment extends BaseFragment {
+    private static final int SCAN_BARCODE_CODE = 101;
+    private ClearableEditText mBarcodeEditText,cet_material_rack;
+    private CheckBox cb_free_listing;
+    private Button mConfirmButton;
+    private TextView mResultTextView;
+    private ImageView mScanImageView;
+    private int mFocusId;
+    private String mBarCode;
+    private org.json.JSONObject jsonObject;
+    private Button btn_kill;
+    private Button mMenuButton;
+    private LinearLayout ll_shangjia,ll_end_data,ll_jiaoyan;
+    private PopupWindow mMenuPopupWindow;
+    private Fragment mFragment;
+    private TextView tv_liaojia,tv_barcode_tailback,tv_liaohao,tv_barremain,tv_name,
+            tv_guige,tv_wuliaomorencangku,tv_current_position,tv_aready_stored_in_storage_space,tv_end_data;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_free_listing;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle(getResources().getString(R.string.free_listing));
+        ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
+        mMenuButton = (Button) mActivity.findViewById(R.id.btn_actionbar_more);
+        mScanImageView = (ImageView) mActivity.findViewById(R.id.btn_actionbar_scan_iv);
+        mBarcodeEditText = root.findViewById(R.id.barcode_info_collect_barcode_et);
+        mConfirmButton = root.findViewById(R.id.barcode_info_collect_confirm_btn);
+        mResultTextView = root.findViewById(R.id.barcode_info_collect_result_tv);
+        cet_material_rack = (ClearableEditText) root.findViewById(R.id.cet_material_rack);
+        cb_free_listing = (CheckBox) root.findViewById(R.id.cb_free_listing);
+        ll_shangjia = root.findViewById(R.id.ll_shangjia);
+        tv_liaojia = root.findViewById(R.id.tv_liaojia);
+        tv_barcode_tailback = root.findViewById(R.id.tv_barcode_tailback);
+        tv_liaohao = root.findViewById(R.id.tv_liaohao);
+        tv_barremain = root.findViewById(R.id.tv_barremain);
+        tv_name = root.findViewById(R.id.tv_name);
+        tv_guige = root.findViewById(R.id.tv_guige);
+        tv_wuliaomorencangku = root.findViewById(R.id.tv_wuliaomorencangku);
+        tv_current_position = root.findViewById(R.id.tv_current_position);
+        tv_aready_stored_in_storage_space = root.findViewById(R.id.tv_aready_stored_in_storage_space);
+        ll_end_data = root.findViewById(R.id.ll_end_data);
+        tv_end_data = root.findViewById(R.id.tv_end_data);
+        ll_jiaoyan = root.findViewById(R.id.ll_jiaoyan);
+
+        btn_kill = mActivity.findViewById(R.id.btn_kill);
+
+        cet_material_rack.requestFocus();
+        jsonObject=new org.json.JSONObject();
+    }
+
+    @Override
+    protected void initEvents() {
+        //料架回车
+        CommonUtil.setEditorActionListener(cet_material_rack, new MyEditorActionListener() {
+            @Override
+            public void MyEditorAction(String text, int actionId, KeyEvent event) {
+                if (!text.isEmpty()&&!cet_material_rack.getText().toString().isEmpty()){
+                    materialRackCode();
+                }
+            }
+        });
+        //条码回车
+        CommonUtil.setEditorActionListener(mBarcodeEditText, new MyEditorActionListener() {
+            @Override
+            public void MyEditorAction(String text, int actionId, KeyEvent event) {
+                try{
+                    if (!TextUtils.isEmpty(cet_material_rack.getText().toString().trim())
+                            && !TextUtils.isEmpty(mBarcodeEditText.getText().toString().trim())
+                    ){
+                        getBarAcceptCode(mBarcodeEditText.getText().toString().trim(),cet_material_rack.getText().toString().trim());
+                    }
+                }catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        });
+
+        mConfirmButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getBarAcceptCode(mBarcodeEditText.getText().toString().trim(),cet_material_rack.getText().toString().trim());
+            }
+        });
+        btn_kill.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                String userName = SharedPreUtil.getString(mActivity, SharedPreUtil.KEY_USERNAME, "");
+                new AlertDialog.Builder(getActivity()).setTitle("提示")
+                        .setMessage("是否结束(" + userName + ")的所有进行中的上架任务?")
+                        .setPositiveButton("是", new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(DialogInterface dialog, int which) {
+                                dialog.dismiss();
+                                savekillAcceptCode("");
+                            }
+                        })
+                        .setNegativeButton("否", new DialogInterface.OnClickListener() {
+                            @Override
+                            public void onClick(DialogInterface dialog, int which) {
+                                dialog.dismiss();
+                            }
+                        })
+                        .show();
+            }
+        });
+
+        mScanImageView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                if (CameraUtil.hasCamera()) {
+                    if (root.findFocus() != null) {
+                        mFocusId = root.findFocus().getId();
+                        Intent intent = new Intent();
+                        intent.setClass(mActivity, CaptureActivity.class);
+                        startActivityForResult(intent, SCAN_BARCODE_CODE);
+                    }
+                } else {
+                    CommonUtil.toastNoRepeat(mActivity, getString(R.string.no_camera_detected));
+                }
+            }
+        });
+        initPopupWindow();
+        mMenuButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                CommonUtil.setBackgroundAlpha(getActivity(), 0.5f);
+                mMenuPopupWindow.showAsDropDown(mMenuButton);
+            }
+        });
+    }
+
+    private void materialRackCode() {
+        String materialRack = cet_material_rack.getText().toString().trim();
+        if (TextUtils.isEmpty(materialRack)) {
+            CommonUtil.toastNoRepeat(mActivity, getResources().getString(R.string.Please_enter_the_material_rack));
+            cet_material_rack.requestFocus();
+            return;
+        }
+
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_CHECK_SHELF)
+                .method(Request.Method.GET)
+                .addParam("shcode",materialRack)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+                org.json.JSONObject resultObject = new org.json.JSONObject(o.toString());
+                ll_jiaoyan.setVisibility(View.VISIBLE);
+                mResultTextView.setVisibility(View.VISIBLE);
+                ll_shangjia.setVisibility(View.GONE);
+                ll_end_data.setVisibility(View.GONE);
+                if (resultObject.optBoolean("success")) {
+                    mResultTextView.setTextColor(getResources().getColor(R.color.blue));
+                    mResultTextView.setText(getResources().getText(R.string.Shelf_validation_successful));
+//                    if (!cb_free_listing.isChecked()){
+//                        cet_material_rack.setText("");
+//                    }
+                    //mBarcodeEditText.setText("");
+                    mBarcodeEditText.requestFocus();
+                }else {
+                    mResultTextView.setTextColor(getResources().getColor(R.color.red));
+                    mResultTextView.setText(resultObject.getString("message"));
+                }
+                CommonUtil.makeNotice();
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+                cet_material_rack.setText(null);
+                cet_material_rack.requestFocus();
+                ll_jiaoyan.setVisibility(View.VISIBLE);
+                mResultTextView.setVisibility(View.VISIBLE);
+                mResultTextView.setTextColor(getResources().getColor(R.color.red));
+                mResultTextView.setText(failStr);
+                ll_shangjia.setVisibility(View.GONE);
+                ll_end_data.setVisibility(View.GONE);
+                CommonUtil.makeNotice();
+            }
+        });
+    }
+
+    private void initPopupWindow() {
+        View view = View.inflate(getActivity(), R.layout.pop_storage_recharge_menu, null);
+
+        Button doneButton = (Button) view.findViewById(R.id.pop_storage_recharge_menu_1);
+        Button todoButton = (Button) view.findViewById(R.id.pop_storage_recharge_menu_2);
+        doneButton.setText("上架任务查询");
+        todoButton.setVisibility(View.GONE);
+        mFragment = new PositionInquiryFragment();
+
+        doneButton.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                closeMenuPopupWindow();
+//                Bundle bundle = new Bundle();
+//                bundle.putString(Constants.FLAG.FLAG_RECHARGE_CALLER, "AcceptNotify!Have");
+//                mFragment.setArguments(bundle);
+                FragmentUtils.switchFragment(FreeListingFragment.this, mFragment);
+            }
+        });
+
+        mMenuPopupWindow = new PopupWindow(view, LinearLayout.LayoutParams.WRAP_CONTENT, LinearLayout.LayoutParams.WRAP_CONTENT, true);
+        mMenuPopupWindow.setBackgroundDrawable(new BitmapDrawable());
+        mMenuPopupWindow.setOnDismissListener(new PopupWindow.OnDismissListener() {
+            @Override
+            public void onDismiss() {
+                closeMenuPopupWindow();
+            }
+        });
+    }
+
+    private void closeMenuPopupWindow() {
+        if (mMenuPopupWindow != null) {
+            mMenuPopupWindow.dismiss();
+            CommonUtil.setBackgroundAlpha(mActivity, 1f);
+        }
+    }
+    @Override
+    protected void initDatas() { ;
+
+    }
+
+    private void getBarAcceptCode(String barcode,String shcode) {
+        if (TextUtils.isEmpty(shcode)){
+            CommonUtil.toastNoRepeat(mActivity, getResources().getString(R.string.Please_enter_the_material_rack));
+            return;
+        }
+        if (TextUtils.isEmpty(barcode)){
+            CommonUtil.toastNoRepeat(mActivity, getResources().getString(R.string.Please_enter_the_barcode_number));
+            return;
+        }
+        progressDialog.show();
+        try {
+            VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                    .url(GloableParams.ADDRESS_FREE_SMART_START)
+                    .method(Request.Method.GET)
+                    .addParam("shcode", shcode)
+                    .addParam("barcode", barcode)
+                    .build(), new HttpCallback() {
+                @Override
+                public void onSuccess(int flag, Object o) throws Exception {
+                    progressDialog.dismiss();
+                    org.json.JSONObject resultObject = new org.json.JSONObject(o.toString());
+                    if (resultObject.optBoolean("success")) {
+                        cet_material_rack.requestFocus();
+                        cet_material_rack.setSelection(cet_material_rack.getText().length());
+                        ll_shangjia.setVisibility(View.VISIBLE);
+                        ll_end_data.setVisibility(View.GONE);
+                        ll_jiaoyan.setVisibility(View.GONE);
+
+                        JSONObject dataObject = FastjsonUtil.getJSONObject(o.toString(),"data");
+                        String BAR_PRODCODE = dataObject.getString("BAR_PRODCODE") == null ? "" : dataObject.getString("BAR_PRODCODE");
+                        String PR_DETAIL = dataObject.getString("PR_DETAIL") == null ? "" : dataObject.getString("PR_DETAIL");
+                        String PR_SPEC = dataObject.getString("PR_SPEC") == null ? "" : dataObject.getString("PR_SPEC");
+                        String PR_ORISPECCODE = dataObject.getString("PR_ORISPECCODE") == null ? "" : dataObject.getString("PR_ORISPECCODE");
+                        String BAR_LOCATION = dataObject.getString("BAR_LOCATION") == null ? "" : dataObject.getString("BAR_LOCATION");
+                        String BAR_CODE = dataObject.getString("BAR_CODE") == null ? "" : dataObject.getString("BAR_CODE");
+                        String BAR_REMAIN = dataObject.getString("BAR_REMAIN") == null ? "" : dataObject.getString("BAR_REMAIN");
+                        String BAR_WHCODE = dataObject.getString("BAR_WHCODE") == null ? "" : dataObject.getString("BAR_WHCODE");
+                        String PR_LOCATION = dataObject.getString("PR_LOCATION") == null ? "" : dataObject.getString("PR_LOCATION");
+                        String LOCATIONS = dataObject.getString("LOCATIONS") == null ? "" : dataObject.getString("LOCATIONS");
+
+                        tv_liaojia.setText(shcode);
+                        tv_barcode_tailback.setText(barcode);
+                        tv_liaohao.setText(BAR_PRODCODE);
+                        tv_barremain.setText(BAR_REMAIN);
+                        tv_name.setText(PR_DETAIL);
+                        tv_guige.setText(PR_SPEC);
+                        tv_wuliaomorencangku.setText(PR_LOCATION);
+                        tv_current_position.setText(BAR_LOCATION);
+                        tv_aready_stored_in_storage_space.setText(LOCATIONS);
+
+                        if (cb_free_listing.isChecked()) {
+                            mBarcodeEditText.setText("");
+                            mBarcodeEditText.requestFocus();
+                        }else {
+                            mBarcodeEditText.setText("");
+                            cet_material_rack.setText("");
+                            cet_material_rack.requestFocus();
+                        }
+                    }
+                    CommonUtil.makeNotice();
+                }
+
+                @Override
+                public void onFail(int flag, String failStr) throws Exception {
+                    progressDialog.dismiss();
+                    CommonUtil.toastNoRepeat(mActivity, failStr);
+                    mResultTextView.setTextColor(Color.RED);
+                    ll_jiaoyan.setVisibility(View.VISIBLE);
+                    mResultTextView.setVisibility(View.VISIBLE);
+                    mResultTextView.setText(failStr);
+                    mBarcodeEditText.requestFocus();
+                    mBarcodeEditText.setText(null);
+                    if (!cb_free_listing.isChecked()) {
+                        cet_material_rack.setText(null);
+                    }
+                    ll_shangjia.setVisibility(View.GONE);
+                    ll_end_data.setVisibility(View.GONE);
+                    CommonUtil.makeNotice();
+                }
+            });
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+    }
+
+    private void savekillAcceptCode(String barcode) {
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_FREE_SMART_END)
+                .method(Request.Method.POST)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+                org.json.JSONObject resultObject = new org.json.JSONObject(o.toString());
+                if (resultObject.optBoolean("success")) {
+                    ll_jiaoyan.setVisibility(View.VISIBLE);
+                    mResultTextView.setVisibility(View.VISIBLE);
+                    ll_shangjia.setVisibility(View.GONE);
+                    ll_end_data.setVisibility(View.VISIBLE);
+                    mResultTextView.setText(null);
+                    mBarcodeEditText.setText(null);
+                    mResultTextView.setTextColor(getResources().getColor(R.color.blue));
+                    mResultTextView.setText("结束上架操作成功");
+                    cet_material_rack.requestFocus();
+                    cet_material_rack.setSelection(cet_material_rack.getText().length());
+
+                    JSONObject dataObject = FastjsonUtil.getJSONObject(o.toString(),"data");
+                    tv_end_data.setText(dataObject.toJSONString());
+                }
+                CommonUtil.makeNotice();
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+                mResultTextView.setTextColor(getResources().getColor(R.color.red));
+                ll_jiaoyan.setVisibility(View.VISIBLE);
+                mResultTextView.setVisibility(View.VISIBLE);
+                mResultTextView.setText(failStr);
+                mBarcodeEditText.requestFocus();
+                mBarcodeEditText.setText(null);
+                cet_material_rack.setText(null);
+                ll_shangjia.setVisibility(View.GONE);
+                ll_end_data.setVisibility(View.GONE);
+                CommonUtil.makeNotice();
+            }
+        });
+
+    }
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        if (resultCode != Activity.RESULT_OK) {
+            return;
+        }
+        if (requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+                if (mFocusId == R.id.barcode_info_collect_barcode_et) {
+                    mBarcodeEditText.setText(result);
+                    mBarcodeEditText.setSelection(result.length());
+                    if (!TextUtils.isEmpty(cet_material_rack.getText().toString())) {
+                        getBarAcceptCode(result,cet_material_rack.getText().toString().trim());
+                    }
+                }
+            }
+        }
+    }
+
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        if (!hidden) {
+            FunctionActivity.setTitle(getResources().getString(R.string.free_listing));
+            ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
+        }else {
+            ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+        }
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+    }
+}

+ 8 - 0
app/src/main/java/com/uas/xzc_productionline/fragment/IndexSettingFragment.java

@@ -49,6 +49,7 @@ import com.uas.xzc_productionline.util.AndroidUtil;
 import com.uas.xzc_productionline.util.CommonUtil;
 import com.uas.xzc_productionline.util.Constants;
 import com.uas.xzc_productionline.util.FileUtils;
+import com.uas.xzc_productionline.util.FragmentUtils;
 import com.uas.xzc_productionline.util.JsonTools;
 import com.uas.xzc_productionline.util.LogUtil;
 
@@ -247,6 +248,8 @@ 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);
+
+        settingCheckUpdateLl.setOnClickListener(this);
     }
 
     @Override
@@ -459,6 +462,11 @@ 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;
+
         }
     }
 

+ 5 - 0
app/src/main/java/com/uas/xzc_productionline/fragment/IndexWareHouseContentFragment.java

@@ -128,6 +128,11 @@ public class IndexWareHouseContentFragment extends BaseFragment implements Adapt
                     getFragmentManager().beginTransaction().addToBackStack(null)
                             .replace(R.id.container_function_fragment, fragment).commit();
                     break;
+//                case GloableParams.LIGHT_RELEASE_THE_ALARM:     //解除警报
+//                    fragment = new ReleaseAlarmFragment();
+//                    getFragmentManager().beginTransaction().addToBackStack(null)
+//                            .replace(R.id.container_function_fragment, fragment).commit();
+//                    break;
             }
         }
     }

+ 1 - 0
app/src/main/java/com/uas/xzc_productionline/fragment/LoginFragment.java

@@ -68,6 +68,7 @@ public class LoginFragment extends BaseFragment implements AdapterView.OnItemSel
             switch (msg.what) {
                 case VolleyUtil.SUCCESS_SUCCESS:
                     String userName = userEditText.getText().toString().trim();
+                    SharedPreUtil.saveString(mActivity, SharedPreUtil.KEY_USERNAME, userName);
                     String pwd = null;
                     if (rmbCheckBox.isChecked()) {
                         pwd = pwdEditText.getText().toString().trim();

+ 169 - 0
app/src/main/java/com/uas/xzc_productionline/fragment/PositionInquiryFragment.java

@@ -0,0 +1,169 @@
+package com.uas.xzc_productionline.fragment;
+
+import android.app.Activity;
+import android.content.Context;
+import android.content.Intent;
+import android.support.v7.widget.LinearLayoutManager;
+import android.support.v7.widget.RecyclerView;
+import android.view.KeyEvent;
+import android.view.inputmethod.InputMethodManager;
+import android.widget.EditText;
+import android.widget.TextView;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.android.volley.Request;
+import com.uas.xzc_productionline.R;
+import com.uas.xzc_productionline.adapter.ReportDetailAdapter;
+import com.uas.xzc_productionline.bean.GroundingBean;
+import com.uas.xzc_productionline.global.GloableParams;
+import com.uas.xzc_productionline.util.CommonUtil;
+import com.uas.xzc_productionline.util.HttpCallback;
+import com.uas.xzc_productionline.util.HttpParams;
+import com.uas.xzc_productionline.util.VolleyRequest;
+import com.uuzuche.lib_zxing.activity.CodeUtils;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @note:仓位物料查询
+ */
+public class PositionInquiryFragment extends BaseFragment{
+    private static final int SCAN_BARCODE_CODE = 402;
+    private List<GroundingBean> mFilterStorageInBeans;
+    private RecyclerView rv_content;
+    private ReportDetailAdapter reportDetailAdapter;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_position_inquiry;
+    }
+
+    @Override
+    protected void initViews() {
+//        ((FunctionActivity) mActivity).setScanIvVisible(true);
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText("上架任务查询");
+        rv_content = mActivity.findViewById(R.id.rv_data);
+    }
+
+    @Override
+    protected void initEvents() {
+        mFilterStorageInBeans = new ArrayList<>();
+        rv_content.setLayoutManager(new LinearLayoutManager(mActivity));
+        reportDetailAdapter = new ReportDetailAdapter();
+        rv_content.setAdapter(reportDetailAdapter);
+
+        saveBarAcceptCode();
+    }
+
+    @Override
+    protected void initDatas() {
+
+    }
+    private void saveBarAcceptCode() {
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_COMMON_GETLOCATIONPROD)
+                .method(Request.Method.GET)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+                try {
+                    mFilterStorageInBeans.clear();
+                    String result = o.toString();
+                    JSONObject resultObject = JSON.parseObject(result);
+                    JSONArray dataArray = resultObject.getJSONArray("data");
+                    if (dataArray != null && dataArray.size() > 0) {
+                        for(Object index:dataArray){
+                            JSONObject data = (JSONObject) index;
+                            GroundingBean groundingBean = new GroundingBean();
+                            groundingBean.setPB_BARCODE(data.getString( "PB_BARCODE"));
+                            groundingBean.setPB_LOCATION(data.getString( "PB_LOCATION"));
+                            groundingBean.setPB_PRODCODE(data.getString( "PB_PRODCODE"));
+                            groundingBean.setPR_DETAIL(data.getString( "PR_DETAIL"));
+                            groundingBean.setPR_SPEC(data.getString( "PR_SPEC"));
+                            groundingBean.setPB_SHELFCODE(data.getString( "PB_SHELFCODE"));
+                            mFilterStorageInBeans.add(groundingBean);
+                        }
+                        reportDetailAdapter.setNewData(mFilterStorageInBeans);
+                    }
+                } catch (Exception e) {
+                    e.printStackTrace();
+                    progressDialog.dismiss();
+                }
+
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+                mFilterStorageInBeans.clear();
+                reportDetailAdapter.setNewData(mFilterStorageInBeans);
+
+            }
+        });
+
+    }
+    @Override
+    public void onActivityResult(int requestCode, int resultCode, Intent data) {
+        super.onActivityResult(requestCode, resultCode, data);
+
+        if (resultCode != Activity.RESULT_OK) {
+            return;
+        }
+
+        if (requestCode == SCAN_BARCODE_CODE && data != null) {
+            if (data.getExtras() != null) {
+                String result = data.getExtras().getString(CodeUtils.RESULT_STRING);
+//                if (mFocusId == R.id.et_collect) {
+//                    modify_barcode_quantity_barcode_cet.setText(result);
+//                    modify_barcode_quantity_barcode_cet.setSelection(result.length());
+//                }
+            }
+        }
+    }
+
+    @Override
+    public void onDestroy() {
+        ((TextView) (getActivity().findViewById(R.id.tv_actionbar_withback))).setText("上架任务查询");
+
+//        ((FunctionActivity) mActivity).setScanIvVisible(false);
+        super.onDestroy();
+    }
+
+    @Override
+    public void onPause() {
+        super.onPause();
+    }
+
+    /**
+     * 隐藏键盘
+     */
+    private void hideKeyboard(EditText editText) {
+        //获取键盘管理对象
+        InputMethodManager inputManager = (InputMethodManager) editText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
+        inputManager.hideSoftInputFromWindow(editText.getWindowToken(), 0);
+    }
+
+    @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;
+            }
+        }
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+
+}

+ 140 - 0
app/src/main/java/com/uas/xzc_productionline/fragment/ReleaseAlarmFragment.java

@@ -0,0 +1,140 @@
+package com.uas.xzc_productionline.fragment;
+
+import android.text.TextUtils;
+import android.view.KeyEvent;
+import android.view.View;
+import android.widget.Button;
+import android.widget.LinearLayout;
+import android.widget.TextView;
+
+import com.android.volley.Request;
+import com.uas.xzc_productionline.R;
+import com.uas.xzc_productionline.activity.FunctionActivity;
+import com.uas.xzc_productionline.global.GloableParams;
+import com.uas.xzc_productionline.listener.MyEditorActionListener;
+import com.uas.xzc_productionline.util.CommonUtil;
+import com.uas.xzc_productionline.util.HttpCallback;
+import com.uas.xzc_productionline.util.HttpParams;
+import com.uas.xzc_productionline.util.VolleyRequest;
+import com.uas.xzc_productionline.view.ClearableEditText;
+
+public
+        /**
+         * Created by sw on 2024-12-31
+         */
+class ReleaseAlarmFragment extends BaseFragment{
+
+    private ClearableEditText cet_material_rack;
+    private Button bt_release_the_alarm;
+    private TextView tv_result;
+    private LinearLayout ll_result;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_release_aliarm;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle(getResources().getString(R.string.release_the_alarm));
+        cet_material_rack = root.findViewById(R.id.cet_material_rack);
+        bt_release_the_alarm = root.findViewById(R.id.bt_release_the_alarm);
+        tv_result = root.findViewById(R.id.tv_result);
+        ll_result = root.findViewById(R.id.ll_result);
+    }
+
+    @Override
+    protected void initEvents() {
+        //料架回车
+        CommonUtil.setEditorActionListener(cet_material_rack, new MyEditorActionListener() {
+            @Override
+            public void MyEditorAction(String text, int actionId, KeyEvent event) {
+                if (!text.isEmpty()&&!cet_material_rack.getText().toString().isEmpty()){
+                    materialRackCode();
+                }
+            }
+        });
+
+        bt_release_the_alarm.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                materialRackCode();
+            }
+        });
+    }
+
+    private void materialRackCode() {
+        String materialRack = cet_material_rack.getText().toString().trim();
+        if (TextUtils.isEmpty(materialRack)) {
+            CommonUtil.toastNoRepeat(mActivity, getResources().getString(R.string.Please_enter_the_material_rack));
+            cet_material_rack.requestFocus();
+            return;
+        }
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_RELEASE_ALARM)
+                .method(Request.Method.POST)
+                .addParam("shcode",materialRack)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+                org.json.JSONObject resultObject = new org.json.JSONObject(o.toString());
+                ll_result.setVisibility(View.VISIBLE);
+                if (resultObject.optBoolean("success")) {
+                    tv_result.setTextColor(getResources().getColor(R.color.blue));
+                    tv_result.setText(getResources().getText(R.string.release_the_alarm) + ":" + materialRack + getResources().getText(R.string.alarm_successful));
+                    cet_material_rack.setText("");
+                }else {
+                    tv_result.setTextColor(getResources().getColor(R.color.red));
+                    tv_result.setText(getResources().getText(R.string.release_the_alarm) + ":" + materialRack + getResources().getText(R.string.alarm_successful));
+                }
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+                cet_material_rack.setText(null);
+                cet_material_rack.requestFocus();
+                ll_result.setVisibility(View.VISIBLE);
+                tv_result.setTextColor(getResources().getColor(R.color.red));
+                tv_result.setText(failStr);
+            }
+        });
+    }
+
+    @Override
+    protected void initDatas() {
+
+    }
+
+    @Override
+    public boolean onKeyDown(int keyCode, KeyEvent event) {
+        return false;
+    }
+
+    @Override
+    public boolean onFragmentBackPressed() {
+        return false;
+    }
+
+    @Override
+    public void onHiddenChanged(boolean hidden) {
+        super.onHiddenChanged(hidden);
+        //        if (!hidden) {
+        //            FunctionActivity.setTitle(getResources().getString(R.string.free_listing));
+        //            ((FunctionActivity) getActivity()).setMoreBtnVisible(true);
+        //        }else {
+        //            ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+        //        }
+    }
+
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+        //        ((FunctionActivity) getActivity()).setMoreBtnVisible(false);
+    }
+
+
+}

+ 3 - 3
app/src/main/java/com/uas/xzc_productionline/fragment/SCSMTChangeFragment.java

@@ -280,7 +280,7 @@ public class SCSMTChangeFragment extends BaseFragment implements TextViewWithBut
 
                 if (!isExist) {
                     tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
-                    tvMsgNotice.setText("站位编号错误");
+                    tvMsgNotice.setText("站位编号错误:" + mCollectEditText.getText().toString().trim());
                     CommonUtil.makeNotice();
                     mCollectEditText.setText("");
                 }
@@ -289,7 +289,7 @@ public class SCSMTChangeFragment extends BaseFragment implements TextViewWithBut
             }
         } else {
             tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
-            tvMsgNotice.setText("站位编号错误");
+            tvMsgNotice.setText("站位编号错误:" + mCollectEditText.getText().toString().trim());
             CommonUtil.makeNotice();
             mCollectEditText.setText("");
         }
@@ -466,7 +466,7 @@ public class SCSMTChangeFragment extends BaseFragment implements TextViewWithBut
                 //如果不匹配
                 else {
                     title = "错误";
-                    content = getString(R.string.notice_smtchild_barcode);
+                    content = getString(R.string.notice_smtchild_barcode) + ": " + mCollectEditText.getText().toString().trim();
                     color = getResources().getColor(R.color.text_error);
                 }
             }

+ 12 - 8
app/src/main/java/com/uas/xzc_productionline/fragment/SCSMTCheckFragment.java

@@ -668,8 +668,9 @@ public class SCSMTCheckFragment extends BaseFragment implements View.OnClickList
 
                 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);
+                    String notice = "站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" + mNoticeStr;
+                    SpannableString spannableString;
+                    spannableString = CommonUtil.spanString(notice, mActivity, ("站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" ).length(), notice.length(), R.color.green);
                     tvMsgNotice.setText(spannableString);
                     CommonUtil.makeNotice();
                     mCollectEditText.setText("");
@@ -679,8 +680,9 @@ public class SCSMTCheckFragment extends BaseFragment implements View.OnClickList
             }
         } 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);
+            String notice = "站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" + mNoticeStr;
+            SpannableString spannableString;
+            spannableString = CommonUtil.spanString(notice, mActivity, ("站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" ).length(), notice.length(), R.color.green);
             tvMsgNotice.setText(spannableString);
             CommonUtil.makeNotice();
             mCollectEditText.setText("");
@@ -743,8 +745,9 @@ public class SCSMTCheckFragment extends BaseFragment implements View.OnClickList
 
                 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);
+                    String notice = "站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" + mNoticeStr;
+                    SpannableString spannableString;
+                    spannableString = CommonUtil.spanString(notice, mActivity, ("站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" ).length(), notice.length(), R.color.green);
                     tvMsgNotice.setText(spannableString);
                     CommonUtil.makeNotice();
                     mCollectEditText.setText("");
@@ -754,8 +757,9 @@ public class SCSMTCheckFragment extends BaseFragment implements View.OnClickList
             }
         } 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);
+            String notice = "站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" + mNoticeStr;
+            SpannableString spannableString;
+            spannableString = CommonUtil.spanString(notice, mActivity, ("站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" ).length(), notice.length(), R.color.green);
             tvMsgNotice.setText(spannableString);
             CommonUtil.makeNotice();
             mCollectEditText.setText("");

+ 7 - 5
app/src/main/java/com/uas/xzc_productionline/fragment/SCSMTInFragment.java

@@ -250,8 +250,9 @@ public class SCSMTInFragment extends BaseFragment implements View.OnClickListene
 
                 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);
+                    String notice = "站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" + mNoticeStr;
+                    SpannableString spannableString;
+                    spannableString = CommonUtil.spanString(notice, mActivity, ("站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" ).length(), notice.length(), R.color.green);
                     tvMsgNotice.setText(spannableString);
                     CommonUtil.makeNotice();
                     mCollectEditText.setText("");
@@ -261,8 +262,9 @@ public class SCSMTInFragment extends BaseFragment implements View.OnClickListene
             }
         } 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);
+            String notice = "站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" + mNoticeStr;
+            SpannableString spannableString;
+            spannableString = CommonUtil.spanString(notice, mActivity, ("站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" ).length(), notice.length(), R.color.green);
             tvMsgNotice.setText(spannableString);
             CommonUtil.makeNotice();
             mCollectEditText.setText("");
@@ -550,7 +552,7 @@ public class SCSMTInFragment extends BaseFragment implements View.OnClickListene
                 else {
                     Log.e("SMTCHILD", "不匹配");
                     title = "错误";
-                    content = getString(R.string.notice_smtchild_barcode);
+                    content = getString(R.string.notice_smtchild_barcode) + ": " + mCollectEditText.getText().toString().trim();
                     color = getResources().getColor(R.color.text_error);
                 }
             }

+ 12 - 8
app/src/main/java/com/uas/xzc_productionline/fragment/SCSMTInspectionFragment.java

@@ -668,8 +668,9 @@ public class SCSMTInspectionFragment extends BaseFragment implements View.OnClic
 
                 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);
+                    String notice = "站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" + mNoticeStr;
+                    SpannableString spannableString;
+                    spannableString = CommonUtil.spanString(notice, mActivity, ("站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" ).length(), notice.length(), R.color.green);
                     tvMsgNotice.setText(spannableString);
                     CommonUtil.makeNotice();
                     mCollectEditText.setText("");
@@ -679,8 +680,9 @@ public class SCSMTInspectionFragment extends BaseFragment implements View.OnClic
             }
         } 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);
+            String notice = "站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" + mNoticeStr;
+            SpannableString spannableString;
+            spannableString = CommonUtil.spanString(notice, mActivity, ("站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" ).length(), notice.length(), R.color.green);
             tvMsgNotice.setText(spannableString);
             CommonUtil.makeNotice();
             mCollectEditText.setText("");
@@ -743,8 +745,9 @@ public class SCSMTInspectionFragment extends BaseFragment implements View.OnClic
 
                 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);
+                    String notice = "站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" + mNoticeStr;
+                    SpannableString spannableString;
+                    spannableString = CommonUtil.spanString(notice, mActivity, ("站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" ).length(), notice.length(), R.color.green);
                     tvMsgNotice.setText(spannableString);
                     CommonUtil.makeNotice();
                     mCollectEditText.setText("");
@@ -754,8 +757,9 @@ public class SCSMTInspectionFragment extends BaseFragment implements View.OnClic
             }
         } 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);
+            String notice = "站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" + mNoticeStr;
+            SpannableString spannableString;
+            spannableString = CommonUtil.spanString(notice, mActivity, ("站位编号错误: " + mCollectEditText.getText().toString().trim() + "\n" ).length(), notice.length(), R.color.green);
             tvMsgNotice.setText(spannableString);
             CommonUtil.makeNotice();
             mCollectEditText.setText("");

+ 75 - 9
app/src/main/java/com/uas/xzc_productionline/fragment/SCSMTJointFragment.java

@@ -67,6 +67,7 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
     private String mSmtLocationCache;
     private SmtDslBean mSmtDslBean = new SmtDslBean();
     private StringRequest mStringRequest;
+    private String dateBarcode = "";
 
     @Override
     protected int getLayout() {
@@ -126,6 +127,59 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
 
     }
 
+    private void getBarcodedev(String barcode) {
+        progressDialog.show();
+        String url = GloableParams.ADDRESS_GET_BARCODE_DEV + "?barcode=" + barcode
+                + "&dsl_linecode=" + mLineInfoBean.getDL_LINECODE()
+                + "&dsl_table=" + mLineInfoBean.getDL_TABLE();
+//        try {
+//            url = GloableParams.ADDRESS_SMT_JOIN_FORCAST_DATAGET
+//                    + "?dsl_location=" + URLEncoder.encode(collect, "utf-8")
+//                    + "&dsl_linecode=" + URLEncoder.encode(mLineInfoBean.getDL_LINECODE(), "utf-8")
+//                    + "&dsl_table=" + URLEncoder.encode(mLineInfoBean.getDL_TABLE(), "utf-8");
+//        } catch (Exception e) {
+//
+//        }
+        PdaApplication.mRequestQueue.cancelAll(TAG + GloableParams.ADDRESS_GET_BARCODE_DEV);
+        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);
+                            String dataObject = resultObject.getString("data");
+                            if (dataObject != null) {
+                                dateBarcode = dataObject;
+                                confirmEvent(dateBarcode);
+                            }
+                        } 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);
+                        tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
+                        tvMsgNotice.setText(errorToast);
+                        mLocationTextView.setText(null);
+                    }
+                }) {
+            @Override
+            public Map<String, String> getHeaders() throws AuthFailureError {
+                return VolleyUtil.getVolleyUtil().setCookies();
+            }
+        };
+
+        mStringRequest.setTag(TAG + GloableParams.ADDRESS_GET_BARCODE_DEV);
+        PdaApplication.mRequestQueue.add(mStringRequest);
+    }
+
     @Override
     protected void initEvents() {
         tvLocation.setTvHintHelper(this);
@@ -140,7 +194,11 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
                     if (actionId == EditorInfo.IME_ACTION_DONE
                             || actionId == EditorInfo.IME_ACTION_SEND
                             || (event != null && event.getAction() == KeyEvent.ACTION_DOWN && event.getKeyCode() == KeyEvent.KEYCODE_ENTER)) {
-                        confirmEvent(collect);
+                        if (TextUtils.isEmpty(mLocationTextView.getText().toString().trim())) {
+                            getBarcodedev(collect);
+                        }else {
+                            confirmEvent(collect);
+                        }
                         return true;
                     }
                 }
@@ -196,6 +254,7 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
                     if (collect.equals(JsonUtils.optStringNotNull(locationObject, "PSL_LOCATION"))) {
                         isExist = true;
                         mLocationTextView.setText(collect);
+                        collect = mCollectEditText.getText().toString().trim();
                         mCollectEditText.setText("");
 
                         String psl_prodcode = JsonUtils.optStringNotNull(locationObject, "PSL_PRODCODE");
@@ -228,7 +287,6 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
 
                         tvMsgNotice.setText("");
                         mCollectEditText.setHint(COLLECT_OLD_PRODCODE);
-
                         joinForcast(collect);
                         break;
                     }
@@ -236,7 +294,7 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
 
                 if (!isExist) {
                     tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
-                    tvMsgNotice.setText("站位编号错误");
+                    tvMsgNotice.setText("站位编号错误:" + mCollectEditText.getText().toString().trim());
                     CommonUtil.makeNotice();
                     mCollectEditText.setText("");
                 }
@@ -245,7 +303,7 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
             }
         } else {
             tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
-            tvMsgNotice.setText("站位编号错误");
+            tvMsgNotice.setText("站位编号错误:" + mCollectEditText.getText().toString().trim());
             CommonUtil.makeNotice();
             mCollectEditText.setText("");
         }
@@ -284,12 +342,20 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
                                     mCollectEditText.requestFocus();
                                     mCollectEditText.setSelection(mCollectEditText.getText().toString().length());
                                     tvMsgNotice.setText("请采集原物料号:" + code);
-                                    confirmEvent(mCollectEditText.getText().toString().trim());
+                                    if (!TextUtils.isEmpty(dateBarcode)) {
+                                        confirmEvent(dateBarcode);
+                                    }else {
+                                        confirmEvent(mCollectEditText.getText().toString().trim());
+                                    }
                                 } else if ("barcode".equals(type)) {
                                     mCollectEditText.setText(code);
                                     mCollectEditText.requestFocus();
                                     mCollectEditText.setSelection(mCollectEditText.getText().toString().length());
-                                    confirmEvent(mCollectEditText.getText().toString().trim());
+                                    if (!TextUtils.isEmpty(dateBarcode)) {
+                                        confirmEvent(dateBarcode);
+                                    }else {
+                                        confirmEvent(mCollectEditText.getText().toString().trim());
+                                    }
                                     tvMsgNotice.setText("请采集原料卷号:" + code);
                                 }
                             }
@@ -443,7 +509,7 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
 
                 if (!isExist) {
                     tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
-                    tvMsgNotice.setText("站位编号错误");
+                    tvMsgNotice.setText("站位编号错误:" + mCollectEditText.getText().toString().trim());
                     CommonUtil.makeNotice();
                     mCollectEditText.setText("");
                 }
@@ -452,7 +518,7 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
             }
         } else {
             tvMsgNotice.setTextColor(getResources().getColor(R.color.red));
-            tvMsgNotice.setText("站位编号错误");
+            tvMsgNotice.setText("站位编号错误:" + mCollectEditText.getText().toString().trim());
             CommonUtil.makeNotice();
             mCollectEditText.setText("");
         }
@@ -632,7 +698,7 @@ public class SCSMTJointFragment extends BaseFragment implements View.OnClickList
                 else {
                     Log.e("SMTCHILD", "不匹配");
                     title = "错误";
-                    content = getString(R.string.notice_smtchild_barcode);
+                    content = getString(R.string.notice_smtchild_barcode) + ": " + mCollectEditText.getText().toString().trim();
                     color = getResources().getColor(R.color.text_error);
                 }
             }

+ 221 - 0
app/src/main/java/com/uas/xzc_productionline/fragment/VersionUpgradeFragment.java

@@ -0,0 +1,221 @@
+package com.uas.xzc_productionline.fragment;
+
+import android.content.Intent;
+import android.net.Uri;
+import android.os.Build;
+import android.os.Handler;
+import android.os.Message;
+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 com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.android.volley.Request;
+import com.uas.xzc_productionline.R;
+import com.uas.xzc_productionline.global.GloableParams;
+import com.uas.xzc_productionline.util.AndroidUtil;
+import com.uas.xzc_productionline.util.CommonUtil;
+import com.uas.xzc_productionline.util.Constants;
+import com.uas.xzc_productionline.util.FastjsonUtil;
+import com.uas.xzc_productionline.util.FileUtils;
+import com.uas.xzc_productionline.util.HttpCallback;
+import com.uas.xzc_productionline.util.HttpParams;
+import com.uas.xzc_productionline.util.VolleyRequest;
+import com.uas.xzc_productionline.util.download.ProgressDownloader;
+import com.uas.xzc_productionline.util.download.ProgressResponseBody;
+import com.uas.xzc_productionline.view.business.CommonProgressPop;
+
+import java.io.File;
+import java.io.IOException;
+
+import static com.uas.xzc_productionline.util.Constants.CONSTANT.APK_FILE_NAME;
+import static com.uas.xzc_productionline.util.Constants.CONSTANT.APK_FILE_PATH;
+
+
+/**
+ * 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;
+
+    @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(APK_FILE_PATH);
+                if (!directory.exists() && !directory.isDirectory()) {
+                    boolean mkdirs = directory.mkdirs();
+                } else {
+                    FileUtils.delAllFile(APK_FILE_PATH);
+                }
+                file = new File(APK_FILE_PATH, 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.download(0L);
+            }
+        });
+    }
+
+    @Override
+    protected void initDatas() {
+        mOldVersionTv.setText(AndroidUtil.getVersionName(mActivity));
+
+        getNewVersionMsg();
+    }
+
+    private void getNewVersionMsg() {
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_OUTMATERIAL_GETPDAVERSION)
+                .method(Request.Method.GET)
+                .addParam("code", "UAS_SMART")
+                .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(APK_FILE_PATH, APK_FILE_NAME);
+                        Intent intent = new Intent(Intent.ACTION_VIEW);
+                        if (Build.VERSION.SDK_INT >= 24) {
+                            Uri apkUri = FileProvider.getUriForFile(mActivity,
+                                    "com.uas.xzc_productionline", apk);
+                            intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+                            intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
+                            intent.setDataAndType(apkUri, "application/vnd.android.package-archive");
+                        } else {
+                            intent.setDataAndType(Uri.fromFile(apk), "application/vnd.android.package-archive");
+                            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
+                        }
+                        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;
+    }
+}

+ 66 - 7
app/src/main/java/com/uas/xzc_productionline/global/GloableParams.java

@@ -233,6 +233,17 @@ public class GloableParams {
     public static String ADDRESS_SMT_DEALLPOSITIONBARCODE;
     public static String ADDRESS_SMT_MAKESOURSUMVIEW;
 
+    public static String ADDRESS_CHECK_SHELF;    //自由上架料号enter
+    public static String ADDRESS_FREE_SMART_START;    //自由上架 条码号enter/上架
+    public static String ADDRESS_FREE_SMART_END;    //自由上架 结束上架
+
+    public static String ADDRESS_COMMON_GETLOCATIONPROD;
+    public static String ADDRESS_OUTMATERIAL_GETPDAVERSION;       //更新app接口
+    public static String ADDRESS_COMMON_DOWNLOADBYID;       //更新app下载路径
+
+    public static String ADDRESS_RELEASE_ALARM;    // 解除报警
+
+    public static String ADDRESS_GET_BARCODE_DEV;
 
     //连接服务器请求地址
     private static final String ADDRESSTAIL_CONNECT_SERVER = "/api/pda/getAllMasters.action";
@@ -641,6 +652,25 @@ public class GloableParams {
 
     private static String ADDRESSTAIL_SMT_MAKESOURSUMVIEW = "/api/pda/smt/makeSoursumView.action";
 
+    //料架ENTER事件
+    private static final String ADDRESSTAIL_CHECK_SHELF = "/api/pda/transfer/checkShelf.action";
+    //条码号enter/上架按钮
+    private static final String ADDRESSTAIL_FREE_SMART_START = "/api/pda/transfer/freeSmartStart.action";
+    //结束上架
+    private static final String ADDRESSTAIL_FREE_SMART_END = "/api/pda/transfer/freeSmartEnd.action";
+
+    private static final String ADDRESSTAIL_PAD_GETLOCATIONPROD = "/api/pda/transfer/getLocationProd.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 ADDRESSAIL_RELEASE_ALARM = "/api/pda/transfer/releaseAlarm.action";
+
+    private static final String ADDRESSAIL_GET_BARCODE_DEV = "/api/pda/smt/getBarcodedev.action";
+
     /**
      * 设置页面
      */
@@ -661,9 +691,11 @@ 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_SMART_SHELVES = "自由上架";
     public static final String GRIDNAME_SETTING = "设置";
     public static final String GRIDNAME_MODIFY_QUANTITY2 = "条码数量修改";
     public static final String GRIDNAME_POST_STOCK = "岗位备料";
+    public static final String LIGHT_RELEASE_THE_ALARM = "解除报警";
     public static String[] indexMainGridNames = {
 //            GRIDNAME_INOUT_STORAGE,
 //            GRIDNAME_SHOPCONTENT,
@@ -673,7 +705,10 @@ public class GloableParams {
 //            GRIDNAME_MSD_MANAGER,
             GRIDNAME_SMTMATERIAL_ADD,
 //            GRIDNAME_SOLDER_MANAGER,
-            GRIDNAME_SETTING};
+            GRIDNAME_SMART_SHELVES,
+            LIGHT_RELEASE_THE_ALARM,
+            GRIDNAME_SETTING
+    };
     public static int[] indexMainGridImgs = {
 //            R.drawable.mainmenu_outinstorage,
             R.drawable.mainmenu_workhousemanager,
@@ -682,7 +717,10 @@ public class GloableParams {
 //            R.drawable.storage_msd_manager,
             R.drawable.ic_smt_feed,
 //            R.drawable.ic_solder_manage,
-            R.drawable.mainmenu_usersetting};
+            R.drawable.iv_shelves,
+            R.drawable.jiechubaojing,
+            R.drawable.mainmenu_usersetting,
+    };
     //INDEX:出入库管理Index
     public static final String GRIDNAME_CODEBAR_COLLECT = "入库";
     public static final String GRIDNAME_CODEBAR_VERIFY = "出库";
@@ -712,12 +750,22 @@ public class GloableParams {
     public static final String GRIDNAME_STOCK_BARCODE = "补贴库存条码";
     public static final String GRIDNAME_WORK_INVENTORY = "盘点作业";
     public static final String GRIDNAME_MODIFY_QUANTITY = "条码数量修改";
-    public static final String[] storageGridNames = {GRIDNAME_GOOD_SEARCH, GRIDNAME_BATCH_OPRATION,
-            GRIDNAME_STORAGE_TRANSFER, GRIDNAME_STOCK_BARCODE,
-            GRIDNAME_WORK_INVENTORY, GRIDNAME_MODIFY_QUANTITY};
+//    public static final String LIGHT_RELEASE_THE_ALARM = "解除报警";
+    public static final String[] storageGridNames = {GRIDNAME_GOOD_SEARCH,
+            GRIDNAME_BATCH_OPRATION,
+            GRIDNAME_STORAGE_TRANSFER,
+            GRIDNAME_STOCK_BARCODE,
+            GRIDNAME_WORK_INVENTORY,
+            GRIDNAME_MODIFY_QUANTITY,
+//            LIGHT_RELEASE_THE_ALARM
+    };
     public static final int[] storageGridImgs = {R.drawable.storage_good_search,
-            R.drawable.storage_bach_operation, R.drawable.storage_transfer, R.drawable.ic_stock_barcode,
-            R.drawable.storage_work_inventory, R.drawable.ic_modify_quantity};
+            R.drawable.storage_bach_operation, R.drawable.storage_transfer,
+            R.drawable.ic_stock_barcode,
+            R.drawable.storage_work_inventory,
+            R.drawable.ic_modify_quantity,
+//            R.drawable.jiechubaojing
+    };
     //DETAIL:搜索备料单号,下拉列表
     public static final String SPINNER_PREPARE_SEARCH = "搜索备料单号";
     public static final String SPINNER_MAKECODE_SEARCH = "搜索制造单号";
@@ -1064,6 +1112,17 @@ public class GloableParams {
         GloableParams.ADDRESS_SMT_DEALLPOSITIONBARCODE = uriHead + GloableParams.ADDRESSTAIL_SMT_DEALLPOSITIONBARCODE;
         GloableParams.ADDRESS_SMT_MAKESOURSUMVIEW = uriHead + GloableParams.ADDRESSTAIL_SMT_MAKESOURSUMVIEW;
 
+        GloableParams.ADDRESS_CHECK_SHELF = uriHead + GloableParams.ADDRESSTAIL_CHECK_SHELF;
+        GloableParams.ADDRESS_FREE_SMART_START = uriHead + GloableParams.ADDRESSTAIL_FREE_SMART_START;
+        GloableParams.ADDRESS_FREE_SMART_END = uriHead + GloableParams.ADDRESSTAIL_FREE_SMART_END;
+
+        GloableParams.ADDRESS_COMMON_GETLOCATIONPROD = uriHead + GloableParams.ADDRESSTAIL_PAD_GETLOCATIONPROD;
+
+        GloableParams.ADDRESS_OUTMATERIAL_GETPDAVERSION = uriHead + GloableParams.ADDRESSTAIL_OUTMATERIAL_GETPDAVERSION;
+        GloableParams.ADDRESS_COMMON_DOWNLOADBYID = uriHead + GloableParams.ADDRESSTAIL_COMMON_DOWNLOADBYID;
+
+        GloableParams.ADDRESS_RELEASE_ALARM = uriHead + GloableParams.ADDRESSAIL_RELEASE_ALARM;
 
+        GloableParams.ADDRESS_GET_BARCODE_DEV = uriHead + GloableParams.ADDRESSAIL_GET_BARCODE_DEV;
     }
 }

+ 2 - 1
app/src/main/java/com/uas/xzc_productionline/tools/SharedPreUtil.java

@@ -20,7 +20,8 @@ public class SharedPreUtil {
     public static final String KEY_SCMAKE_PREPARE = "key_scmake_prepare";
     //飞达上料,备料单缓存
     public static final String KEY_SCMAKE_FEEDER = "key_scmake_feeder";
-
+    //账号名称
+    public static final String KEY_USERNAME = "username";
 
     //清除IP和PORT的所有缓存
     public static void removeAll(Context pContext) {

+ 9 - 0
app/src/main/java/com/uas/xzc_productionline/util/Constants.java

@@ -12,6 +12,8 @@ public interface Constants {
         String PRINT_SHARE_PACKAGE = "com.dynamixsoftware.printershare";
         String PRINT_FILE_NAME = "print.pdf";
         String PRINT_FILE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/PDA_WP/printFile";
+        String APK_FILE_PATH = Environment.getExternalStorageDirectory().getAbsolutePath() + "/xzc_productionline/apk";
+        String APK_FILE_NAME = "yitao_newelectronic.apk";
 
         String APP_ICON_URL = "http://zhbj.qianlong.com/logo.png";
 
@@ -33,6 +35,13 @@ 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;
     }
 
     /**

+ 231 - 0
app/src/main/java/com/uas/xzc_productionline/util/CrashHandler.java

@@ -0,0 +1,231 @@
+package com.uas.xzc_productionline.util;
+
+import android.content.Context;
+import android.content.pm.PackageInfo;
+import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
+import android.os.Build;
+import android.os.Environment;
+import android.os.Looper;
+import android.util.Log;
+
+import com.uas.xzc_productionline.application.PdaApplication;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.io.Writer;
+import java.lang.Thread.UncaughtExceptionHandler;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+
+
+public class CrashHandler implements UncaughtExceptionHandler {
+
+    public static final String TAG = "CrashHandler";
+
+    //系统默认的UncaughtException处理类
+    private UncaughtExceptionHandler mDefaultHandler;
+    //CrashHandler实例
+    private static CrashHandler INSTANCE = new CrashHandler();
+    //程序的Context对象
+    private Context mContext;
+    //用来存储设备信息和异常信息
+    private Map<String, String> infos = new HashMap<String, String>();
+
+    /** 保证只有一个CrashHandler实例 */
+    private CrashHandler() {
+    }
+
+    private DateFormat formatter = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
+    /** 获取CrashHandler实例 ,单例模式 */
+    public static CrashHandler getInstance() {
+        return INSTANCE;
+    }
+
+    /**
+     * 初始化
+     * @param context
+     */
+    public void init(Context context) {
+        mContext = context;
+        //获取系统默认的UncaughtException处理器
+        mDefaultHandler = Thread.getDefaultUncaughtExceptionHandler();
+        //设置该CrashHandler为程序的默认处理器
+        Thread.setDefaultUncaughtExceptionHandler(this);
+    }
+
+    /**
+     * 当UncaughtException发生时会转入该函数来处理
+     */
+    @Override
+    public void uncaughtException(Thread thread, Throwable ex) {
+        if (!handleException(ex) && mDefaultHandler != null) {
+            //如果用户没有处理则让系统默认的异常处理器来处理
+            mDefaultHandler.uncaughtException(thread, ex);
+        } else {
+            try {
+                Thread.sleep(3000);
+            } catch (InterruptedException e) {
+                Log.e(TAG, "error : ", e);
+            }
+            //退出程序
+            android.os.Process.killProcess(android.os.Process.myPid());
+            System.exit(1);
+        }
+    }
+
+    /**
+     * 自定义错误处理,收集错误信息 发送错误报告等操作均在此完成.
+     *
+     * @param ex
+     * @return true:如果处理了该异常信息;否则返回false.
+     */
+    private boolean handleException(Throwable ex) {
+        if (ex == null) {
+            return false;
+        }
+        final String msg = ex.getLocalizedMessage();
+        //使用Toast来显示异常信息
+        new Thread() {
+            @Override
+            public void run() {
+                Looper.prepare();
+                //MToast.makeText(msg).show();
+                Looper.loop();
+            }
+        }.start();
+
+//        MAppData.GetInstance().setBooleanData("LoginAuto", false);
+//        if(!MAppData.GetInstance().isXG()) {
+//            Intent intent_a = new Intent(mContext, MService.class);
+//            mContext.stopService(intent_a);
+//        }
+
+        //收集设备参数信息
+//        ExceptionError(ex);     //提交到服务器
+        saveCrashInfo2File(ex);
+        collectDeviceInfo(mContext);
+        return true;
+    }
+
+    /**
+     * 收集设备参数信息
+     * @param ctx
+     */
+    public void collectDeviceInfo(Context ctx) {
+        try {
+            PackageManager pm = ctx.getPackageManager();
+            PackageInfo pi = pm.getPackageInfo(ctx.getPackageName(), PackageManager.GET_ACTIVITIES);
+            if (pi != null) {
+                String versionName = pi.versionName == null ? "null" : pi.versionName;
+                String versionCode = pi.versionCode + "";
+                infos.put("versionName", versionName);
+                infos.put("versionCode", versionCode);
+            }
+        } catch (NameNotFoundException e) {
+            Log.e(TAG, "an error occured when collect package info", e);
+        }
+        java.lang.reflect.Field[] fields = Build.class.getDeclaredFields();
+        for (java.lang.reflect.Field field : fields) {
+            try {
+                field.setAccessible(true);
+                infos.put(field.getName(), field.get(null).toString());
+                Log.d(TAG, field.getName() + " : " + field.get(null));
+            } catch (Exception e) {
+                Log.e(TAG, "an error occured when collect crash info", e);
+            }
+        }
+    }
+
+    private String saveCrashInfo2File(Throwable ex) {
+        StringBuffer sb = new StringBuffer();
+//        for (Map.Entry<String, String> entry : infos.entrySet()) {
+//            String key = entry.getKey();
+//            String value = entry.getValue();
+//            sb.append(key + "=" + value + "\n");
+//        }
+
+        Writer writer = new StringWriter();
+        PrintWriter printWriter = new PrintWriter(writer);
+        ex.printStackTrace(printWriter);
+        Throwable cause = ex.getCause();
+        while (cause != null) {
+            Log.i("liuyou", "cause:"+cause.toString()+"--");
+            cause.printStackTrace(printWriter);
+            cause = cause.getCause();
+        }
+        printWriter.close();
+        String result = writer.toString();
+        Log.i("liuyou", "result:"+result);
+        sb.append(result);
+        try {
+            long timestamp = System.currentTimeMillis();
+            String time = formatter.format(new Date());
+            String fileName = "crash-" + time + "-" + timestamp + ".log";
+            if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
+                String path = "/sdcard/Log_"+mContext.getPackageManager().getPackageInfo(mContext.getPackageName(), 0).packageName+"/";
+                File dir = new File(path);
+                if (!dir.exists()) {
+                    dir.mkdirs();
+                }
+                FileOutputStream fos = new FileOutputStream(path + fileName);
+                fos.write(sb.toString().getBytes());
+                fos.close();
+            }
+            return fileName;
+        } catch (Exception e) {
+            Log.e(TAG, "an error occured while writing file...", e);
+        }
+        return null;
+    }
+
+    private final int _WriteLog  = 0;
+    private void ExceptionError(Throwable ex) {
+        StringBuffer sb = new StringBuffer();
+        Writer writer = new StringWriter();
+        PrintWriter printWriter = new PrintWriter(writer);
+        ex.printStackTrace(printWriter);
+        Throwable cause = ex.getCause();
+        while (cause != null) {
+            Log.i("liuyou", "cause:" + cause.toString() + "--");
+            cause.printStackTrace(printWriter);
+            cause = cause.getCause();
+        }
+        printWriter.close();
+        String result = writer.toString();
+        sb.append(result);
+        Log.e("aaa", "收集的异常信息为:" + sb.toString());
+//        WebService ws = new WebService(mContext, _WriteLog, true, "WriteLog");
+//        HashMap<String, Object> property = new HashMap<String, Object>();
+//        property.put("loginName", MAppData.GetInstance().getStringData("LoginName"));
+//        property.put("password", MAppData.GetInstance().getStringData("LoginPwd"));
+//        property.put("logContent", Contents.APPName + "-" + getVersion() + " " + sb.toString());
+//        ws.addWebServiceListener(new WebServiceListener() {
+//
+//            @Override
+//            public void onWebServiceReceive(String method, int id, String result) {
+//                // TODO Auto-generated method stub
+//                android.os.Process.killProcess(android.os.Process.myPid());
+//                System.exit(1);
+//            }
+//        });
+//        ws.SyncGet(property);
+    }
+
+    public String getVersion() {
+        try {
+            PackageManager manager = PdaApplication.getInstance().getContext().getPackageManager();
+            PackageInfo info = manager.getPackageInfo(PdaApplication.getInstance().getContext().getPackageName(), 0);
+            String version = info.versionName;
+            return  version;
+        } catch (Exception e) {
+            e.printStackTrace();
+            return "";
+        }
+    }
+}

+ 149 - 0
app/src/main/java/com/uas/xzc_productionline/util/download/ProgressDownloader.java

@@ -0,0 +1,149 @@
+package com.uas.xzc_productionline.util.download;
+
+
+import com.uas.xzc_productionline.application.PdaApplication;
+import com.uas.xzc_productionline.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/xzc_productionline/util/download/ProgressResponseBody.java

@@ -0,0 +1,74 @@
+package com.uas.xzc_productionline.util.download;
+
+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);
+    }
+
+}

+ 71 - 0
app/src/main/java/com/uas/xzc_productionline/view/business/CommonProgressPop.java

@@ -0,0 +1,71 @@
+package com.uas.xzc_productionline.view.business;
+
+import android.content.Context;
+import android.view.View;
+import android.view.animation.Animation;
+import android.widget.ProgressBar;
+import android.widget.TextView;
+import com.uas.xzc_productionline.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);
+    }
+
+}

BIN
app/src/main/res/drawable-xhdpi/iv_shelves.png


BIN
app/src/main/res/drawable-xhdpi/jiechubaojing.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>

+ 387 - 0
app/src/main/res/layout/fragment_free_listing.xml

@@ -0,0 +1,387 @@
+<?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">
+
+    <LinearLayout
+        android:orientation="vertical"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+
+        <CheckBox
+            android:id="@+id/cb_free_listing"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+
+            android:layout_marginTop="5dp"
+            android:layout_marginBottom="5dp"
+            android:text="@string/continuously_listed"
+            android:textSize="16sp"
+            />
+
+        <LinearLayout
+            android:layout_marginTop="5dp"
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <TextView
+                android:id="@+id/material_in_collect_location_tv"
+                android:layout_width="70dp"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:padding="10dp"
+                android:text="@string/material_rack"
+                android:textColor="@color/body_text_1"
+                android:textSize="16sp"  />
+
+            <com.uas.xzc_productionline.view.ClearableEditText
+                android:id="@+id/cet_material_rack"
+                style="@style/EditTextStyle"
+                android:layout_width="0dp"
+                android:layout_weight="1"
+                android:hint="@string/Please_enter_the_material_rack"
+                android:background="@drawable/shape_msg_block"
+                android:lines="1"
+                android:maxLines="1"
+                android:textColor="@color/black"
+                android:singleLine="true"/>
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_marginTop="@dimen/dp_10"
+            android:orientation="horizontal"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content">
+
+            <TextView
+                android:layout_width="70dp"
+                android:layout_height="match_parent"
+                android:gravity="center"
+                android:padding="6dp"
+                android:text="@string/string_barcode"
+                android:textColor="@color/body_text_1"
+                android:textSize="16sp" />
+
+            <com.uas.xzc_productionline.view.ClearableEditText
+                android:id="@+id/barcode_info_collect_barcode_et"
+                    style="@style/EditTextStyle"
+                    android:background="@drawable/shape_msg_block"
+                    android:layout_width="0dp"
+                    android:layout_weight="1"
+                    android:hint="@string/please_collect_barcode"
+                    android:focusable="true"
+                    android:focusableInTouchMode="true"
+                    android:imeOptions="actionSend"
+                    android:textColor="@color/black" />
+            </LinearLayout>
+
+    </LinearLayout>
+    <LinearLayout
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content">
+        <Button
+            android:id="@+id/barcode_info_collect_confirm_btn"
+            style="@style/ButtonStyle"
+            android:layout_marginTop="16dp"
+            android:text="上架"
+            android:layout_weight="1"/>
+        <Button
+            android:id="@+id/btn_kill"
+            style="@style/ButtonStyle"
+            android:layout_marginTop="16dp"
+            android:text="结束上架"
+            android:layout_weight="1"/>
+
+    </LinearLayout>
+
+    <LinearLayout
+        tools:visibility="visible"
+        android:visibility="gone"
+        android:id="@+id/ll_shangjia"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:layout_marginTop="10dp"
+        android:background="@drawable/shape_msg_block"
+        android:padding="10dp"
+        >
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="2dp"
+            >
+
+            <TextView
+                android:id="@+id/tv_material_rack"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/material_rack"
+                android:textSize="12sp"
+                />
+
+            <TextView
+                android:id="@+id/tv_material_rack_flag"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                android:text=":"
+                android:layout_toEndOf="@+id/tv_material_rack"
+                />
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                android:layout_toEndOf="@+id/tv_material_rack_flag"
+               android:id="@+id/tv_liaojia"
+                />
+
+            <TextView
+                android:layout_toStartOf="@+id/tv_barcode_tailback"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/text_barcode_tailback"
+                android:textSize="12sp"
+                />
+
+            <TextView
+                android:id="@+id/tv_barcode_tailback"
+                android:layout_alignParentEnd="true"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                />
+
+        </RelativeLayout>
+
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="2dp"
+            >
+
+            <TextView
+                android:id="@+id/tv_procode_tailback"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/text_procode_tailback"
+                android:textSize="12sp"
+                />
+
+            <TextView
+                android:id="@+id/tv_liaohao"
+                android:layout_toEndOf="@+id/tv_procode_tailback"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                />
+
+            <TextView
+                android:layout_toStartOf="@+id/tv_barremain"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/text_barremain"
+                android:textSize="12sp"
+                />
+
+            <TextView
+                android:id="@+id/tv_barremain"
+                android:layout_alignParentEnd="true"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                />
+
+        </RelativeLayout>
+
+        <LinearLayout
+            android:layout_marginTop="2dp"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            >
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/pr_detail"
+                android:textSize="12sp"
+                />
+
+            <TextView
+                android:id="@+id/tv_name"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                />
+
+        </LinearLayout>
+
+        <LinearLayout
+            android:layout_marginTop="2dp"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            >
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/pr_spec"
+                android:textSize="12sp"
+                />
+
+            <TextView
+                android:id="@+id/tv_guige"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                />
+
+        </LinearLayout>
+
+        <RelativeLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="2dp"
+            >
+
+            <TextView
+                android:id="@+id/tv_default_warehouse_for_materials"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/Default_warehouse_for_materials"
+                android:textSize="12sp"
+                />
+
+            <TextView
+                android:id="@+id/tv_default_warehouse_for_materials_flag"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                android:text=":"
+                android:layout_toEndOf="@+id/tv_default_warehouse_for_materials"
+                />
+
+            <TextView
+                android:id="@+id/tv_wuliaomorencangku"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                android:layout_toEndOf="@+id/tv_default_warehouse_for_materials_flag"
+                />
+
+            <TextView
+                android:layout_toStartOf="@+id/tv_current_position_flag"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/Current_position"
+                android:textSize="12sp"
+                />
+
+            <TextView
+                android:id="@+id/tv_current_position_flag"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                android:text=":"
+                android:layout_toStartOf="@+id/tv_current_position"
+                />
+
+            <TextView
+                android:id="@+id/tv_current_position"
+                android:layout_alignParentEnd="true"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                />
+
+        </RelativeLayout>
+
+        <LinearLayout
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:orientation="horizontal"
+            android:layout_marginTop="2dp"
+            >
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:text="@string/aready_stored_in_storage_space"
+                android:textSize="12sp"
+                />
+
+
+            <TextView
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                android:text=":"
+                />
+
+            <TextView
+                android:id="@+id/tv_aready_stored_in_storage_space"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:textSize="12sp"
+                />
+
+        </LinearLayout>
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/ll_end_data"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:orientation="vertical"
+        android:layout_marginTop="@dimen/spacing_big"
+        android:background="@drawable/shape_msg_block"
+        android:visibility="gone"
+        tools:visibility="visible"
+        android:padding="10dp"
+        >
+
+        <TextView
+            android:id="@+id/tv_end_data"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:visibility="gone"
+            tools:visibility="visible"
+            tools:text="料架:xxxx,条码:xxxx 结束上架成功" />
+
+    </LinearLayout>
+
+
+    <LinearLayout
+        android:id="@+id/ll_jiaoyan"
+        android:orientation="vertical"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="@dimen/spacing_big"
+        android:background="@drawable/shape_msg_block"
+        android:visibility="gone"
+        tools:visibility="visible"
+        android:padding="10dp">
+
+        <TextView
+            android:id="@+id/barcode_info_collect_result_tv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:visibility="gone"
+            tools:visibility="visible"
+            tools:text="采集成功,条码:786528238;数量:2;料号:1209837;名称规格:瓶子" />
+
+
+    </LinearLayout>
+
+
+</LinearLayout>

+ 16 - 0
app/src/main/res/layout/fragment_position_inquiry.xml

@@ -0,0 +1,16 @@
+<?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">
+
+
+    <android.support.v7.widget.RecyclerView
+        android:id="@+id/rv_data"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_weight="1" />
+
+</LinearLayout>

+ 94 - 0
app/src/main/res/layout/fragment_release_aliarm.xml

@@ -0,0 +1,94 @@
+<?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:orientation="vertical"
+    android:layout_width="match_parent"
+    android:layout_height="match_parent"
+    >
+
+    <LinearLayout
+        android:layout_marginTop="35dp"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="30dp"
+        android:layout_marginEnd="30dp"
+        >
+
+        <TextView
+            android:id="@+id/material_in_collect_location_tv"
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:padding="10dp"
+            android:text="@string/material_rack"
+            android:textColor="@color/red"
+            android:textSize="16sp"  />
+
+        <com.uas.xzc_productionline.view.ClearableEditText
+            android:id="@+id/cet_material_rack"
+            style="@style/EditTextStyle"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:hint="@string/Please_enter_the_material_rack"
+            android:background="@drawable/shape_msg_block"
+            android:lines="1"
+            android:maxLines="1"
+            android:textColor="@color/black"
+            android:singleLine="true"/>
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_marginTop="30dp"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="50dp"
+        android:layout_marginStart="15dp"
+        android:layout_marginEnd="15dp"
+        >
+
+        <Button
+            android:id="@+id/bt_release_the_alarm"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:textSize="16sp"
+            android:textColor="@color/white"
+            android:background="@drawable/bg_button"
+            android:text="@string/release_the_alarm"
+            android:layout_weight="4"/>
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:id="@+id/ll_result"
+        android:orientation="vertical"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="15dp"
+        android:layout_marginStart="15dp"
+        android:layout_marginEnd="15dp"
+        android:background="@drawable/shape_msg_block"
+        android:visibility="gone"
+        tools:visibility="visible"
+        android:padding="10dp">
+
+        <TextView
+            android:id="@+id/tv_result"
+            android:layout_width="match_parent"
+            android:layout_height="match_parent"
+            android:layout_marginTop="5dp"
+            android:layout_marginStart="5dp"
+            android:layout_marginEnd="5dp"
+            android:layout_marginBottom="5dp"
+            tools:visibility="visible"
+            />
+
+    </LinearLayout>
+
+
+
+
+
+</LinearLayout>

+ 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="gone"
+        android:text="下载新版本 " />
+</LinearLayout>

+ 137 - 0
app/src/main/res/layout/item_report_detail.xml

@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="utf-8"?><!--主菜单griditem布局-->
+<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="wrap_content"
+    android:orientation="vertical"
+    android:paddingLeft="15dp"
+    android:paddingTop="10dp"
+    android:paddingRight="10dp">
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:text="条码号:"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/tv_tiaomahao"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:minWidth="80dp"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp"
+            tools:text="YS1506002" />
+    </LinearLayout>
+
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:text="料架:"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/tv_qty"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:minWidth="80dp"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp"
+            tools:text="YS1506002" />
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="10dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:text="物料编号:"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/tv_pichi"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            android:paddingLeft="6dp"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp"
+            tools:text="YS1506002" />
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="15dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:text="名称:"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/tv_report_num"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:minWidth="80dp"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp"
+            tools:text="YS1506002" />
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginTop="15dp"
+        android:orientation="horizontal">
+
+        <TextView
+            android:layout_width="wrap_content"
+            android:layout_height="match_parent"
+            android:text="规格:"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp" />
+
+        <TextView
+            android:id="@+id/tv_report_man"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:minWidth="80dp"
+            android:textColor="@color/body_text_1"
+            android:textSize="14sp"
+            tools:text="YS1506002" />
+    </LinearLayout>
+
+
+    <View
+        android:layout_width="match_parent"
+        android:layout_height="0.5dp"
+        android:layout_marginTop="10dp"
+        android:background="@color/me_menu_item_press" />
+
+</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>

+ 0 - 1
app/src/main/res/layout/popwin_whbatch_breakpackage.xml

@@ -58,7 +58,6 @@
                 android:text="@string/text_btn_close"/>
             <Button
                 android:id="@+id/btn_print"
-                android:layout_toLeftOf="@id/btn_dialog_confirm_ok"
                 style="@style/PopwinCancleButtonStyle"
                 android:text="@string/text_btn_print"/>
         </RelativeLayout>

+ 3 - 0
app/src/main/res/values/color.xml

@@ -100,4 +100,7 @@
     <color name="menu_item_press">#DFDEDE</color>
 
     <color name="titleBlue">#BF2F95DD</color> <!-- 青蓝色 -->
+    <color name="yellow_stop">#FFC107</color>
+    <color name="me_menu_item_press">#DFDEDE</color>
+
 </resources>

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

@@ -1,6 +1,6 @@
 <resources>
     <string name="my_app_name">UAS智能终端系统</string>
-    <string name="my_app_name_test">产线-行之成</string>
+    <string name="my_app_name_test">行之成-产线</string>
     <string name="hello_world">Hello world!</string>
     <string name="action_settings">Settings</string>
     <string name="title_activity_connect_server_fragment">ConnectServerFragment</string>
@@ -429,4 +429,20 @@
         <item>重新采集</item>
         <item>未提交列表</item>
     </string-array>
+
+    <string name="free_listing">自由上架</string>
+    <string name="continuously_listed">连续上架</string>
+    <string name="material_rack">料架</string>
+    <string name="Please_enter_the_material_rack">请输入料架</string>
+    <string name="Please_enter_the_barcode_number">请输入条码号</string>
+    <string name="Shelf_validation_successful">料架效验成功</string>
+    <string name="Default_warehouse_for_materials">物料默认仓库</string>
+    <string name="Current_position">目前仓位</string>
+    <string name="aready_stored_in_storage_space">已经存放仓位</string>
+
+
+    <string name="release_the_alarm">解除警报</string>
+    <string name="alarm_successful">报警成功</string>
+
+
 </resources>

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

@@ -739,4 +739,15 @@
         <item name="android:textSize">14sp</item>
         <item name="android:layout_gravity">center_vertical</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>

+ 3 - 3
build.gradle

@@ -50,12 +50,12 @@ task clean(type: Delete) {
 
 ext {
     android = [
-            minSdkVersion    : 16,
+            minSdkVersion    : 17,
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 1,
-            versionName      : "v1.0"
+            versionCode      : 7,
+            versionName      : "v1.0.6"
     ]
 
     depsVersion = [

+ 1 - 2
pda_libs/pulltoreflashlibrary/src/main/AndroidManifest.xml

@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="utf-8"?>
 <manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.handmark.pulltorefresh.library"
-    android:versionCode="2110"
-    android:versionName="2.1.1" >
+   >
 
     <application />