ソースを参照

仓库管理增加库位库存核查功能

songw 5 ヶ月 前
コミット
080cc8a645

+ 63 - 0
app/src/main/java/com/uas/keg_wms_new/bean/InventoryVerificationStorageLocationBean.java

@@ -0,0 +1,63 @@
+package com.uas.keg_wms_new.bean;
+
+public
+        /**
+         * Created by sw on 2025-06-25
+         */
+class InventoryVerificationStorageLocationBean {
+    //{
+    //            "BAR_REMAIN": 710,   //数量
+    //            "BAR_LOCATION": null,  //仓位
+    //            "PR_SPEC": "0201,240Ω,1/20W,1% ,-55", //名称
+    //            "PR_DETAIL": "贴片0201电阻",  //规格
+    //            "BAR_PRODCODE": "KR02011100022"  //物料编号(料号)
+    //        }
+
+
+    private int BAR_REMAIN;
+    private String BAR_LOCATION;
+    private String PR_SPEC;
+    private String PR_DETAIL;
+    private String BAR_PRODCODE;
+
+    public int getBAR_REMAIN() {
+        return BAR_REMAIN;
+    }
+
+    public void setBAR_REMAIN(int BAR_REMAIN) {
+        this.BAR_REMAIN = BAR_REMAIN;
+    }
+
+    public String getBAR_LOCATION() {
+        return BAR_LOCATION;
+    }
+
+    public void setBAR_LOCATION(String BAR_LOCATION) {
+        this.BAR_LOCATION = BAR_LOCATION;
+    }
+
+    public String getPR_SPEC() {
+        return PR_SPEC;
+    }
+
+    public void setPR_SPEC(String PR_SPEC) {
+        this.PR_SPEC = PR_SPEC;
+    }
+
+    public String getPR_DETAIL() {
+        return PR_DETAIL;
+    }
+
+    public void setPR_DETAIL(String PR_DETAIL) {
+        this.PR_DETAIL = PR_DETAIL;
+    }
+
+    public String getBAR_PRODCODE() {
+        return BAR_PRODCODE;
+    }
+
+    public void setBAR_PRODCODE(String BAR_PRODCODE) {
+        this.BAR_PRODCODE = BAR_PRODCODE;
+    }
+
+}

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

@@ -182,6 +182,11 @@ public class IndexWareHouseContentFragment extends BaseFragment implements Adapt
                     getFragmentManager().beginTransaction().addToBackStack(null)
                             .replace(R.id.container_function_fragment, fragment).commit();
                     break;
