Sfoglia il codice sorgente

出库采集下一采集物料数据格式变化

RaoMeng 5 anni fa
parent
commit
9ffb571679

BIN
.idea/caches/build_file_checksums.ser


BIN
.idea/caches/gradle_models.ser


+ 6 - 0
.idea/compiler.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="CompilerConfiguration">
+    <bytecodeTargetLevel target="1.8" />
+  </component>
+</project>

+ 3 - 2
.idea/gradle.xml

@@ -1,11 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
+  <component name="GradleMigrationSettings" migrationVersion="1" />
   <component name="GradleSettings">
     <option name="linkedExternalProjectsSettings">
       <GradleProjectSettings>
+        <option name="testRunner" value="PLATFORM" />
         <option name="distributionType" value="LOCAL" />
         <option name="externalProjectPath" value="$PROJECT_DIR$" />
-        <option name="gradleHome" value="$APPLICATION_HOME_DIR$/gradle/gradle-5.0" />
         <option name="modules">
           <set>
             <option value="$PROJECT_DIR$" />
@@ -16,7 +17,7 @@
           </set>
         </option>
         <option name="resolveModulePerSourceSet" value="false" />
-        <option name="testRunner" value="PLATFORM" />
+        <option name="useQualifiedModuleNames" value="true" />
       </GradleProjectSettings>
     </option>
   </component>

+ 50 - 0
.idea/jarRepositories.xml

@@ -0,0 +1,50 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="RemoteRepositoriesConfiguration">
+    <remote-repository>
+      <option name="id" value="central" />
+      <option name="name" value="Maven Central repository" />
+      <option name="url" value="https://repo1.maven.org/maven2" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="jboss.community" />
+      <option name="name" value="JBoss Community repository" />
+      <option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="BintrayJCenter" />
+      <option name="name" value="BintrayJCenter" />
+      <option name="url" value="https://jcenter.bintray.com/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="Google2" />
+      <option name="name" value="Google2" />
+      <option name="url" value="https://maven.google.com/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="maven" />
+      <option name="name" value="maven" />
+      <option name="url" value="https://jitpack.io" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="Google" />
+      <option name="name" value="Google" />
+      <option name="url" value="https://dl.google.com/dl/android/maven2/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="D:\Android\android-sdk\extras\m2repository" />
+      <option name="name" value="D:\Android\android-sdk\extras\m2repository" />
+      <option name="url" value="file:/D:/Android/android-sdk/extras/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="D:\Android\android-sdk\extras\google\m2repository" />
+      <option name="name" value="D:\Android\android-sdk\extras\google\m2repository" />
+      <option name="url" value="file:/D:/Android/android-sdk/extras/google/m2repository/" />
+    </remote-repository>
+    <remote-repository>
+      <option name="id" value="D:\Android\android-sdk\extras\android\m2repository" />
+      <option name="name" value="D:\Android\android-sdk\extras\android\m2repository" />
+      <option name="url" value="file:/D:/Android/android-sdk/extras/android/m2repository/" />
+    </remote-repository>
+  </component>
+</project>

+ 1 - 1
.idea/misc.xml

@@ -5,7 +5,7 @@
       <configuration PROFILE_NAME="Debug" CONFIG_NAME="Debug" />
     </configurations>
   </component>
-  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="JDK" project-jdk-type="JavaSDK">
+  <component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="true" project-jdk-name="JDK" project-jdk-type="JavaSDK">
     <output url="file://$PROJECT_DIR$/build/classes" />
   </component>
   <component name="ProjectType">

+ 41 - 11
app/src/main/java/com/uas/storage_manage/fragment/IOCOutMakeMaterialOper.java

