Coder Social home page Coder Social logo

polyteknik / pro1041-duan1 Goto Github PK

View Code? Open in Web Editor NEW
1.0 0.0 1.0 111.92 MB

Dự án 1: Xây dựng phần mềm quản lí bán hàng của cửa hàng bán thiết bị di động

Java 95.01% CSS 1.94% JavaScript 0.04% HTML 2.04% TSQL 0.97%
fpl javaswing pro1041 fpt-polytechnic

pro1041-duan1's Introduction

Build Status


Dự án được xuất hiện trên website của trường (xem thêm)

DAVISY-PRO1014

Tên dự án: Xây dựng ứng dụng quản lý bán hàng cho cửa hàng bán phụ kiện thiết bị di động DAVISY



Thành viên

Tên thành viên Ảnh minh họa Chức vụ Sản phẩm nổi bật
Trần Hữu Đang 06-00-18-00-html5.gif Project Manager, developer Mô phỏng thuật toán sắp xếp
Nguyễn Khánh Đan BA Writer, Tester, developer Hệ thống bán hàng FreshFood
Đoàn Hiệp Sỹ DevOps, developer Phần mềm quản lí xe máy
Phùng Quốc Vinh Data Scentist, developer Dodge Game
Lê Bích Vi Business Analyst, developer Quản lí kí túc xá

Ngoài ra các thành viên còn đảm nhận một số nhiệm vụ khác được trình bày cụ thể trong phần báo cáo!


Documents



Mô tả chi tiết dự án

Mô tả

Phần mềm là dự án cuối môn của nhóm DAVISY trong môn dự án 1 - PRO1041 tại FPT Polytechnic được hướng dẫn bởi thầy Trần Văn Nhuộm.

Account

Tên tài khoản Tên đăng nhập Chức vụ Email Trạng Thái
Trần Văn Nhuộm admin Quản trị [email protected] Đang hoạt động
Trần Hữu Đang dangth Quản lí [email protected] Đang hoạt động
Nguyễn Khánh Đan dannk Nhân viên [email protected] Đang hoạt động
Đoàn Hiệp Sỹ sydh Nhân viên [email protected] Đang hoạt động
Phùng Quốc Vinh vinhpq Nhân viên [email protected] Ngưng hoạt động
Lê Bích Vi vilb Nhân viên [email protected] Đang hoạt động


Quản trị sẽ có toàn quyền với phần mềm

Quản lí chỉ được phép thêm các nhân viên và các thống kê về doanh thu (cùng toàn bộ các quyền của nhân viên)

Nhân viên sẽ bị hạn chế về quyền thêm tài khoản (chỉ được thêm sửa xóa khách hàng), chỉ được xem thống kê sản phẩm bán chạy



Install

  1. Tải và giải nén file đã được đính kèm
  2. Cài đặt vào ổ đĩa D trong máy tính
  3. Chạy chương trình đã cài đặt và đăng nhập với tài khoản bên trên

Run Project by Netbeans IDE

  1. Mở project "DAVISYS"
  2. Chạy trang login hoặc main trong package com.gui
  3. Đăng nhập các tài khoản bên trên


Các công nghệ sử dụng trong dự án

drawer

void initMenu() {
        drawer = Drawer.newDrawer(this)
                .addChild(new DrawerItem("Cửa sổ chính").build())
                .addChild(new DrawerItem("Tài khoản").build())
                .addFooter(new DrawerItem("Đăng xuất").build())
                .event(new EventDrawer() {
                    @Override
                    public void selected(int index, DrawerItem item) {
                        if (drawer.isShow()) {
                          drawer.hide();
                        }
                        switch (index) {
                            case 0:
                              //gọi trang Main
                              break;
                            case 1:
                              //gọi trang tài khoản
                              break;
                        }
                    }
                }).build();
}


webcam

public void initWebcam() {
    Dimension size = WebcamResolution.QVGA.getSize();
    webcam = Webcam.getWebcams().get(0); //0 is default webcam
    webcam.setViewSize(size);
    panel = new WebcamPanel(webcam);
    panel.setPreferredSize(size);
    pnQR.add(panel, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 470, 300));
    executor.execute(this);
}

Ghi đè phương thức chạy của luồng mở webcam

