po3a  

、系统背景

某机械有限公司为了公司进一步的发展,需要实现企业数字化管理,新引进一套企业信息管理系统(ERP由于该产品缺乏入库功能,特委托石家庄铁道大学信息科学与技术学院前进22软件有限公司开发仓库管理功能。

二、 数据结构要求:(5分)

1定义WarehouseInformation类,其中包括个私有变量(itemnumberitemnamesuppliername,warehousingtime,shipmenttimewarehousenumber,warehouseplace,itemnumber,outnumber)。

各成员的含义如下:

变量itemno 为字符串类型 String表示商品编号(有8 位数字组成)。

变量itemname 为字符串类型 String表示商品名称

变量suppliernameString 类型,表示供货商名称。

变量warehousingtimeString 类型,表示入库时间,长度八位例如:20230904

变量shipmenttimeString类型,表示出库时间,长度八位例如:20230904,如果该商品未出库,则出库时间为空,如果该商品已出库,则要求出库时间必须晚于入库时间。

变量warehousenumberString类型,表示仓库编号。长度三位。

变量warehouseplaceString类型,表示存放商品的具体位置,长度八位数字XXXXYYZZ其中XXXX表示货架号,YY表示货架的层号,ZZ表示存放在该货架该层的商品顺序号。

变量itemnumber为整型,表示入库商品的数量。

变量outnumber为整型,表示出库商品的数量。

 

对每个变量定义 get()(读取变量信息)和 set()(设置变量信息)的方法。

2赋初值方法包括个参数,用于为变量sitemnumberitemnamesuppliername,warehousingtime,shipmenttimewarehousenumber,warehouseplace,itemnumber,outnumber)赋值。

三、 功能要求:(10分)

该功能完成仓库管理的基本功能功能,定义WarehouseManagement类完成下列功能。

1利用数组实现至少存储五个商品入库基本信息;1分)

2、仓库管理系统的主界面如下图所示:1分)

①界面要求;(0.5分)

***********************************************************

石家庄铁道大学前进22软件开发有限公司

仓库管理系统2022版

***********************************************************

1商品入库管理

2商品信息修改

3商品出库管理

4、仓库盘点管理

**********************************************************

 

②功能说明

输入数字1-4执行相应的功能,输入其他数字提示错误信息(该选项不存在),并返回主界面。0.5分)

 

2、商品入库管理功能操作流程:(2分)

①在主界面选择“商品入库管理”功能后,进入“商品入库管理”界面,如下图所示:(0.5分)

依次录入商品编码、商品名称、供货商信息、入库时间、存放仓库号、存放位置信息,录入完成后的界面如下所示:

***********************************************************

石家庄铁道大学前进22软件开发有限公司

仓库管理系统2022

***********************************************************

商品编号:20203982

商品名称:华为笔记本电脑

供货商信息河北省正大光明有限公司

入库时间:20230904

存放仓库号:003

存放位置信息:0180350

入库商品数量:100

**********************************************************

如果商品编码、入库时间、存放仓库号、存放位置信息录入格式错误,则提示录入错误要求用户重新录入正确信息。(1分)

 

 

全部正确信息录入完毕后,显示如下界面。

***********************************************************

石家庄铁道大学前进22软件开发有限公司

仓库管理系统2022

***********************************************************

商品编号:20203982

商品名称:华为笔记本电脑

供货商信息:河北省正大光明有限公司

入库时间:20230904

存放仓库号:003

存放位置信息:0180350

入库商品数量100

