Browse Source

指定页面增加操作失败提示音, 调整库位库存核查调整表格显示逻辑

songw 5 months ago
parent
commit
458f5950a2

+ 2 - 1
app/src/main/java/com/uas/keg_wms_new/application/PdaApplication.java

@@ -100,7 +100,8 @@ public class PdaApplication extends Application {
 //        mSoundMap.put(SoundUtil.SOUND_THIRTEEN, mSoundPool.load(this, R.raw.operation_failed, 1));      //操作失败
         //扫码提示音
         mSoundQRCodeMap = new HashMap<>();
-        mSoundQRCodeMap.put(SoundUtil.SOUND_TWELVE, mSoundPoolQRCode.load(this, R.raw.operation_successful, 1));
+        mSoundQRCodeMap.put(SoundUtil.SOUND_TWELVE, mSoundPoolQRCode.load(this, R.raw.operation_successful, 1));    //操作成功
+        mSoundQRCodeMap.put(SoundUtil.SOUND_THIRTEEN, mSoundPoolQRCode.load(this, R.raw.operation_failed, 1));      //操作失败
         //友盟统计SDK
         initUmeng();
         //抓包

+ 1 - 0
app/src/main/java/com/uas/keg_wms_new/fragment/BarcodeInCollectFragment.java

@@ -229,6 +229,7 @@ public class BarcodeInCollectFragment extends BaseFragment {
                     public void onFail(int flag, String failStr) throws Exception {
                         progressDialog.dismiss();
                         CommonUtil.toastNoRepeat(mActivity, failStr);
+                        SoundUtil.playQC(SoundUtil.SOUND_THIRTEEN);
                     }
                 });
     }

+ 6 - 3
app/src/main/java/com/uas/keg_wms_new/fragment/FreeListingFragment.java

@@ -222,7 +222,8 @@ public class FreeListingFragment extends BaseFragment {
                 mResultTextView.setText(failStr);
                 ll_shangjia.setVisibility(View.GONE);
                 ll_end_data.setVisibility(View.GONE);
-                CommonUtil.makeNotice();
+                //CommonUtil.makeNotice();
+                SoundUtil.playQC(SoundUtil.SOUND_THIRTEEN);
             }
         });
     }
@@ -346,7 +347,8 @@ public class FreeListingFragment extends BaseFragment {
                     }
                     ll_shangjia.setVisibility(View.GONE);
                     ll_end_data.setVisibility(View.GONE);
-                    CommonUtil.makeNotice();
+                    //CommonUtil.makeNotice();
+                    SoundUtil.playQC(SoundUtil.SOUND_THIRTEEN);
                 }
             });
         } catch (Exception e) {
@@ -396,7 +398,8 @@ public class FreeListingFragment extends BaseFragment {
                 cet_material_rack.setText(null);
                 ll_shangjia.setVisibility(View.GONE);
                 ll_end_data.setVisibility(View.GONE);
-                CommonUtil.makeNotice();
+                //CommonUtil.makeNotice();
+                SoundUtil.playQC(SoundUtil.SOUND_THIRTEEN);
             }
         });
 

+ 3 - 0
app/src/main/java/com/uas/keg_wms_new/fragment/IOCOutMakeMaterialOper.java

@@ -767,6 +767,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                     mCollectResultTextView.setVisibility(View.VISIBLE);
                     mCollectResultTextView.setTextColor(getResources().getColor(R.color.red));
                     mCollectResultTextView.setText(errorToast);
+                    SoundUtil.playQC(SoundUtil.SOUND_THIRTEEN);
                 }
 
             }
@@ -818,6 +819,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                     mCollectResultTextView.setVisibility(View.VISIBLE);
                     mCollectResultTextView.setTextColor(getResources().getColor(R.color.red));
                     mCollectResultTextView.setText(errorToast);
+                    SoundUtil.playQC(SoundUtil.SOUND_THIRTEEN);
                 }
 
             }
@@ -1250,6 +1252,7 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                     mCollectResultTextView.setVisibility(View.VISIBLE);
                     mCollectResultTextView.setTextColor(getResources().getColor(R.color.red));
                     mCollectResultTextView.setText(errorToast);
