java控制台输出订单管理系统

本文介绍了一个使用Java在控制台实现的订单管理系统。系统包括商家平台和用户平台,通过接口交互。商家和用户信息存储在泛型表中,各平台类对相关功能进行抽象并实现。
摘要由CSDN通过智能技术生成

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.
import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.sql.*; public class system extends JFrame { JDesktopPane deskpane = new JDesktopPane();//在窗体里建立虚拟桌 JPanel p = new JPanel();//创建一个面板并实例化 public system(){//构造函数 setTitle("订单管理系统");//设置窗体标题 Container con = getContentPane(); con.setLayout(new BorderLayout());//创建一个布局 con.add(deskpane,BorderLayout.CENTER);//实例虚拟桌面的布局 Font f =new Font("新宋体",Font.PLAIN,12); JMenuBar mb = new JMenuBar();//实例化菜单栏 mb.setOpaque(true); setJMenuBar(mb); mb.setOpaque(true); setJMenuBar(mb); JMenu systemM = new JMenu("系统管理"); systemM.setFont(f); mb.add(systemM); JMenuItem land = new JMenuItem("重新登陆"); land.setFont(f); JMenuItem exit = new JMenuItem("退出系统"); exit.setFont(f); systemM.add(land); systemM.add(exit); JMenu userM = new JMenu("用户管理"); userM.setFont(f); mb.add(userM); JMenuItem password = new JMenuItem("密码修改"); password.setFont(f); JMenuItem addDelete = new JMenuItem("添加/删除用户"); addDelete.setFont(f); userM.add(password); userM.add(addDelete); JMenu mesM = new JMenu("信息管理"); mesM .setFont(f); mb.add(mesM ); JMenu addM= new JMenu("添加信息"); addM.setFont(f); JMenu viewM = new JMenu("查看信息"); viewM.setFont(f); JMenu modifM = new JMenu("修改信息"); modifM.setFont(f); JMenu deleteM = new JMenu("删除信息"); deleteM.setFont(f); mesM.add(addM); mesM.add(viewM); mesM.add(modifM); mesM.add(deleteM); JMenuItem addgoods = new JMenuItem("添加商品信息"); addgoods.setFont(f); addM.add(addgoods); JMenuItem addclient = new JMenuItem("添加客户信息"); addclient.setFont(f); addM.add(addclient); JMenuItem viewgoods= new JMenuItem("查看商品信息"); viewgoods.setFont(f); viewM.add(viewgoods); JMenuItem viewclient = new JMenuItem("查看客户信息"); viewclient.setFont(f); viewM.add(viewclient); JMenuItem modifgoods = new JMenuItem("修改商品信息"); modifgoods.setFont(f); modifM.add(modifgoods); JMenuItem modifclient = new JMenuItem("修改用户信息"); modifclient.setFont(f); modifM.add(modifclient); JMenuItem deletegoods = new JMenuItem("删除商品信息"); deletegoods.setFont(f); deleteM.add(deletegoods); JMenuItem deleteclient = new JMenuItem("删除用户信息"); deleteclient.setFont(f); deleteM.add(deleteclient); JMenu orderM = new JMenu("订单管理"); orderM.setFont(f); mb.add(orderM); JMenuItem addO= new JMenuItem("添加订单"); addO.setFont(f); JMenuItem viewO = new JMenuItem("查看订单"); viewO.setFont(f); JMenuItem modifO = new JMenuItem("修改订单"); modifO.setFont(f); JMenuItem deleteO = new JMenuItem("删除订单"); deleteO.setFont(f); orderM.add(addO); orderM.add(viewO); orderM.add(modifO); orderM.add(deleteO); //主界面上标出学号、姓名、及所作系统名 JLabel jlabel1=new JLabel(); jlabel1.setFont(new Font("宋体",Font.BOLD,15)); //设置字体 jlabel1.setHorizontalAlignment(SwingConstants.CENTER); //设置位置 jlabel1.setText("简易订单管理系统学号:070810228" + " 姓名:廖太春指导老师:周老师"); jlabel1.setBounds(450,350, 200, 200); deskpane.add(jlabel1); password.addActionListener(new ActionListener(){//密码修改监听 public void actionPerformed(ActionEvent e){ System.out.println("修改密码"); deskpane.add(new modifpsw()); } }); land.addActionListener(new ActionListener(){//重新登陆监听 public void actionPerformed(ActionEvent e){ System.out.println("登录"); setVisible(false); new Land(); } }); addDelete.addActionListener(new ActionListener(){//添加/删除用户监听 public void actionPerformed(ActionEvent e){ deskpane.add(new AddDeleteUser()); } }); addgoods.addActionListener(new ActionListener(){//添加商品信息 public void actionPerformed(ActionEvent e){ deskpane.add(new addgoods()); } }); addclient.addActionListener(new ActionListener(){//添加用户信息 public void actionPerformed(ActionEvent e){ deskpane.add(new addclient()); } }); viewgoods.addActionListener(new ActionListener(){//查看商品信息 public void actionPerformed(ActionEvent e){ System.out.println("查看商品信息"); deskpane.add(new viewgoods()); } }); viewclient.addActionListener(new ActionListener(){//查看客户信息 public void actionPerformed(ActionEvent e){ System.out.println("查看客户信息"); deskpane.add(new viewclient()); } }); modifgoods.addActionListener(new ActionListener(){//修改商品信息 public void actionPerformed(ActionEvent e){ System.out.println("修改商品信息"); deskpane.add(new modifgoods()); } }); modifclient.addActionListener(new ActionListener(){//修改用户信息 public void actionPerformed(ActionEvent e){ System.out.println("修改用户信息"); deskpane.add(new modifclient()); } }); deletegoods.addActionListener(new ActionListener(){//删除商品信息 public void actionPerformed(ActionEvent e){ System.out.println("删除商品信息"); deskpane.add(new deletegoods()); } }); deleteclient.addActionListener(new ActionListener(){//删除用户信息 public void actionPerformed(ActionEvent e){ System.out.println("删除用户信息"); deskpane.add(new deleteclient()); } }); addO.addActionListener(new ActionListener(){//添加订单 public void actionPerformed(ActionEvent e){ deskpane.add(new addO()); } }); viewO.addActionListener(new ActionListener(){//查看订单 public void actionPerformed(ActionEvent e){ deskpane.add(new viewO()); } }); modifO.addActionListener(new ActionListener(){//修改订单 public void actionPerformed(ActionEvent e){ System.out.println("修改订单"); deskpane.add(new modifO()); } }); deleteO.addActionListener(new ActionListener(){//删除订单 public void actionPerformed(ActionEvent e){ System.out.println("/删除订单"); deskpane.add(new deleteO()); } }); exit.addActionListener(new ActionListener(){//退出系统监听 public void actionPerformed(ActionEvent e){ setVisible(false); } }); this.setBounds(200,200,700,600); setVisible(true); } public static void main(String[] args){ new Land(); } }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值