
Code quản lí bán hàng của cửa hàng cung cấp phụ kiện di động bằng Java+ báo cáo
by Vinh ITin Java , Scripts & Code on June 3, 2023Choose Your Desired Option(s)
Code quản lí bán hàng của cửa hàng cung cấp phụ kiện di động bằng Java+ báo cáo
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
- Yêu cầu môi trường công nghệ
- Ứng dụng phải được thực với công nghệ Swing và JDBC chạy trên mọi hệ điều hành với môi trường JDK tối thiểu 1.8
- Hệ quản trị CSDL SQL Server 2008 trở lên

giao diện cửa sổ chính

Giao diện quản lý nhân viên

Giao diện quản lý khách hàng

Giao diện quản lý chức vụ

Giao diện quản lý sản phẩm

Giao diện quản lý loại sản phẩm

Giao diện quản lý bán hàng (Giỏ hàng)

giao diện thống kê doanh thu

Giao diện thống kê sản phẩm bán chạy

Giao diện đăng nhập
Install
- Tải và giải nén file đã được đính kèm
- Cài đặt vào ổ đĩa D trong máy tính
- 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
- Mở project “DAVISYS”
- Chạy trang login hoặc main trong package com.gui
- Đă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
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
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
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
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
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
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);
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);
}
| Download Category | Java, Scripts & Code |
| Product Homepage URL→ | |
| Product Version | |
| File Type | JAVA, SQL, TXT, .DOCX . . |
| File Size | 37.8 MB |
| Developer | |
| Documentation |





