5 e-stock est un système de gestion de stock automatisé qui permettra :
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
11 \section section_tdm Table des matières
23 \section section_infos Informations
25 \author Pierre-Antoine Legger <pierreantoinelegger@gmail.com>
26 \author Joffrey Tranchat <joffrey.tranchat@gmail.com>
29 \see https://svn.riouxsvn.com/e-stock
32 \page page_README README
38 ## Présentation {#presentation}
40 __e-stock__ est un système de gestion de stock automatisé qui permettra :
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
46 Une armoire sera composée de 8 casiers maximum. Chaque casier sera équipé :
48 * d'une gâche électrique afin d'assurer son ouverture/fermeture ;
49 * d'une balance pour assurer le comptage automatique des articles.
51 Le comptage automatique de la quantité est déterminé en fonction du poids unitaire et du poids mesuré sur la balance.
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é.
55 On distinguera deux type d'articles :
57 * les « consommables » qui sortent définitivement du stock
58 * les « empruntables » qui peuvent être restitués après leur utilisation
60 ## Base de données MySQL {#bdd}
62 
65 DROP DATABASE IF EXISTS `e-stock`;
66 CREATE DATABASE IF NOT EXISTS `e-stock`;
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'@'%';
73 -- --------------------------------------------------------
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;
81 INSERT INTO `Profil` (`Nom`) VALUES
86 -- --------------------------------------------------------
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;
95 -- --------------------------------------------------------
97 INSERT INTO `Groupe` (`Nom`) VALUES
102 -- --------------------------------------------------------
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;
121 -- --------------------------------------------------------
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;
131 INSERT INTO `Armoire` (`idArmoire`,`Nom`,`Description`,`nbCasiers`) VALUES('1','B22','Atelier','2');
133 -- --------------------------------------------------------
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;
141 INSERT INTO `Type` (`Nom`) VALUES
145 -- --------------------------------------------------------
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;
153 INSERT INTO `Unite` (`Nom`) VALUES
160 -- --------------------------------------------------------
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;
168 INSERT INTO `Comptage` (`Nom`) VALUES
173 -- --------------------------------------------------------
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;
181 INSERT INTO `Action` (`Nom`) VALUES
185 -- --------------------------------------------------------
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;
199 -- --------------------------------------------------------
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;
217 -- --------------------------------------------------------
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;
234 ## Recette {#recette}
236 - Pierre-Antoine Legger
238 * Rechercher un article
240 * Communiquer avec le SE pour :
241 * Commander l'ouverture/fermeture des casiers
242 * Afficher l'état ouvert/fermé des casiers
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
252 ## Informations {#informations}
254 \author Pierre-Antoine Legger <pierreantoinelegger@gmail.com>
255 \author Joffrey Tranchat <joffrey.tranchat@gmail.com>
258 \see https://svn.riouxsvn.com/e-stock
261 \page page_about A propos
263 \author Pierre-Antoine Legger <pierreantoinelegger@gmail.com>
264 \author Joffrey Tranchat <joffrey.tranchat@gmail.com>
267 \see https://svn.riouxsvn.com/e-stock
270 \page page_licence Licence GPL
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.
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.
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