+                    SoundUtil.playQC(SoundUtil.SOUND_THIRTEEN);
                 }
 
             }

+ 21 - 14
app/src/main/java/com/uas/keg_wms_new/fragment/InventoryVerificationStorageLocationsFra.java

@@ -75,7 +75,7 @@ class InventoryVerificationStorageLocationsFra extends BaseFragment{
         String barCode = cet_bar_code.getText().toString().trim();
         String position = cet_position.getText().toString().trim();
         if (TextUtils.isEmpty(barCode) && TextUtils.isEmpty(position)) {
-            CommonUtil.toastNoRepeat(mActivity, "请输入需要查询的(料号/条码)或仓位");
+            CommonUtil.toastNoRepeat(getActivity(), "请输入需要查询的(料号/条码)或仓位");
             if (TextUtils.isEmpty(barCode)) {
                 cet_bar_code.requestFocus();
             }else {
@@ -98,6 +98,7 @@ class InventoryVerificationStorageLocationsFra extends BaseFragment{
                 JSONArray dataArr = resultObject.getJSONArray("data");
                 if (dataArr != null) {
                     if (dataArr.size() > 0) {
+                        ivslbList.clear();
                         for (int i = 0; i < dataArr.size(); i++) {
                             JSONObject jsonObject = dataArr.getJSONObject(i);
                             InventoryVerificationStorageLocationBean ivslb = new InventoryVerificationStorageLocationBean();
@@ -109,9 +110,10 @@ class InventoryVerificationStorageLocationsFra extends BaseFragment{
                             ivslbList.add(ivslb);
                         }
                     }else {
-                        CommonUtil.toastNoRepeat(mActivity, "未匹配到数据");
+                        CommonUtil.toastNoRepeat(getActivity(), "未匹配到数据");
                     }
                     if (ivslbList.size() > 0) {
+                        st_data.setVisibility(View.VISIBLE);
                         setFilterTableData(ivslbList);
                     }
                 }
@@ -120,9 +122,14 @@ class InventoryVerificationStorageLocationsFra extends BaseFragment{
             @Override
             public void onFail(int flag, String failStr) throws Exception {
                 progressDialog.dismiss();
-                CommonUtil.toastNoRepeat(mActivity, failStr);
-                cet_bar_code.setText("");
-                cet_position.setText("");
+                if (mActivity != null) {
+                    cet_bar_code.setText("");
+                    cet_position.setText("");
+                    CommonUtil.toastNoRepeat(mActivity, failStr);
+                    ivslbList.clear();
+                    st_data.setVisibility(View.GONE);
+                    setFilterTableData(ivslbList);
+                }
             }
         });
     }
@@ -131,30 +138,30 @@ class InventoryVerificationStorageLocationsFra extends BaseFragment{
     protected void initDatas() {
         ivslbList = new ArrayList();
 
-        WindowManager wm = mActivity.getWindowManager();
+        WindowManager wm = getActivity().getWindowManager();
         int screenWith = wm.getDefaultDisplay().getWidth();
         st_data.getConfig().setMinTableWidth(screenWith)
                 .setShowXSequence(false)
                 .setShowYSequence(false)
                 .setShowTableTitle(false)
                 .setFixedTitle(true)
-                .setVerticalPadding(CommonUtil.dip2px(mActivity, 12))
-                .setColumnTitleVerticalPadding(CommonUtil.dip2px(mActivity, 12))
-                .setHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
-                .setSequenceHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
-                .setColumnTitleHorizontalPadding(CommonUtil.dip2px(mActivity, 10))
-                .setColumnTitleStyle(new FontStyle(CommonUtil.sp2px(mActivity, 15), Color.parseColor("#000000")))
+                .setVerticalPadding(CommonUtil.dip2px(getActivity(), 12))
+                .setColumnTitleVerticalPadding(CommonUtil.dip2px(getActivity(), 12))
+                .setHorizontalPadding(CommonUtil.dip2px(getActivity(), 10))
+                .setSequenceHorizontalPadding(CommonUtil.dip2px(getActivity(), 10))
+                .setColumnTitleHorizontalPadding(CommonUtil.dip2px(getActivity(), 10))
+                .setColumnTitleStyle(new FontStyle(CommonUtil.sp2px(getActivity(), 15), Color.parseColor("#000000")))
                 .setContentCellBackgroundFormat(new BaseCellBackgroundFormat<CellInfo>() {
                     @Override
                     public int getBackGroundColor(CellInfo cellInfo) {
                         if (cellInfo.row % 2 == 0) {
-                            return ContextCompat.getColor(mActivity, R.color.blue_50);
+                            return ContextCompat.getColor(getActivity(), R.color.blue_50);
                         }
                         return TableConfig.INVALID_COLOR;
                     }
                 });
 
-        BAR_LOCATIO = new Column<String>("仓位", "BAR_LOCATIO");
+        BAR_LOCATIO = new Column<String>("仓位", "BAR_LOCATION");
         BAR_PRODCODE = new Column<String>("物料编号", "BAR_PRODCODE");
         BAR_REMAIN = new Column<String>("数量", "BAR_REMAIN");
 

+ 2 - 1
app/src/main/java/com/uas/keg_wms_new/fragment/JLTStorageInBarcodeFragment.java

@@ -642,11 +642,11 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
             @Override
             public void onFail(int flag, String failStr) throws Exception {
                 progressDialog.dismiss();
-
                 mModelEditText.setText("");
                 mModelEditText.requestFocus();
                 mSearchEnclosureAdapter.notifyDataSetChanged();
                 CommonUtil.toastNoRepeat(mActivity, failStr);
+                SoundUtil.playQC(SoundUtil.SOUND_THIRTEEN);
             }
         });
     }
@@ -989,6 +989,7 @@ public class JLTStorageInBarcodeFragment extends BaseFragment implements View.On
             public void onFail(int flag, String failStr) throws Exception {
                 progressDialog.dismiss();
                 CommonUtil.toastNoRepeat(mActivity, failStr);
+                SoundUtil.playQC(SoundUtil.SOUND_THIRTEEN);
             }
         });
     }

