Documentos de Académico
Documentos de Profesional
Documentos de Cultura
TEMA
Ventas de autos
DOCENTE
INTEGRANTES
SECCIÓN
15698
CICLO
2021-2
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
PRESENTACIÓN
La empresa Sobre
Ruedas S.A.C, está
centrado en vender autos
de alta calidad y brindar
un servicio excelente en
atención al cliente, el
personal está altamente
calificado y capacitado a
la necesidad del cliente.
Su funcionalidad se basa en hacer convenios con empresas de producción de
autos, a su vez contamos con equipos altamente calificados que ayudará en
recomendar autos dependiendo a la necesidad de cada comprador, así sí
mismo, se cumplirá en mantener actualizado el conocimiento y la rentabilidad
del negocio.
● RUC: 20123458975
● Razón Social: Sobre Ruedas S.A.C
● Página Web: http://www.SobreRuedas.com.pe
● Representante legal: Jason, David, Luy, Jhon
● Gerente General: Lizeth
● Tipo Empresa: Sociedad Anónima Cerrada
● Condición: Activo
● Fecha Inicio Actividades: 02/09/2021
● Actividad: Servicios
● Dirección Legal: Av. San Martin 123 Urb. El Pachacamac
● Distrito / Ciudad: Pachacamac-Lima
● Departamento: Lima
● Teléfono: Cel 999987123
● Correo electrónico: SobreRuedas@hotmail.com
2
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
CULTURA ORGANIZACIONAL
MISIÓN
VISIÓN
Ser la empresa líder en brindar un excelente servicio para la venta de autos, a su vez,
tener convenios con todas las marcas de autos, contando con nuestra propia marca y
llegar a fortalecer la confianza y satisfacción con nuestros clientes.
VALORES
3
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
PROPÓSITOS
GENERALES
4
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
DIAGRAMA UML
5
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
PROGRAMA
PACKEGE “ HERENCIA “
JAVA CLASS “ DOCUMENTO “
package Herencias;
/**
* @return the nrodocumento
*/
public int getNrodocumento() {
return nrodocumento;
}
/**
* @param nrodocumento the nrodocumento to set
*/
public void setNrodocumento(int nrodocumento) {
this.nrodocumento = nrodocumento;
6
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
/**
* @return the fecha
*/
public String getFecha() {
return fecha;
}
/**
* @param fecha the fecha to set
*/
public void setFecha(String fecha) {
this.fecha = fecha;
}
/**
* @return the importeu
*/
public double getImporteu() {
return importeu;
}
/**
* @param importeu the importeu to set
*/
public void setImporteu(double importeu) {
this.importeu = importeu;
}
/**
* @return the NombreProducto
7
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
*/
public String getNombreProducto() {
return NombreProducto;
}
/**
* @param NombreProducto the NombreProducto to set
*/
public void setNombreProducto(String NombreProducto) {
this.NombreProducto = NombreProducto;
}
}
JAVA CLASS “PERSONA “
package Herencias;
import datos.Admi;
8
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
/**
* @return the Dni
*/
public int getDni() {
return Dni;
}
/**
* @param Dni the Dni to set
*/
public void setDni(int Dni) {
this.Dni = Dni;
}
/**
* @return the Nombre
*/
public String getNombre() {
return Nombre;
}
/**
* @param Nombre the Nombre to set
*/
public void setNombre(String Nombre) {
this.Nombre = Nombre;
}
/**
* @return the Apelldio
*/
public String getApelldio() {
9
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
return Apelldio;
}
/**
* @param Apelldio the Apelldio to set
*/
public void setApelldio(String Apelldio) {
this.Apelldio = Apelldio;
}
/**
* @return the Contraseña
*/
public String getContraseña() {
return Contraseña;
}
/**
* @param Contraseña the Contraseña to set
*/
public void setContraseña(String Contraseña) {
this.Contraseña = Contraseña;
}
}
PACKEGE “ DATOS”
JAVA CLASS “ ADMI “
package datos;
10
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
this.Estado = Estado;
}
/**
* @return the Estado
*/
public String getEstado() {
return Estado;
}
/**
* @param Estado the Estado to set
*/
public void setEstado(String Estado) {
this.Estado = Estado;
}
}
JAVA CLASS “ AUXILIAR “
package datos;
import java.awt.event.KeyEvent;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JDesktopPane;
import javax.swing.JInternalFrame;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import javax.swing.JTextField;
import javax.swing.table.DefaultTableModel;
import precentacion.frmPrincipal;
11
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
}else{
tecla.consume();
}
}
public static void verPantalla(JDesktopPane escritorio, JInternalFrame frame){
if(frame.isShowing()==false){
frmPrincipal.jdpEscritorio.add(frame);
frame.show();
frame.setLocation((escritorio.getWidth()-frame.getWidth())/2,
(escritorio.getHeight()-frame.getHeight())/2);
}
}
//-------------PRODUCTOO -----------------
public static void formatoTablaProducto(JTable tabla,int[] tamaño){
for(int i=0;i<tamaño.length;i++){
tabla.getColumnModel().getColumn(i).setPreferredWidth(tamaño[i]);
}
}
public static String GenerarCodigoProducto(int Cantidad , int Tamaño){
clsProductoTrans pro=new clsProductoTrans();
boolean salir=false;
String codigo="";
int talla=0;
int existe=0;
while(salir==false){
12
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
codigo=""+(int)(Math.random()*Cantidad);
talla=codigo.length();
if(talla<Tamaño){
for(int i =0;i<(Tamaño-talla);i++){
codigo+="0";
}
}
existe=0;
for(int p=0;p<pro.tamaño();p++){
if(Integer.parseInt(codigo)==pro.obtener(p).getCodigo()){
existe++;
break;
}
}
if(existe<1){
salir=true;
}
}
return codigo;
}
public static String Nombre(JTextField cajaTexto){
String texto=cajaTexto.getText();
if(texto.equals("")){
while(texto.equals("")){
texto=JOptionPane.showInputDialog(null,"Ingrese el nombre del producto :");
if(texto==null){
texto="";
}
}
}
return texto;
}
13
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
}else{
tecla.consume();
}
}
public static double precio (JTextField cajaTexto){
double pre=0;
String preStr=cajaTexto.getText();
boolean salir=false;
while(salir==false){
try {
pre=Double.parseDouble(preStr);
salir=true;
} catch (Exception e) {
salir=false;
preStr=JOptionPane.showInputDialog(null,"Ingrese correctamente el precio
");
}
}
return pre;
}
public static int stock(JTextField cajaTexto){
int sto=0;
String stoStr=cajaTexto.getText();
boolean salir=false;
while(salir==false){
try {
sto=Integer.parseInt(stoStr);
salir=true;
14
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
} catch (Exception e) {
salir=false;
stoStr=JOptionPane.showInputDialog(null,"Ingrese correctamente el Stock ");
}
}
return sto;
}
public static String estado(JCheckBox chec){
String mensaje="";
if(chec.isSelected()){
mensaje="Habilitado";
}else{
mensaje="Desabilitado";
}
return mensaje;
}
public static String tipo(JComboBox box){
return box.getSelectedItem().toString();
}
public static int provedor(JTextField text){
String texto=text.getText();
boolean salir=false;
while(salir==false){
if(texto.length()<1){
JOptionPane.showMessageDialog(null,"Ingrese el codigo del proveedor ");
texto=text.getText();
}else{
salir=true;
}
}
return Integer.parseInt(texto);
15
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
}
public static void listarProducto(DefaultTableModel dtm, int cantidad){
clsProductoTrans pro=new clsProductoTrans();
int numFilas=dtm.getRowCount();
if(numFilas>0){
for(int i=0;i<numFilas;i++){
dtm.removeRow(0);
}
}
for(int i=0;i<cantidad;i++){
Object[] obj=new Object[]{
pro.obtener(i).getCodigo(),pro.obtener(i).getNombre(),pro.obtener(i).getPreci
o(),pro.obtener(i).getStock(),
pro.obtener(i).getEstado(),pro.obtener(i).getTipo(),pro.obtener(i).getFecha(),
pro.obtener(i).getCodProvedor()
};
dtm.addRow(obj);
}
}
public static void buscarProducto(KeyEvent tecla,String texto,DefaultTableModel
dtm){
clsProductoTrans pro=new clsProductoTrans();
char t=tecla.getKeyChar();
String cadena=texto+""+t;
if(t==KeyEvent.VK_BACK_SPACE){
cadena=texto.substring(0,cadena.length()-1);
}
int numFilas=dtm.getRowCount();
if(numFilas>0){
for(int i=0;i<numFilas;i++){
dtm.removeRow(0);
}
16
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
}
for(int i=0;i<pro.tamaño();i++){
if(pro.obtener(i).getNombre().contains(cadena)){
Object[] obj=new Object[]{
pro.obtener(i).getCodigo(),pro.obtener(i).getNombre(),pro.obtener(i).getPr
ecio(),pro.obtener(i).getStock(),
pro.obtener(i).getEstado(),pro.obtener(i).getTipo(),pro.obtener(i).getFecha(),
pro.obtener(i).getCodProvedor()
};
dtm.addRow(obj);
}
}
}
public static void formatoTablaCliente(JTable tabla,int[] tamaño){
for(int i=0;i<tamaño.length;i++){
tabla.getColumnModel().getColumn(i).setPreferredWidth(tamaño[i]);
}
}
// --------------CLIENTEE -----------------------------//
public static int dni(JTextField cajaTexto){
int sto=0;
String stoStr=cajaTexto.getText();
boolean salir=false;
while(salir==false){
try {
sto=Integer.parseInt(stoStr);
salir=true;
} catch (Exception e) {
salir=false;
stoStr=JOptionPane.showInputDialog(null,"Ingrese correctamente el DNI ");
}
}
17
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
return sto;
}
public static void validarNumerosCliente(KeyEvent tecla, String texto , int cantidad){
char t=tecla.getKeyChar();
if(Character.isDigit(t) && texto.length()<cantidad){
}else{
tecla.consume();
}
}
public static String NombreCliente(JTextField cajaTexto){
String texto=cajaTexto.getText();
if(texto.equals("")){
while(texto.equals("")){
texto=JOptionPane.showInputDialog(null,"Ingrese el nombre del cliente :");
if(texto==null){
texto="";
}
}
}
return texto;
}
public static String ApellidoCliente(JTextField cajaTexto){
String texto=cajaTexto.getText();
if(texto.equals("")){
while(texto.equals("")){
texto=JOptionPane.showInputDialog(null,"Ingrese el apellido del cliente :");
if(texto==null){
texto="";
}
}
}
18
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
return texto;
}
public static String tipoClinte(JComboBox box){
return box.getSelectedItem().toString();
}
public static int ruc (JTextField cajaTexto){
int r=0;
String preStr=cajaTexto.getText();
boolean salir=false;
while(salir==false){
try {
r =Integer.parseInt(preStr);
salir=true;
} catch (Exception e) {
salir=false;
preStr=JOptionPane.showInputDialog(null,"Ingrese correctamente el precio
");
}
}
return r;
}
public static void listarCliente(DefaultTableModel dtm, int cantidad){
clsClienteTrans pro=new clsClienteTrans();
int numFilas=dtm.getRowCount();
if(numFilas>0){
for(int i=0;i<numFilas;i++){
dtm.removeRow(0);
}
}
for(int i=0;i<cantidad;i++){
Object[] obj=new Object[]{
19
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
pro.obtener(i).getDni(),pro.obtener(i).getNombre(),pro.obtener(i).getApellido
(),pro.obtener(i).getDia(),
pro.obtener(i).getMes(),pro.obtener(i).getAño(),pro.obtener(i).getRuc(),pro.o
btener(i).getOperacion(),
};
dtm.addRow(obj);
}
}
}
JAVA CLASS “INGRESOTRANS”
package datos;
import Herencias.persona;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;
public clsIngresoTrans(){
emple=new ArrayList<persona>();
cargar();
}
public void cargar(){
try{
20
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
21
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
public clsCliente(int Dni, String Nombre, String Apellido, int dia, int mes, int año, int
ruc, String operacion) {
22
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
this.Dni = Dni;
this.Nombre = Nombre;
this.Apellido = Apellido;
this.dia = dia;
this.mes = mes;
this.año = año;
this.ruc = ruc;
this.operacion = operacion;
}
/**
* @return the Dni
*/
public int getDni() {
return Dni;
}
/**
* @param Dni the Dni to set
*/
public void setDni(int Dni) {
this.Dni = Dni;
}
/**
* @return the Nombre
*/
public String getNombre() {
return Nombre;
}
/**
23
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
/**
* @return the Apellido
*/
public String getApellido() {
return Apellido;
}
/**
* @param Apellido the Apellido to set
*/
public void setApellido(String Apellido) {
this.Apellido = Apellido;
}
/**
* @return the dia
*/
public int getDia() {
return dia;
}
/**
* @param dia the dia to set
*/
public void setDia(int dia) {
this.dia = dia;
24
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
/**
* @return the mes
*/
public int getMes() {
return mes;
}
/**
* @param mes the mes to set
*/
public void setMes(int mes) {
this.mes = mes;
}
/**
* @return the año
*/
public int getAño() {
return año;
}
/**
* @param año the año to set
*/
public void setAño(int año) {
this.año = año;
}
/**
* @return the ruc
25
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
*/
public int getRuc() {
return ruc;
}
/**
* @param ruc the ruc to set
*/
public void setRuc(int ruc) {
this.ruc = ruc;
}
/**
* @return the operacion
*/
public String getOperacion() {
return operacion;
}
/**
* @param operacion the operacion to set
*/
public void setOperacion(String operacion) {
this.operacion = operacion;
}
}
JAVA CLASS “ CLIENTETRANS “
package datos;
import java.io.BufferedReader;
import java.io.File;
26
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;
public class clsClienteTrans {
ArrayList<clsCliente>pro;
public clsClienteTrans() {
pro = new ArrayList<>() ;
cargar();
}
public void cargar(){
try{
File archivo= new File("cliente.txt");
if(archivo.exists()){
BufferedReader br=new BufferedReader (new FileReader(archivo));
String linea="";
while((linea=br.readLine())!=null){
StringTokenizer st=new StringTokenizer(linea,",");
int dni=Integer.parseInt(st.nextToken());
String nombre=st.nextToken();
String apellido=st.nextToken();
int dia=Integer.parseInt(st.nextToken());
int mes=Integer.parseInt(st.nextToken());
int año=Integer.parseInt(st.nextToken());
int ruc=Integer.parseInt(st.nextToken());
String operacion=st.nextToken();
clsCliente x = new
clsCliente(dni,nombre,apellido,dia,mes,año,ruc,operacion);
adicionar(x);
27
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
}
}else{
JOptionPane.showMessageDialog(null,"el archivo no existe");
}
}catch (Exception e){
}
}
public clsCliente obtener(int pos){
return pro.get(pos);
}
public int tamaño(){
return pro.size();
}
public void adicionar(clsCliente x){
pro.add(x);
}
public void grabar(){
try{
PrintWriter pw=new PrintWriter(new FileWriter("cliente.txt"));
for(int i=0;i<tamaño();i++){
pw.print(obtener(i).getDni()+","+obtener(i).getNombre()
+","+obtener(i).getApellido()+","+obtener(i).getDia()+","+obtener(i).getMes()+
","+obtener(i).getAño()+","+obtener(i).getRuc()+","+obtener(i).getOperacion()
+"\r\n");
}
pw.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,"Se produjo un error al grabar el
cliente");
}
}
}
28
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
public clsProducto(int Codigo, String Nombre, double Precio, int Stock, String Estado,
String fecha, String Tipo, int CodProvedor) {
this.Codigo = Codigo;
this.Nombre = Nombre;
this.Precio = Precio;
this.Stock = Stock;
this.Estado = Estado;
this.fecha=fecha;
this.Tipo = Tipo;
this.CodProvedor = CodProvedor;
}
/**
* @return the Codigo
*/
public int getCodigo() {
return Codigo;
}
29
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
/**
* @param Codigo the Codigo to set
*/
public void setCodigo(int Codigo) {
this.Codigo = Codigo;
}
/**
* @return the Nombre
*/
public String getNombre() {
return Nombre;
}
/**
* @param Nombre the Nombre to set
*/
public void setNombre(String Nombre) {
this.Nombre = Nombre;
}
/**
* @return the Precio
*/
public double getPrecio() {
return Precio;
}
/**
* @param Precio the Precio to set
*/
public void setPrecio(double Precio) {
30
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
this.Precio = Precio;
}
/**
* @return the Stock
*/
public int getStock() {
return Stock;
}
/**
* @param Stock the Stock to set
*/
public void setStock(int Stock) {
this.Stock = Stock;
}
/**
* @return the Estado
*/
public String getEstado() {
return Estado;
}
/**
* @param Estado the Estado to set
*/
public void setEstado(String Estado) {
this.Estado = Estado;
}
/**
31
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
/**
* @param fecha the fecha to set
*/
public void setFecha(String fecha) {
this.fecha = fecha;
}
/**
* @return the Tipo
*/
public String getTipo() {
return Tipo;
}
/**
* @param Tipo the Tipo to set
*/
public void setTipo(String Tipo) {
this.Tipo = Tipo;
}
/**
* @return the CodProvedor
*/
public int getCodProvedor() {
return CodProvedor;
32
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
/**
* @param CodProvedor the CodProvedor to set
*/
public void setCodProvedor(int CodProvedor) {
this.CodProvedor = CodProvedor;
}
}
JAVA CLASS “PRODUCTOTRANS “
package datos;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.FileWriter;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;
public clsProductoTrans() {
pro =new ArrayList<>();
cargar();
}
public void cargar(){
try{
File archivo= new File("Producto.txt");
33
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
if(archivo.exists()){
BufferedReader br=new BufferedReader (new FileReader(archivo));
String linea="";
while((linea=br.readLine())!=null){
StringTokenizer st=new StringTokenizer(linea,",");
int codigo=Integer.parseInt(st.nextToken());
String nombre=st.nextToken();
double precio = Double.parseDouble(st.nextToken());
int stock =Integer.parseInt(st.nextToken());
String estado=st.nextToken();
String fecha = st.nextToken();
String tipo=st.nextToken();
int codPro=Integer.parseInt(st.nextToken());
clsProducto x = new clsProducto(codigo, nombre, precio, stock,
estado,fecha, tipo, codPro);
adicionar(x);
}
}else{
JOptionPane.showMessageDialog(null,"el archivo no existe");
}
}catch (Exception e){
}
}
34
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
}
public void grabar(){
try{
PrintWriter
pw=new
PrintWriter(new FileWriter("Producto.txt"));
for(int i=0;i<tamaño();i++){
pw.print(obtener(i).getCodigo()+","+obtener(i).getNombre()
+","+obtener(i).getPrecio()+","+obtener(i).getStock()+
","+obtener(i).getEstado()+","+obtener(i).getTipo()+","+obtener(i).getFecha()
+","+obtener(i).getCodProvedor()+"\r\n");
}
pw.close();
}catch(Exception e){
JOptionPane.showMessageDialog(null,"Se produjo un error al gravar el
producto");
}
}
}
35
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
36
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
37
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
38
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
39
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
SQL - XAMP
CONEXIÓN SQL
40
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
41
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
42
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
43
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
44
UNIVERSIDAD TECNOLOGÍCA DEL PERÚ
CONCLUSIONES
Con la implementación de este proyecto ha permitido emplear cada una de las clases
mostradas durante cada sección de aprendizaje semanal para llegar a tomar todas las
herramientas para darle un sistema amigable y fácil para su uso a la empresa que nos
propusimos desarrollar.
45