+                case GloableParams.INVENTORY_VERIFICATION_STORAGE_LOCATIONS:    //库位库存核查
+                    fragment = new InventoryVerificationStorageLocationsFra();
+                    getFragmentManager().beginTransaction().addToBackStack(null)
+                            .replace(R.id.container_function_fragment, fragment).commit();
+                    break;
 
             }
             if (mFragment != null) {

+ 204 - 0
app/src/main/java/com/uas/keg_wms_new/fragment/InventoryVerificationStorageLocationsFra.java

@@ -0,0 +1,204 @@
+package com.uas.keg_wms_new.fragment;
+
+import android.graphics.Color;
+import android.support.v4.content.ContextCompat;
+import android.text.TextUtils;
+import android.view.KeyEvent;
+import android.view.View;
+import android.view.WindowManager;
+import android.widget.Button;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.android.volley.Request;
+import com.bin.david.form.core.SmartTable;
+import com.bin.david.form.core.TableConfig;
+import com.bin.david.form.data.CellInfo;
+import com.bin.david.form.data.column.Column;
+import com.bin.david.form.data.format.bg.BaseCellBackgroundFormat;
+import com.bin.david.form.data.style.FontStyle;
+import com.bin.david.form.data.table.TableData;
+import com.uas.keg_wms_new.R;
+import com.uas.keg_wms_new.activity.FunctionActivity;
+import com.uas.keg_wms_new.bean.InventoryVerificationStorageLocationBean;
+import com.uas.keg_wms_new.global.GloableParams;
+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;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public
+        /**
+         * Created by sw on 2024-12-31
+         */
+class InventoryVerificationStorageLocationsFra extends BaseFragment{
+
+    private ClearableEditText cet_bar_code,cet_position;
+    private Button bt_query;
+    private List<InventoryVerificationStorageLocationBean> ivslbList;
+    private Column<String> BAR_LOCATIO, BAR_PRODCODE, BAR_REMAIN ;
+    private SmartTable st_data;
+    private TableData mTableData;
+
+    @Override
+    protected int getLayout() {
+        return R.layout.fra_inventory_veriflcation_storage_location;
+    }
+
+    @Override
+    protected void initViews() {
+        FunctionActivity.setTitle(getResources().getString(R.string.Inventory_verification_of_storage_locations));
+        cet_bar_code = root.findViewById(R.id.cet_bar_code);
+        cet_position = root.findViewById(R.id.cet_position);
+        bt_query = root.findViewById(R.id.bt_query);
+        st_data = root.findViewById(R.id.st_data);
+
+        cet_bar_code.requestFocus();
+    }
+
+    @Override
+    protected void initEvents() {
+        bt_query.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                getQueryData();
+            }
+        });
+    }
+
+    private void getQueryData() {
+        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, "请输入需要查询的(料号/条码)或仓位");
+            if (TextUtils.isEmpty(barCode)) {
+                cet_bar_code.requestFocus();
+            }else {
+                cet_position.requestFocus();
+            }
+            return;
+        }
+        progressDialog.show();
+        VolleyRequest.getInstance().stringRequest(new HttpParams.Builder()
+                .url(GloableParams.ADDRESS_LOCATION_CHECK)
+                .method(Request.Method.GET)
+                .addParam("pr_code",barCode)
+                .addParam("location",position)
+                .build(), new HttpCallback() {
+            @Override
+            public void onSuccess(int flag, Object o) throws Exception {
+                progressDialog.dismiss();
+                String result = o.toString();
+                JSONObject resultObject = JSON.parseObject(result);
+                JSONArray dataArr = resultObject.getJSONArray("data");
+                if (dataArr != null) {
+                    if (dataArr.size() > 0) {
+                        for (int i = 0; i < dataArr.size(); i++) {
+                            JSONObject jsonObject = dataArr.getJSONObject(i);
+                            InventoryVerificationStorageLocationBean ivslb = new InventoryVerificationStorageLocationBean();
+                            ivslb.setBAR_REMAIN(jsonObject.getInteger("BAR_REMAIN"));
+                            ivslb.setBAR_LOCATION(jsonObject.getString("BAR_LOCATION"));
+                            ivslb.setPR_SPEC(jsonObject.getString("PR_SPEC"));
+                            ivslb.setPR_DETAIL(jsonObject.getString("PR_DETAIL"));
+                            ivslb.setBAR_PRODCODE(jsonObject.getString("BAR_PRODCODE"));
+                            ivslbList.add(ivslb);
+                        }
+                    }else {
+                        CommonUtil.toastNoRepeat(mActivity, "未匹配到数据");
+                    }
+                    if (ivslbList.size() > 0) {
+                        setFilterTableData(ivslbList);
+                    }
+                }
+            }
+
+            @Override
+            public void onFail(int flag, String failStr) throws Exception {
+                progressDialog.dismiss();
+                CommonUtil.toastNoRepeat(mActivity, failStr);
+                cet_bar_code.setText("");
+                cet_position.setText("");
+            }
+        });
+    }
+
+    @Override
+    protected void initDatas() {
+        ivslbList = new ArrayList();
+
+        WindowManager wm = mActivity.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")))
+                .setContentCellBackgroundFormat(new BaseCellBackgroundFormat<CellInfo>() {
+                    @Override
+                    public int getBackGroundColor(CellInfo cellInfo) {
+                        if (cellInfo.row % 2 == 0) {
+                            return ContextCompat.getColor(mActivity, R.color.blue_50);
+                        }
+                        return TableConfig.INVALID_COLOR;
+                    }
+                });
+
+        BAR_LOCATIO = new Column<String>("仓位", "BAR_LOCATIO");
+        BAR_PRODCODE = new Column<String>("物料编号", "BAR_PRODCODE");
+        BAR_REMAIN = new Column<String>("数量", "BAR_REMAIN");
+
+    }
+
+    private void setFilterTableData(List<InventoryVerificationStorageLocationBean> filterTableData) {
+        mTableData = new TableData<InventoryVerificationStorageLocationBean>("出库单列表", filterTableData,
+                BAR_LOCATIO, BAR_PRODCODE, BAR_REMAIN);
+        st_data.setTableData(mTableData);
+        //        st_data.requestLayout();
+        st_data.postDelayed(new Runnable() {
+            @Override
+            public void run() {
+                st_data.postInvalidate();
+            }
+        }, 100);
+    }
+
+    @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);
+    }
+
+
+}

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

