Browse Source

已加入排序以及接口打印日志

songw 3 months ago
parent
commit
4d33f2735c

+ 1 - 1
app/src/main/java/uas/erp/huiyan_wms/activity/IndexActivity.java

@@ -84,7 +84,7 @@ public class IndexActivity extends BaseActivity implements AdapterView.OnItemCli
 
     private void initPermisstion() {
         //判断是否大于10.0的安卓系统
-        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.Q) {
+        if (Build.VERSION.SDK_INT > Build.VERSION_CODES.R) {
             PermissionUtils permissionUtils = new PermissionUtils();
             permissionUtils.setPermission(this, "蓝牙", "蓝牙相关", new PermissionUtils.AfterPermissionTwo() {
                         @Override

+ 10 - 1
app/src/main/java/uas/erp/huiyan_wms/bean/StorageRechargeListBean.java

@@ -10,11 +10,20 @@ public class StorageRechargeListBean {
     private long mAndId;
     private String mProdcode;
     private String mOrdercode;
-    private long mOrderNo;
+    private long mOrderNo;  //采购序号
     private double mQuantity;
     private String mSpec;
     private String mDetail;
     private String BAN_QTY;
+    private int AND_DETNO;
+
+    public int getAND_DETNO() {
+        return AND_DETNO;
+    }
+
+    public void setAND_DETNO(int AND_DETNO) {
+        this.AND_DETNO = AND_DETNO;
+    }
 
     public String getBAN_QTY() {
         return BAN_QTY;

+ 16 - 0
app/src/main/java/uas/erp/huiyan_wms/fragment/IndexWareHouseContentFragment.java

@@ -159,6 +159,22 @@ public class IndexWareHouseContentFragment extends BaseFragment implements Adapt
                     getFragmentManager().beginTransaction().addToBackStack(null)
                             .replace(R.id.container_function_fragment, fragment).commit();
                     break;
+                case GloableParams.GRIDNAME_COLOR_BOX_AND_OUTER_BOX_VERIFICATION://彩盒标签与外箱标签校验
+                    fragment = new OutboundLis_Two_fragment();
+                    getFragmentManager().beginTransaction().addToBackStack(null)
+                            .replace(R.id.container_function_fragment, fragment).commit();
+                    break;
+                case GloableParams.GRIDNAME_CALIBRATION_OF_OUTER_BOX_AND_PALLET://外箱标签与栈板标签校验
+                    fragment = new OutboundLis_Two_fragment();
+                    getFragmentManager().beginTransaction().addToBackStack(null)
+                            .replace(R.id.container_function_fragment, fragment).commit();
+                    break;
+                case GloableParams.GRIDNAME_COLOR_BOX_AND_FUSELAGE_VERIFICATION://彩盒标签和机身标签校验
+                    fragment = new OutboundLis_Two_fragment();
+                    getFragmentManager().beginTransaction().addToBackStack(null)
+                            .replace(R.id.container_function_fragment, fragment).commit();
+                    break;
+
             }
 //        }
     }

+ 2 - 2
app/src/main/java/uas/erp/huiyan_wms/fragment/NewBePutInStorageOrderDetailFragment.java

@@ -137,6 +137,7 @@ public class NewBePutInStorageOrderDetailFragment extends BaseFragment{
             }
         });
 
+        jlt_storage_in_barcode_barcode_et.requestFocus();
     }
 
     @Override
@@ -291,7 +292,6 @@ public class NewBePutInStorageOrderDetailFragment extends BaseFragment{
         });
     }
 