@@ -674,14 +674,28 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                             com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
                             com.alibaba.fastjson.JSONObject dataObject = resultObject.getJSONObject("data");
                             if (dataObject != null) {
+                                com.alibaba.fastjson.JSONArray locationArray = dataObject.getJSONArray("BAR_LOCATION");
+                                String locationStr = "";
+                                if (locationArray != null && locationArray.size() > 0) {
+                                    for (int i = 0; i < locationArray.size(); i++) {
+                                        com.alibaba.fastjson.JSONObject locationObject = locationArray.getJSONObject(i);
+                                        if (locationObject != null) {
+                                            locationStr += FastjsonUtil.getText(locationObject, "DATA");
+                                            if (i < locationArray.size() - 1) {
+                                                locationStr += "\n\u3000\u3000\u3000";
+                                            }
+                                        }
+                                    }
+                                }
                                 String materialInfo =
                                         "下一采集货品\n物料:" + FastjsonUtil.getText(dataObject, "PD_PRODCODE")
                                                 + "; \n数量:" + FastjsonUtil.getText(dataObject, "NEEDREADY")
                                                 + "; \n序号:" + FastjsonUtil.getText(dataObject, "PD_PDNO")
                                                 + "; \n品牌:" + FastjsonUtil.getText(dataObject, "PD_BRAND")
                                                 + "; \n仓库:" + FastjsonUtil.getText(dataObject, "PD_WHCODE")
-                                                + "; \n库位:" + FastjsonUtil.getText(dataObject, "BAR_LOCATION")
-                                                + "; \nDC:" + FastjsonUtil.getText(dataObject, "BAR_DATECODE");
+                                                + "; \n库位:" + locationStr
+//                                                + "; \nDC:" + FastjsonUtil.getText(dataObject, "BAR_DATECODE")
+                                        ;
                                 if (mMaterialInforTextView != null) {
                                     mMaterialInforTextView.setText(materialInfo);
                                 }
@@ -808,15 +822,31 @@ public class IOCOutMakeMaterialOper extends BaseFragment implements View.OnClick
                                 Object next = dataObject.get("next");
                                 if (next != null && !"null".equals(next.toString())) {
                                     com.alibaba.fastjson.JSONObject nextObject = dataObject.getJSONObject("next");
-                                    String materialInfo =
-                                            "下一采集货品\n物料:" + FastjsonUtil.getText(nextObject, "PD_PRODCODE")
-                                                    + "; \n数量:" + FastjsonUtil.getText(nextObject, "NEEDREADY")
-                                                    + "; \n序号:" + FastjsonUtil.getText(nextObject, "PD_PDNO")
-                                                    + "; \n品牌:" + FastjsonUtil.getText(nextObject, "PD_BRAND")
-                                                    + "; \n仓库:" + FastjsonUtil.getText(nextObject, "PD_WHCODE")
-                                                    + "; \n库位:" + FastjsonUtil.getText(nextObject, "BAR_LOCATION")
-                                                    + "; \nDC:" + FastjsonUtil.getText(nextObject, "BAR_DATECODE");
-                                    mMaterialInforTextView.setText(materialInfo);
+                                    if (nextObject != null) {
+                                        com.alibaba.fastjson.JSONArray locationArray = nextObject.getJSONArray("BAR_LOCATION");
+                                        String locationStr = "";
+                                        if (locationArray != null && locationArray.size() > 0) {
+                                            for (int i = 0; i < locationArray.size(); i++) {
+                                                com.alibaba.fastjson.JSONObject locationObject = locationArray.getJSONObject(i);
+                                                if (locationObject != null) {
+                                                    locationStr += FastjsonUtil.getText(locationObject, "DATA");
+                                                    if (i < locationArray.size() - 1) {
+                                                        locationStr += "\n\u3000\u3000\u3000";
+                                                    }
+                                                }
+                                            }
+                                        }
+                                        String materialInfo =
+                                                "下一采集货品\n物料:" + FastjsonUtil.getText(nextObject, "PD_PRODCODE")
+                                                        + "; \n数量:" + FastjsonUtil.getText(nextObject, "NEEDREADY")
+                                                        + "; \n序号:" + FastjsonUtil.getText(nextObject, "PD_PDNO")
+                                                        + "; \n品牌:" + FastjsonUtil.getText(nextObject, "PD_BRAND")
+                                                        + "; \n仓库:" + FastjsonUtil.getText(nextObject, "PD_WHCODE")
+                                                        + "; \n库位:" + locationStr
+//                                                        + "; \nDC:" + FastjsonUtil.getText(nextObject, "BAR_DATECODE")
+                                                ;
+                                        mMaterialInforTextView.setText(materialInfo);
+                                    }
                                 } else {
                                     mMaterialInforTextView.setText("该出库单已经完成备料");
                                 }

+ 109 - 1
app/src/main/java/com/uas/storage_manage/fragment/SpecialOutNewFragment.java

@@ -43,7 +43,7 @@ import java.util.List;
 public class SpecialOutNewFragment extends BaseFragment implements CommonSelectPop.OnDataSelectListener {
     private static final int SCAN_BARCODE_CODE = 333;
 
-    private TextView mNumTv, mTitleTv, mLocationEt, mResultTv;
+    private TextView mNumTv, mTitleTv, mLocationEt, mResultTv, mNextTv;
     private ClearableEditText mBarcodeEt, mDcEt, mReasonEt;
     private ImageView mScanIv;
     private LinearLayout mLocationLl;
@@ -75,6 +75,7 @@ public class SpecialOutNewFragment extends BaseFragment implements CommonSelectP
         mLocationEt = (TextView) root.findViewById(R.id.special_out_new_location_et);
         mConfirmBtn = root.findViewById(R.id.special_out_new_confirm_btn);
         mResultTv = (TextView) root.findViewById(R.id.special_out_new_result_tv);
+        mNextTv = (TextView) root.findViewById(R.id.special_out_new_next_material_tv);
         mReasonEt = root.findViewById(R.id.special_out_new_reason_et);
 
         mSelectPop = new CommonSelectPop(mActivity);
@@ -141,8 +142,83 @@ public class SpecialOutNewFragment extends BaseFragment implements CommonSelectP
 
         String dcCheck = SharedPreUtil.getString(mActivity, Constants.CONSTANT.STORAGE_OUT_DC, "");
         mDcEt.setText(dcCheck);
+
+        if (CommonUtil.isNetWorkConnected(mActivity)) {
+            getNextMaterialInfo();
+        } else {
+            CommonUtil.toastNoRepeat(mActivity, getString(R.string.net_not_connect));
+            mNextTv.setText(getString(R.string.net_not_connect));
+        }
+    }
+
+    /**
+     * 获取下一采集货品信息
+     */
+    private void getNextMaterialInfo() {
+        progressDialog.show();
+        String url = GloableParams.ADDRESS_PDAIO_OUT_GETNEXTDATA + "?pi_id=" + pi_id;
+
+        VollyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(url)
+                .method(Request.Method.GET)
+                .tag(TAG + "getnext")
+                .flag(0)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                try {
+                    progressDialog.dismiss();
+                    String result = o.toString();
+                    com.alibaba.fastjson.JSONObject resultObject = JSON.parseObject(result);
+                    com.alibaba.fastjson.JSONObject dataObject = resultObject.getJSONObject("data");
+                    if (dataObject != null) {
+                        com.alibaba.fastjson.JSONArray locationArray = dataObject.getJSONArray("BAR_LOCATION");
+                        String locationStr = "";
+                        if (locationArray != null && locationArray.size() > 0) {
+                            for (int i = 0; i < locationArray.size(); i++) {
+                                com.alibaba.fastjson.JSONObject locationObject = locationArray.getJSONObject(i);
+                                if (locationObject != null) {
+                                    locationStr += FastjsonUtil.getText(locationObject, "DATA");
+                                    if (i < locationArray.size() - 1) {
+                                        locationStr += "\n\u3000\u3000\u3000";
+                                    }
+                                }
+                            }
+                        }
+                        String materialInfo =
+                                "下一采集货品\n物料:" + FastjsonUtil.getText(dataObject, "PD_PRODCODE")
+                                        + "; \n数量:" + FastjsonUtil.getText(dataObject, "NEEDREADY")
+                                        + "; \n序号:" + FastjsonUtil.getText(dataObject, "PD_PDNO")
+                                        + "; \n品牌:" + FastjsonUtil.getText(dataObject, "PD_BRAND")
+                                        + "; \n仓库:" + FastjsonUtil.getText(dataObject, "PD_WHCODE")
+                                        + "; \n库位:" + locationStr
+//                                                + "; \nDC:" + FastjsonUtil.getText(dataObject, "BAR_DATECODE")
+                                ;
+                        if (mNextTv != null) {
+                            mNextTv.setText(materialInfo);
+                        }
+                    } else {
+                        if (mNextTv != null) {
+                            mNextTv.setText("该出库单已经完成备料");
+                        }
+                    }
+                } catch (Exception e) {
+
+                }
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+                if (mNextTv != null) {
+                    mNextTv.setText(failStr);
+                }
+            }
+        });
     }
 