@@ -305,6 +305,8 @@ public class GloableParams {
     public static String ADDRESS_TRANSFER_TRANSFERTONEWLOCATION;    //仓库管理:库位确认转移
     public static String ADDRESS_BARSTOCK_SEARCHBYLOCATION;         //仓库管理:库位物料库存查询
 
+    public static String ADDRESS_LOCATION_CHECK;         //库位库存核查-查询
+
     //连接服务器请求地址
     private static final String ADDRESSTAIL_CONNECT_SERVER = "/api/pda/getAllMasters.action";
     //登录页面请求地址
@@ -852,6 +854,9 @@ public class GloableParams {
     //仓库管理:库位物料库存查询
     private static final String ADDRESSTAIL_BARSTOCK_SEARCHBYLOCATION = "/api/pda/barStock/searchByLocation.action";
 
+    //仓库管理 -- 库位库存核查-- 查询
+    private static final String ADDRESSTAIL_LOCATION_CHECK = "/api/pda/check/locationCheck.action";
+
     /**
      *智能上架(扫码)
      */
@@ -918,6 +923,7 @@ public class GloableParams {
     public static final String LIGHT_RELEASE_THE_ALARM = "解除报警";
     public static final String ILLUMINATE_BY_CUSTOMER = "按客户点亮";
     public static final String GRIDNAME_WHCODE_TRANSFER = "移库";
+    public static final String INVENTORY_VERIFICATION_STORAGE_LOCATIONS = "库位库存核查";
     public static final String[] storageGridNames = {
             GRIDNAME_GOOD_SEARCH,
             GRIDNAME_BATCH_OPRATION,
@@ -932,7 +938,8 @@ public class GloableParams {
             LIGHT_EMPTY_STORAGE_SPACE,
             LIGHT_RELEASE_THE_ALARM,
             ILLUMINATE_BY_CUSTOMER,
-            GRIDNAME_WHCODE_TRANSFER
+            GRIDNAME_WHCODE_TRANSFER,
+            INVENTORY_VERIFICATION_STORAGE_LOCATIONS
     };
     public static final int[] storageGridImgs = {
             R.drawable.storage_good_search,
@@ -948,7 +955,8 @@ public class GloableParams {
             R.drawable.dianliangkongkucun,
             R.drawable.jiechubaojing,
             R.drawable.kehudianliang,
-            R.drawable.storage_transfer
+            R.drawable.storage_transfer,
+            R.drawable.kuweikucunhecha
     };
     //DETAIL:搜索备料单号,下拉列表
     public static final String SPINNER_PREPARE_SEARCH = "搜索备料单号";
@@ -1370,5 +1378,7 @@ public class GloableParams {
         GloableParams.ADDRESS_TRANSFER_TRANSFERTONEWLOCATION = uriHead + GloableParams.ADDRESSTAIL_TRANSFER_TRANSFERTONEWLOCATION;
         GloableParams.ADDRESS_BARSTOCK_SEARCHBYLOCATION = uriHead + GloableParams.ADDRESSTAIL_BARSTOCK_SEARCHBYLOCATION;
 
+        GloableParams.ADDRESS_LOCATION_CHECK = uriHead + GloableParams.ADDRESSTAIL_LOCATION_CHECK;
+
     }
 }

+ 7 - 2
app/src/main/java/com/uas/keg_wms_new/util/CommonUtil.java

@@ -581,8 +581,13 @@ public class CommonUtil {
                 errorStr = "系统错误";
             }
         }
-        //振动提示
-        makeNotice();
+        try {
+            //振动提示
+            makeNotice();
+        }catch (Exception e) {
+            e.printStackTrace();
+        }
+
         /*MediaPlayer mp = new MediaPlayer();
         try {
             mp.setDataSource(PdaApplication.getmContext(), RingtoneManager

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


+ 107 - 0
app/src/main/res/layout/fra_inventory_veriflcation_storage_location.xml

@@ -0,0 +1,107 @@
+<?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="10dp"
+        android:layout_marginEnd="10dp"
+        >
+
+        <TextView
+            android:layout_width="90dp"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:padding="10dp"
+            android:text="料号/条码"
+            android:textColor="@color/red"
+            android:textSize="16sp"  />
+
+        <com.uas.keg_wms_new.view.ClearableEditText
+            android:id="@+id/cet_bar_code"
+            style="@style/EditTextStyle"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:hint="请输入料号/条码"
+            android:background="@drawable/shape_msg_block"
+            android:lines="1"
+            android:maxLines="1"
+            android:textColor="@color/black"
+            android:singleLine="true"/>
+
+    </LinearLayout>
+
+    <LinearLayout
+        android:layout_marginTop="35dp"
+        android:orientation="horizontal"
+        android:layout_width="match_parent"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="10dp"
+        android:layout_marginEnd="10dp"
+        >
+
+        <TextView
+            android:layout_width="90dp"
+            android:layout_height="match_parent"
+            android:gravity="center"
+            android:padding="10dp"
+            android:text="仓位"
+            android:textColor="@color/red"
+            android:textSize="16sp"  />
+
+        <com.uas.keg_wms_new.view.ClearableEditText
+            android:id="@+id/cet_position"
+            style="@style/EditTextStyle"
+            android:layout_width="0dp"
+            android:layout_weight="1"
+            android:hint="仓位"
+            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_query"
+            android:layout_width="0dp"
+            android:layout_height="match_parent"
+            android:textSize="16sp"
+            android:textColor="@color/white"
+            android:background="@drawable/bg_button"
+            android:text="查询"
+            android:layout_weight="4"/>
+
+    </LinearLayout>
+
+
+    <com.bin.david.form.core.SmartTable
+        android:layout_marginTop="10dp"
+        android:layout_marginStart="10dp"
+        android:layout_marginEnd="10dp"
+        android:id="@+id/st_data"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:layout_weight="1" />
+
+
+
+</LinearLayout>

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

@@ -458,6 +458,8 @@
     <string name="Inventory_barcode_printing">库存条码打印</string>
     <string name="Please_enter_barcode">请输入条码</string>
 
+    <string name="Inventory_verification_of_storage_locations">库位库存核查</string>
+
 
 
 </resources>