-
     public void getmakeInWarhouse(String input){
         String text_radiobutton = null;
         if (radiobutton1.isChecked()==true){
@@ -309,7 +309,7 @@ public class NewBePutInStorageOrderDetailFragment extends BaseFragment{
         VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
                 .url(GloableParams.ADDRESS_DOCUMENTLIBRARY_MAKEINWARHOUSE)
                 .method(Request.Method.GET)
-                .tag(TAG + "getindatalist")
+                .tag(GloableParams.ADDRESS_DOCUMENTLIBRARY_MAKEINWARHOUSE)
                 .flag(0)
                 .addParam("inoutno",mPiInoutno)
                 .addParam("cancel",ck_cancel.isChecked()+"")

+ 55 - 1
app/src/main/java/uas/erp/huiyan_wms/fragment/SupplierPlatformFragment.java

@@ -27,7 +27,10 @@ import com.uuzuche.lib_zxing.activity.CaptureActivity;
 import com.uuzuche.lib_zxing.activity.CodeUtils;
 
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.List;
+import java.util.function.ToIntFunction;
 
 import androidx.appcompat.app.AlertDialog;
 import androidx.fragment.app.Fragment;
@@ -497,6 +500,31 @@ public class SupplierPlatformFragment extends BaseFragment implements View.OnCli
 
     private void analysisGetBarcode(String result) {
         Log.d("rechargeBarcode", result);
+//        result= "{\n" +
+//                "        \"success\": true,\n" +
+//                "        \"data\": {\n" +
+//                "                \"main\": {\n" +
+//                "                        \"AN_CODE\": \"2025120019\",\n" +
+//                "                        \"AN_ID\": 142733,\n" +
+//                "                        \"AN_VENDNAME\": \"深圳市联钰供应链管理有限公司\",\n" +
+//                "                        \"AN_STATUS\": \"已审核\"\n" +
+//                "                },\n" +
+//                "                \"detail\": [\n" +
+//                "                        {\n" +
+//                "                                \"AND_ID\": 113103,\n" +
+//                "                                \"AND_DETNO\": 2,\n" +
+//                "                                \"AND_ORDERCODE\": \"332-251128003\",\n" +
+//                "                                \"AND_ORDERDETNO\": 1,\n" +
+//                "                                \"AND_PRODCODE\": \"17-1017000045\",\n" +
+//                "                                \"AND_INQTY\": 2100,\n" +
+//                "                                \"PR_DETAIL\": \"SENSOR\",\n" +
+//                "                                \"PR_SPEC\": \"SC3332P 35pin csp 3mp 思特威(K734E);\",\n" +
+//                "                                \"BAN_QTY\": 2100\n" +
+//                "                        }\n" +
+//                "                ],\n" +
+//                "                \"barcode\": \"HY251201000652\"\n" +
+//                "        }\n" +
+//                "}";
         JSONObject resultObject = JSON.parseObject(result);
         JSONObject dataObject = resultObject.getJSONObject("data");
         if (dataObject != null) {
@@ -508,13 +536,15 @@ public class SupplierPlatformFragment extends BaseFragment implements View.OnCli
                 mHeaderSupplierTextView.setText(FastjsonUtil.getText(mainObject, "AN_VENDNAME"));
                 mHeaderStateTextView.setText(FastjsonUtil.getText(mainObject, "AN_STATUS"));
             }
-            JSONArray detailArray = dataObject.getJSONArray("detail");
+//            JSONArray detailArray = dataObject.getJSONArray("detail");
+            JSONArray detailArray = sortJsonArrayByField(dataObject.getJSONArray("detail"), "AND_DETNO");
             if (detailArray != null) {
                 for (int i = 0; i < detailArray.size(); i++) {
                     JSONObject detailObject = detailArray.getJSONObject(i);
                     if (detailObject != null) {
                         StorageRechargeListBean storageRechargeListBean = new StorageRechargeListBean();
                         storageRechargeListBean.setAndId(FastjsonUtil.getLong(detailObject, "AND_ID"));
+                        storageRechargeListBean.setAND_DETNO(FastjsonUtil.getInt(detailObject, "AND_DETNO"));
                         storageRechargeListBean.setProdcode(FastjsonUtil.getText(detailObject, "AND_PRODCODE"));
                         storageRechargeListBean.setOrdercode(FastjsonUtil.getText(detailObject, "AND_ORDERCODE"));
                         storageRechargeListBean.setOrderNo(FastjsonUtil.getLong(detailObject, "AND_ORDERDETNO"));
@@ -545,6 +575,30 @@ public class SupplierPlatformFragment extends BaseFragment implements View.OnCli
         }
     }
 
+    public static JSONArray sortJsonArrayByField(JSONArray jsonArray, String field) {
+        List<JSONObject> jsonList = new ArrayList<>();
+
+        // 将 JSONArray 转换为 List<JSONObject>
+        for (int i = 0; i < jsonArray.size(); i++) {
+            jsonList.add(jsonArray.getJSONObject(i));
+        }
+
+        // 使用 Comparator 按字段排序
+        Collections.sort(jsonList, Comparator.comparingInt(new ToIntFunction<JSONObject>() {
+            @Override
+            public int applyAsInt(JSONObject value) {
+                return value.getIntValue(field);
+            }
+        }));
+
+        // 转换回 JSONArray
+        JSONArray sortedJsonArray = new JSONArray();
+        for (JSONObject jsonObject : jsonList) {
+            sortedJsonArray.add(jsonObject);
+        }
+
+        return sortedJsonArray;
+    }
 
     @Override
     public void onDestroyView() {

+ 9 - 0
app/src/main/java/uas/erp/huiyan_wms/global/GloableParams.java

@@ -806,6 +806,9 @@ public class GloableParams {
     public static final String MENU_STORAGE_BARCODE_FREEZE = "库存条码冻结";
     public static final String GRIDNAME_FINISHED_PRODUCT_STORAGE = "成品入库";
     public static final String GRIDNAME_FINISHED_PRODUCT_OUTBOUND = "成品出库";
+    public static final String GRIDNAME_COLOR_BOX_AND_OUTER_BOX_VERIFICATION = "彩盒标签与外箱标签校验";
+    public static final String GRIDNAME_CALIBRATION_OF_OUTER_BOX_AND_PALLET = "外箱标签与栈板标签校验";
+    public static final String GRIDNAME_COLOR_BOX_AND_FUSELAGE_VERIFICATION = "彩盒标签和机身标签校验";
     public static final String[] storageGridNames = {
             GRIDNAME_GOOD_SEARCH,
             GRIDNAME_BATCH_OPRATION,
@@ -817,6 +820,9 @@ public class GloableParams {
             MENU_STORAGE_BARCODE_FREEZE,
             GRIDNAME_FINISHED_PRODUCT_STORAGE,
             GRIDNAME_FINISHED_PRODUCT_OUTBOUND,
+            GRIDNAME_COLOR_BOX_AND_OUTER_BOX_VERIFICATION,
+            GRIDNAME_CALIBRATION_OF_OUTER_BOX_AND_PALLET,
+            GRIDNAME_COLOR_BOX_AND_FUSELAGE_VERIFICATION
     };
     public static final int[] storageGridImgs = {
             R.drawable.storage_good_search,
@@ -829,6 +835,9 @@ public class GloableParams {
             R.drawable.kucuntiaomadongjie,
             R.drawable.ic_finished_product_storage,
             R.drawable.ic_finished_product_outbound,
+            R.drawable.ic_finished_product_outbound,
+            R.drawable.ic_finished_product_outbound,
+            R.drawable.ic_finished_product_outbound
     };
     //DETAIL:搜索备料单号,下拉列表
     public static final String SPINNER_PREPARE_SEARCH = "搜索备料单号";

+ 2 - 0
app/src/main/java/uas/erp/huiyan_wms/util/VolleyRequest.java

@@ -110,6 +110,7 @@ public class VolleyRequest {
                     public void onResponse(String s) {
                         try {
                             LogUtil.prinlnLongMsg("responseSucc", s);
+                            MyLog.e("aaa","接口响应信息:" + s);
                             httpCallback.onSuccess(httpParams.getFlag(), s);
                         } catch (Exception e) {
                             e.printStackTrace();
@@ -122,6 +123,7 @@ public class VolleyRequest {
                         String errorToast = CommonUtil.showErrorToast(volleyError, false);
                         try {
                             LogUtil.e("responErr", errorToast);
+                            MyLog.e("aaa","接口错误信息:" + errorToast);
                             if (errorToast.length() >= 500) {
                                 Activity activity=new Activity();
                                 String maName = SharedPreUtil.getString(activity, Constants.FLAG.ACCOUNT_NAME_CACHE, null);

+ 1 - 1
app/src/main/java/uas/erp/huiyan_wms/view/ClearableEditText.java

@@ -186,7 +186,7 @@ public class ClearableEditText extends AppCompatEditText implements View.OnTouch
         return mOnTouchListener != null && mOnTouchListener.onTouch(v, event);
     }
 
-    EditTextFocus etFocus;
+    private EditTextFocus etFocus;
     public interface EditTextFocus{
         void setFoucus();
     }

+ 43 - 39
app/src/main/res/layout/newbeputinstorageorderdetail_fragment.xml

@@ -3,59 +3,60 @@
     android:layout_width="match_parent"
     android:layout_height="match_parent"
     android:orientation="vertical">
+
     <LinearLayout
-        android:layout_marginTop="@dimen/dp_10"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
         android:layout_marginLeft="@dimen/dp_10"
+        android:layout_marginTop="@dimen/dp_10"
         android:layout_marginRight="@dimen/dp_10"
-        android:orientation="horizontal"
-        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:layout_gravity="center"
             android:gravity="center"
-            android:textColor="@color/black"
-            android:text="单号:">
-        </TextView>
+            android:text="单号:"
+            android:textColor="@color/black"></TextView>
+
         <TextView
-            android:layout_marginLeft="5dp"
             android:id="@+id/tv_pi_inoutno"
             android:layout_width="match_parent"
             android:layout_height="wrap_content"
-            android:layout_weight="1"
             android:layout_gravity="center"
-            android:gravity="left"
-            android:textColor="@color/black"
+            android:layout_marginLeft="5dp"
             android:layout_marginRight="@dimen/space_left_5"
-            android:text="">
-        </TextView>
+            android:layout_weight="1"
+            android:gravity="left"
+            android:text=""
+            android:textColor="@color/black"></TextView>
+
         <TextView
             android:id="@+id/tv_productdetails"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:background="@color/gray_light"
             android:padding="5dp"
-            android:text="产品明细">
-        </TextView>
+            android:text="产品明细"></TextView>
 
         <TextView
-            android:layout_marginStart="10dp"
             android:id="@+id/tv_generate_document_details"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_marginStart="10dp"
             android:background="@color/gray_light"
             android:padding="5dp"
-            android:text="生成单据明细"/>
+            android:text="生成单据明细" />
 
         <TextView
-            android:layout_marginStart="10dp"
             android:id="@+id/tv_submint"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
+            android:layout_marginStart="10dp"
             android:background="@color/gray_light"
             android:padding="5dp"
-            android:text="提交"/>
+            android:text="提交" />
 
     </LinearLayout>
 
@@ -63,61 +64,66 @@
         android:id="@+id/tv_qty"
         android:layout_width="wrap_content"
         android:layout_height="wrap_content"
-        android:textColor="@color/black"
         android:layout_marginLeft="@dimen/dp_10"
-        android:text="">
-    </TextView>
+        android:text=""
+        android:textColor="@color/black"></TextView>
+
     <com.bin.david.form.core.SmartTable
-        android:layout_marginTop="@dimen/dp_10"
         android:id="@+id/jlt_storage_in_filter_list_st"
         android:layout_width="match_parent"
         android:layout_height="match_parent"
+        android:layout_marginTop="@dimen/dp_10"
         android:layout_marginBottom="@dimen/dp_10"
         android:layout_weight="1" />
+
     <TextView
         android:id="@+id/tv_hint"
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
         android:padding="5dp"
-        android:text="">
-    </TextView>
+        android:text=""></TextView>
+
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content">
+
         <RadioGroup
             android:id="@+id/radiogroup1"
-            android:layout_height="wrap_content"
             android:layout_width="match_parent"
+            android:layout_height="wrap_content"
             android:orientation="horizontal">
 
             <RadioButton
                 android:id="@+id/radiobutton1"
-                android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
-                android:layout_marginLeft="10dp"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="2dp"
                 android:text="卡通箱号" />
 
             <RadioButton
                 android:id="@+id/radiobutton2"
-                android:layout_marginLeft="@dimen/dp_10"
-                android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="2dp"
                 android:text="单台序列号" />
+
             <RadioButton
                 android:id="@+id/radiobig"
-                android:layout_marginLeft="@dimen/dp_10"
-                android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:layout_marginLeft="2dp"
                 android:text="大箱号" />
+
             <RadioButton
                 android:id="@+id/radiobutton0"
-                android:layout_height="wrap_content"
                 android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
                 android:text="栈板号" />
 
         </RadioGroup>
 
     </LinearLayout>
+
     <LinearLayout
         android:layout_width="match_parent"
         android:layout_height="wrap_content"
@@ -130,20 +136,18 @@
             android:layout_weight="1"
             android:background="@drawable/bg_line_edittext"
             android:focusable="true"
-            android:selectAllOnFocus="true"
             android:hint="请采集条码号/二维码"
             android:imeOptions="actionSend"
-            android:textColor="@color/black"
-            />
+            android:selectAllOnFocus="true"
+            android:textColor="@color/black" />
+
         <CheckBox
             android:id="@+id/ck_cancel"
             android:layout_width="wrap_content"
             android:layout_height="wrap_content"
             android:layout_marginRight="@dimen/dp_10"
-            android:text="取消">
-        </CheckBox>
+            android:text="取消"></CheckBox>
     </LinearLayout>
 
 
-
 </LinearLayout>

+ 3 - 3
build.gradle

@@ -50,12 +50,12 @@ task clean(type: Delete) {
 
 ext {
     android = [
-            minSdkVersion    : 21,
+            minSdkVersion    : 24,
             targetSdkVersion : 31,
             compileSdkVersion: 31,
             buildToolsVersion: "35.0.0",
-            versionCode      : 5,
-            versionName      : "1.0.4"
+            versionCode      : 7,
+            versionName      : "1.0.6"
     ]
 
     depsVersion = [

+ 1 - 1
settings.gradle

@@ -1,4 +1,4 @@
-rootProject.name = "huiyan_WMS"
+rootProject.name = "HuiYan_WMS"
 include ':app'
 
 include ':progresslitelibrary'