+
     private void barcodeEnterEvent(boolean force) {
         String barcode = mBarcodeEt.getText().toString().trim();
         if (TextUtils.isEmpty(barcode)) {
@@ -231,6 +307,38 @@ public class SpecialOutNewFragment extends BaseFragment implements CommonSelectP
                                 mResultTv.setVisibility(View.VISIBLE);
 
                                 CommonUtil.toastNoRepeat(getActivity(), "采集成功");
+
+                                Object next = dataObject.get("next");
+                                if (next != null && !"null".equals(next.toString())) {
+                                    com.alibaba.fastjson.JSONObject nextObject = dataObject.getJSONObject("next");
+                                    if (nextObject != null) {
+                                        com.alibaba.fastjson.JSONArray locationArray = nextObject.getJSONArray("BAR_LOCATION");
+                                        String locationStr = "";
+                                        if (locationArray != null && locationArray.size() > 0) {
+                                            for (int i = 0; i < locationArray.size(); i++) {
+                                                com.alibaba.fastjson.JSONObject locationObject = locationArray.getJSONObject(i);
+                                                if (locationObject != null) {
+                                                    locationStr += FastjsonUtil.getText(locationObject, "DATA");
+                                                    if (i < locationArray.size() - 1) {
+                                                        locationStr += "\n\u3000\u3000\u3000";
+                                                    }
+                                                }
+                                            }
+                                        }
+                                        String materialInfo =
+                                                "下一采集货品\n物料:" + FastjsonUtil.getText(nextObject, "PD_PRODCODE")
+                                                        + "; \n数量:" + FastjsonUtil.getText(nextObject, "NEEDREADY")
+                                                        + "; \n序号:" + FastjsonUtil.getText(nextObject, "PD_PDNO")
+                                                        + "; \n品牌:" + FastjsonUtil.getText(nextObject, "PD_BRAND")
+                                                        + "; \n仓库:" + FastjsonUtil.getText(nextObject, "PD_WHCODE")
+                                                        + "; \n库位:" + locationStr
+//                                                        + "; \nDC:" + FastjsonUtil.getText(nextObject, "BAR_DATECODE")
+                                                ;
+                                        mNextTv.setText(materialInfo);
+                                    }
+                                } else {
+                                    mNextTv.setText("该出库单已经完成备料");
+                                }
                             }
                         } catch (Exception e) {
                             e.printStackTrace();

+ 9 - 0
app/src/main/res/layout/fragment_special_out_new.xml

@@ -191,6 +191,15 @@
             android:padding="10dp"
             android:visibility="gone"
             tools:text="采集结果" />
+
+        <TextView
+            android:id="@+id/special_out_new_next_material_tv"
+            android:layout_width="match_parent"
+            android:layout_height="wrap_content"
+            android:layout_marginTop="@dimen/spacing_big"
+            android:background="@drawable/shape_msg_block"
+            android:padding="10dp"
+            tools:text="物料:PD_PRODCODE, 名称规格:PR_DETAIL || PR_SPEC未备料数: PD_RESTQTY,最小包装数:PR_ZXBZS,仓位:BAR_LOCATION,有PD_BATCHCODE 则显示批号:PD_BATCHCODE" />
     </LinearLayout>
 
 </ScrollView>

+ 2 - 2
build.gradle

@@ -42,8 +42,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 3,
-            versionName      : "v2.1"
+            versionCode      : 4,
+            versionName      : "v2.2"
     ]
 
     depsVersion = [

BIN
pda_libs/pulltoreflashlibrary/build/intermediates/classes/debug/com/handmark/pulltorefresh/library/BuildConfig.class


+ 1 - 1
pda_libs/pulltoreflashlibrary/build/intermediates/incremental/packageDebugResources/compile-file-map.properties

@@ -1,4 +1,4 @@
-#Fri Oct 16 10:17:46 CST 2020
+#Mon Nov 30 14:30:32 CST 2020
 E\:\\Projects\\CompayProjects\\pda_storage\\pda_libs\\pulltoreflashlibrary\\src\\main\\res\\anim\\slide_in_from_top.xml=E\:\\Projects\\CompayProjects\\pda_storage\\pda_libs\\pulltoreflashlibrary\\build\\intermediates\\packaged_res\\debug\\anim\\slide_in_from_top.xml
 E\:\\Projects\\CompayProjects\\pda_storage\\pda_libs\\pulltoreflashlibrary\\src\\main\\res\\drawable-hdpi\\default_ptr_flip.png=E\:\\Projects\\CompayProjects\\pda_storage\\pda_libs\\pulltoreflashlibrary\\build\\intermediates\\packaged_res\\debug\\drawable-hdpi-v4\\default_ptr_flip.png
 E\:\\Projects\\CompayProjects\\pda_storage\\pda_libs\\pulltoreflashlibrary\\src\\main\\res\\drawable-mdpi\\default_ptr_flip.png=E\:\\Projects\\CompayProjects\\pda_storage\\pda_libs\\pulltoreflashlibrary\\build\\intermediates\\packaged_res\\debug\\drawable-mdpi-v4\\default_ptr_flip.png

BIN
pda_libs/pulltoreflashlibrary/build/intermediates/intermediate-jars/debug/classes.jar


BIN
pda_libs/pulltoreflashlibrary/build/intermediates/intermediate-jars/debug/full.jar