Browse Source

增加点亮空仓库功能及相关页面接口

songw 11 months ago
parent
commit
d7d83ae97c

+ 5 - 2
app/src/main/java/com/uas/keg_wms_new/adapter/ReportDetailAdapter.java

@@ -16,15 +16,18 @@ public class ReportDetailAdapter extends BaseQuickAdapter<GroundingBean, BaseVie
     @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_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_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());
     }
 }

+ 9 - 0
app/src/main/java/com/uas/keg_wms_new/bean/GroundingBean.java

@@ -12,6 +12,15 @@ public class GroundingBean {
     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;

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

@@ -261,20 +261,20 @@ public class FreeListingFragment extends BaseFragment {
     }
 
     private void getBarAcceptCode(String barcode,String shcode) {
-        if (TextUtils.isEmpty(barcode)){
-            CommonUtil.toastNoRepeat(mActivity, getResources().getString(R.string.Please_enter_the_barcode_number));
-            return;
-        }
         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", barcode)
+                    .addParam("shcode", shcode)
                     .addParam("barcode", barcode)
                     .build(), new HttpCallback() {
                 @Override
@@ -327,7 +327,9 @@ public class FreeListingFragment extends BaseFragment {
                     mResultTextView.setText(failStr);
                     mBarcodeEditText.requestFocus();
                     mBarcodeEditText.setText(null);
-                    cet_material_rack.setText(null);
+                    if (!cb_free_listing.isChecked()) {
+                        cet_material_rack.setText(null);
+                    }
                     ll_shangjia.setVisibility(View.GONE);
                     ll_end_data.setVisibility(View.GONE);
                 }

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

@@ -156,6 +156,11 @@ public class IndexWareHouseContentFragment extends BaseFragment implements Adapt
                     getFragmentManager().beginTransaction().addToBackStack(null)
                             .replace(R.id.container_function_fragment, fragment).commit();
                     break;
+                case GloableParams.LIGHT_EMPTY_STORAGE_SPACE:     //点亮空仓位
+                    fragment = new LightEmptyStorageSpaceFragment();
+                    getFragmentManager().beginTransaction().addToBackStack(null)
+                            .replace(R.id.container_function_fragment, fragment).commit();
+                    break;
             }
             if (mFragment != null) {
                 FragmentUtils.switchFragment(IndexWareHouseContentFragment.this, mFragment);

+ 232 - 0
app/src/main/java/com/uas/keg_wms_new/fragment/LightEmptyStorageSpaceFragment.java

@@ -0,0 +1,232 @@
+package com.uas.keg_wms_new.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.keg_wms_new.R;
+import com.uas.keg_wms_new.activity.FunctionActivity;
+import com.uas.keg_wms_new.global.GloableParams;
+import com.uas.keg_wms_new.listener.MyEditorActionListener;
+import com.uas.keg_wms_new.util.CommonUtil;
+import com.uas.keg_wms_new.util.HttpCallback;
+import com.uas.keg_wms_new.util.HttpParams;
+import com.uas.keg_wms_new.util.VolleyRequest;
+import com.uas.keg_wms_new.view.ClearableEditText;
+
+public
+        /**
+         * Created by sw on 2024-12-19
+         */
+class LightEmptyStorageSpaceFragment extends BaseFragment{
+
+
+    private ClearableEditText cet_material_rack;
+    private Button bt_light_empty_storage_space,bt_extinguish_empty_storage_space;
+    private TextView tv_result;
+    private LinearLayout ll_result;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fragment_light_empty_storage_space;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle(getResources().getString(R.string.light_empty_storage_space));
+
+        cet_material_rack = root.findViewById(R.id.cet_material_rack);
+        bt_light_empty_storage_space = root.findViewById(R.id.bt_light_empty_storage_space);
+        bt_extinguish_empty_storage_space = root.findViewById(R.id.bt_extinguish_empty_storage_space);
+        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_light_empty_storage_space.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getlightEmptyStorage(cet_material_rack.getText().toString().trim());
+            }
+        });
+
+        bt_extinguish_empty_storage_space.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getExtinguishEmptyStorageSpace(cet_material_rack.getText().toString().trim());
+            }
+        });
+
+    }
+
+    private void getExtinguishEmptyStorageSpace(String shcode) {
+        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().stringRequest60(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_SHELF_LIGHT_ON_EMPTY_LOCATION)
+                .method(Request.Method.GET)
+                .addParam("shcode",shcode)
+                .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(resultObject.getString("data"));
+                    cet_material_rack.setText("");
+                }else {
+                    tv_result.setTextColor(getResources().getColor(R.color.red));
+                    tv_result.setText(resultObject.getString("message"));
+                }
+            }
+
+            @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);
+            }
+        });
+    }
+
+    private void getlightEmptyStorage(String shcode) {
+        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().stringRequest60(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_SHELF_LIGHT_ON_EMPTY_LOCATION)
+                .method(Request.Method.GET)
+                .addParam("shcode",shcode)
+                .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(resultObject.getString("data"));
+                    cet_material_rack.setText("");
+                }else {
+                    tv_result.setTextColor(getResources().getColor(R.color.red));
+                    tv_result.setText(resultObject.getString("message"));
+                }
+            }
+
+            @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);
+            }
+        });
+    }
+
+    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_GET_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_result.setVisibility(View.VISIBLE);
+                if (resultObject.optBoolean("success")) {
+                    tv_result.setTextColor(getResources().getColor(R.color.blue));
+                    tv_result.setText(getResources().getText(R.string.Shelf_validation_successful));
+                    cet_material_rack.setText("");
+                }else {
+                    tv_result.setTextColor(getResources().getColor(R.color.red));
+                    tv_result.setText(resultObject.getString("message"));
+                }
+            }
+
+            @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);
+    }
+
+}

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

