package gg;
public class WarehouseInformation {
private String itemnode;
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 String getItemnode() {
return itemnode;
}
public void setItemnode(String itemnode) {
this.itemnode = itemnode;
}
public String getSuppliername() {
return suppliername;
}
public void setSuppliername(String suppliername) {
this.suppliername = suppliername;
}
public String getItemname() {
return itemname;
}
public void setItemname(String itemname) {
this.itemname = itemname;
}
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;
}
public WarehouseInformation(String itemnode,String itemname,String suppliername,String warehousingtime,String shipmenttime,String warehousenumber,String warehouseplace,int itemnumber,int outnumber) {
this.itemnode = itemnode;
this.itemname = itemname;
this.itemnumber= itemnumber;
this.outnumber=outnumber;
this.shipmenttime=shipmenttime;
this.suppliername=suppliername;
this.warehousenumber=warehousenumber;
this.warehouseplace=warehouseplace;
this.warehousingtime=warehousingtime;
}
}
标签:String,print,System,修改,println,sc,out From: https://www.cnblogs.com/liyize/p/17709683.html
import java.util.Scanner;
public class WarehouseManagement {
static String [] itemnumber =new String[5];
static String [] itemname =new String[5];
static String [] suppliername =new String[5];
static String [] warehousingtime =new String[5];
static String [] warehousenumber =new String[5];
static String [] warehouseplace =new String[5];
static int [] itemno =new int [5];
public static int menu(){
Scanner sc=new Scanner(System.in);
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("**********************************************************");
int ch;
System.out.println("请选择");
ch=sc.nextInt();
return ch;
}
public static void luru(int m){
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("***********************************************************");
System.out.println("商品编号:");
String s;
Scanner sc=new Scanner(System.in);
s= sc.next();
System.out.print("商品名称:");
String s1;
s1=sc.next();
System.out.print("供货商信息:");
String s2;
s2=sc.next();
System.out.print("入库时间:");
String s3;
s3=sc.next();
System.out.print("存放库房号:");
String s4;
s4=sc.next();
System.out.print("存放位置信息:");
String s5;
s5=sc.next();
System.out.print("入库商品数量:");
int s6;
s6=sc.nextInt();
System.out.println("该商品的入库操作已完成,是否提交(Y/N)");
String s7;
s7=sc.next();
if (s7.equals("Y")) {
itemnumber[m]=s;
itemname[m]=s1;
suppliername[m]=s2;
warehousingtime[m]=s3;
warehousenumber[m]=s4;
warehouseplace[m]=s5;
itemno[m]=s6;
System.out.println("录入成功");
}
}
public static void xiugai(int m){
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("***********************************************************");
System.out.println("请输入商品编号:");
Scanner sc=new Scanner(System.in);
String s1;
s1=sc.next();
for (int i=0;i<m;i++){
if(itemnumber[i].equals(s1)){
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("***********************************************************");
System.out.println("1.商品编号:");
System.out.println(itemnumber[i]);
System.out.print("2.商品名称:");
System.out.println(itemname[i]);
System.out.print("3.供货商信息:");
System.out.println(suppliername[i]);
System.out.print("4.入库时间:");
System.out.println(warehousingtime[i]);
System.out.print("5.存放仓库号:");
System.out.println(warehousenumber[i]);
System.out.print("6.存放位置信息:");
System.out.println(warehouseplace[i]);
System.out.print("7.入库商品数量:");
System.out.println(itemno[i]);
System.out.print("请选择需要修改的信息编号(1-7):");
int x;
x=sc.nextInt();
if (x!=1&&x!=2&&x!=3&&x!=4&&x!=5&&x!=7&&x!=6){
System.out.println("该选项不存在");
}
if(x==1){
String s2;
s2=sc.next();
itemnumber[i]=s2;
System.out.println("修改成功");
}
if(x==2){
String s3;
s3=sc.next();
itemname[i]=s3;
System.out.println("修改成功");
}
if(x==3){
String s4;
s4=sc.next();
suppliername[i]=s4;
System.out.println("修改成功");
}
if(x==4){
String s5;
s5=sc.next();
warehousingtime[i]=s5;
System.out.println("修改成功");
}
if(x==5){
String s6;
s6=sc.next();
warehousenumber[i]=s6;
System.out.println("修改成功");
}
if(x==6){
String s7;
s7=sc.next();
warehouseplace[i]=s7;
System.out.println("修改成功");
}
if(x==7){
int s8;
s8=sc.nextInt();
itemno[i]=s8;
System.out.println("修改成功");
}
}
if(i==4){
if(itemnumber[i].equals(s1)){
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("***********************************************************");
System.out.println("1.商品编号:");
System.out.println(itemnumber[i]);
System.out.print("2.商品名称:");
System.out.println(itemname[i]);
System.out.print("3.供货商信息:");
System.out.println(suppliername[i]);
System.out.print("4.入库时间:");
System.out.println(warehousingtime[i]);
System.out.print("5.存放仓库号:");
System.out.println(warehousenumber[i]);
System.out.print("6.存放位置信息:");
System.out.println(warehouseplace[i]);
System.out.print("7.入库商品数量:");
System.out.println(itemno[i]);
System.out.print("请选择需要修改的信息编号(1-7):");
int x;
x=sc.nextInt();
if (x!=1&&x!=2&&x!=3&&x!=4&&x!=5&&x!=7&&x!=6){
System.out.println("该选项不存在");
}
if(x==1){
String s2;
s2=sc.next();
itemnumber[i]=s2;
System.out.println("修改成功");
}
if(x==2){
String s3;
s3=sc.next();
itemname[i]=s3;
System.out.println("修改成功");
}
if(x==3){
String s4;
s4=sc.next();
suppliername[i]=s4;
System.out.println("修改成功");
}
if(x==4){
String s5;
s5=sc.next();
warehousingtime[i]=s5;
System.out.println("修改成功");
}
if(x==5){
String s6;
s6=sc.next();
warehousenumber[i]=s6;
System.out.println("修改成功");
}
if(x==6){
String s7;
s7=sc.next();
warehouseplace[i]=s7;
System.out.println("修改成功");
}
if(x==7){
int s8;
s8=sc.nextInt();
itemno[i]=s8;
System.out.println("修改成功");
}
}
}
}
}
public static void chuku(int m){
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("***********************************************************");
System.out.println("请输入商品编号:");
Scanner sc=new Scanner(System.in);
String s;
s=sc.next();
for (int i=0;i<m;i++){
if(itemnumber[i].equals(s)){
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("***********************************************************");
System.out.println("1.商品编号:");
System.out.println(itemnumber[i]);
System.out.print("2.商品名称:");
System.out.println(itemname[i]);
System.out.print("3.供货商信息:");
System.out.println(suppliername[i]);
System.out.print("4.入库时间:");
System.out.println(warehousingtime[i]);
System.out.print("5.存放仓库号:");
System.out.println(warehousenumber[i]);
System.out.print("6.存放位置信息:");
System.out.println(warehouseplace[i]);
System.out.print("7.入库商品数量:");
System.out.println(itemno[i]);
System.out.print("出库时间:");
// Scanner sc=new Scanner(System.in);
String x;
x=sc.next();
System.out.print("出库数量");
int y=sc.nextInt();
if(y>itemno[i]){
System.out.println("输入错误");
}
else {
itemno[i] = itemno[i] - y;
}
}
if(i==4){
if(itemnumber[i].equals(s)){
System.out.println("***********************************************************");
System.out.println(" 石家庄铁道大学前进22软件开发有限公司");
System.out.println(" 仓库管理系统2022版");
System.out.println("***********************************************************");
System.out.println("1.商品编号:");
System.out.println(itemnumber[i]);
System.out.print("2.商品名称:");
System.out.println(itemname[i]);
System.out.print("3.供货商信息:");
System.out.println(suppliername[i]);
System.out.print("4.入库时间:");
System.out.println(warehousingtime[i]);
System.out.print("5.存放仓库号:");
System.out.println(warehousenumber[i]);
System.out.print("6.存放位置信息:");
System.out.println(warehouseplace[i]);
System.out.print("7.入库商品数量:");
System.out.println(itemno[i]);
System.out.print("出库时间:");
// Scanner sc=new Scanner(System.in);
String x;
x=sc.next();
System.out.print("出库数量");
int y=sc.nextInt();
if(y>itemno[i]){
System.out.println("输入错误");
}
else {
itemno[i] = itemno[i] - y;
}
}
else{
System.out.println("输入错误");
}
}
}
}
public static void pandian(int m){
for(int i=0;i<m;i++){
System.out.print("商品编号:");
System.out.print(itemnumber[i]);
System.out.print("商品名称:");
System.out.print(itemname[i]);
System.out.print("库存数量:");
System.out.println(itemno[i]);
}
}
public static void main(String[] args){
int choice;
int m=0;
boolean flag=true;
while(flag){
choice=menu();
switch(choice){
case 1:
luru(m);
m++;
break;
case 2:
xiugai(m);
break;
case 3:
chuku(m);
break;
case 4:
pandian(m);
break;
case 5:
flag=false;
}
}
}
}