@Override
    public void run() {
        do {
            try {
                Thread.sleep(100);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }

            Result result = null;
            BufferedImage image = null;
            if (!webcam.isOpen()) {
                return;
            }
            if (webcam.isOpen()) {
                if ((image = webcam.getImage()) == null) {
                    continue;
                }
            }
            LuminanceSource source = new BufferedImageLuminanceSource(image);
            BinaryBitmap bitmap = new BinaryBitmap(new HybridBinarizer(source));
            try {
                result = new MultiFormatReader().decode(bitmap);
            } catch (NotFoundException e) {
            }
            if (result != null) {
                //xử lý mã tại đây
            }
        } while (true);
    }


bitmap

//Trình tạo mã QR
try {
    String charset = "UTF-8"; // or "ISO-8859-1"
    Map< EncodeHintType, ErrorCorrectionLevel> hintMap = new HashMap< EncodeHintType, ErrorCorrectionLevel>();
    hintMap.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L);
    BitMatrix matrix = new MultiFormatWriter().encode(
            new String(qrCodeData.getBytes(charset), charset),
            BarcodeFormat.QR_CODE, 200, 200, hintMap);
    MatrixToImageWriter.writeToFile(matrix, filePath.substring(filePath
            .lastIndexOf('.') + 1), new File(filePath));
     } catch (Exception e) {
}


file

try {
    XSSFWorkbook wb = new XSSFWorkbook();
    XSSFSheet sheet = wb.createSheet("Danh sách sản phẩm");
    XSSFRow row = null;
    Cell cell = null;
    row = sheet.createRow(0);

    cell = row.createCell(0, CellType.STRING);
    cell.setCellValue("MÃ SẢN PHẨM");

    cell = row.createCell(1, CellType.STRING);
    cell.setCellValue("TÊN SẢN PHẨM");

    JFileChooser fc = new JFileChooser();
    fc.showOpenDialog(null);
    File f = fc.getSelectedFile();
    String path = f.getAbsoluteFile().toString();
    String file = f.getAbsolutePath();
    if (!path.contains(".xlsx")) {
        file = f.getAbsolutePath() + ".xlsx";
    }
    try {
        FileOutputStream fis = new FileOutputStream(file);
        wb.write(fis);
        fis.close();
    } catch (Exception ex) {
        System.out.println(ex);
    }
} catch (Exception ex) {
    System.out.println(ex);
}


chart

Date now = new Date();
    SimpleDateFormat formater = new SimpleDateFormat();
    formater.applyPattern("yyyy");
    String thisYear = formater.format(now);
    List<Object[]> listTKSP_L = TKdao.getSPBanChayTL(thisYear);
    DefaultPieDataset data = new DefaultPieDataset();
    float tongsl = 0;
    for (Object[] row : listTKSP_L) {
        tongsl += (int) row[1];
    }
    for (Object[] row : listTKSP_L) {
        data.setValue((String) (row[0]), (((int) row[1] / tongsl) * 100));
    }
    JFreeChart Chart = ChartFactory.createPieChart("Tỷ lệ phần trăm loại sản phẩm bán được", data, true, true, true);
    ChartPanel chartPanel = new ChartPanel(Chart);
    chartPanel.setPreferredSize(new Dimension(jpPie.getWidth(), jpPie.getHeight()));

    jpPie.removeAll();
    jpPie.setLayout(new CardLayout());
    jpPie.add(chartPanel);


Email

Properties prop = new Properties();
    prop.put("mail.smtp.host", "smtp.gmail.com");
    prop.put("mail.smtp.port", "587");
    prop.put("mail.smtp.auth", "true");
    prop.put("mail.smtp.starttls.enable", "true"); //TLS

    Session session = Session.getInstance(prop,
            new Authenticator() {
        protected PasswordAuthentication getPasswordAuthentication() {
            return new PasswordAuthentication(username, password);
        }
    });
    try {
        Message message = new MimeMessage(session);
        message.setFrom(new InternetAddress(email));
        message.setRecipients(
                Message.RecipientType.TO,
                InternetAddress.parse(email)
        );

        Multipart content = new MimeMultipart();
        MimeBodyPart textBody = new MimeBodyPart();

        message.setSubject("DAVISY");

        textBody.setText("Hello");

        content.addBodyPart(textBody);
        message.setContent(content);
        Transport.send(message);

    } catch (MessagingException e) {
        System.out.println(e);
    }

Designed by Theanishtar in CanTho city.

pro1041-duan1's People

Contributors

bank2k3 avatar nguyenkhanhdan avatar doansy16 avatar theanishtar avatar dinhisme avatar

Stargazers

 avatar

Forkers

klakala

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.