@@ -86,6 +86,7 @@ public class PositionInquiryFragment extends BaseFragment{
                             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);

+ 16 - 2
app/src/main/java/com/uas/keg_wms_new/global/GloableParams.java

@@ -283,6 +283,9 @@ public class GloableParams {
     public static String ADDRESS_FREE_SMART_START;    //自由上架 条码号enter/上架
     public static String ADDRESS_FREE_SMART_END;    //自由上架 结束上架
 
+    public static String ADDRESS_GET_SHELF;    // 点亮空仓位/料架Enter
+    public static String ADDRESS_SHELF_LIGHT_ON_EMPTY_LOCATION;    // 点亮空仓位/点亮空仓位
+
     //连接服务器请求地址
     private static final String ADDRESSTAIL_CONNECT_SERVER = "/api/pda/getAllMasters.action";
     //登录页面请求地址
@@ -791,6 +794,11 @@ public class GloableParams {
     //结束上架
     private static final String ADDRESSTAIL_FREE_SMART_END = "/api/pda/transfer/freeSmartEnd.action";
 
+    // 点亮空仓位/料架enter
+    private static final String ADDRESSAIL_GET_SHELF = "/api/pda/transfer/getShelf.action";
+    //点亮空仓位/点亮空仓位
+    private static final String ADDRESSAIL_SHELF_LIGHT_ON_EMPTY_LOCATION = "/api/pda/transfer/shelfLightOnEmptyLocation.action";
+
 
     /**
      *智能上架(扫码)
@@ -853,6 +861,7 @@ public class GloableParams {
 //    public static final String GRIDNAME_SMART_SHELVES = "智能上架(扫码)";
 //    public static final String GRIDNAME_SMART_SHELVES = "AGV上架";
     public static final String GRIDNAME_SMART_SHELVES = "自由上架";
+    public static final String LIGHT_EMPTY_STORAGE_SPACE = "点亮空库位";
     public static final String[] storageGridNames = {
             GRIDNAME_GOOD_SEARCH,
             GRIDNAME_BATCH_OPRATION,
@@ -862,7 +871,8 @@ public class GloableParams {
             MENU_STORAGE_BARCODE_INFO_COLLECT,
 //            GRIDNAME_BOM_CHECK,
 //            MENU_STORAGE_STOCK_INFO_COLLECT
-            GRIDNAME_SMART_SHELVES
+            GRIDNAME_SMART_SHELVES,
+            LIGHT_EMPTY_STORAGE_SPACE
     };
     public static final int[] storageGridImgs = {
             R.drawable.storage_good_search,
@@ -872,7 +882,8 @@ public class GloableParams {
             R.drawable.ic_modify_quantity,
 //            R.drawable.storage_msd_manager,
 //            R.drawable.storage_transfer
-            R.drawable.iv_shelves
+            R.drawable.iv_shelves,
+            R.drawable.dianliangkongkucun
     };
     //DETAIL:搜索备料单号,下拉列表
     public static final String SPINNER_PREPARE_SEARCH = "搜索备料单号";
@@ -1266,5 +1277,8 @@ public class GloableParams {
         GloableParams.ADDRESS_FREE_SMART_START = uriHead + GloableParams.ADDRESSTAIL_FREE_SMART_START;
         GloableParams.ADDRESS_FREE_SMART_END = uriHead + GloableParams.ADDRESSTAIL_FREE_SMART_END;
 
+        GloableParams.ADDRESS_GET_SHELF = uriHead + GloableParams.ADDRESSAIL_GET_SHELF;
+        GloableParams.ADDRESS_SHELF_LIGHT_ON_EMPTY_LOCATION = uriHead + GloableParams.ADDRESSAIL_SHELF_LIGHT_ON_EMPTY_LOCATION;
+
     }
 }

+ 4 - 0
app/src/main/java/com/uas/keg_wms_new/util/VolleyRequest.java

@@ -53,6 +53,10 @@ public class VolleyRequest {
         stringRequest(null, httpParams, 10 * 1000, httpCallback);
     }
 
+    public void stringRequest60(final HttpParams httpParams, final HttpCallback httpCallback) {
+        stringRequest(null, httpParams, 60 * 1000, httpCallback);
+    }
+
     public void stringRequest(StringRequest stringRequest, final HttpParams httpParams, final int timeoutMs, final HttpCallback httpCallback) {
         if (httpParams == null) {
             throw new IllegalArgumentException("httpParams can not be NULL");

BIN
app/src/main/res/drawable/dianliangkongkucun.png


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

@@ -3,7 +3,6 @@
     xmlns:tools="http://schemas.android.com/tools"
     android:layout_width="match_parent"
     android:layout_height="match_parent"
-    xmlns:ndroid="http://schemas.android.com/apk/res-auto"
     android:orientation="vertical"
     android:padding="@dimen/root_layout_padding">
 

+ 110 - 0
app/src/main/res/layout/fragment_light_empty_storage_space.xml

@@ -0,0 +1,110 @@
+<?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.keg_wms_new.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_light_empty_storage_space"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:textSize="16sp"
+            android:textColor="@color/white"
+            android:background="@drawable/bg_button"
+            android:text="@string/light_empty_storage_space"
+            android:layout_weight="4"/>
+
+        <View
+            android:layout_width="0dp"
+            android:layout_height="wrap_content"
+            android:layout_weight="1"
+            />
+
+        <Button
+            android:id="@+id/bt_extinguish_empty_storage_space"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:textSize="16sp"
+            android:textColor="@color/white"
+            android:background="@drawable/bg_button_yellow"
+            android:text="@string/extinguish_empty_storage_space"
+            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>

+ 1 - 1
app/src/main/res/layout/item_report_detail.xml

@@ -40,7 +40,7 @@
         <TextView
             android:layout_width="wrap_content"
             android:layout_height="match_parent"
-            android:text="仓位:"
+            android:text="料架:"
             android:textColor="@color/body_text_1"
             android:textSize="14sp" />
 

+ 7 - 0
app/src/main/res/values/strings.xml

@@ -446,4 +446,11 @@
     <string name="Current_position">目前仓位</string>
     <string name="aready_stored_in_storage_space">已经存放仓位</string>
 
+    <string name="light_empty_storage_space">点亮空库位</string>
+    <string name="extinguish_empty_storage_space">熄灭空库位</string>
+
+
+
+
+
 </resources>

+ 2 - 2
build.gradle

@@ -54,8 +54,8 @@ ext {
             targetSdkVersion : 28,
             compileSdkVersion: 28,
             buildToolsVersion: "28.0.3",
-            versionCode      : 2,
-            versionName      : "v1.0.1"
+            versionCode      : 3,
+            versionName      : "v1.0.2"
     ]
 
     depsVersion = [