import java.util.ArrayList;
import java.util.Scanner;
public class mainFrame {
public static void main(String[] args) {
ArrayList<WarehouseInformation> array=new ArrayList<WarehouseInformation>();
while(true){
System.out.println("**********************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("**********************************");
System.out.println(" 1、商品入库管理");
System.out.println(" 2、商品信息修改");
System.out.println(" 3、商品出库管理");
System.out.println(" 4、仓库盘点管理");
System.out.println("**********************************");
System.out.println("请输入:");
Scanner sc=new Scanner(System.in);
String number=sc.nextLine();
switch (number){
case "1":
goodsWarehousing(array);
break;
case "2":
modifyWarehous(array);
break;
case "3":
outboundWarehouse(array);
break;
case "4":
countGoods(array);
System.exit(0);
}
}
}
public static void goodsWarehousing(ArrayList<WarehouseInformation> array){
System.out.println("**********************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("**********************************");
System.out.print("商品编号:");
Scanner sc=new Scanner(System.in);
String itemno=sc.nextLine();
System.out.print("商品名称:");
String itemname=sc.nextLine();
System.out.print("供货商信息:");
String suppliername =sc.nextLine();
System.out.print("入库时间:");
String warehousingtime =sc.nextLine();
System.out.print("存放仓库号:");
String warehousenumber=sc.nextLine();
System.out.print("存放位置信息:");
String warehouseplace=sc.nextLine();
System.out.print("入库商品数量:");
int itemnumber=sc.nextInt();
WarehouseInformation s=new WarehouseInformation();
s.setItemno(itemno);
s.setItemname(itemname);
s.setSuppliername(suppliername);
s.setWarehousingtime(warehousingtime);
s.setWarehousenumber(warehousenumber);
s.setWarehouseplace(warehouseplace);
s.setItemnumber(itemnumber);
System.out.println("**********************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("**********************************");
System.out.println("商品编号:"+s.getItemno());
System.out.println("商品名称:"+s.getItemname());
System.out.println("供货商信息:"+s.getSuppliername());
System.out.println("入库时间:"+s.getWarehousingtime());
System.out.println("存放仓库号:"+s.getWarehousenumber());
System.out.println("存放位置信息:"+s.getWarehouseplace());
System.out.println("入库商品数量:"+s.getItemnumber());
System.out.println("该商品入库操作已完成,是否提交(Y/N)");
String n=sc.nextLine();
array.add(s);
}
public static void modifyWarehous(ArrayList<WarehouseInformation> array){
System.out.println("**********************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("**********************************");
System.out.println(" 请输入商品编号:XXXXXXXX");
System.out.println("**********************************");
Scanner sc=new Scanner(System.in);
String itemno=sc.nextLine();
if(array.size()==0)
{
System.out.println("库中没有该商品");
return;
}
WarehouseInformation s=new WarehouseInformation();
for (int i=0;i<array.size();i++){
s=array.get(i);
if(s.getItemno().equals(itemno )){
System.out.println("**********************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("**********************************");
System.out.println("1.商品编号:"+s.getItemno());
System.out.println("2.商品名称:"+s.getItemname());
System.out.println("3.供货商信息:"+s.getSuppliername());
System.out.println("4.入库时间:"+s.getWarehousingtime());
System.out.println("5.存放仓库号:"+s.getWarehousenumber());
System.out.println("6.存放位置信息:"+s.getWarehouseplace());
System.out.println("7.入库商品数量:"+s.getItemnumber());
System.out.println("请选择需要修改的信息编号(1-7):");
System.out.println("**********************************");
int m=sc.nextInt();
if(m>=0||m>7)
{
System.out.println("该选项不存在");
return;
}
else{
switch (m) {
case 1:
String itemno1 = sc.nextLine();
s.setItemno(itemno1);
array.add(s);
break;
case 2:
String itemname1 = sc.nextLine();
s.setItemname(itemname1);
array.add(s);
break;
case 3:
String suppliername1 = sc.nextLine();
s.setSuppliername(suppliername1);
array.add(s);
break;
case 4:
String warehousingtime1= sc.nextLine();
s.setWarehousingtime(warehousingtime1);
array.add(s);
break;
case 5:
String warehousenumber1 = sc.nextLine();
s.setWarehousenumber(warehousenumber1);
array.add(s);
break;
case 6:
String warehouseplace1 = sc.nextLine();
s.setWarehouseplace(warehouseplace1);
array.add(s);
break;
case 7:
int itemnumber1 = sc.nextInt();
s.setItemnumber(itemnumber1);
array.add(s);
break;
}
}
}
}
}
public static void outboundWarehouse(ArrayList<WarehouseInformation> array) {
Scanner sc = new Scanner(System.in);
System.out.println("**********************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("**********************************");
System.out.println(" 请输入商品编号:XXXXXXXX");
System.out.println("**********************************");
String itemno = sc.nextLine();
WarehouseInformation s = new WarehouseInformation();
for (int i = 0; i < array.size(); i++) {
s = array.get(i);
if (s.getItemno().equals(itemno)) {
System.out.println("**********************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("**********************************");
System.out.println(" 1.商品编号:" + s.getItemno());
System.out.println(" 2.商品名称:" + s.getItemname());
System.out.println(" 3.供货商信息:" + s.getSuppliername());
System.out.println(" 4.入库时间:" + s.getWarehousingtime());
System.out.println(" 5.存放仓库号:" + s.getWarehousenumber());
System.out.println(" 6.存放位置信息:" + s.getWarehouseplace());
System.out.println(" 7.入库商品数量:" + s.getItemnumber());
System.out.println(" 出库时间:XXXXXXXXX");
System.out.println(" 出库数量:xxx ");
System.out.println("**********************************");
break;
}
String shipmenttime = sc.nextLine();
int outnumber = sc.nextInt();
s.setShipmenttime(shipmenttime);
s.setOutnumber(outnumber);
System.out.println("请选择(Y/N)");
String a = sc.nextLine();
array.add(s);
}
}
public static void countGoods(ArrayList<WarehouseInformation> array){
System.out.println("**********************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("***********************************");
for(int i=0;i<array.size();i++)
{
WarehouseInformation s=array.get(i);
Scanner sc=new Scanner(System.in);
int n=s.getItemnumber()-s.getOutnumber();
System.out.println("商品编号:"+s.getItemno()+"、商品名称:"+s.getItemname()+"、库存量:"+n);
}
System.out.println("***********************************");
}
}
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;
public WarehouseInformation() {
}
public String getItemno() {
return itemno;
}
public void setItemno(String itemno) {
this.itemno = itemno;
}
public String getItemname() {
return itemname;
}
public void setItemname(String itemname) {
this.itemname = itemname;
}
public String getSuppliername() {
return suppliername;
}
public void setSuppliername(String suppliername) {
this.suppliername = suppliername;
}
public String getWarehousingtime() {
return warehousingtime;
}
public void setWarehousingtime(String warehousingtime) {
this.warehousingtime = warehousingtime;
}
public String getShipmenttime() {
return shipmenttime;
}
public void setShipmenttime(String shipmenttime) {
this.shipmenttime = shipmenttime;
}
public String getWarehousenumber() {
return warehousenumber;
}
public void setWarehousenumber(String warehousenumber) {
this.warehousenumber = warehousenumber;
}
public String getWarehouseplace() {
return warehouseplace;
}
public void setWarehouseplace(String warehouseplace) {
this.warehouseplace = warehouseplace;
}
public int getItemnumber() {
return itemnumber;
}
public void setItemnumber(int itemnumber) {
this.itemnumber = itemnumber;
}
public int getOutnumber() {
return outnumber;
}
public void setOutnumber(int outnumber) {
this.outnumber = outnumber;
}
}