标签:开学,String,System,item,测试,println,重写,public,out From: https://www.cnblogs.com/bdsz/p/17711537.html
import java.util.Scanner;
public class WarehouseManagement {
public static void main(String[] args) {
ItemhouseInformation item []=new ItemhouseInformation[5];
while(true){
menu.show();
int a=0;
Scanner num = new Scanner(System.in);
a = num.nextInt();
if(a==1){
menu.inmanagement(item);
}
else if(a==2){
menu.xiugai(item);
}
else if(a==3){
menu.chuku(item);
}
else if(a==4){
menu.pandian(item);
break;
}
else{
System.out.println("输入不正确,请重新输入");
}
}
}
}
class ItemhouseInformation {
private String itemno,itemname,suppliername,itemhousingtime,shipmenttime,itemhousenumber,itemhouseplace;
private int itemnumber,outnumber;
ItemhouseInformation(String itemno,String itemname,String suppliername,String itemhousingtime,String shipmenttime,String itemhousenumber,String itemhouseplace,int itemnumber,int outnumber)
{
this.itemno=itemno;
this.itemname=itemname;
this.suppliername=suppliername;
this.itemhousingtime=itemhousingtime;
this.shipmenttime=shipmenttime;
this.itemhousenumber=itemhousenumber;
this.itemhouseplace=itemhouseplace;
this.itemnumber=itemnumber;
this.outnumber=outnumber;
}
public void setItemno(String s){itemno=s;}
public String getItemno(){return itemno;}
public void setItemname(String s){itemname=s;}
public String getItemname(){return itemname;}
public void setSuppliername(String s)
{suppliername=s;}
public String getSuppliername(){return suppliername;}
public void setItemhousingtime(String s){itemhousingtime=s;}
public String getItemhousingtime(){return itemhousingtime;}
public void setShipmenttime(String s){shipmenttime=s;}
public String getShipmenttime(){return shipmenttime;}
public void setItemhousenumber(String s){itemhousenumber=s;}
public String getItemhousenumber(){return itemhousenumber;}
public void setItemhouseplace(String s){itemhouseplace=s;}
public String getItemhouseplace(){return itemhouseplace;}
public void setItemnumber(int s){itemnumber=s;}
public int getItemnumber(){return itemnumber;}
public void setOutnumber(int s){outnumber=s;}
public int getOutnumber(){return outnumber;}
}
class menu {
public static void show() {
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版\n" +
"***********************************************************\n" +
"1、商品入库管理\n" +
"2、商品信息修改\n" +
"3、商品出库管理\n" +
"4、仓库盘点管理\n" +
"**********************************************************");
}
public static void inmanagement(ItemhouseInformation item[]) {
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版\n" +
"***********************************************************\n" +
"请依次输入商品编码、商品名称、供货商信息、入库时间、存放仓库号、存放位置信息");
String num1;
Scanner num = new Scanner(System.in);
num1 = num.next();
int i;
for (i = 0; i < 5; i++) {
String args[]=new String[i];
if (item[i].getItemno().equals(num1)) {
while (true) {
System.out.println("***********************************************************\n" +
"石家庄铁道大学前进22软件开发有限公司\n" +
"仓库管理系统2022版\n" +
"***********************************************************\n");
System.out.println("商品编号:" + item[i].getItemno());
System.out.println("商品名称:" + item[i].getItemname());
System.out.println("供货商信息:" + item[i].getSuppliername());
System.out.println("入库时间:" + item[i].getItemhousingtime());
System.out.println("存放仓库号:" + item[i].getItemhousenumber());
System.out.println("存放位置信息:" + item[i].getItemhouseplace());
System.out.println("入库商品数量:" + item[i].getItemnumber());
System.out.println("该商品入库操作已完成,是否提交(Y/N)\n" +
"**********************************************************");
break;
}
}
if (i == 5) {
System.out.println("请重新输入");
}
}
}
public static void xiugai(ItemhouseInformation item[]) {
System.out.println("***********************************************************\n"+
"石家庄铁道大学前进22软件开发有限公司\n+"+
"仓库管理系统2022版\n"+
"***********************************************************\n"+
"请输入商品编号:XXXXXXXX\n"+
"**********************************************************");
String num1;
Scanner num = new Scanner(System.in);
num1=num.next();
int u;
u=num.nextInt();
switch(u){
case 1:
}
}
public static void chuku(ItemhouseInformation item[]){
}
public static void pandian(ItemhouseInformation item[]){
System.out.println("***********************************************************\n"+
"石家庄铁道大学前进22软件开发有限公司\n"+
"仓库管理系统2022版\n"+
"***********************************************************\n");
int i;
for (i = 0; i < 5; i++){
System.out.println("商品编号:" + item[i].getItemno());
System.out.println("商品名称:" + item[i].getItemname());
System.out.println("库存数量:");
}
String num1;
Scanner num = new Scanner(System.in);
num1 = num.next();
}
}