+ 1 - 0
app/src/main/java/com/uas/keg_wms_new/fragment/MaterialOutRevocationStockFragment.java

@@ -381,6 +381,7 @@ public class MaterialOutRevocationStockFragment extends BaseFragment {
                         mBarcodeEditText.requestFocus();
                         mResultTextView.setVisibility(View.VISIBLE);
                         mResultTextView.setText(errorToast);
+                        SoundUtil.playQC(SoundUtil.SOUND_THIRTEEN);
                     }
                 }) {
             @Override

+ 1 - 1
app/src/main/java/com/uas/keg_wms_new/util/SoundUtil.java

@@ -43,7 +43,7 @@ public class SoundUtil {
         }
     }
 
-    //二维码提示音相关
+    //二维码提示音--操作成功
     public static void playQC(final int soundId) {
         pauseQC();
         if (PdaApplication.mSoundPoolQRCode != null) {

+ 6 - 6
app/src/main/res/layout/fra_inventory_veriflcation_storage_location.xml

@@ -12,12 +12,12 @@
         android:orientation="horizontal"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginStart="10dp"
-        android:layout_marginEnd="10dp"
+        android:layout_marginStart="15dp"
+        android:layout_marginEnd="15dp"
         >
 
         <TextView
-            android:layout_width="90dp"
+            android:layout_width="120dp"
             android:layout_height="match_parent"
             android:gravity="center"
             android:padding="10dp"
@@ -44,12 +44,12 @@
         android:orientation="horizontal"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
-        android:layout_marginStart="10dp"
-        android:layout_marginEnd="10dp"
+        android:layout_marginStart="15dp"
+        android:layout_marginEnd="15dp"
         >
 
         <TextView
-            android:layout_width="90dp"
+            android:layout_width="120dp"
             android:layout_height="match_parent"
             android:gravity="center"
             android:padding="10dp"

+ 2 - 2
build.gradle

@@ -54,8 +54,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 35,
-            versionName      : "v1.3.1"
+            versionCode      : 39,
+            versionName      : "v1.3.5"
     ]
 
     depsVersion = [