Projet e-stok  0.2
BTS SNIR LaSalle Avignon 2020
README.md
Aller à la documentation de ce fichier.
1 \mainpage Le projet
2 
3 \tableofcontents
4 
5 e-stock est un système de gestion de stock automatisé qui permettra :
6 
7 * de contrôler et gérer l'utilisation de produits stockés dans une armoire sensible
8 * d'assurer la traçabilité de l'attribution du matériel et des consommables stockés
9 * de sécuriser l'accès par un contrôle d'accès par badge RFID
10 
11 \section section_tdm Table des matières
12 - \ref page_README
13 - \ref page_changelog
14 \if todo
15 - \ref todo
16 \endif
17 \if bug
18 - \ref bug
19 \endif
20 - \ref page_about
21 - \ref page_licence
22 
23 \section section_infos Informations
24 
25 \author Pierre-Antoine Legger <pierreantoinelegger@gmail.com>
26 \author Joffrey Tranchat <joffrey.tranchat@gmail.com>
27 \date 2020
28 \version 0.2
29 \see https://svn.riouxsvn.com/e-stock
30 
31 
32 \page page_README README
33 
34 [TOC]
35 
36 # Projet {#projet}
37 
38 ## Présentation {#presentation}
39 
40 __e-stock__ est un système de gestion de stock automatisé qui permettra :
41 
42 * de contrôler et gérer l'utilisation de produits stockés dans une armoire sensible
43 * d'assurer la traçabilité de l'attribution du matériel et des consommables stockés
44 * de sécuriser l'accès par un contrôle d'accès par badge RFID
45 
46 Une armoire sera composée de 8 casiers maximum. Chaque casier sera équipé :
47 
48 * d'une gâche électrique afin d'assurer son ouverture/fermeture ;
49 * d'une balance pour assurer le comptage automatique des articles.
50 
51 Le comptage automatique de la quantité est déterminé en fonction du poids unitaire et du poids mesuré sur la balance.
52 
53 Un lecteur de badge RFID est intégré à chaque armoire pour contrôler l'accès. L'exploitation de l'armoire ​ e-stock​ est possible à partir de l'écran tactile intégré.
54 
55 On distinguera deux type d'articles :
56 
57 * les « consommables » qui sortent définitivement du stock
58 * les « empruntables » qui peuvent être restitués après leur utilisation
59 
60 ## Base de données MySQL {#bdd}
61 
62 ![](./sql/e-stock-v0.4.png)
63 
64 ~~~ {.sql}
65 DROP DATABASE IF EXISTS `e-stock`;
66 CREATE DATABASE IF NOT EXISTS `e-stock`;
67 USE `e-stock`;
68 
69 -- Création du compte d'accès à la base de données e-stock
70 -- CREATE USER 'estock'@'%' IDENTIFIED BY 'password';
71 -- GRANT ALL PRIVILEGES ON `e-stock`.* TO 'estock'@'%';
72 -- FLUSH PRIVILEGES;
73 -- --------------------------------------------------------
74 
75 CREATE TABLE IF NOT EXISTS `Profil` (
76  `idProfil` int(11) NOT NULL AUTO_INCREMENT,
77  `Nom` varchar(64) NOT NULL,
78  PRIMARY KEY (`idProfil`)
79 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
80 
81 INSERT INTO `Profil` (`Nom`) VALUES
82 ('Administrateur'),
83 ('Gestionnaire'),
84 ('Utilisateur');
85 
86 -- --------------------------------------------------------
87 
88 CREATE TABLE IF NOT EXISTS `Groupe` (
89  `idGroupe` int(11) NOT NULL AUTO_INCREMENT,
90  `Nom` varchar(64) NOT NULL,
91  PRIMARY KEY (`idGroupe`),
92  CONSTRAINT Unique_Groupe UNIQUE (`Nom`)
93 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
94 
95 -- --------------------------------------------------------
96 
97 INSERT INTO `Groupe` (`Nom`) VALUES
98 ('PROFESSEUR'),
99 ('1-BTS-SN'),
100 ('T-BTS-SN');
101 
102 -- --------------------------------------------------------
103 
104 CREATE TABLE IF NOT EXISTS `Utilisateur` (
105  `idUtilisateur` int(11) NOT NULL AUTO_INCREMENT,
106  `idProfil` int(11) NOT NULL,
107  `idGroupe` int(11) NOT NULL,
108  `Nom` varchar(64) NOT NULL,
109  `Prenom` varchar(64) NOT NULL,
110  `DateValidite` date NOT NULL,
111  `Identifiant` varchar(255) DEFAULT NULL,
112  `MotDePasse` varchar(255) DEFAULT NULL,
113  `Badge` varchar(11) NOT NULL,
114  `Email` varchar(64) NOT NULL,
115  PRIMARY KEY (`idUtilisateur`),
116 -- CONSTRAINT Unique_Utilisateur UNIQUE (`Badge`),
117  CONSTRAINT Utilisateur_fk_1 FOREIGN KEY (`idProfil`) REFERENCES Profil(`idProfil`) ON DELETE CASCADE,
118  CONSTRAINT Utilisateur_fk_2 FOREIGN KEY (`idGroupe`) REFERENCES Groupe(`idGroupe`) ON DELETE CASCADE
119 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
120 
121 -- --------------------------------------------------------
122 
123 CREATE TABLE IF NOT EXISTS `Armoire` (
124  `idArmoire` int(11) NOT NULL,
125  `Nom` varchar(255) NOT NULL,
126  `Description` varchar(255) DEFAULT NULL,
127  `nbCasiers` int(11) NOT NULL DEFAULT 8,
128  PRIMARY KEY (`idArmoire`)
129 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
130 
131 INSERT INTO `Armoire` (`idArmoire`,`Nom`,`Description`,`nbCasiers`) VALUES('1','B22','Atelier','2');
132 
133 -- --------------------------------------------------------
134 
135 CREATE TABLE IF NOT EXISTS `Type` (
136  `idType` int(11) NOT NULL AUTO_INCREMENT,
137  `Nom` varchar(64) NOT NULL,
138  PRIMARY KEY (`idType`)
139 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
140 
141 INSERT INTO `Type` (`Nom`) VALUES
142 ('Equipement'),
143 ('Consommable');
144 
145 -- --------------------------------------------------------
146 
147 CREATE TABLE IF NOT EXISTS `Unite` (
148  `idUnite` int(11) NOT NULL AUTO_INCREMENT,
149  `Nom` varchar(64) NOT NULL,
150  PRIMARY KEY (`idUnite`)
151 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
152 
153 INSERT INTO `Unite` (`Nom`) VALUES
154 ('Metre'),
155 ('Piece'),
156 ('Pourcentage'),
157 ('Poids g'),
158 ('Poids kg');
159 
160 -- --------------------------------------------------------
161 
162 CREATE TABLE IF NOT EXISTS `Comptage` (
163  `idComptage` int(11) NOT NULL AUTO_INCREMENT,
164  `Nom` varchar(64) NOT NULL,
165  PRIMARY KEY (`idComptage`)
166 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
167 
168 INSERT INTO `Comptage` (`Nom`) VALUES
169 ('Aucun'),
170 ('Automatique'),
171 ('CodeBarre');
172 
173 -- --------------------------------------------------------
174 
175 CREATE TABLE IF NOT EXISTS `Action` (
176  `idAction` int(11) NOT NULL AUTO_INCREMENT,
177  `Nom` varchar(64) NOT NULL,
178  PRIMARY KEY (`idAction`)
179 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
180 
181 INSERT INTO `Action` (`Nom`) VALUES
182 ('Entree'),
183 ('Sortie');
184 
185 -- --------------------------------------------------------
186 
187 CREATE TABLE IF NOT EXISTS `Article` (
188  `idArticle` int(11) NOT NULL AUTO_INCREMENT,
189  `idType` int(11) NOT NULL,
190  -- `Type` enum('Equipement','Consommable'),
191  `Nom` varchar(255) NOT NULL,
192  `Code` varchar(255) NOT NULL,
193  `Designation` varchar(255) NOT NULL,
194  `Poids` int(11) NOT NULL,
195  PRIMARY KEY (`idArticle`),
196  CONSTRAINT Article_fk_1 FOREIGN KEY (`idType`) REFERENCES Type(`idType`) ON DELETE CASCADE
197 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
198 
199 -- --------------------------------------------------------
200 
201 CREATE TABLE IF NOT EXISTS `Stock` (
202  `idStock` int(11) NOT NULL AUTO_INCREMENT,
203  `idArticle` int(11) NOT NULL,
204  `idComptage` int(11) NOT NULL,
205  `idUnite` int(11) NOT NULL,
206  `Quantite` int(11) DEFAULT 0,
207  `Disponible` int(11) DEFAULT 0,
208  `Tare` int(11) NOT NULL,
209  `numeroCasier` int(11) NOT NULL,
210  PRIMARY KEY (`idStock`),
211  CONSTRAINT Unique_NumeroCasier UNIQUE (`numeroCasier`),
212  CONSTRAINT Stock_fk_2 FOREIGN KEY (`idArticle`) REFERENCES Article(`idArticle`) ON DELETE CASCADE,
213  CONSTRAINT Stock_fk_3 FOREIGN KEY (`idComptage`) REFERENCES Comptage(`idComptage`) ON DELETE CASCADE,
214  CONSTRAINT Stock_fk_4 FOREIGN KEY (`idUnite`) REFERENCES Unite(`idUnite`) ON DELETE CASCADE
215 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
216 
217 -- --------------------------------------------------------
218 
219 CREATE TABLE IF NOT EXISTS `Mouvement` (
220  `idMouvement` int(11) NOT NULL AUTO_INCREMENT,
221  `idUtilisateur` int(11) NOT NULL,
222  `idStock` int(11) NOT NULL,
223  `idAction` int(11) NOT NULL,
224  -- `Action` enum('Entree','Sortie'),
225  `Quantite` int(11) NOT NULL,
226  `Horodatage` datetime NOT NULL,
227  PRIMARY KEY (`idMouvement`),
228  CONSTRAINT Mouvement_fk_1 FOREIGN KEY (`idUtilisateur`) REFERENCES Utilisateur(`idUtilisateur`) ON DELETE CASCADE,
229  CONSTRAINT Mouvement_fk_2 FOREIGN KEY (`idStock`) REFERENCES Stock(`idStock`) ON DELETE CASCADE,
230  CONSTRAINT Mouvement_fk_3 FOREIGN KEY (`idAction`) REFERENCES Action(`idAction`) ON DELETE CASCADE
231 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
232 ~~~
233 
234 ## Recette {#recette}
235 
236 - Pierre-Antoine Legger
237  * S'authentifier
238  * Rechercher un article
239  * Consulter le stock
240  * Communiquer avec le SE pour :
241  * Commander l'ouverture/fermeture des casiers
242  * Afficher l'état ouvert/fermé des casiers
243 
244 - Joffrey Tranchat
245  * Prendre et rapporter un article
246  * Mettre à jour le stock et les mouvements
247  * Consulter les mouvements
248  * Communiquer avec le SE pour :
249  * Récupérer les pesées des casiers
250  * Assurer le comptage automatique
251 
252 ## Informations {#informations}
253 
254 \author Pierre-Antoine Legger <pierreantoinelegger@gmail.com>
255 \author Joffrey Tranchat <joffrey.tranchat@gmail.com>
256 \date 2020
257 \version 0.2
258 \see https://svn.riouxsvn.com/e-stock
259 
260 
261 \page page_about A propos
262 
263 \author Pierre-Antoine Legger <pierreantoinelegger@gmail.com>
264 \author Joffrey Tranchat <joffrey.tranchat@gmail.com>
265 \date 2020
266 \version 0.2
267 \see https://svn.riouxsvn.com/e-stock
268 
269 
270 \page page_licence Licence GPL
271 
272 This program is free software; you can redistribute it and/or modify
273 it under the terms of the GNU General Public License as published by
274 the Free Software Foundation; either version 2 of the License, or
275 (at your option) any later version.
276 
277 This program is distributed in the hope that it will be useful,
278 but WITHOUT ANY WARRANTY; without even the implied warranty of
279 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
280 GNU General Public License for more details.
281 
282 You should have received a copy of the GNU General Public License
283 along with this program; if not, write to the Free Software
284 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA