java控制台输出订单管理系统
import kotlin.collections.ArrayDeque;
import java.util.*;
//Define store Object
class Product {
int Id ;
String Productname;
int Price;
int Num;
Product(int id,String productname,int price,int num){
Id = id;
Productname = productname;
Price = price;
Num = num;
}
}
class UserOrder {
int Id ;
String Productname;
int Price;
int Num;
UserOrder(int id,String productname,int price,int num){
Id = id;
Productname = productname;
Price = price;
Num = num;
}
void getTotalPrice(){
}
}
class Orderplatform {
//business object
public static boolean flag = true;
public static List<Product> productlist= new LinkedList<Product>();
public static Iterator<Product> productiter= productlist.iterator();
//user object
public static List<UserOrder> userlist= new LinkedList<UserOrder>();
public static Iterator<UserOrder> useriter= userlist.iterator();
public static boolean userflag = true;
Orderplatform(String s){
ProjectPower projectPower;
System.out.println("商家编辑今日商品:"+s+" 请输入 1,展现商品列表,输入 2,商品新增,输入 3,商品编辑 ,输入 4,商品删除,5 exit" +
",6 进入用户下单\"");
do {
Scanner scanner = new Scanner(System.in);
String select = scanner.nextLine();
//decrese mang quit
try {
int userdicesion = Integer.parseInt(select);
switch (userdicesion) {
case 1:
projectPower = new ProductsList();
projectPower.Partpower();
break;
case 2:
projectPower = new ProductsAdd();
projectPower.Partpower();
break;
case 3:
projectPower = new ProductsEdit();
projectPower.Partpower();
break;
case 4:
projectPower = new ProductsDell();
projectPower.Partpower();
break;
case 5:
exit();
case 6:
UserAdpter userAdpter = new UserAdpter();
break;
default:
break;
}
}
catch (Exception e){
System.out.