该商品入库操作已完成,是否提交(Y/N

**********************************************************

选择Y”将商品信息存储到到相应的数组中,并返回主界面。选择N”,则忽略上述录入内容,并返回商品入库界面。(0.5分)

 

3、商品信息修改(2分)

①在主界面选择“商品信息修改”功能后,进入“商品信息修改”界面,如下图所示:

 

 

 

 

 

***********************************************************

石家庄铁道大学前进22软件开发有限公司

仓库管理系统2022

***********************************************************

请输入商品编号:XXXXXXXX

**********************************************************

提示用户输入八位的商品编号。

②如果库中不存在该商品信息,则提示库中没有该商品,返回到商品修改界面。如果库中存在该商品,则显示:商品编码、商品名称、供货商信息、入库时间、存放仓库号、存放位置信息。如下图所示。(1分)

***********************************************************

石家庄铁道大学前进22软件开发有限公司

仓库管理系统2022

***********************************************************

1、商品编号:20203982

2、商品名称:华为笔记本电脑

3、供货商信息:河北省正大光明有限公司

4、入库时间:20230904

5、存放仓库号:003

6、存放位置信息:0180350

7、入库商品数量:100

请选择需要修改的信息编号(1-7

**********************************************************

输入数字1-7显示出需要修改的信息录入界面如下图所示,输入其他数字提示错误信息(该选项不存在),并返回主界面(0.5分)***********************************************************

石家庄铁道大学前进22软件开发有限公司

仓库管理系统2022

***********************************************************

1、商品编号:20203982

2、商品名称:华为笔记本电脑

3、供货商信息:河北省正大光明有限公司

4、入库时间:20230904

5、存放仓库号:003

6、存放位置信息:0180350

7、商品数量:100

请选择需要修改的信息编号(1-72

请输入修改后的商品名称:XXXXXXXX

**********************************************************

选择Y”将修改信息保存提交。选择N”,不保存修改信息返回系统主界面。(0.5分)

4、商品出库管理2分)

①在主界面选择“商品出库管理”功能后,进入“商品出库管理”界面,如下图所示:(0.5分)

***********************************************************

石家庄铁道大学前进22软件开发有限公司

仓库管理系统2022

***********************************************************

请输入商品编号:XXXXXXXX

**********************************************************

提示用户输入八位的商品编号。

②如果库中不存在该商品信息,则提示库中没有该商品,返回到商品修改界面。如果库中存在该商品,则显示:商品编码、商品名称、供货商信息、入库时间、存放仓库号、存放位置信息。如下图所示。(1分)

***********************************************************

石家庄铁道大学前进22软件开发有限公司

仓库管理系统2022

***********************************************************

1、商品编号:20203982

2、商品名称:华为笔记本电脑

3、供货商信息:河北省正大光明有限公司

4、入库时间:20230904

5、存放仓库号:003

6、存放位置信息:0180350

7、入库商品数量:100

出库时间XXXXXXXXX

出库数量:xxx

**********************************************************

③,填写出库时间和出库数量,出库数量要小于该商品在数据库中所有入库数量之和,选择Y”保存结果,返回系统主界面。选择N”, 返回当前界面。(0.5分)

 

 

5、用户选择数字4”,进入仓库盘点功能,显示如下界面。(2分)

 

 

***********************************************************

石家庄铁道大学前进22软件开发有限公司

仓库管理系统2022

***********************************************************

1、 商品编号:XXXXXXX、商品名称:XXXXX、库存数量:xxx

2、 商品编号:XXXXXXX、商品名称:XXXXX、库存数量:xxx

3、 商品编号:XXXXXXX、商品名称:XXXXX、库存数量:xxx

4、 商品编号:XXXXXXX、商品名称:XXXXX、库存数量:xxx

5、 商品编号:XXXXXXX、商品名称:XXXXX、库存数量:xxx

………………………………………………….

**********************************************************

显示全部商品数量,期中库存数量=入库数量之和 -- 出库数量之和

创建

WarehouseInformation.java

WarehouseManagement.java

Main.java

 

复制代码
public class WarehouseInformation {
    private String itemno;//商品编号
    private String itemname;//商品名称
    private String suppliername;//供货商名称
    private String warehousingtime;//入库时间
    private String shipmenttime;//出库时间
    private String warehousenumber;//仓库编号
    private String warehouseplace;//存放商品的具体位置
    private int  itemnumber;//入库商品的数量
    private int outnumber;//出库商品的数量

    //get(),set()方法


    public String getItemno() {
        return itemno;
    }

    public String getItemname() {
        return itemname;
    }

    public String getSuppliername() {
        return suppliername;
    }

    public String getWarehousingtime() {
        return warehousingtime;
    }

    public String getShipmenttime() {
        return shipmenttime;
    }

    public String getWarehousenumber() {
        return warehousenumber;
    }

    public String getWarehouseplace() {
        return warehouseplace;
    }

    public int getItemnumber() {
        return itemnumber;
    }

    public int getOutnumber() {
        return outnumber;
    }

    public void setItemno(String itemno) {
        this.itemno = itemno;
    }

    public void setItemname(String itemname) {
        this.itemname = itemname;
    }

    public void setSuppliername(String suppliername) {
        this.suppliername = suppliername;
    }

    public void setWarehousingtime(String warehousingtime) {
        this.warehousingtime = warehousingtime;
    }

    public void setShipmenttime(String shipmenttime) {
        this.shipmenttime = shipmenttime;
    }

    public void setWarehousenumber(String warehousenumber) {
        this.warehousenumber = warehousenumber;
    }

    public void setWarehouseplace(String warehouseplace) {
        this.warehouseplace = warehouseplace;
    }

    public void setItemnumber(int itemnumber) {
        this.itemnumber = itemnumber;
    }

    public void setOutnumber(int outnumber) {
        this.outnumber = outnumber;
    }

    //赋初值方法
    public WarehouseInformation(String itemno, String itemname, String suppliername, String warehousingtime, String shipmenttime, String warehousenumber, String warehouseplace, int itemnumber, int outnumber) {
        this.itemno = itemno;
        this.itemname = itemname;
        this.suppliername = suppliername;
        this.warehousingtime = warehousingtime;
        this.shipmenttime = shipmenttime;
        this.warehousenumber = warehousenumber;
        this.warehouseplace = warehouseplace;
        this.itemnumber = itemnumber;
        this.outnumber = outnumber;
    }

}


复制代码
复制代码
import jdk.dynalink.beans.StaticClass;

import java.util.Scanner;

public class WarehouseManagement {
    static WarehouseInformation[] warehouseInformations=new WarehouseInformation[50];

    public void chishihua(){
        WarehouseInformation w1=new WarehouseInformation("00000001","商品名称1","供货商名称1","20220901","20220902","001","00010101",176,100);
        WarehouseInformation w2=new WarehouseInformation("00000002","商品名称2","供货商名称2","20220901","20220903","002","00020202",187,100);
        WarehouseInformation w3=new WarehouseInformation("00000003","商品名称3","供货商名称3","20220901","20220904","003","00030303",450,200);
        WarehouseInformation w4=new WarehouseInformation("00000005","商品名称4","供货商名称4","20220902","20220904","004","00040404",310,200);
        WarehouseInformation w5=new WarehouseInformation("00000005","商品名称5","供货商名称5","20220902","20220905","005","00050505",500,400);
        warehouseInformations[0]=w1;
        warehouseInformations[1]=w2;
        warehouseInformations[2]=w3;
        warehouseInformations[3]=w4;
        warehouseInformations[4]=w5;
    }

    public void menu(){
        System.out.println("***********************************************************\n");
        System.out.println("           石家庄铁道大学前进22软件开发有限公司\n");
        System.out.println("                  仓库管理系统2022版\n");
        System.out.println("***********************************************************\n");
        System.out.println("                    1、商品入库管理\n");
        System.out.println("                    2、商品信息修改\n");
        System.out.println("                    3、商品出库管理\n");
        System.out.println("                    4、仓库盘点管理\n");
        System.out.println("**********************************************************\n");
        System.out.println("请选择您需要的功能:\n");
        choice();
    }

    public void choice(){
        Scanner sc=new Scanner(System.in);
        int c=sc.nextInt();
        switch (c){
            case 1:
                in();
                break;
            case 2:
                change();
                break;
            case 3:
                out();
                break;
            case 4:
                Inventory();
                break;
            default:
                System.out.println("您输入的信息有误请再次输入");
                menu();
        }
    }
    //商品入库管理方法
    public void in(){
        System.out.println("***********************************************************\n");
        System.out.println("           石家庄铁道大学前进22软件开发有限公司\n");
        System.out.println("                  仓库管理系统2022版\n");
        System.out.println("***********************************************************\n");
        while (true){
            int t=0;
            for (int i=5;i<6;i++){
                System.out.println("请录入商品编码(有8 位数字组成,如00000001):\n");
                Scanner sc = new Scanner(System.in);
                String no= sc.next();
                if(no.length()==8){
                    System.out.println("输入正确!请继续录入商品名称\n");
                    String na= sc.next();
//                    warehouseInformations[i].setItemno(no);
//                    warehouseInformations[i].setItemname(na);
                    System.out.println("输入正确!请继续录入供货商信息\n");
                    String sna=sc.next();
//                    warehouseInformations[i].setSuppliername(sna);
                    System.out.println("输入正确!请继续录入入库时间(长度八位例如:20230904)\n");
                    String wt=sc.next();
                    if(wt.length()==8){
                        System.out.println("输入正确!请继续录入出库时间(长度八位例如:20230905,请注意时间要晚于入库时间)\n");
//                        warehouseInformations[i].setWarehousingtime(wt);
                        String st=sc.next();
                        if (st.length()==8){
//                            warehouseInformations[i].setShipmenttime(st);
                            System.out.println("输入正确!请继续录入仓库编号(长度三位,如001)\n");
                            String wn=sc.next();
                            if(wn.length()==3){
//                                warehouseInformations[i].setWarehousenumber(wn);
                                System.out.println("输入正确!请继续录入商品的具体位置\n");
                                System.out.println("长度八位数字XXXXYYZZ,其中XXXX表示货架号,YY表示货架的层号,ZZ表示存放在该货架该层的商品顺序号\n");
                                String wp=sc.next();
                                if (wp.length()==8){
//                                    warehouseInformations[i].setWarehouseplace(wt);
                                    System.out.println("输入正确!请继续录入入库商品的数量\n");
                                    int num1= sc.nextInt();
//                                    warehouseInformations[i].setItemnumber(num1);
                                    System.out.println("输入正确!请继续录入出库商品的数量\n");
                                    int num2=sc.nextInt();
                                    System.out.println("输入正确!已成功录入所有信息\n");
                                    warehouseInformations[i].setItemno(no);
                                    warehouseInformations[i].setItemname(na);
                                    warehouseInformations[i].setSuppliername(sna);
                                    warehouseInformations[i].setWarehousingtime(wt);
                                    warehouseInformations[i].setShipmenttime(st);
                                    warehouseInformations[i].setWarehousenumber(wn);
                                    warehouseInformations[i].setWarehouseplace(wt);
                                    warehouseInformations[i].setItemnumber(num1);
                                    System.out.println("***********************************************************\n");
                                    System.out.println("           石家庄铁道大学前进22软件开发有限公司\n");
                                    System.out.println("                  仓库管理系统2022版\n");
                                    System.out.println("***********************************************************\n");
                                    System.out.println("                  商品编号:"+warehouseInformations[i].getItemno());
                                    System.out.println("               商品名称:"+warehouseInformations[i].getItemname());
                                    System.out.println("             供货商信息:"+warehouseInformations[i].getSuppliername());
                                    System.out.println("                    入库时间:"+warehouseInformations[i].getWarehousingtime());
                                    System.out.println("                      存放仓库号:"+warehouseInformations[i].getWarehousenumber());
                                    System.out.println("                   存放位置信息:"+warehouseInformations[i].getWarehouseplace());
                                    System.out.println("                     入库商品数量:"+warehouseInformations[i].getItemnumber());
                                    System.out.println("**********************************************************\n");
                                    System.out.println(" \n");
                                    System.out.println("***********************************************************\n");
                                    System.out.println("           石家庄铁道大学前进22软件开发有限公司\n");
                                    System.out.println("                  仓库管理系统2022版\n");
                                    System.out.println("***********************************************************\n");
                                    System.out.println("                  商品编号:"+warehouseInformations[i].getItemno());
                                    System.out.println("               商品名称:"+warehouseInformations[i].getItemname());
                                    System.out.println("             供货商信息:"+warehouseInformations[i].getSuppliername());
                                    System.out.println("                    入库时间:"+warehouseInformations[i].getWarehousingtime());
                                    System.out.println("                      存放仓库号:"+warehouseInformations[i].getWarehousenumber());
                                    System.out.println("                   存放位置信息:"+warehouseInformations[i].getWarehouseplace());
                                    System.out.println("                     入库商品数量:"+warehouseInformations[i].getItemnumber());
                                    System.out.println("              该商品入库操作已完成,是否提交(Y/N)");
                                    System.out.println("**********************************************************\n");
                                    String c=sc.next();
                                    if(c.equals("Y")){
                                        menu();
                                        t=1;
                                    }else if(c.equals("N")){
                                        t=0;
                                        warehouseInformations[i].setItemnumber(0);
                                        warehouseInformations[i].setWarehouseplace(" ");
                                        warehouseInformations[i].setWarehousenumber(" ");
                                        warehouseInformations[i].setShipmenttime(" ");
                                        warehouseInformations[i].setWarehousingtime(" ");
                                        warehouseInformations[i].setSuppliername(" ");
                                        warehouseInformations[i].setItemname(" ");
                                        warehouseInformations[i].setItemno(" ");
                                    }
                                }
                            }else {
                                t=0;
                                System.out.println("输入错误,请重新输入:");
                            }
                        }
                    }else {
                        t=0;
                        System.out.println("输入错误,请重新输入:");
                    }
                }else{
                    t=0;
                    System.out.println("输入错误,请重新输入:");
                }
            }
            if (t==1){
                break;
            }
        }
    }

    //商品信息修改方法
    public void change(){
        while (true) {
            int t=0;
            System.out.println("***********************************************************\n");
            System.out.println("           石家庄铁道大学前进22软件开发有限公司\n");
            System.out.println("                  仓库管理系统2022版\n");
            System.out.println("***********************************************************\n");
            System.out.println("               请输入商品编号:XXXXXXXX\n");
            System.out.println("***********************************************************\n");
            System.out.println("请输入八位的商品编号:");
            Scanner sc =new Scanner(System.in);
            String num =sc.next();
            for(int i=0;i<50;i++){
                if (num.equals(warehouseInformations[i].getItemno())){
                    System.out.println("***********************************************************\n");
                    System.out.println("           石家庄铁道大学前进22软件开发有限公司\n");
                    System.out.println("                  仓库管理系统2022版\n");
                    System.out.println("***********************************************************\n");
                    System.out.println("                  1.商品编号:"+warehouseInformations[i].getItemno());
                    System.out.println("               2.商品名称:"+warehouseInformations[i].getItemname());
                    System.out.println("             3.供货商信息:"+warehouseInformations[i].getSuppliername());
                    System.out.println("                    4.入库时间:"+warehouseInformations[i].getWarehousingtime());
                    System.out.println("                      5.存放仓库号:"+warehouseInformations[i].getWarehousenumber());
                    System.out.println("                   6.存放位置信息:"+warehouseInformations[i].getWarehouseplace());
                    System.out.println("                     7.入库商品数量:"+warehouseInformations[i].getItemnumber());
                    System.out.println("              请选择需要修改的信息编号(1-7):\n");
                    System.out.println("**********************************************************\n");
                    int cho= sc.nextInt();
                    if (cho>=1 && cho<=7){
                        System.out.println("***********************************************************\n");
                        System.out.println("           石家庄铁道大学前进22软件开发有限公司\n");
                        System.out.println("                  仓库管理系统2022版\n");
                        System.out.println("***********************************************************\n");
                        System.out.println("                  1.商品编号:"+warehouseInformations[i].getItemno());
                        System.out.println("               2.商品名称:"+warehouseInformations[i].getItemname());
                        System.out.println("             3.供货商信息:"+warehouseInformations[i].getSuppliername());
                        System.out.println("                    4.入库时间:"+warehouseInformations[i].getWarehousingtime());
                        System.out.println("                      5.存放仓库号:"+warehouseInformations[i].getWarehousenumber());
                        System.out.println("                   6.存放位置信息:"+warehouseInformations[i].getWarehouseplace());
                        System.out.println("                     7.入库商品数量:"+warehouseInformations[i].getItemnumber());
                        System.out.println("              请选择需要修改的信息编号(1-7):\n"+cho);
                        System.out.println("              请输入修改后的商品名称:XXXXXXXX\n");
                        System.out.println("**********************************************************\n");
                        switch (cho){
                            case 1:
                                String n1=sc.next();
                                String t1=warehouseInformations[i].getItemno();
                                warehouseInformations[i].setItemno(n1);
                                System.out.println("信息修改完毕,是否保存(Y/N)\n");
                                String c1=sc.next();
                                if(c1.equals("Y")){
                                    t=1;
                                    menu();

                                }else if(c1.equals("N")) {
                                    t = 0;
                                    warehouseInformations[i].setItemno(t1);
                                }
                                break;
                            case 2:
                                String n2 = sc.next();
                                String t2=warehouseInformations[i].getItemname();
                                warehouseInformations[i].setItemname(n2);
                                System.out.println("信息修改完毕,是否保存(Y/N)\n");
                                String c2=sc.next();
                                if(c2.equals("Y")){
                                    t=1;
                                    menu();

                                }else if(c2.equals("N")) {
                                    t = 0;
                                    warehouseInformations[i].setItemname(t2);
                                }
                                break;
                            case 3:
                                String n3= sc.next();
                                String t3=warehouseInformations[i].getSuppliername();
                                warehouseInformations[i].setSuppliername(n3);
                                System.out.println("信息修改完毕,是否保存(Y/N)\n");
                                String c3=sc.next();
                                if(c3.equals("Y")){
                                    t=1;
                                    menu();

                                }else if(c3.equals("N")) {
                                    t = 0;
                                    warehouseInformations[i].setSuppliername(t3);
                                }
                                break;
                            case 4:
                                String n4 = sc.next();
                                String t4 =warehouseInformations[i].getWarehousingtime();
                                warehouseInformations[i].setWarehousingtime(n4);
                                System.out.println("信息修改完毕,是否保存(Y/N)\n");
                                String c4=sc.next();
                                if(c4.equals("Y")){
                                    t=1;
                                    menu();

                                }else if(c4.equals("N")) {
                                    t = 0;
                                    warehouseInformations[i].setWarehousingtime(t4);
                                }
                                break;
                            case 5:
                                String n5= sc.next();
                                String t5=warehouseInformations[i].getWarehousenumber();
                                warehouseInformations[i].setWarehousenumber(n5);
                                System.out.println("信息修改完毕,是否保存(Y/N)\n");
                                String c5=sc.next();
                                if(c5.equals("Y")){
                                    t=1;
                                    menu();

                                }else if(c5.equals("N")) {
                                    t = 0;
                                    warehouseInformations[i].setWarehousenumber(t5);
                                }
                                break;
                            case 6:
                                String n6 = sc.next();
                                String t6=warehouseInformations[i].getWarehouseplace();
                                warehouseInformations[i].setWarehouseplace(n6);
                                System.out.println("信息修改完毕,是否保存(Y/N)\n");
                                String c6=sc.next();
                                if(c6.equals("Y")){
                                    t=1;
                                    menu();

                                }else if(c6.equals("N")) {
                                    t = 0;
                                    warehouseInformations[i].setWarehouseplace(t6);
                                }
                                break;
                            case 7:
                                int n7=sc.nextInt();
                                int t7=warehouseInformations[i].getItemnumber();
                                warehouseInformations[i].setItemnumber(n7);
                                System.out.println("信息修改完毕,是否保存(Y/N)\n");
                                String c7=sc.next();
                                if(c7.equals("Y")){
                                    t=1;
                                    menu();

                                }else if(c7.equals("N")) {
                                    t = 0;
                                    warehouseInformations[i].setItemnumber(t7);
                                }
                                break;
                        }
                        System.out.println("信息修改完毕,是否保存(Y/N)\n");
                        String c=sc.next();
                        if(c.equals("Y")){
                            t=1;
                            menu();

                        }else if(c.equals("N")) {
                            t = 0;
                            switch (cho){
                                case 1:

                                    warehouseInformations[i].setItemno(sc.next());
                                case 2:
                                    warehouseInformations[i].setItemname(sc.next());
                                case 3:
                                    warehouseInformations[i].setSuppliername(sc.next());
                                case 4:
                                    warehouseInformations[i].setWarehousingtime(sc.next());
                                case 5:
                                    warehouseInformations[i].setWarehousenumber(sc.next());
                                case 6:
                                    warehouseInformations[i].setWarehouseplace(sc.next());
                                case 7:
                                    warehouseInformations[i].setItemnumber(sc.nextInt());
                            }

                        }
                    }else {
                        System.out.println("错误信息(该选项不存在)\n");
                        t=1;
                        menu();
                    }

                }else{
                    t=1;
                    System.out.println("库中不存在该商品信息\n");
                }
            }
            if(t==1){
                menu();
                break;
            }
        }
    }

    //商品出库管理方法
    public void out() {
        while (true) {
            int t;
            t = 0;
            System.out.println("***********************************************************\n");
            System.out.println("           石家庄铁道大学前进22软件开发有限公司\n");
            System.out.println("                  仓库管理系统2022版\n");
            System.out.println("***********************************************************\n");
            System.out.println("               请输入商品编号:XXXXXXXX\n");
            System.out.println("***********************************************************\n");
            System.out.println("请输入八位的商品编号:");
            Scanner sc = new Scanner(System.in);
            String num = sc.next();
            for (int i = 0; i < 50; i++) {
                if (num.equals(warehouseInformations[i].getItemno())) {
                    System.out.println("***********************************************************\n");
                    System.out.println("           石家庄铁道大学前进22软件开发有限公司\n");
                    System.out.println("                  仓库管理系统2022版\n");
                    System.out.println("***********************************************************\n");
                    System.out.println("                  1.商品编号:" + warehouseInformations[i].getItemno());
                    System.out.println("               2.商品名称:" + warehouseInformations[i].getItemname());
                    System.out.println("             3.供货商信息:" + warehouseInformations[i].getSuppliername());
                    System.out.println("                    4.入库时间:" + warehouseInformations[i].getWarehousingtime());
                    System.out.println("                      5.存放仓库号:" + warehouseInformations[i].getWarehousenumber());
                    System.out.println("                   6.存放位置信息:" + warehouseInformations[i].getWarehouseplace());
                    System.out.println("                     7.入库商品数量:" + warehouseInformations[i].getItemnumber());
                    System.out.println("                    出库时间:XXXXXXXXX\n");
                    System.out.println("                        出库数量:xxx\n");
                    System.out.println("**********************************************************\n");
                    System.out.println("请依次填写出库时间和出库数量(其中出库时间为八位,出库数量要小于该商品在数据库中所有入库数量之和):\n");
                    String ti= sc.next();
                    int ni=sc.nextInt();
                    System.out.println("      是否保存以上操作(Y/N)\n");
                    String cho = sc.next();
                    if(cho.equals("Y")){
                        warehouseInformations[i].setShipmenttime(ti);
                        warehouseInformations[i].setOutnumber(ni);
                        menu();
                    } else if (cho.equals("N")) {
                        menu();
                    }
                } else if(!num.equals(warehouseInformations[i].getItemno())) {
                    t = 1;
                    System.out.println("库中不存在该商品信息\n");
                    change();
                }
            }
        if (t == 1) {
            menu();
            break;
        }
    }
    }



    //仓库盘点管理方法
    public void Inventory(){
        System.out.println("***********************************************************\n");
        System.out.println("           石家庄铁道大学前进22软件开发有限公司\n");
        System.out.println("                  仓库管理系统2022版\n");
        System.out.println("***********************************************************\n");
        for (int i=0;i<=warehouseInformations.length;i++) {
            System.out.println(i+1+"、"+"  商品编号:"+warehouseInformations[i].getItemno()+"、商品名称:"+warehouseInformations[i].getItemname()+"、库存数量:"+(warehouseInformations[i].getItemnumber()-warehouseInformations[i].getOutnumber()));
        }
        System.out.println("**********************************************************\n");

    }

}
复制代码
public class Main {
    public static void main(String[] args) {
        WarehouseManagement Wh1= new WarehouseManagement();
        Wh1.chishihua();
        Wh1.menu();
    }
}

 

posted on   po3a  阅读(16)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
 
点击右上角即可分享
微信分享提示