Franciaflex-magalie-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- 438 discussions
r213 - in trunk: . magalie-persistence magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity magalie-services magalie-web
by Bavencoff@users.forge.codelutin.com 30 May '13
by Bavencoff@users.forge.codelutin.com 30 May '13
30 May '13
Author: Bavencoff
Date: 2013-05-30 14:16:14 +0200 (Thu, 30 May 2013)
New Revision: 213
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
Prepare release : generate script SQL, check dependency, update dependency
Modified:
trunk/magalie-persistence/pom.xml
trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/AbstractEntity.java
trunk/magalie-services/pom.xml
trunk/magalie-web/pom.xml
trunk/pom.xml
Modified: trunk/magalie-persistence/pom.xml
===================================================================
--- trunk/magalie-persistence/pom.xml 2013-05-29 13:24:06 UTC (rev 212)
+++ trunk/magalie-persistence/pom.xml 2013-05-30 12:16:14 UTC (rev 213)
@@ -117,6 +117,52 @@
<!--</execution>-->
<!--</executions>-->
<!--</plugin>-->
+ <plugin>
+ <groupId>com.aziphael</groupId>
+ <artifactId>hibernate4-dll-maven-plugin</artifactId>
+ <version>1.0.RELEASE</version>
+ <goals>
+ <goal>export</goal>
+ </goals>
+ <configuration>
+ <entityPackage>com.franciaflex.magalie.persistence.entity</entityPackage>
+ <dialect>org.hibernate.dialect.Oracle10gDialect</dialect>
+ <drop>false</drop>
+ <!-- Export file. Default is ${project.build.directory}/generated-sources/sql/schema-export.sql -->
+ <exportFile>${project.build.directory}/generated-sources/sql/export.sql</exportFile>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>de.juplo</groupId>
+ <artifactId>hibernate4-maven-plugin</artifactId>
+ <version>1.0.1</version>
+ <executions>
+ <execution>
+ <id>executionCreate</id>
+ <goals>
+ <goal>export</goal>
+ </goals>
+ <configuration>
+ <type>CREATE</type>
+ <outputFile>${project.build.directory}/generated-sources/Create.sql</outputFile>
+ </configuration>
+ </execution>
+ <execution>
+ <id>executionDrop</id>
+ <goals>
+ <goal>export</goal>
+ </goals>
+ <configuration>
+ <type>DROP</type>
+ <outputFile>${project.build.directory}/generated-sources/Drop.sql</outputFile>
+ </configuration>
+ </execution>
+ </executions>
+ <configuration>
+ <hibernateDialect>org.hibernate.dialect.Oracle10gDialect</hibernateDialect>
+ <target>SCRIPT</target>
+ </configuration>
+ </plugin>
</plugins>
</build>
Modified: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/AbstractEntity.java
===================================================================
--- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/AbstractEntity.java 2013-05-29 13:24:06 UTC (rev 212)
+++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/entity/AbstractEntity.java 2013-05-30 12:16:14 UTC (rev 213)
@@ -26,8 +26,10 @@
import com.google.common.base.Objects;
import org.apache.commons.lang3.builder.ToStringBuilder;
-public abstract class AbstractEntity {
+import java.io.Serializable;
+public abstract class AbstractEntity implements Serializable {
+
public abstract String getId();
@Override
Modified: trunk/magalie-services/pom.xml
===================================================================
--- trunk/magalie-services/pom.xml 2013-05-29 13:24:06 UTC (rev 212)
+++ trunk/magalie-services/pom.xml 2013-05-30 12:16:14 UTC (rev 213)
@@ -31,11 +31,6 @@
</dependency>
<dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- </dependency>
-
- <dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
</dependency>
Modified: trunk/magalie-web/pom.xml
===================================================================
--- trunk/magalie-web/pom.xml 2013-05-29 13:24:06 UTC (rev 212)
+++ trunk/magalie-web/pom.xml 2013-05-30 12:16:14 UTC (rev 213)
@@ -128,13 +128,7 @@
<artifactId>log4j</artifactId>
</dependency>
- <!-- Test dependencies -->
<dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- </dependency>
-
- <dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>runtime</scope>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2013-05-29 13:24:06 UTC (rev 212)
+++ trunk/pom.xml 2013-05-30 12:16:14 UTC (rev 213)
@@ -79,6 +79,17 @@
<role>technical writer</role>
</roles>
</developer>
+ <developer>
+ <id>sbavencoff</id>
+ <name>Sylvain Bavencoff</name>
+ <email>bavencoff at codelutin.com</email>
+ <organization>CodeLutin</organization>
+ <organizationUrl>http://www.codelutin.com</organizationUrl>
+ <timezone>+2</timezone>
+ <roles>
+ <role>developer</role>
+ </roles>
+ </developer>
</developers>
<packaging>pom</packaging>
@@ -92,19 +103,18 @@
<!-- versions -->
<nuitonWebVersion>1.13</nuitonWebVersion>
<nuitonUtilsVersion>2.6.12</nuitonUtilsVersion>
- <h2Version>1.3.170</h2Version>
+ <h2Version>1.3.172</h2Version>
<postgresqlVersion>9.1-901-1.jdbc4</postgresqlVersion>
<struts2Version>2.3.8</struts2Version>
<jqueryPluginVersion>3.5.1</jqueryPluginVersion>
<bootstrapPluginVersion>1.6.0</bootstrapPluginVersion>
<shiroVersion>1.2.1</shiroVersion>
- <slf4jVersion>1.7.2</slf4jVersion>
+ <slf4jVersion>1.7.5</slf4jVersion>
<jettyVersion>${jettyPluginVersion}</jettyVersion>
<hibernateVersion>4.1.9.Final</hibernateVersion>
<seleniumVersion>2.28.0</seleniumVersion>
<mockitoVersion>1.9.5</mockitoVersion>
<nuitonI18nVersion>2.5</nuitonI18nVersion>
- <topiaVersion>2.7.1</topiaVersion>
<eugeneVersion>2.5.6.1</eugeneVersion>
<!-- license to use -->
@@ -142,7 +152,7 @@
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
- <scope>test</scope>
+ <scope>provided</scope>
<version>${h2Version}</version>
</dependency>
@@ -184,6 +194,7 @@
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>${struts2Version}</version>
+ <scope>compile</scope>
</dependency>
<dependency>
@@ -240,12 +251,19 @@
<scope>runtime</scope>
</dependency>
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>${log4jVersion}</version>
+ <scope>runtime</scope>
+ </dependency>
+
<!-- Others -->
<dependency>
<groupId>javax.mail</groupId>
<artifactId>mail</artifactId>
- <version>1.4.6</version>
+ <version>1.4.7</version>
</dependency>
<dependency>
1
0
r212 - in branches/magalie-eugene: . magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao
by tchemit@users.forge.codelutin.com 29 May '13
by tchemit@users.forge.codelutin.com 29 May '13
29 May '13
Author: tchemit
Date: 2013-05-29 15:24:06 +0200 (Wed, 29 May 2013)
New Revision: 212
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
remove generic from dao
Added:
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseJpaDao.java
Removed:
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedListJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractKanbanJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationErrorJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractMagalieUserJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractPreparedArticleReceptionJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedListJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementOrderJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStoredArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractSupplierJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractUnavailableArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractWarehouseJpaDao.java
Modified:
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java
branches/magalie-eugene/pom.xml
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractArticleJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractArticleJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractArticleJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,43 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.Article;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-
-public class AbstractArticleJpaDao<E extends Article> extends GeneratedArticleJpaDao<E> {
-
- public AbstractArticleJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public E findByCode(String articleCode) {
- TypedQuery<E> query = createQuery("from Article a where a.code = :code");
- query.setParameter(Article.PROPERTY_CODE, articleCode);
- return findUniqueOrNull(query);
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedArticleJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedArticleJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedArticleJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,57 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.DeliveredRequestedArticle;
-import com.franciaflex.magalie.persistence.entity.RequestedList;
-import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-import java.util.List;
-
-public class AbstractDeliveredRequestedArticleJpaDao<E extends DeliveredRequestedArticle> extends GeneratedDeliveredRequestedArticleJpaDao<E> {
-
- public AbstractDeliveredRequestedArticleJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public E find(StorageMovementOrder storageMovementOrder) {
- TypedQuery<E> query =
- createQuery(
- "from DeliveredRequestedArticle dra where dra.storageMovementOrder = :storageMovementOrder");
- query.setParameter("storageMovementOrder", storageMovementOrder);
- return findUniqueOrNull(query);
- }
-
- @Override
- public List<E> findAll(RequestedList requestedList) {
- TypedQuery<E> query =
- createQuery(
- "from DeliveredRequestedArticle dra where dra.requestedArticle.requestedList = :requestedList");
- query.setParameter("requestedList", requestedList);
- return findAll(query);
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedListJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedListJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedListJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,65 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.DeliveredRequestedList;
-import com.franciaflex.magalie.persistence.entity.DeliveredRequestedListStatus;
-import com.franciaflex.magalie.persistence.entity.MagalieUser;
-import com.franciaflex.magalie.persistence.entity.RequestedList;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-
-public class AbstractDeliveredRequestedListJpaDao<E extends DeliveredRequestedList> extends GeneratedDeliveredRequestedListJpaDao<E> {
-
- public AbstractDeliveredRequestedListJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public E findByAffectedTo(MagalieUser affectedTo) {
-
- TypedQuery<E> query = createQuery(
- "from DeliveredRequestedList drl where drl.status = :affected and drl.affectedTo = :affectedTo");
-
- query.setParameter("affectedTo", affectedTo);
-
- query.setParameter("affected", DeliveredRequestedListStatus.AFFECTED);
-
- return findUniqueOrNull(query);
-
- }
-
- @Override
- public E findByRequestedList(RequestedList requestedList) {
-
- TypedQuery<E> query = createQuery(
- "from DeliveredRequestedList drl where drl.requestedList = :requestedList");
-
- query.setParameter("requestedList", requestedList);
-
- return findUniqueOrNull(query);
-
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractKanbanJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractKanbanJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractKanbanJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,46 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.Article;
-import com.franciaflex.magalie.persistence.entity.Kanban;
-import com.franciaflex.magalie.persistence.entity.Warehouse;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-
-public class AbstractKanbanJpaDao<E extends Kanban> extends GeneratedKanbanJpaDao<E> {
-
- public AbstractKanbanJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public E find(Article article, Warehouse warehouse) {
- TypedQuery<E> query = createQuery("from Kanban k where k.article = :article and k.warehouse = :warehouse");
- query.setParameter("article", article);
- query.setParameter("warehouse", warehouse);
- return query.getSingleResult();
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationErrorJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationErrorJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationErrorJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,63 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.Article;
-import com.franciaflex.magalie.persistence.entity.Location;
-import com.franciaflex.magalie.persistence.entity.LocationError;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import javax.persistence.TypedQuery;
-import java.util.List;
-
-public class AbstractLocationErrorJpaDao<E extends LocationError> extends GeneratedLocationErrorJpaDao<E> {
-
- public AbstractLocationErrorJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public E findByLocation(Location location) {
- TypedQuery<E> query = createQuery("from LocationError se where se.location = :location");
- query.setParameter("location", location);
- return findUniqueOrNull(query);
- }
-
- @Override
- public List<Location> getAllLocationsInError(Article article) {
- TypedQuery<Location> query = createQuery(Location.class,
- "select se.location from LocationError se where se.article = :article");
- query.setParameter("article", article);
- List<Location> allLocationsInError = query.getResultList();
- return allLocationsInError;
- }
-
- @Override
- public List<E> findAll() {
- TypedQuery<E> query = createQuery("from LocationError se order by se.reportDate");
- List<E> all = query.getResultList();
- return all;
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,84 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.Locations;
-import com.franciaflex.magalie.persistence.entity.Building;
-import com.franciaflex.magalie.persistence.entity.Location;
-import com.franciaflex.magalie.persistence.entity.Warehouse;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-import java.util.List;
-
-public class AbstractLocationJpaDao<E extends Location> extends GeneratedLocationJpaDao<E> {
-
- public AbstractLocationJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public E find(String code, Warehouse warehouse) {
- TypedQuery<E> query = createQuery("from Location l where l.code = :code and l.warehouse = :warehouse");
- query.setParameter("code", code);
- query.setParameter("warehouse", warehouse);
- return findUnique(query);
- }
-
- protected List<E> findAllWithoutReception(Building building, Warehouse warehouse) {
- boolean filterOnBuilding = building != null;
- boolean filterOnWarehouse = warehouse != null;
- String hql = " from Location l where";
- if (filterOnBuilding) {
- hql += " l.warehouse.building = :building and ";
- }
- if (filterOnWarehouse) {
- hql += " l.warehouse = :warehouse and ";
- }
- hql += " l.code != :codeForReceptionLocations and "
- + " l.code != :codeForWarehouseWithoutLocations and "
- + " l.fullLocation = false "
- + " order by l.warehouse.building.code, l.warehouse.code, l.code";
- TypedQuery<E> query = createQuery(hql);
- if (filterOnBuilding) {
- query.setParameter("building", building);
- }
- if (filterOnWarehouse) {
- query.setParameter("warehouse", warehouse);
- }
- query.setParameter("codeForReceptionLocations", Locations.codeForReceptionLocations());
- query.setParameter("codeForWarehouseWithoutLocations", Locations.codeForWarehouseWithoutLocations());
- return findAll(query);
- }
-
- @Override
- public List<E> findAllWithoutReception(Building building) {
- return findAllWithoutReception(building, null);
- }
-
- @Override
- public List<E> findAllWithoutReception(Warehouse warehouse) {
- return findAllWithoutReception(null, warehouse);
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractMagalieUserJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractMagalieUserJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractMagalieUserJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,52 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.MagalieUser;
-
-import javax.persistence.EntityManager;
-import javax.persistence.Query;
-import javax.persistence.TypedQuery;
-import java.util.List;
-
-public class AbstractMagalieUserJpaDao<E extends MagalieUser> extends GeneratedMagalieUserJpaDao<E> {
-
- public AbstractMagalieUserJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public E findByLogin(String login) {
- TypedQuery<E> query = createQuery("from MagalieUser mu where mu.login = :login");
- query.setParameter("login", login);
- return findUnique(query);
- }
-
- @Override
- public List<E> findAll() {
- TypedQuery<E> query = createQuery("from MagalieUser mu order by mu.login");
- List<E> resultList = query.getResultList();
- return resultList;
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractPreparedArticleReceptionJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractPreparedArticleReceptionJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractPreparedArticleReceptionJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,20 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-
-public class AbstractPreparedArticleReceptionJpaDao<E extends PreparedArticleReception> extends GeneratedPreparedArticleReceptionJpaDao<E> {
-
- public AbstractPreparedArticleReceptionJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public E findByBarcode(String barcode) {
- TypedQuery<E> query = createQuery("from PreparedArticleReception par where par.barcode = :barcode");
- query.setParameter("barcode", barcode);
- return findUniqueOrNull(query);
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedArticleJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedArticleJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedArticleJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,65 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.Building;
-import com.franciaflex.magalie.persistence.entity.DeliveredRequestedListStatus;
-import com.franciaflex.magalie.persistence.entity.MagalieUser;
-import com.franciaflex.magalie.persistence.entity.RequestedArticle;
-import com.franciaflex.magalie.persistence.entity.RequestedList;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-import java.util.List;
-
-public class AbstractRequestedArticleJpaDao<E extends RequestedArticle> extends GeneratedRequestedArticleJpaDao<E> {
-
- public AbstractRequestedArticleJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public List<E> findAllUndelivered(Building building, MagalieUser affectedTo, String listType) {
- TypedQuery<E> query = createQuery(
- "from RequestedArticle ra where "
- + " ra not in (select dra.requestedArticle from DeliveredRequestedArticle dra) "
- + " and ra.requestedList.building = :building "
- + " and ra.requestedList.listType = :listType "
- + " and ra.requestedList not in (select drl.requestedList from DeliveredRequestedList drl where drl.status = :complete or drl.status = :affected and drl.affectedTo != :affectedTo)");
- query.setParameter("building", building);
- query.setParameter("listType", listType);
- query.setParameter("complete", DeliveredRequestedListStatus.COMPLETE);
- query.setParameter("affected", DeliveredRequestedListStatus.AFFECTED);
- query.setParameter("affectedTo", affectedTo);
- return findAll(query);
- }
-
- @Override
- public List<E> findAll(RequestedList requestedList) {
- TypedQuery<E> query = createQuery("from RequestedArticle ra where ra.requestedList = :requestedList");
- query.setParameter("requestedList", requestedList);
- return findAll(query);
- }
-
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedListJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedListJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedListJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,43 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.RequestedList;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-import java.util.List;
-
-public class AbstractRequestedListJpaDao<E extends RequestedList> extends GeneratedRequestedListJpaDao<E> {
-
- public AbstractRequestedListJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public List<String> findAllDistinctListTypes() {
- TypedQuery<String> query = createQuery(String.class, "select distinct rl.listType from RequestedList rl");
- return query.getResultList();
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,65 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.Locations;
-import com.franciaflex.magalie.persistence.entity.Article;
-import com.franciaflex.magalie.persistence.entity.Building;
-import com.franciaflex.magalie.persistence.entity.StorageMovement;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-import java.util.List;
-
-public class AbstractStorageMovementJpaDao<E extends StorageMovement> extends GeneratedStorageMovementJpaDao<E> {
-
- public AbstractStorageMovementJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public List<E> findAllByArticle(Article article) {
- TypedQuery<E> query = createQuery("from StorageMovement sm where sm.article = :article");
- query.setParameter("article", article);
- return query.getResultList();
- }
-
- @Override
- public List<E> findAllInReception(Building building) {
- TypedQuery<E> query = createQuery(
- " from StorageMovement sm" +
- " where sm.originLocation.code = :codeForReceptionLocations and sm.originLocation.warehouse.building = :building" +
- " or " +
- " sm.destinationLocation.code = :codeForReceptionLocations and sm.destinationLocation.warehouse.building = :building");
- query.setParameter("building", building);
- query.setParameter("codeForReceptionLocations", Locations.codeForReceptionLocations());
- return query.getResultList();
- }
-
- @Override
- public List<E> findAll() {
- TypedQuery<E> query = createQuery("from StorageMovement sm order by sm.orderDate");
- return query.getResultList();
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementOrderJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementOrderJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementOrderJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,53 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.Building;
-import com.franciaflex.magalie.persistence.entity.MagalieUser;
-import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-import java.util.List;
-
-public class AbstractStorageMovementOrderJpaDao<E extends StorageMovementOrder> extends GeneratedStorageMovementOrderJpaDao<E> {
-
- public AbstractStorageMovementOrderJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public List<E> findNotConfirmedByUser(MagalieUser magalieUser, Building building) {
- TypedQuery<E> query = createQuery(
- " select distinct smo" +
- " from StorageMovementOrder smo" +
- " inner join smo.storageMovements as sm" +
- " where sm.magalieUser = :magalieUser" +
- " and sm.originLocation.warehouse.building = :building" +
- " and sm.confirmDate is null");
- query.setParameter("magalieUser", magalieUser);
- query.setParameter("building", building);
- return query.getResultList();
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStoredArticleJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStoredArticleJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStoredArticleJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,77 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.Locations;
-import com.franciaflex.magalie.persistence.entity.Article;
-import com.franciaflex.magalie.persistence.entity.Building;
-import com.franciaflex.magalie.persistence.entity.StoredArticle;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-import java.util.List;
-
-public class AbstractStoredArticleJpaDao<E extends StoredArticle> extends GeneratedStoredArticleJpaDao<E> {
-
- public AbstractStoredArticleJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public List<E> findAllForArticleInBuilding(Article article, Building building) {
- TypedQuery<E> query = createQuery("from StoredArticle sa where sa.article = :article and sa.location.warehouse.withdrawAllowed = true and sa.location.warehouse.building = :building");
- query.setParameter("article", article);
- query.setParameter("building", building);
- List<E> resultList = findAll(query);
- for (StoredArticle storedArticle : resultList) {
- entityManager.detach(storedArticle);
- }
- return resultList;
- }
-
- @Override
- public List<E> findAllReceivedForAllSupplier(Building building) {
- TypedQuery<E> query = createQuery("from StoredArticle sa where sa.location.warehouse.building = :building and sa.location.code = :code");
- query.setParameter("building", building);
- query.setParameter("code", Locations.codeForReceptionLocations());
- List<E> resultList = findAll(query);
- for (StoredArticle storedArticle : resultList) {
- entityManager.detach(storedArticle);
- }
- return resultList;
- }
-
- @Override
- public List<E> findAllReceivedForSupplier(Building building, String supplierId) {
- TypedQuery<E> query = createQuery("from StoredArticle sa where sa.location.warehouse.building = :building and sa.location.code = :code and sa.article.supplier.id = :supplierId");
- query.setParameter("building", building);
- query.setParameter("supplierId", supplierId);
- query.setParameter("code", Locations.codeForReceptionLocations());
- List<E> resultList = findAll(query);
- for (StoredArticle storedArticle : resultList) {
- entityManager.detach(storedArticle);
- }
- return resultList;
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractSupplierJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractSupplierJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractSupplierJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,50 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.Locations;
-import com.franciaflex.magalie.persistence.entity.Building;
-import com.franciaflex.magalie.persistence.entity.Location;
-import com.franciaflex.magalie.persistence.entity.Supplier;
-import com.franciaflex.magalie.persistence.entity.Warehouse;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-import java.util.List;
-
-public class AbstractSupplierJpaDao<E extends Supplier> extends GeneratedSupplierJpaDao<E> {
-
- public AbstractSupplierJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public List<E> findAllWithReceivedArticles(Building building) {
- TypedQuery<E> query = createQuery("select sa.article.supplier from StoredArticle sa where sa.location.code = :code and sa.location.warehouse.building = :building");
- query.setParameter(Warehouse.PROPERTY_BUILDING, building);
- query.setParameter(Location.PROPERTY_CODE, Locations.codeForReceptionLocations());
- return findAll(query);
- }
-
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractUnavailableArticleJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractUnavailableArticleJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractUnavailableArticleJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,46 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.entity.Article;
-import com.franciaflex.magalie.persistence.entity.Building;
-import com.franciaflex.magalie.persistence.entity.UnavailableArticle;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-
-public class AbstractUnavailableArticleJpaDao<E extends UnavailableArticle> extends GeneratedUnavailableArticleJpaDao<E> {
-
- public AbstractUnavailableArticleJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public E findByArticle(Building building, Article article) {
- TypedQuery<E> query = createQuery("from UnavailableArticle ua where ua.article = :article and ua.building = :building");
- query.setParameter(UnavailableArticle.PROPERTY_ARTICLE, article);
- query.setParameter(UnavailableArticle.PROPERTY_BUILDING, building);
- return findUniqueOrNull(query);
- }
-}
Deleted: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractWarehouseJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractWarehouseJpaDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractWarehouseJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -1,47 +0,0 @@
-package com.franciaflex.magalie.persistence.dao;
-
-/*
- * #%L
- * MagaLiE :: Persistence
- * $Id:$
- * $HeadURL:$
- * %%
- * Copyright (C) 2013 CodeLutin
- * %%
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- * #L%
- */
-
-import com.franciaflex.magalie.persistence.Locations;
-import com.franciaflex.magalie.persistence.entity.Building;
-import com.franciaflex.magalie.persistence.entity.Warehouse;
-
-import javax.persistence.EntityManager;
-import javax.persistence.TypedQuery;
-import java.util.List;
-
-public class AbstractWarehouseJpaDao<E extends Warehouse> extends GeneratedWarehouseJpaDao<E> {
-
- public AbstractWarehouseJpaDao(EntityManager entityManager) {
- super(entityManager);
- }
-
- @Override
- public List<E> findAllWithoutLocations(Building building) {
- TypedQuery<E> query = createQuery("from Warehouse w where w.building = :building and w in (select l.warehouse from Location l where l.code = :code)");
- query.setParameter(Warehouse.PROPERTY_BUILDING, building);
- query.setParameter(Warehouse.PROPERTY_CODE, Locations.codeForWarehouseWithoutLocations());
- return query.getResultList();
- }
-}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -26,8 +26,8 @@
import com.franciaflex.magalie.persistence.entity.Article;
/** @author bleny */
-public interface ArticleDao<E extends Article> {
+public interface ArticleDao {
- E findByCode(String articleCode);
+ Article findByCode(String articleCode);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractArticleJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,43 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Article;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+public class ArticleJpaDao extends AbstractArticleJpaDao {
+
+ public ArticleJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public Article findByCode(String articleCode) {
+ TypedQuery<Article> query = createQuery("from Article a where a.code = :code");
+ query.setParameter(Article.PROPERTY_CODE, articleCode);
+ return findUniqueOrNull(query);
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -26,6 +26,6 @@
import com.franciaflex.magalie.persistence.entity.Building;
/** @author bleny */
-public interface BuildingDao<E extends Building> {
+public interface BuildingDao {
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -30,10 +30,10 @@
import java.util.List;
/** @author bleny */
-public interface DeliveredRequestedArticleDao<E extends DeliveredRequestedArticle> {
+public interface DeliveredRequestedArticleDao {
- E find(StorageMovementOrder storageMovementOrder);
+ DeliveredRequestedArticle find(StorageMovementOrder storageMovementOrder);
- List<E> findAll(RequestedList requestedList);
+ List<DeliveredRequestedArticle> findAll(RequestedList requestedList);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedArticleJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,57 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.DeliveredRequestedArticle;
+import com.franciaflex.magalie.persistence.entity.RequestedList;
+import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class DeliveredRequestedArticleJpaDao extends AbstractDeliveredRequestedArticleJpaDao {
+
+ public DeliveredRequestedArticleJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public DeliveredRequestedArticle find(StorageMovementOrder storageMovementOrder) {
+ TypedQuery<DeliveredRequestedArticle> query =
+ createQuery(
+ "from DeliveredRequestedArticle dra where dra.storageMovementOrder = :storageMovementOrder");
+ query.setParameter("storageMovementOrder", storageMovementOrder);
+ return findUniqueOrNull(query);
+ }
+
+ @Override
+ public List<DeliveredRequestedArticle> findAll(RequestedList requestedList) {
+ TypedQuery<DeliveredRequestedArticle> query =
+ createQuery(
+ "from DeliveredRequestedArticle dra where dra.requestedArticle.requestedList = :requestedList");
+ query.setParameter("requestedList", requestedList);
+ return findAll(query);
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -28,10 +28,10 @@
import com.franciaflex.magalie.persistence.entity.RequestedList;
/** @author bleny */
-public interface DeliveredRequestedListDao<E extends DeliveredRequestedList> {
+public interface DeliveredRequestedListDao {
- E findByAffectedTo(MagalieUser affectedTo);
+ DeliveredRequestedList findByAffectedTo(MagalieUser affectedTo);
- E findByRequestedList(RequestedList requestedList);
+ DeliveredRequestedList findByRequestedList(RequestedList requestedList);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedListJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,65 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.DeliveredRequestedList;
+import com.franciaflex.magalie.persistence.entity.DeliveredRequestedListStatus;
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.RequestedList;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+public class DeliveredRequestedListJpaDao extends AbstractDeliveredRequestedListJpaDao {
+
+ public DeliveredRequestedListJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public DeliveredRequestedList findByAffectedTo(MagalieUser affectedTo) {
+
+ TypedQuery<DeliveredRequestedList> query = createQuery(
+ "from DeliveredRequestedList drl where drl.status = :affected and drl.affectedTo = :affectedTo");
+
+ query.setParameter("affectedTo", affectedTo);
+
+ query.setParameter("affected", DeliveredRequestedListStatus.AFFECTED);
+
+ return findUniqueOrNull(query);
+
+ }
+
+ @Override
+ public DeliveredRequestedList findByRequestedList(RequestedList requestedList) {
+
+ TypedQuery<DeliveredRequestedList> query = createQuery(
+ "from DeliveredRequestedList drl where drl.requestedList = :requestedList");
+
+ query.setParameter("requestedList", requestedList);
+
+ return findUniqueOrNull(query);
+
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -28,8 +28,8 @@
import com.franciaflex.magalie.persistence.entity.Warehouse;
/** @author bleny */
-public interface KanbanDao<E extends Kanban> {
+public interface KanbanDao {
- public E find(Article article, Warehouse warehouse);
+ public Kanban find(Article article, Warehouse warehouse);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractKanbanJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,46 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Kanban;
+import com.franciaflex.magalie.persistence.entity.Warehouse;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+public class KanbanJpaDao extends AbstractKanbanJpaDao {
+
+ public KanbanJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public Kanban find(Article article, Warehouse warehouse) {
+ TypedQuery<Kanban> query = createQuery("from Kanban k where k.article = :article and k.warehouse = :warehouse");
+ query.setParameter("article", article);
+ query.setParameter("warehouse", warehouse);
+ return query.getSingleResult();
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -29,11 +29,11 @@
import java.util.List;
-public interface LocationDao<E extends Location> {
+public interface LocationDao {
- E find(String code, Warehouse warehouse);
+ Location find(String code, Warehouse warehouse);
- List<E> findAllWithoutReception(Building building);
+ List<Location> findAllWithoutReception(Building building);
- List<E> findAllWithoutReception(Warehouse warehouse);
+ List<Location> findAllWithoutReception(Warehouse warehouse);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -30,12 +30,11 @@
import java.util.List;
/** @author bleny */
-public interface LocationErrorDao<E extends LocationError> {
+public interface LocationErrorDao {
- E findByLocation(Location location);
+ LocationError findByLocation(Location location);
List<Location> getAllLocationsInError(Article article);
- List<E> findAll();
-
+ List<LocationError> findAll();
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationErrorJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,62 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Location;
+import com.franciaflex.magalie.persistence.entity.LocationError;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class LocationErrorJpaDao extends AbstractLocationErrorJpaDao {
+
+ public LocationErrorJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public LocationError findByLocation(Location location) {
+ TypedQuery<LocationError> query = createQuery("from LocationError se where se.location = :location");
+ query.setParameter("location", location);
+ return findUniqueOrNull(query);
+ }
+
+ @Override
+ public List<Location> getAllLocationsInError(Article article) {
+ TypedQuery<Location> query = createQuery(Location.class,
+ "select se.location from LocationError se where se.article = :article");
+ query.setParameter("article", article);
+ List<Location> allLocationsInError = query.getResultList();
+ return allLocationsInError;
+ }
+
+ @Override
+ public List<LocationError> findAll() {
+ TypedQuery<LocationError> query = createQuery("from LocationError se order by se.reportDate");
+ List<LocationError> all = query.getResultList();
+ return all;
+ }
+}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,84 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.Locations;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.Location;
+import com.franciaflex.magalie.persistence.entity.Warehouse;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class LocationJpaDao extends AbstractLocationJpaDao {
+
+ public LocationJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public Location find(String code, Warehouse warehouse) {
+ TypedQuery<Location> query = createQuery("from Location l where l.code = :code and l.warehouse = :warehouse");
+ query.setParameter("code", code);
+ query.setParameter("warehouse", warehouse);
+ return findUnique(query);
+ }
+
+ protected List<Location> findAllWithoutReception(Building building, Warehouse warehouse) {
+ boolean filterOnBuilding = building != null;
+ boolean filterOnWarehouse = warehouse != null;
+ String hql = " from Location l where";
+ if (filterOnBuilding) {
+ hql += " l.warehouse.building = :building and ";
+ }
+ if (filterOnWarehouse) {
+ hql += " l.warehouse = :warehouse and ";
+ }
+ hql += " l.code != :codeForReceptionLocations and "
+ + " l.code != :codeForWarehouseWithoutLocations and "
+ + " l.fullLocation = false "
+ + " order by l.warehouse.building.code, l.warehouse.code, l.code";
+ TypedQuery<Location> query = createQuery(hql);
+ if (filterOnBuilding) {
+ query.setParameter("building", building);
+ }
+ if (filterOnWarehouse) {
+ query.setParameter("warehouse", warehouse);
+ }
+ query.setParameter("codeForReceptionLocations", Locations.codeForReceptionLocations());
+ query.setParameter("codeForWarehouseWithoutLocations", Locations.codeForWarehouseWithoutLocations());
+ return findAll(query);
+ }
+
+ @Override
+ public List<Location> findAllWithoutReception(Building building) {
+ return findAllWithoutReception(building, null);
+ }
+
+ @Override
+ public List<Location> findAllWithoutReception(Warehouse warehouse) {
+ return findAllWithoutReception(null, warehouse);
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -28,10 +28,10 @@
import java.util.List;
/** @author bleny */
-public interface MagalieUserDao<E extends MagalieUser> {
+public interface MagalieUserDao {
- E findByLogin(String login);
+ MagalieUser findByLogin(String login);
- List<E> findAll();
+ List<MagalieUser> findAll();
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractMagalieUserJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,52 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class MagalieUserJpaDao extends AbstractMagalieUserJpaDao {
+
+ public MagalieUserJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public MagalieUser findByLogin(String login) {
+ TypedQuery<MagalieUser> query = createQuery("from MagalieUser mu where mu.login = :login");
+ query.setParameter("login", login);
+ return findUnique(query);
+ }
+
+ @Override
+ public List<MagalieUser> findAll() {
+ TypedQuery<MagalieUser> query = createQuery("from MagalieUser mu order by mu.login");
+ List<MagalieUser> resultList = query.getResultList();
+ return resultList;
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -3,7 +3,7 @@
import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
/** @author bleny */
-public interface PreparedArticleReceptionDao<E extends PreparedArticleReception> {
+public interface PreparedArticleReceptionDao {
- E findByBarcode(String barcode);
+ PreparedArticleReception findByBarcode(String barcode);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractPreparedArticleReceptionJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,20 @@
+package com.franciaflex.magalie.persistence.dao;
+
+import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+public class PreparedArticleReceptionJpaDao extends AbstractPreparedArticleReceptionJpaDao {
+
+ public PreparedArticleReceptionJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public PreparedArticleReception findByBarcode(String barcode) {
+ TypedQuery<PreparedArticleReception> query = createQuery("from PreparedArticleReception par where par.barcode = :barcode");
+ query.setParameter("barcode", barcode);
+ return findUniqueOrNull(query);
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -31,10 +31,10 @@
import java.util.List;
/** @author bleny */
-public interface RequestedArticleDao<E extends RequestedArticle> {
+public interface RequestedArticleDao {
- List<E> findAllUndelivered(Building building, MagalieUser affectedTo, String listType);
+ List<RequestedArticle> findAllUndelivered(Building building, MagalieUser affectedTo, String listType);
- List<E> findAll(RequestedList requestedList);
+ List<RequestedArticle> findAll(RequestedList requestedList);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedArticleJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,65 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.DeliveredRequestedListStatus;
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.RequestedArticle;
+import com.franciaflex.magalie.persistence.entity.RequestedList;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class RequestedArticleJpaDao extends AbstractRequestedArticleJpaDao {
+
+ public RequestedArticleJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<RequestedArticle> findAllUndelivered(Building building, MagalieUser affectedTo, String listType) {
+ TypedQuery<RequestedArticle> query = createQuery(
+ "from RequestedArticle ra where "
+ + " ra not in (select dra.requestedArticle from DeliveredRequestedArticle dra) "
+ + " and ra.requestedList.building = :building "
+ + " and ra.requestedList.listType = :listType "
+ + " and ra.requestedList not in (select drl.requestedList from DeliveredRequestedList drl where drl.status = :complete or drl.status = :affected and drl.affectedTo != :affectedTo)");
+ query.setParameter("building", building);
+ query.setParameter("listType", listType);
+ query.setParameter("complete", DeliveredRequestedListStatus.COMPLETE);
+ query.setParameter("affected", DeliveredRequestedListStatus.AFFECTED);
+ query.setParameter("affectedTo", affectedTo);
+ return findAll(query);
+ }
+
+ @Override
+ public List<RequestedArticle> findAll(RequestedList requestedList) {
+ TypedQuery<RequestedArticle> query = createQuery("from RequestedArticle ra where ra.requestedList = :requestedList");
+ query.setParameter("requestedList", requestedList);
+ return findAll(query);
+ }
+
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -28,7 +28,7 @@
import java.util.List;
/** @author bleny */
-public interface RequestedListDao<E extends RequestedList> {
+public interface RequestedListDao {
List<String> findAllDistinctListTypes();
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedListJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,43 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.RequestedList;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class RequestedListJpaDao extends AbstractRequestedListJpaDao {
+
+ public RequestedListJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<String> findAllDistinctListTypes() {
+ TypedQuery<String> query = createQuery(String.class, "select distinct rl.listType from RequestedList rl");
+ return query.getResultList();
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -30,11 +30,11 @@
import java.util.List;
/** @author bleny */
-public interface StorageMovementDao <E extends StorageMovement>{
+public interface StorageMovementDao {
- List<E> findAllByArticle(Article article);
+ List<StorageMovement> findAllByArticle(Article article);
- List<E> findAll();
+ List<StorageMovement> findAll();
- List<E> findAllInReception(Building building);
+ List<StorageMovement> findAllInReception(Building building);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,65 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.Locations;
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.StorageMovement;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class StorageMovementJpaDao extends AbstractStorageMovementJpaDao {
+
+ public StorageMovementJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<StorageMovement> findAllByArticle(Article article) {
+ TypedQuery<StorageMovement> query = createQuery("from StorageMovement sm where sm.article = :article");
+ query.setParameter("article", article);
+ return query.getResultList();
+ }
+
+ @Override
+ public List<StorageMovement> findAllInReception(Building building) {
+ TypedQuery<StorageMovement> query = createQuery(
+ " from StorageMovement sm" +
+ " where sm.originLocation.code = :codeForReceptionLocations and sm.originLocation.warehouse.building = :building" +
+ " or " +
+ " sm.destinationLocation.code = :codeForReceptionLocations and sm.destinationLocation.warehouse.building = :building");
+ query.setParameter("building", building);
+ query.setParameter("codeForReceptionLocations", Locations.codeForReceptionLocations());
+ return query.getResultList();
+ }
+
+ @Override
+ public List<StorageMovement> findAll() {
+ TypedQuery<StorageMovement> query = createQuery("from StorageMovement sm order by sm.orderDate");
+ return query.getResultList();
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -29,8 +29,8 @@
import java.util.List;
-public interface StorageMovementOrderDao<E extends StorageMovementOrder> {
+public interface StorageMovementOrderDao {
- public List<E> findNotConfirmedByUser(MagalieUser magalieUser, Building building);
+ public List<StorageMovementOrder> findNotConfirmedByUser(MagalieUser magalieUser, Building building);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementOrderJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,53 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class StorageMovementOrderJpaDao extends AbstractStorageMovementOrderJpaDao{
+
+ public StorageMovementOrderJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<StorageMovementOrder> findNotConfirmedByUser(MagalieUser magalieUser, Building building) {
+ TypedQuery<StorageMovementOrder> query = createQuery(
+ " select distinct smo" +
+ " from StorageMovementOrder smo" +
+ " inner join smo.storageMovements as sm" +
+ " where sm.magalieUser = :magalieUser" +
+ " and sm.originLocation.warehouse.building = :building" +
+ " and sm.confirmDate is null");
+ query.setParameter("magalieUser", magalieUser);
+ query.setParameter("building", building);
+ return query.getResultList();
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -29,11 +29,11 @@
import java.util.List;
-public interface StoredArticleDao<E extends StoredArticle> {
+public interface StoredArticleDao {
- List<E> findAllForArticleInBuilding(Article article, Building building);
+ List<StoredArticle> findAllForArticleInBuilding(Article article, Building building);
- List<E> findAllReceivedForAllSupplier(Building building);
+ List<StoredArticle> findAllReceivedForAllSupplier(Building building);
- List<E> findAllReceivedForSupplier(Building building, String supplierId);
+ List<StoredArticle> findAllReceivedForSupplier(Building building, String supplierId);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStoredArticleJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,77 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.Locations;
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.StoredArticle;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class StoredArticleJpaDao extends AbstractStoredArticleJpaDao {
+
+ public StoredArticleJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<StoredArticle> findAllForArticleInBuilding(Article article, Building building) {
+ TypedQuery<StoredArticle> query = createQuery("from StoredArticle sa where sa.article = :article and sa.location.warehouse.withdrawAllowed = true and sa.location.warehouse.building = :building");
+ query.setParameter("article", article);
+ query.setParameter("building", building);
+ List<StoredArticle> resultList = findAll(query);
+ for (StoredArticle storedArticle : resultList) {
+ entityManager.detach(storedArticle);
+ }
+ return resultList;
+ }
+
+ @Override
+ public List<StoredArticle> findAllReceivedForAllSupplier(Building building) {
+ TypedQuery<StoredArticle> query = createQuery("from StoredArticle sa where sa.location.warehouse.building = :building and sa.location.code = :code");
+ query.setParameter("building", building);
+ query.setParameter("code", Locations.codeForReceptionLocations());
+ List<StoredArticle> resultList = findAll(query);
+ for (StoredArticle storedArticle : resultList) {
+ entityManager.detach(storedArticle);
+ }
+ return resultList;
+ }
+
+ @Override
+ public List<StoredArticle> findAllReceivedForSupplier(Building building, String supplierId) {
+ TypedQuery<StoredArticle> query = createQuery("from StoredArticle sa where sa.location.warehouse.building = :building and sa.location.code = :code and sa.article.supplier.id = :supplierId");
+ query.setParameter("building", building);
+ query.setParameter("supplierId", supplierId);
+ query.setParameter("code", Locations.codeForReceptionLocations());
+ List<StoredArticle> resultList = findAll(query);
+ for (StoredArticle storedArticle : resultList) {
+ entityManager.detach(storedArticle);
+ }
+ return resultList;
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -29,8 +29,8 @@
import java.util.List;
/** @author bleny */
-public interface SupplierDao<E extends Supplier> {
+public interface SupplierDao {
- List<E> findAllWithReceivedArticles(Building building);
+ List<Supplier> findAllWithReceivedArticles(Building building);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractSupplierJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,50 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.Locations;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.Location;
+import com.franciaflex.magalie.persistence.entity.Supplier;
+import com.franciaflex.magalie.persistence.entity.Warehouse;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class SupplierJpaDao extends AbstractSupplierJpaDao {
+
+ public SupplierJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<Supplier> findAllWithReceivedArticles(Building building) {
+ TypedQuery<Supplier> query = createQuery("select sa.article.supplier from StoredArticle sa where sa.location.code = :code and sa.location.warehouse.building = :building");
+ query.setParameter(Warehouse.PROPERTY_BUILDING, building);
+ query.setParameter(Location.PROPERTY_CODE, Locations.codeForReceptionLocations());
+ return findAll(query);
+ }
+
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -28,8 +28,8 @@
import com.franciaflex.magalie.persistence.entity.UnavailableArticle;
/** @author bleny */
-public interface UnavailableArticleDao<E extends UnavailableArticle> {
+public interface UnavailableArticleDao {
- E findByArticle(Building building, Article article);
+ UnavailableArticle findByArticle(Building building, Article article);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractUnavailableArticleJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,46 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.UnavailableArticle;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+
+public class UnavailableArticleJpaDao extends AbstractUnavailableArticleJpaDao {
+
+ public UnavailableArticleJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public UnavailableArticle findByArticle(Building building, Article article) {
+ TypedQuery<UnavailableArticle> query = createQuery("from UnavailableArticle ua where ua.article = :article and ua.building = :building");
+ query.setParameter(UnavailableArticle.PROPERTY_ARTICLE, article);
+ query.setParameter(UnavailableArticle.PROPERTY_BUILDING, building);
+ return findUniqueOrNull(query);
+ }
+}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -29,8 +29,8 @@
import java.util.List;
/** @author bleny */
-public interface WarehouseDao<E extends Warehouse> {
+public interface WarehouseDao {
- List<E> findAllWithoutLocations(Building building);
+ List<Warehouse> findAllWithoutLocations(Building building);
}
Copied: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseJpaDao.java (from rev 207, branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractWarehouseJpaDao.java)
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseJpaDao.java (rev 0)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseJpaDao.java 2013-05-29 13:24:06 UTC (rev 212)
@@ -0,0 +1,47 @@
+package com.franciaflex.magalie.persistence.dao;
+
+/*
+ * #%L
+ * MagaLiE :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2013 CodeLutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * #L%
+ */
+
+import com.franciaflex.magalie.persistence.Locations;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.Warehouse;
+
+import javax.persistence.EntityManager;
+import javax.persistence.TypedQuery;
+import java.util.List;
+
+public class WarehouseJpaDao extends AbstractWarehouseJpaDao {
+
+ public WarehouseJpaDao(EntityManager entityManager) {
+ super(entityManager);
+ }
+
+ @Override
+ public List<Warehouse> findAllWithoutLocations(Building building) {
+ TypedQuery<Warehouse> query = createQuery("from Warehouse w where w.building = :building and w in (select l.warehouse from Location l where l.code = :code)");
+ query.setParameter(Warehouse.PROPERTY_BUILDING, building);
+ query.setParameter(Warehouse.PROPERTY_CODE, Locations.codeForWarehouseWithoutLocations());
+ return query.getResultList();
+ }
+}
Modified: branches/magalie-eugene/pom.xml
===================================================================
--- branches/magalie-eugene/pom.xml 2013-05-29 12:54:54 UTC (rev 211)
+++ branches/magalie-eugene/pom.xml 2013-05-29 13:24:06 UTC (rev 212)
@@ -107,7 +107,7 @@
<mockitoVersion>1.9.5</mockitoVersion>
<nuitonI18nVersion>2.5</nuitonI18nVersion>
<topiaVersion>2.7.1</topiaVersion>
- <eugeneVersion>2.6.3-SNAPSHOT</eugeneVersion>
+ <eugeneVersion>2.6.3</eugeneVersion>
<!-- license to use -->
<license.licenseName>agpl_v3</license.licenseName>
1
0
r211 - in trunk: magalie-persistence/src/main/java/com/franciaflex/magalie/persistence magalie-services/src/main/java/com/franciaflex/magalie/services magalie-services/src/main/java/com/franciaflex/magalie/services/service magalie-web/src/main/java/com/franciaflex/magalie/web magalie-web/src/main/java/com/franciaflex/magalie/web/action magalie-web/src/main/webapp/WEB-INF/content
by bleny@users.forge.codelutin.com 29 May '13
by bleny@users.forge.codelutin.com 29 May '13
29 May '13
Author: bleny
Date: 2013-05-29 14:54:54 +0200 (Wed, 29 May 2013)
New Revision: 211
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
refs #2168 implementation of simple withdraw (missing driver licence and article availability)
Added:
trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/SimpleWithdrawItemTask.java
trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/SimpleWithdrawItemService.java
trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PrepareWithdrawItemAction.java
trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/SimpleWithdrawItemAction.java
trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-withdraw-item-input.jsp
trunk/magalie-web/src/main/webapp/WEB-INF/content/simple-withdraw-item-input.jsp
Removed:
trunk/magalie-web/src/main/webapp/WEB-INF/content/fulfil-kanban-input.jsp
Modified:
trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Locations.java
trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/StoredArticles.java
trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/FulfilKanbanService.java
trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/StorageTransferService.java
trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/Activity.java
trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/FulfilKanbanAction.java
trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp
Modified: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Locations.java
===================================================================
--- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Locations.java 2013-05-29 12:30:22 UTC (rev 210)
+++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/Locations.java 2013-05-29 12:54:54 UTC (rev 211)
@@ -25,6 +25,7 @@
import com.franciaflex.magalie.persistence.entity.Location;
import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.base.Predicates;
import com.google.common.collect.Lists;
@@ -75,6 +76,14 @@
}
}
+ protected static class GetBarcode implements Function<Location, String> {
+
+ @Override
+ public String apply(Location location) {
+ return location.getBarcode();
+ }
+ }
+
public static Predicate<Location> accessibleLocationPredicate(MagalieUser magalieUser) {
return new AccessibleLocationPredicate(magalieUser);
}
@@ -117,4 +126,13 @@
);
return isAcceptableForReception;
}
+
+ public static Predicate<Location> barcodeEquals(String originLocationBarcode) {
+ return Predicates.compose(Predicates.equalTo(originLocationBarcode), getBarcodeFunction());
+ }
+
+ public static Function<Location, String> getBarcodeFunction() {
+ return new GetBarcode();
+ }
+
}
Modified: trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/StoredArticles.java
===================================================================
--- trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/StoredArticles.java 2013-05-29 12:30:22 UTC (rev 210)
+++ trunk/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/StoredArticles.java 2013-05-29 12:54:54 UTC (rev 211)
@@ -172,4 +172,8 @@
return Functions.compose(Articles.getSupplierFunction(), getArticleFunction());
}
+ public static Predicate<StoredArticle> locationBarcodeEquals(String originLocationBarcode) {
+ return Predicates.compose(Locations.barcodeEquals(originLocationBarcode), getLocationFunction());
+ }
+
}
Added: trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/SimpleWithdrawItemTask.java
===================================================================
--- trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/SimpleWithdrawItemTask.java (rev 0)
+++ trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/SimpleWithdrawItemTask.java 2013-05-29 12:54:54 UTC (rev 211)
@@ -0,0 +1,31 @@
+package com.franciaflex.magalie.services;
+
+import com.franciaflex.magalie.persistence.entity.StoredArticle;
+
+import java.util.List;
+
+public class SimpleWithdrawItemTask {
+
+ protected List<StoredArticle> storedArticles;
+
+ // TODO brendan 29/05/13
+ protected boolean driverLicenseRequired;
+
+ protected boolean articleUnavailable;
+
+ public SimpleWithdrawItemTask(List<StoredArticle> storedArticles) {
+ this.storedArticles = storedArticles;
+ }
+
+ public List<StoredArticle> getStoredArticles() {
+ return storedArticles;
+ }
+
+ public boolean isDriverLicenseRequired() {
+ return driverLicenseRequired;
+ }
+
+ public boolean isArticleUnavailable() {
+ return articleUnavailable;
+ }
+}
Modified: trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/FulfilKanbanService.java
===================================================================
--- trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/FulfilKanbanService.java 2013-05-29 12:30:22 UTC (rev 210)
+++ trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/FulfilKanbanService.java 2013-05-29 12:54:54 UTC (rev 211)
@@ -23,10 +23,8 @@
* #L%
*/
-import com.franciaflex.magalie.persistence.Locations;
import com.franciaflex.magalie.persistence.MagaliePersistenceContext;
import com.franciaflex.magalie.persistence.dao.KanbanDao;
-import com.franciaflex.magalie.persistence.dao.LocationDao;
import com.franciaflex.magalie.persistence.dao.WarehouseDao;
import com.franciaflex.magalie.persistence.entity.Article;
import com.franciaflex.magalie.persistence.entity.Building;
@@ -91,8 +89,12 @@
Building building = destinationWarehouse.getBuilding();
- Location destinationLocation = getDestinationLocation(destinationWarehouse);
+ SimpleWithdrawItemService simpleWithdrawItemService =
+ serviceContext.newService(SimpleWithdrawItemService.class);
+ Location destinationLocation =
+ simpleWithdrawItemService.getDestinationLocation(destinationWarehouse);
+
BookArticleRequest bookArticleRequest =
new BookArticleRequest(
magalieUser, building, article,
@@ -105,18 +107,6 @@
}
- protected Location getDestinationLocation(Warehouse destinationWarehouse) {
-
- MagaliePersistenceContext persistenceContext = serviceContext.getPersistenceContext();
-
- LocationDao locationDao = persistenceContext.getLocationDao();
-
- Location location = locationDao.find(Locations.codeForWarehouseWithoutLocations(), destinationWarehouse);
-
- return location;
-
- }
-
public List<Warehouse> getDestinationWarehouses(Building building) {
MagaliePersistenceContext persistenceContext = serviceContext.getPersistenceContext();
Added: trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/SimpleWithdrawItemService.java
===================================================================
--- trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/SimpleWithdrawItemService.java (rev 0)
+++ trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/SimpleWithdrawItemService.java 2013-05-29 12:54:54 UTC (rev 211)
@@ -0,0 +1,122 @@
+package com.franciaflex.magalie.services.service;
+
+import com.franciaflex.magalie.persistence.Locations;
+import com.franciaflex.magalie.persistence.MagaliePersistenceContext;
+import com.franciaflex.magalie.persistence.dao.LocationDao;
+import com.franciaflex.magalie.persistence.dao.StorageMovementDao;
+import com.franciaflex.magalie.persistence.dao.WarehouseDao;
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.Location;
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.StorageMovement;
+import com.franciaflex.magalie.persistence.entity.StoredArticle;
+import com.franciaflex.magalie.persistence.entity.Warehouse;
+import com.franciaflex.magalie.services.MagalieService;
+import com.franciaflex.magalie.services.MagalieServiceContext;
+import com.franciaflex.magalie.services.SimpleWithdrawItemTask;
+import com.franciaflex.magalie.services.exception.InvalidMagalieBarcodeException;
+import com.google.common.collect.Lists;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.util.Date;
+
+public class SimpleWithdrawItemService implements MagalieService {
+
+ private static final Log log = LogFactory.getLog(SimpleWithdrawItemService.class);
+
+ protected MagalieServiceContext serviceContext;
+
+ @Override
+ public void setServiceContext(MagalieServiceContext serviceContext) {
+ this.serviceContext = serviceContext;
+ }
+
+ public SimpleWithdrawItemTask getSimpleWithdrawItemTask(Building building, String articleBarcode) throws InvalidMagalieBarcodeException {
+
+ ArticleStorageService articleStorageService =
+ serviceContext.newService(ArticleStorageService.class);
+
+ MagalieBarcodeService magalieBarcodeService =
+ serviceContext.newService(MagalieBarcodeService.class);
+
+ Article article = magalieBarcodeService.getArticle(articleBarcode);
+
+ Iterable<StoredArticle> storedArticles =
+ articleStorageService.getStoredArticles(building, article);
+
+ SimpleWithdrawItemTask simpleWithdrawItemTask =
+ new SimpleWithdrawItemTask(Lists.newArrayList(storedArticles));
+
+ return simpleWithdrawItemTask;
+
+ }
+
+ public void confirmStorageMovement(MagalieUser magalieUser, String destinationWarehouseId, StoredArticle storedArticle) {
+
+ MagaliePersistenceContext persistenceContext = serviceContext.getPersistenceContext();
+
+ WarehouseDao warehouseDao = persistenceContext.getWarehouseDao();
+
+ Date now = serviceContext.getNow();
+
+ // principle is taking a stored article and get everything (all quantity)
+
+ Location originLocation = storedArticle.getLocation();
+
+ Article article = storedArticle.getArticle();
+
+ double quantity = storedArticle.getQuantity();
+
+ if (log.isInfoEnabled()) {
+ log.info("user " + magalieUser.getLogin() + " took " +
+ quantity + " " + article.getUnit() + " from " +
+ originLocation.getBarcode());
+ }
+
+ // find actual destination location
+
+ Warehouse destinationWarehouse = warehouseDao.findById(destinationWarehouseId);
+
+ Location destinationLocation = getDestinationLocation(destinationWarehouse);
+
+ // create new storage movement
+
+ StorageMovement storageMovement = new StorageMovement();
+
+ storageMovement.setOriginLocation(originLocation);
+
+ storageMovement.setDestinationLocation(destinationLocation);
+
+ storageMovement.setMagalieUser(magalieUser);
+
+ storageMovement.setArticle(article);
+
+ storageMovement.setActualQuantity(quantity);
+
+ storageMovement.setConfirmDate(now);
+
+ // save storage movement
+
+ StorageMovementDao storageMovementDao = persistenceContext.getStorageMovementDao();
+
+ storageMovementDao.persist(storageMovement);
+
+ persistenceContext.commit();
+
+ }
+
+ protected Location getDestinationLocation(Warehouse destinationWarehouse) {
+
+ MagaliePersistenceContext persistenceContext = serviceContext.getPersistenceContext();
+
+ LocationDao locationDao = persistenceContext.getLocationDao();
+
+ Location location = locationDao.find(Locations.codeForWarehouseWithoutLocations(), destinationWarehouse);
+
+ return location;
+
+ }
+
+}
Modified: trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/StorageTransferService.java
===================================================================
--- trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/StorageTransferService.java 2013-05-29 12:30:22 UTC (rev 210)
+++ trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/StorageTransferService.java 2013-05-29 12:54:54 UTC (rev 211)
@@ -90,7 +90,7 @@
return storedArticle;
}
- public void confirmStorageTransfer(MagalieUser magalieUser, StoredArticle storedArticle, double Quantity, Location destinationLocation ) {
+ public void confirmStorageTransfer(MagalieUser magalieUser, StoredArticle storedArticle, double quantity, Location destinationLocation) {
MagaliePersistenceContext persistenceContext = serviceContext.getPersistenceContext();
@@ -110,7 +110,7 @@
storageMovement.setArticle(storedArticle.getArticle());
- storageMovement.setActualQuantity(Quantity);
+ storageMovement.setActualQuantity(quantity);
storageMovement.setConfirmDate(now);
Modified: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/Activity.java
===================================================================
--- trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/Activity.java 2013-05-29 12:30:22 UTC (rev 210)
+++ trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/Activity.java 2013-05-29 12:54:54 UTC (rev 211)
@@ -33,6 +33,7 @@
REQUESTED_LISTS,
KANBANS,
+ SIMPLE_WITHDRAW,
RECEPTIONS,
PREPARED_RECEPTIONS
Modified: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/FulfilKanbanAction.java
===================================================================
--- trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/FulfilKanbanAction.java 2013-05-29 12:30:22 UTC (rev 210)
+++ trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/FulfilKanbanAction.java 2013-05-29 12:54:54 UTC (rev 211)
@@ -44,6 +44,7 @@
@Results({
+ @Result(name="input", type = "dispatcher", location = "/WEB-INF/content/prepare-withdraw-item-input.jsp"),
@Result(name="success", type="redirectAction", params = { "actionName", "withdraw-item!input", "storageMovementOrderId", "${storageMovementOrderId}" })
})
public class FulfilKanbanAction extends MagalieActionSupport implements Preparable {
Added: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PrepareWithdrawItemAction.java
===================================================================
--- trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PrepareWithdrawItemAction.java (rev 0)
+++ trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PrepareWithdrawItemAction.java 2013-05-29 12:54:54 UTC (rev 211)
@@ -0,0 +1,156 @@
+package com.franciaflex.magalie.web.action;
+
+import com.franciaflex.magalie.persistence.entity.Article;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
+import com.franciaflex.magalie.persistence.entity.Warehouse;
+import com.franciaflex.magalie.services.exception.InvalidMagalieBarcodeException;
+import com.franciaflex.magalie.services.service.FulfilKanbanService;
+import com.franciaflex.magalie.services.service.SimpleWithdrawItemService;
+import com.franciaflex.magalie.web.Activity;
+import com.franciaflex.magalie.web.MagalieActionSupport;
+import com.franciaflex.magalie.web.MagalieSession;
+import com.opensymphony.xwork2.Preparable;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.convention.annotation.Result;
+import org.apache.struts2.convention.annotation.Results;
+
+import java.util.List;
+
+@Results({
+ @Result(name="success", type="redirectAction", params = { "actionName", "simple-withdraw-item!input", "articleBarcode", "${articleBarcode}", "destinationWarehouseId", "${destinationWarehouseId}"})
+})
+public class PrepareWithdrawItemAction extends MagalieActionSupport implements Preparable {
+
+ private static final Log log = LogFactory.getLog(PrepareWithdrawItemAction.class);
+
+ protected MagalieSession session;
+
+ protected String articleBarcode;
+
+ protected StorageMovementOrder storageMovementOrder;
+
+ protected List<Warehouse> destinationWarehouses;
+
+ protected String destinationWarehouseId;
+
+ protected Double quantity;
+
+ protected boolean askQuantity;
+
+ protected Article article;
+
+ protected Warehouse destinationWarehouse;
+
+ protected FulfilKanbanService fulfilKanbanService;
+
+ protected SimpleWithdrawItemService simpleWithdrawItemService;
+
+ public void setSession(MagalieSession session) {
+ this.session = session;
+ }
+
+ public void setFulfilKanbanService(FulfilKanbanService fulfilKanbanService) {
+ this.fulfilKanbanService = fulfilKanbanService;
+ }
+
+ public void setSimpleWithdrawItemService(SimpleWithdrawItemService simpleWithdrawItemService) {
+ this.simpleWithdrawItemService = simpleWithdrawItemService;
+ }
+
+ @Override
+ public void prepare() {
+
+ Building building = session.getBuilding();
+
+ destinationWarehouses = fulfilKanbanService.getDestinationWarehouses(building);
+
+ // let's help user by selecting by default the previously used destination warehouse
+
+ Warehouse lastUsedDestinationWarehouseForKanbans = session.getLastUsedDestinationWarehouseForKanbans();
+
+ if (lastUsedDestinationWarehouseForKanbans != null) {
+
+ destinationWarehouseId = lastUsedDestinationWarehouseForKanbans.getId();
+
+ }
+
+ }
+
+ public boolean isAskQuantity() {
+ return askQuantity;
+ }
+
+ public String getDestinationWarehouseId() {
+ return destinationWarehouseId;
+ }
+
+ public List<Warehouse> getDestinationWarehouses() {
+ return destinationWarehouses;
+ }
+
+ public void setArticleBarcode(String articleBarcode) {
+ this.articleBarcode = articleBarcode;
+ }
+
+ public void setDestinationWarehouseId(String destinationWarehouseId) {
+ this.destinationWarehouseId = destinationWarehouseId;
+ }
+
+ public void setQuantity(Double quantity) {
+ this.quantity = quantity;
+ }
+
+ @Override
+ public void validate() {
+
+ if (log.isDebugEnabled()) {
+ log.debug("article barcode is " + articleBarcode);
+ }
+
+ destinationWarehouse = fulfilKanbanService.getStore(destinationWarehouseId);
+
+ // save used destination warehouse to propose it by default on next kanban
+ session.setLastUsedDestinationWarehouseForKanbans(destinationWarehouse);
+
+ try {
+
+ article = fulfilKanbanService.getArticle(articleBarcode);
+
+ } catch (InvalidMagalieBarcodeException e) {
+
+ addFieldError("articleBarcode", "Le code barre n'est pas un code valide");
+
+ }
+
+ if (quantity != null) {
+
+ addFieldError("quantity", "Il ne faut pas préciser la quantité");
+
+ }
+
+ }
+
+ @Override
+ public String execute() {
+
+ session.setActivity(Activity.SIMPLE_WITHDRAW);
+
+ return SUCCESS;
+
+ }
+
+ public Article getArticle() {
+ return article;
+ }
+
+ public String getArticleBarcode() {
+ return articleBarcode;
+ }
+
+ public String getStorageMovementOrderId() {
+ return storageMovementOrder.getId();
+ }
+
+}
Added: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/SimpleWithdrawItemAction.java
===================================================================
--- trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/SimpleWithdrawItemAction.java (rev 0)
+++ trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/SimpleWithdrawItemAction.java 2013-05-29 12:54:54 UTC (rev 211)
@@ -0,0 +1,148 @@
+package com.franciaflex.magalie.web.action;
+
+import com.franciaflex.magalie.persistence.StoredArticles;
+import com.franciaflex.magalie.persistence.entity.Building;
+import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import com.franciaflex.magalie.persistence.entity.StoredArticle;
+import com.franciaflex.magalie.services.SimpleWithdrawItemTask;
+import com.franciaflex.magalie.services.exception.InvalidMagalieBarcodeException;
+import com.franciaflex.magalie.services.service.SimpleWithdrawItemService;
+import com.franciaflex.magalie.web.MagalieActionSupport;
+import com.franciaflex.magalie.web.MagalieSession;
+import com.google.common.base.Optional;
+import com.google.common.collect.Iterables;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.struts2.convention.annotation.Result;
+import org.apache.struts2.convention.annotation.Results;
+
+@Results({
+ @Result(name="success", type="redirectAction", params = { "actionName", "prepare-withdraw-item!input" }),
+ @Result(name="error", type="redirectAction", params = { "actionName", "prepare-withdraw-item!input" })
+})
+public class SimpleWithdrawItemAction extends MagalieActionSupport {
+
+ private static final Log log = LogFactory.getLog(SimpleWithdrawItemAction.class);
+
+ protected SimpleWithdrawItemService service;
+
+ protected String storedArticleId;
+
+ protected String articleBarcode;
+
+ protected MagalieSession session;
+
+ protected SimpleWithdrawItemTask simpleWithdrawItemTask;
+
+ protected String destinationWarehouseId;
+
+ protected String originLocationBarcode;
+
+ public void setSession(MagalieSession session) {
+ this.session = session;
+ }
+
+ public void setArticleBarcode(String articleBarcode) {
+ this.articleBarcode = articleBarcode;
+ }
+
+ public void setDestinationWarehouseId(String destinationWarehouseId) {
+ this.destinationWarehouseId = destinationWarehouseId;
+ }
+
+ public void setService(SimpleWithdrawItemService service) {
+ this.service = service;
+ }
+
+ @Override
+ public String input() {
+
+ Building building = session.getBuilding();
+
+ try {
+
+ simpleWithdrawItemTask = service.getSimpleWithdrawItemTask(building, articleBarcode);
+
+ } catch (InvalidMagalieBarcodeException e) {
+
+ log.error("should never occur, barcode is validated before arriving in this action", e);
+
+ session.addMessage("Le code barre " + articleBarcode + " n'est pas un code valide");
+
+ return ERROR;
+
+ }
+
+ if (simpleWithdrawItemTask.isDriverLicenseRequired()) {
+
+ session.addMessage("Un permis est requis pour accéder à cet article");
+
+ return ERROR;
+
+ }
+
+ if (simpleWithdrawItemTask.isArticleUnavailable()) {
+
+ session.addMessage("Cet article n'est pas disponible");
+
+ return ERROR;
+
+ }
+
+ return INPUT;
+
+ }
+
+ public String getDestinationWarehouseId() {
+ return destinationWarehouseId;
+ }
+
+ public String getArticleBarcode() {
+ return articleBarcode;
+ }
+
+ public SimpleWithdrawItemTask getSimpleWithdrawItemTask() {
+ return simpleWithdrawItemTask;
+ }
+
+ public void setStoredArticleId(String storedArticleId) {
+ this.storedArticleId = storedArticleId;
+ }
+
+ public void setOriginLocationBarcode(String originLocationBarcode) {
+ this.originLocationBarcode = originLocationBarcode;
+ }
+
+ @Override
+ public String execute() throws InvalidMagalieBarcodeException {
+
+ MagalieUser magalieUser = session.getMagalieUser();
+
+ Building building = session.getBuilding();
+
+ simpleWithdrawItemTask = service.getSimpleWithdrawItemTask(building, articleBarcode);
+
+ Optional<StoredArticle> storedArticleOptional =
+ Iterables.tryFind(
+ simpleWithdrawItemTask.getStoredArticles(),
+ StoredArticles.locationBarcodeEquals(originLocationBarcode));
+
+ if (storedArticleOptional.isPresent()) {
+
+ service.confirmStorageMovement(
+ magalieUser, destinationWarehouseId,
+ storedArticleOptional.get());
+
+ } else {
+
+ addFieldError("originLocationBarcode", "Ce n'est pas le code-barre d'un emplacement valide");
+
+ return INPUT;
+
+ }
+
+ return SUCCESS;
+
+ }
+
+}
Modified: trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp 2013-05-29 12:30:22 UTC (rev 210)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/choose-activity.jsp 2013-05-29 12:54:54 UTC (rev 211)
@@ -34,8 +34,9 @@
bindKey('3', function(){ redirectTo($('#prepareArticleReceptionLink'));});
bindKey('4', function(){ redirectTo($('#preparePreparedArticleReceptionLink'));});
bindKey('5', function(){ redirectTo($('#storageTransferLink'));});
+ bindKey('6', function(){ redirectTo($('#prepareWithdrawItemLink'));});
<s:if test="movementOrderResume" >
- bindKey('6', function(){ redirectTo($('#movementOrderResumeLink'));});
+ bindKey('7', function(){ redirectTo($('#movementOrderResumeLink'));});
</s:if>
bindKey('Esc', function(){ redirectTo($('#logoutLink'));});
});
@@ -66,11 +67,14 @@
<s:url namespace="/" action="storage-transfer-location!input" id="storageTransferUrl"/>
<s:a href="%{storageTransferUrl}" cssClass="btn btn-block" id="storageTransferLink" >Transfert de stock (5)</s:a>
+<s:url namespace="/" action="prepare-withdraw-item!input" id="prepareWithdrawItemUrl"/>
+<s:a href="%{prepareWithdrawItemUrl}" cssClass="btn btn-block" id="prepareWithdrawItemLink" >Prélèvement immédiat (6)</s:a>
+
<s:if test="movementOrderResume" >
<s:url namespace="/" action="withdraw-item!input" id="movementOrderResumeUrl">
<s:param name="storageMovementOrderId" value="%{movementOrderResume.id}" />
</s:url>
- <s:a href="%{movementOrderResumeUrl}" cssClass="btn btn-block" id="movementOrderResumeLink" >Reprendre l'ordre de mouvement (6)</s:a>
+ <s:a href="%{movementOrderResumeUrl}" cssClass="btn btn-block" id="movementOrderResumeLink" >Reprendre l'ordre de mouvement (7)</s:a>
</s:if>
<s:url namespace="/" action="logout" id="logoutUrl"/>
Deleted: trunk/magalie-web/src/main/webapp/WEB-INF/content/fulfil-kanban-input.jsp
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/fulfil-kanban-input.jsp 2013-05-29 12:30:22 UTC (rev 210)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/fulfil-kanban-input.jsp 2013-05-29 12:54:54 UTC (rev 211)
@@ -1,57 +0,0 @@
-<%--
- #%L
- MagaLiE :: UI
- $Id:$
- $HeadURL:$
- %%
- Copyright (C) 2013 CodeLutin
- %%
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU Affero General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU Affero General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- #L%
- --%>
-<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
-<%@ taglib prefix="s" uri="/struts-tags" %>
-
-<head>
- <title>Traitement des kanbans</title>
- <script type="text/javascript">
- $(document).ready(function () {
- $("#fulfil-kanban_articleBarcode").focus();
- bindKey('Esc', function(){ redirectTo($('#chooseActivityLink'));});
- });
- </script>
-</head>
-
-<s:url namespace="/" action="choose-activity" id="chooseActivityUrl"/>
-
-<s:form>
- <s:textfield key="articleBarcode" label="Article" inputAppendIcon="barcode" cssClass="input-medium" />
-
- <s:select label="Magasin destination"
- key="destinationWarehouseId"
- list="destinationWarehouses"
- listKey="id"
- listValue="code"
- required="true"
- />
-
- <s:if test="askQuantity">
- <s:textfield name="quantity" label="Qté" inputAppend="%{article.unit}" cssClass="input-mini" />
- </s:if>
-
- <div class="btn-group">
- <s:a href="%{chooseActivityUrl}" cssClass="btn" id="chooseActivityLink" >Changer d'activité (Esc)</s:a>
- <s:submit name="next" value="Suivant" cssClass="btn btn-primary" />
- </div>
-</s:form>
\ No newline at end of file
Copied: trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-withdraw-item-input.jsp (from rev 200, trunk/magalie-web/src/main/webapp/WEB-INF/content/fulfil-kanban-input.jsp)
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-withdraw-item-input.jsp (rev 0)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/prepare-withdraw-item-input.jsp 2013-05-29 12:54:54 UTC (rev 211)
@@ -0,0 +1,57 @@
+<%--
+ #%L
+ MagaLiE :: UI
+ $Id:$
+ $HeadURL:$
+ %%
+ Copyright (C) 2013 CodeLutin
+ %%
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU Affero General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU Affero General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
+ #L%
+ --%>
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<head>
+ <title>Traitement des kanbans</title>
+ <script type="text/javascript">
+ $(document).ready(function () {
+ $("#fulfil-kanban_articleBarcode").focus();
+ bindKey('Esc', function(){ redirectTo($('#chooseActivityLink'));});
+ });
+ </script>
+</head>
+
+<s:url namespace="/" action="choose-activity" id="chooseActivityUrl"/>
+
+<s:form>
+ <s:textfield key="articleBarcode" label="Article" inputAppendIcon="barcode" cssClass="input-medium" />
+
+ <s:select label="Magasin destination"
+ key="destinationWarehouseId"
+ list="destinationWarehouses"
+ listKey="id"
+ listValue="code"
+ required="true"
+ />
+
+ <s:if test="askQuantity">
+ <s:textfield name="quantity" label="Qté" inputAppend="%{article.unit}" cssClass="input-mini" />
+ </s:if>
+
+ <div class="btn-group">
+ <s:a href="%{chooseActivityUrl}" cssClass="btn" id="chooseActivityLink" >Changer d'activité (Esc)</s:a>
+ <s:submit name="next" value="Suivant" cssClass="btn btn-primary" />
+ </div>
+</s:form>
\ No newline at end of file
Added: trunk/magalie-web/src/main/webapp/WEB-INF/content/simple-withdraw-item-input.jsp
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/simple-withdraw-item-input.jsp (rev 0)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/simple-withdraw-item-input.jsp 2013-05-29 12:54:54 UTC (rev 211)
@@ -0,0 +1,33 @@
+<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8" %>
+<%@ taglib prefix="s" uri="/struts-tags" %>
+
+<head>
+ <title>Prélèvement immédiat</title>
+ <link rel="stylesheet" href="<s:url value='/css/magalie-ck3x-reduced.css' />"/>
+</head>
+
+<s:url namespace="/" action="choose-activity" id="cancelUrl" />
+
+<s:form>
+
+ <ul>
+
+ <s:iterator value="simpleWithdrawItemTask.storedArticles">
+
+ <li><s:property value="location.barcode" /></li>
+ </s:iterator>
+
+ </ul>
+
+ <s:textfield key="originLocationBarcode" label="Emplacement prélevé" inputAppendIcon="barcode" cssClass="input-medium" />
+
+ <s:hidden name="destinationWarehouseId" value="%{destinationWarehouseId}" />
+
+ <s:hidden name="articleBarcode" value="%{articleBarcode}" />
+
+ <div class="btn-group">
+ <s:a href="%{cancelUrl}" cssClass="btn" id="CancelLink" >Quitter (Esc)</s:a>
+ <s:submit name="" value="Valider" cssClass="btn btn-primary" />
+ </div>
+
+</s:form>
1
0
r210 - in trunk: magalie-services/src/main/java/com/franciaflex/magalie/services/service magalie-web/src/main/java/com/franciaflex/magalie/web/action magalie-web/src/main/webapp/WEB-INF/content magalie-web/src/main/webapp/js
by Bavencoff@users.forge.codelutin.com 29 May '13
by Bavencoff@users.forge.codelutin.com 29 May '13
29 May '13
Author: Bavencoff
Date: 2013-05-29 14:30:22 +0200 (Wed, 29 May 2013)
New Revision: 210
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
refs #2164 : change radio set to link for choice of article
Removed:
trunk/magalie-web/src/main/webapp/js/storage-transfer-input.js
Modified:
trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ArticleStorageService.java
trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/StorageTransferAction.java
trunk/magalie-web/src/main/webapp/WEB-INF/content/storage-transfer-input.jsp
Modified: trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ArticleStorageService.java
===================================================================
--- trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ArticleStorageService.java 2013-05-29 09:21:35 UTC (rev 209)
+++ trunk/magalie-services/src/main/java/com/franciaflex/magalie/services/service/ArticleStorageService.java 2013-05-29 12:30:22 UTC (rev 210)
@@ -408,6 +408,10 @@
}
+ // Warning :
+ // this function don't add a new StoredArticle
+ // if exist a storage movement with new article in location
+
Iterable<StoredArticle> result = Iterables.filter(storedArticles, StoredArticles.notEmpty());
return result;
Modified: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/StorageTransferAction.java
===================================================================
--- trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/StorageTransferAction.java 2013-05-29 09:21:35 UTC (rev 209)
+++ trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/StorageTransferAction.java 2013-05-29 12:30:22 UTC (rev 210)
@@ -9,8 +9,6 @@
import org.apache.commons.logging.LogFactory;
import org.apache.struts2.convention.annotation.Result;
import org.apache.struts2.convention.annotation.Results;
-import org.apache.struts2.json.JSONException;
-import org.apache.struts2.json.JSONUtil;
import java.util.List;
@@ -19,7 +17,7 @@
*/
@Results({
- @Result(name="success", type="redirectAction", params = { "actionName", "storage-transfer-location!input"})
+ @Result(name="success", type="redirectAction", params = { "actionName", "storage-transfer-location!input"})
})
public class StorageTransferAction extends MagalieActionSupport {
@@ -37,6 +35,8 @@
protected String storedArticleId;
+ protected StoredArticle storedArticle;
+
protected String destinationBarCode;
protected double quantity;
@@ -56,10 +56,20 @@
@Override
public String input() {
+ if (log.isDebugEnabled()) {
+ log.debug("originId : " + originId + "\n" +
+ "storedArticleId : " + storedArticleId);
+ }
+
origin = service.getLocationById(originId);
storedArticles = service.getStoredArticlesInLocation(origin);
+ if (storedArticleId != null) {
+ storedArticle = service.findStoredArticle(storedArticleId);
+ quantity = storedArticle.getQuantity();
+ }
+
return INPUT;
}
@@ -71,22 +81,22 @@
return storedArticles;
}
- public String getModelAsJson() throws JSONException {
-
- String json = JSONUtil.serialize(getStoredArticles());
-
- return json;
-
- }
-
public String getStoredArticleId() {
return storedArticleId;
}
+ public StoredArticle getStoredArticle() {
+ return storedArticle;
+ }
+
public double getQuantity() {
return quantity;
}
+ public String getDestinationBarCode (){
+ return destinationBarCode;
+ }
+
public void setStoredArticleId(String storedArticleId) {
this.storedArticleId = storedArticleId;
}
@@ -112,15 +122,8 @@
origin = service.getLocationById(originId);
- storedArticles = service.getStoredArticlesInLocation(origin);
+ storedArticle = service.findStoredArticle(storedArticleId);
- if (storedArticleId == null) {
- addFieldError("storedArticleId", "Sélectionnez un article");
- return INPUT;
- }
-
- StoredArticle storedArticle = service.findStoredArticle(storedArticleId);
-
if (quantity == 0) {
addFieldError("quantity", "la quantité ne doit pas être nulle");
return INPUT;
Modified: trunk/magalie-web/src/main/webapp/WEB-INF/content/storage-transfer-input.jsp
===================================================================
--- trunk/magalie-web/src/main/webapp/WEB-INF/content/storage-transfer-input.jsp 2013-05-29 09:21:35 UTC (rev 209)
+++ trunk/magalie-web/src/main/webapp/WEB-INF/content/storage-transfer-input.jsp 2013-05-29 12:30:22 UTC (rev 210)
@@ -5,9 +5,15 @@
<head>
<title>Transfert de stock</title>
<script type="text/javascript">
- var model = <s:property value="modelAsJson" escapeHtml="false" />;
+ $(document).ready(function () {
+ bindKey("Esc", function(){ redirectTo($('#CancelLink'));});
+ <s:if test="storedArticle != null" >
+ $('#storage-transfer_destinationBarCode').focus();
+ </s:if>
+ });
+
+
</script>
- <script src="<s:url value='/js/storage-transfer-input.js' />"></script>
<link rel="stylesheet" href="<s:url value='/css/magalie-ck3x-reduced.css' />"/>
</head>
@@ -17,22 +23,67 @@
<dl class="dl-horizontal">
<dt>Source</dt>
<dd><s:property value="origin.warehouse.code + origin.code" /></dd>
+ <s:if test="storedArticle != null" >
+ <dt>Article</dt>
+ <dd><s:property value="storedArticle.article.description" /></dd>
+ <dt>Réf</dt>
+ <dd><s:property value="storedArticle.article.code" /></dd>
+ <dt>Qté disponible</dt>
+ <dd><s:property value="storedArticle.quantity + ' ' + storedArticle.article.unit" /></dd>
+ </s:if>
</dl>
</header>
-<s:form cssClass="form-horizontal">
- <s:hidden name="originId" value="%{origin.id}" />
+<s:if test="storedArticle == null" >
+ <s:iterator value="storedArticles" status="stat">
+ <li>
+ <s:set var="elementStoredArticleId">storedArticleId<s:property value="#stat.index" /></s:set>
+ <s:url namespace="/" action="storage-transfer!input" id="storageTransferNextStepUrl">
+ <s:param name="originId" value="%{origin.id}" />
+ <s:param name="storedArticleId" value="%{id}" />
+ </s:url>
+ <s:if test="#stat.index < shortcuts.size()">
+ <script type="text/javascript">
+ $(document).ready(function () {
+ var id = '<s:property value="elementStoredArticleId" />';
+ bindKey(<s:property value="shortcuts.get(#stat.index)" />, function(){ redirectTo($('#' + id));});
+ });
+ </script>
+ <s:a href="%{storageTransferNextStepUrl}" id="%{elementStoredArticleId}">
+ <s:property value="article.description" />
+ (<s:property value="article.code" />)
+ (<s:property value="quantity" />
+ <s:property value="article.unit" />)
+ (<s:property value="shortcuts.get(#stat.index)" />)
+ </s:a>
+ </s:if>
+ <s:else>
+ <s:a href="%{storageTransferNextStepUrl}" >
+ <s:property value="article.description" />
+ (<s:property value="article.code" />)
+ (<s:property value="quantity" />
+ <s:property value="article.unit" />)
+ </s:a>
+ </s:else>
+ </li>
+ </s:iterator>
- <s:radio name="storedArticleId" list="storedArticles" listKey="id" listValue="article.description + ' (' + article.code + ')'" cssClass="radio" />
+ <s:a href="%{cancelUrl}" cssClass="btn" id="CancelLink" >Quitter (Esc)</s:a>
- <s:textfield name="quantity" label="Qté" inputAppend="" type="number" step="any" min="0" cssClass="input-mini" />
+</s:if>
+<s:else>
+ <s:form cssClass="form-horizontal">
+ <s:hidden name="originId" value="%{origin.id}" />
+ <s:hidden name="storedArticleId" value="%{storedArticle.id}" />
- <s:textfield key="destinationBarCode" label="Destination" inputAppendIcon="barcode" cssClass="input-small" />
+ <s:textfield name="quantity" label="Qté" inputAppend="%{storedArticle.article.unit}" type="number" step="any" min="0" cssClass="input-mini" />
+ <s:textfield key="destinationBarCode" label="Destination" inputAppendIcon="barcode" cssClass="input-small" />
- <div class="btn-group">
- <s:a href="%{cancelUrl}" cssClass="btn" id="CancelLink" >Quitter (Esc)</s:a>
- <s:submit name="" value="Valider" cssClass="btn btn-primary" />
- </div>
-</s:form>
\ No newline at end of file
+ <div class="btn-group">
+ <s:a href="%{cancelUrl}" cssClass="btn" id="CancelLink" >Quitter (Esc)</s:a>
+ <s:submit name="" value="Valider" cssClass="btn btn-primary" />
+ </div>
+ </s:form>
+</s:else>
Deleted: trunk/magalie-web/src/main/webapp/js/storage-transfer-input.js
===================================================================
--- trunk/magalie-web/src/main/webapp/js/storage-transfer-input.js 2013-05-29 09:21:35 UTC (rev 209)
+++ trunk/magalie-web/src/main/webapp/js/storage-transfer-input.js 2013-05-29 12:30:22 UTC (rev 210)
@@ -1,58 +0,0 @@
-
-model.storedArticleIndex = 0;
-
-model.setArticle = function(StorageArticleId) {
- for (var i = 0; i < this.length; i++) {
- if (this[i].id == StorageArticleId) {
- model.storedArticleIndex = i;
- }
- }
- return this.storedArticleIndex;
-};
-
-model.getQuantity = function() {
- return this[this.storedArticleIndex].quantity;
-};
-
-model.getUnit = function() {
- return this[this.storedArticleIndex].article.unit;
-
-};
-
-var view = {
-
- refreshQuantity : function() {
- $('#storage-transfer_quantity').val(model.getQuantity());
- $('#storage-transfer_quantity').next('span').text(model.getUnit());
- },
-
- refreshLocation : function() {
- $('#storage-transfer_destinationBarCode').val('');
- }
-
-
-};
-
-var controller = {
-
- onChangeArticle : function () {
- var StoredArticleId = $('input[type=radio][name=storedArticleId]:checked').attr('value');
- model.setArticle(StoredArticleId);
- view.refreshQuantity();
- view.refreshLocation();
- $('#storage-transfer_destinationBarCode').focus();
- }
-
-};
-
-$(document).ready(function () {
- var inputRadios = $("input[name='storedArticleId']") ;
- $.each(inputRadios, function(index, radio) {
- if (index < SHORTCUTS.length) {
- $(radio).parent().append(" (" + SHORTCUTS[index] + ")")
- bindKey(SHORTCUTS[index], function(){ $(radio).click();});
- }
- });
- $('input[type=radio][name=storedArticleId]').change(controller.onChangeArticle);
- bindKey('Esc', function(){ redirectTo($('#CancelLink'));});
-});
\ No newline at end of file
1
0
29 May '13
Author: tchemit
Date: 2013-05-29 11:21:35 +0200 (Wed, 29 May 2013)
New Revision: 209
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
upse jpa meta transformer
Modified:
branches/magalie-eugene/magalie-persistence/pom.xml
Modified: branches/magalie-eugene/magalie-persistence/pom.xml
===================================================================
--- branches/magalie-eugene/magalie-persistence/pom.xml 2013-05-29 09:17:06 UTC (rev 208)
+++ branches/magalie-eugene/magalie-persistence/pom.xml 2013-05-29 09:21:35 UTC (rev 209)
@@ -106,14 +106,16 @@
<phase>generate-sources</phase>
<configuration>
<!-- Corresponding to extracted package from zargo file -->
- <fullPackagePath>com.franciaflex.magalie.persistence.entity</fullPackagePath>
+ <fullPackagePath>
+ com.franciaflex.magalie.persistence.entity
+ </fullPackagePath>
<!-- defaultPackage used for generation -->
- <defaultPackage>com.franciaflex.magalie.persistence</defaultPackage>
+ <defaultPackage>
+ com.franciaflex.magalie.persistence
+ </defaultPackage>
<templates>
- org.nuiton.jpa.templates.JpaEntityTransformer,
- org.nuiton.jpa.templates.JpaDaoTransformer,
- org.nuiton.jpa.templates.JpaPersistenceContextTransformer,
- org.nuiton.eugene.java.JavaEnumerationTransformer
+ org.nuiton.eugene.java.JavaEnumerationTransformer,
+ org.nuiton.jpa.templates.JpaMetaTransformer
</templates>
</configuration>
<goals>
1
0
r208 - trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action
by bleny@users.forge.codelutin.com 29 May '13
by bleny@users.forge.codelutin.com 29 May '13
29 May '13
Author: bleny
Date: 2013-05-29 11:17:06 +0200 (Wed, 29 May 2013)
New Revision: 208
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
wrong value for activity
Modified:
trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PrepareArticleReceptionAction.java
Modified: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PrepareArticleReceptionAction.java
===================================================================
--- trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PrepareArticleReceptionAction.java 2013-05-29 08:55:37 UTC (rev 207)
+++ trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/PrepareArticleReceptionAction.java 2013-05-29 09:17:06 UTC (rev 208)
@@ -60,7 +60,7 @@
@Override
public String input() {
- session.setActivity(Activity.PREPARED_RECEPTIONS);
+ session.setActivity(Activity.RECEPTIONS);
Building building = session.getBuilding();
1
0
r207 - in branches/magalie-eugene/magalie-persistence/src/main: java/com/franciaflex/magalie/persistence/dao xmi
by tchemit@users.forge.codelutin.com 29 May '13
by tchemit@users.forge.codelutin.com 29 May '13
29 May '13
Author: tchemit
Date: 2013-05-29 10:55:37 +0200 (Wed, 29 May 2013)
New Revision: 207
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
add generic in user dao + notGeneratedValue stereotype
Modified:
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedListJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractKanbanJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationErrorJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractMagalieUserJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractPreparedArticleReceptionJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedListJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementOrderJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStoredArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractSupplierJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractUnavailableArticleJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractWarehouseJpaDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java
branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java
branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractArticleJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractArticleJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractArticleJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -35,7 +35,7 @@
}
@Override
- public Article findByCode(String articleCode) {
+ public E findByCode(String articleCode) {
TypedQuery<E> query = createQuery("from Article a where a.code = :code");
query.setParameter(Article.PROPERTY_CODE, articleCode);
return findUniqueOrNull(query);
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedArticleJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedArticleJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedArticleJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -38,20 +38,20 @@
}
@Override
- public DeliveredRequestedArticle find(StorageMovementOrder storageMovementOrder) {
+ public E find(StorageMovementOrder storageMovementOrder) {
TypedQuery<E> query =
- entityManager.createQuery(
- "from DeliveredRequestedArticle dra where dra.storageMovementOrder = :storageMovementOrder", getEntityClass());
+ createQuery(
+ "from DeliveredRequestedArticle dra where dra.storageMovementOrder = :storageMovementOrder");
query.setParameter("storageMovementOrder", storageMovementOrder);
return findUniqueOrNull(query);
}
@Override
- public List<DeliveredRequestedArticle> findAll(RequestedList requestedList) {
+ public List<E> findAll(RequestedList requestedList) {
TypedQuery<E> query =
- entityManager.createQuery(
- "from DeliveredRequestedArticle dra where dra.requestedArticle.requestedList = :requestedList", getEntityClass());
+ createQuery(
+ "from DeliveredRequestedArticle dra where dra.requestedArticle.requestedList = :requestedList");
query.setParameter("requestedList", requestedList);
- return (List<DeliveredRequestedArticle>) findAll(query);
+ return findAll(query);
}
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedListJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedListJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractDeliveredRequestedListJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -38,7 +38,7 @@
}
@Override
- public DeliveredRequestedList findByAffectedTo(MagalieUser affectedTo) {
+ public E findByAffectedTo(MagalieUser affectedTo) {
TypedQuery<E> query = createQuery(
"from DeliveredRequestedList drl where drl.status = :affected and drl.affectedTo = :affectedTo");
@@ -52,7 +52,7 @@
}
@Override
- public DeliveredRequestedList findByRequestedList(RequestedList requestedList) {
+ public E findByRequestedList(RequestedList requestedList) {
TypedQuery<E> query = createQuery(
"from DeliveredRequestedList drl where drl.requestedList = :requestedList");
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractKanbanJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractKanbanJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractKanbanJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -37,8 +37,8 @@
}
@Override
- public Kanban find(Article article, Warehouse warehouse) {
- TypedQuery<E> query = entityManager.createQuery("from Kanban k where k.article = :article and k.warehouse = :warehouse", getEntityClass());
+ public E find(Article article, Warehouse warehouse) {
+ TypedQuery<E> query = createQuery("from Kanban k where k.article = :article and k.warehouse = :warehouse");
query.setParameter("article", article);
query.setParameter("warehouse", warehouse);
return query.getSingleResult();
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationErrorJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationErrorJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationErrorJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -39,7 +39,7 @@
}
@Override
- public LocationError findByLocation(Location location) {
+ public E findByLocation(Location location) {
TypedQuery<E> query = createQuery("from LocationError se where se.location = :location");
query.setParameter("location", location);
return findUniqueOrNull(query);
@@ -47,7 +47,8 @@
@Override
public List<Location> getAllLocationsInError(Article article) {
- Query query = entityManager.createQuery("select se.location from LocationError se where se.article = :article");
+ TypedQuery<Location> query = createQuery(Location.class,
+ "select se.location from LocationError se where se.article = :article");
query.setParameter("article", article);
List<Location> allLocationsInError = query.getResultList();
return allLocationsInError;
@@ -55,7 +56,7 @@
@Override
public List<E> findAll() {
- Query query = entityManager.createQuery("from LocationError se order by se.reportDate");
+ TypedQuery<E> query = createQuery("from LocationError se order by se.reportDate");
List<E> all = query.getResultList();
return all;
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractLocationJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -39,14 +39,14 @@
}
@Override
- public Location find(String code, Warehouse warehouse) {
+ public E find(String code, Warehouse warehouse) {
TypedQuery<E> query = createQuery("from Location l where l.code = :code and l.warehouse = :warehouse");
query.setParameter("code", code);
query.setParameter("warehouse", warehouse);
return findUnique(query);
}
- protected List<Location> findAllWithoutReception(Building building, Warehouse warehouse) {
+ protected List<E> findAllWithoutReception(Building building, Warehouse warehouse) {
boolean filterOnBuilding = building != null;
boolean filterOnWarehouse = warehouse != null;
String hql = " from Location l where";
@@ -69,16 +69,16 @@
}
query.setParameter("codeForReceptionLocations", Locations.codeForReceptionLocations());
query.setParameter("codeForWarehouseWithoutLocations", Locations.codeForWarehouseWithoutLocations());
- return (List<Location>) findAll(query);
+ return findAll(query);
}
@Override
- public List<Location> findAllWithoutReception(Building building) {
+ public List<E> findAllWithoutReception(Building building) {
return findAllWithoutReception(building, null);
}
@Override
- public List<Location> findAllWithoutReception(Warehouse warehouse) {
+ public List<E> findAllWithoutReception(Warehouse warehouse) {
return findAllWithoutReception(null, warehouse);
}
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractMagalieUserJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractMagalieUserJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractMagalieUserJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -37,7 +37,7 @@
}
@Override
- public MagalieUser findByLogin(String login) {
+ public E findByLogin(String login) {
TypedQuery<E> query = createQuery("from MagalieUser mu where mu.login = :login");
query.setParameter("login", login);
return findUnique(query);
@@ -45,7 +45,7 @@
@Override
public List<E> findAll() {
- Query query = entityManager.createQuery("from MagalieUser mu order by mu.login");
+ TypedQuery<E> query = createQuery("from MagalieUser mu order by mu.login");
List<E> resultList = query.getResultList();
return resultList;
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractPreparedArticleReceptionJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractPreparedArticleReceptionJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractPreparedArticleReceptionJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -12,7 +12,7 @@
}
@Override
- public PreparedArticleReception findByBarcode(String barcode) {
+ public E findByBarcode(String barcode) {
TypedQuery<E> query = createQuery("from PreparedArticleReception par where par.barcode = :barcode");
query.setParameter("barcode", barcode);
return findUniqueOrNull(query);
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedArticleJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedArticleJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedArticleJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -40,7 +40,7 @@
}
@Override
- public List<RequestedArticle> findAllUndelivered(Building building, MagalieUser affectedTo, String listType) {
+ public List<E> findAllUndelivered(Building building, MagalieUser affectedTo, String listType) {
TypedQuery<E> query = createQuery(
"from RequestedArticle ra where "
+ " ra not in (select dra.requestedArticle from DeliveredRequestedArticle dra) "
@@ -52,14 +52,14 @@
query.setParameter("complete", DeliveredRequestedListStatus.COMPLETE);
query.setParameter("affected", DeliveredRequestedListStatus.AFFECTED);
query.setParameter("affectedTo", affectedTo);
- return (List<RequestedArticle>) findAll(query);
+ return findAll(query);
}
@Override
- public List<RequestedArticle> findAll(RequestedList requestedList) {
+ public List<E> findAll(RequestedList requestedList) {
TypedQuery<E> query = createQuery("from RequestedArticle ra where ra.requestedList = :requestedList");
query.setParameter("requestedList", requestedList);
- return (List<RequestedArticle>) findAll(query);
+ return findAll(query);
}
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedListJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedListJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractRequestedListJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -37,7 +37,7 @@
@Override
public List<String> findAllDistinctListTypes() {
- TypedQuery<String> query = entityManager.createQuery("select distinct rl.listType from RequestedList rl", String.class);
+ TypedQuery<String> query = createQuery(String.class, "select distinct rl.listType from RequestedList rl");
return query.getResultList();
}
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -29,7 +29,7 @@
import com.franciaflex.magalie.persistence.entity.StorageMovement;
import javax.persistence.EntityManager;
-import javax.persistence.Query;
+import javax.persistence.TypedQuery;
import java.util.List;
public class AbstractStorageMovementJpaDao<E extends StorageMovement> extends GeneratedStorageMovementJpaDao<E> {
@@ -39,15 +39,15 @@
}
@Override
- public List<StorageMovement> findAllByArticle(Article article) {
- Query query = entityManager.createQuery("from StorageMovement sm where sm.article = :article");
+ public List<E> findAllByArticle(Article article) {
+ TypedQuery<E> query = createQuery("from StorageMovement sm where sm.article = :article");
query.setParameter("article", article);
return query.getResultList();
}
@Override
- public List<StorageMovement> findAllInReception(Building building) {
- Query query = entityManager.createQuery(
+ public List<E> findAllInReception(Building building) {
+ TypedQuery<E> query = createQuery(
" from StorageMovement sm" +
" where sm.originLocation.code = :codeForReceptionLocations and sm.originLocation.warehouse.building = :building" +
" or " +
@@ -59,7 +59,7 @@
@Override
public List<E> findAll() {
- Query query = entityManager.createQuery("from StorageMovement sm order by sm.orderDate");
+ TypedQuery<E> query = createQuery("from StorageMovement sm order by sm.orderDate");
return query.getResultList();
}
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementOrderJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementOrderJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStorageMovementOrderJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -28,7 +28,7 @@
import com.franciaflex.magalie.persistence.entity.StorageMovementOrder;
import javax.persistence.EntityManager;
-import javax.persistence.Query;
+import javax.persistence.TypedQuery;
import java.util.List;
public class AbstractStorageMovementOrderJpaDao<E extends StorageMovementOrder> extends GeneratedStorageMovementOrderJpaDao<E> {
@@ -38,8 +38,8 @@
}
@Override
- public List<StorageMovementOrder> findNotConfirmedByUser(MagalieUser magalieUser, Building building) {
- Query query = entityManager.createQuery(
+ public List<E> findNotConfirmedByUser(MagalieUser magalieUser, Building building) {
+ TypedQuery<E> query = createQuery(
" select distinct smo" +
" from StorageMovementOrder smo" +
" inner join smo.storageMovements as sm" +
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStoredArticleJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStoredArticleJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractStoredArticleJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -39,11 +39,11 @@
}
@Override
- public List<StoredArticle> findAllForArticleInBuilding(Article article, Building building) {
+ public List<E> findAllForArticleInBuilding(Article article, Building building) {
TypedQuery<E> query = createQuery("from StoredArticle sa where sa.article = :article and sa.location.warehouse.withdrawAllowed = true and sa.location.warehouse.building = :building");
query.setParameter("article", article);
query.setParameter("building", building);
- List<StoredArticle> resultList = (List<StoredArticle>) findAll(query);
+ List<E> resultList = findAll(query);
for (StoredArticle storedArticle : resultList) {
entityManager.detach(storedArticle);
}
@@ -51,11 +51,11 @@
}
@Override
- public List<StoredArticle> findAllReceivedForAllSupplier(Building building) {
+ public List<E> findAllReceivedForAllSupplier(Building building) {
TypedQuery<E> query = createQuery("from StoredArticle sa where sa.location.warehouse.building = :building and sa.location.code = :code");
query.setParameter("building", building);
query.setParameter("code", Locations.codeForReceptionLocations());
- List<StoredArticle> resultList = (List<StoredArticle>) findAll(query);
+ List<E> resultList = findAll(query);
for (StoredArticle storedArticle : resultList) {
entityManager.detach(storedArticle);
}
@@ -63,12 +63,12 @@
}
@Override
- public List<StoredArticle> findAllReceivedForSupplier(Building building, String supplierId) {
+ public List<E> findAllReceivedForSupplier(Building building, String supplierId) {
TypedQuery<E> query = createQuery("from StoredArticle sa where sa.location.warehouse.building = :building and sa.location.code = :code and sa.article.supplier.id = :supplierId");
query.setParameter("building", building);
query.setParameter("supplierId", supplierId);
query.setParameter("code", Locations.codeForReceptionLocations());
- List<StoredArticle> resultList = (List<StoredArticle>) findAll(query);
+ List<E> resultList = findAll(query);
for (StoredArticle storedArticle : resultList) {
entityManager.detach(storedArticle);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractSupplierJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractSupplierJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractSupplierJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -40,11 +40,11 @@
}
@Override
- public List<Supplier> findAllWithReceivedArticles(Building building) {
+ public List<E> findAllWithReceivedArticles(Building building) {
TypedQuery<E> query = createQuery("select sa.article.supplier from StoredArticle sa where sa.location.code = :code and sa.location.warehouse.building = :building");
query.setParameter(Warehouse.PROPERTY_BUILDING, building);
query.setParameter(Location.PROPERTY_CODE, Locations.codeForReceptionLocations());
- return (List<Supplier>) findAll(query);
+ return findAll(query);
}
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractUnavailableArticleJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractUnavailableArticleJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractUnavailableArticleJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -37,7 +37,7 @@
}
@Override
- public UnavailableArticle findByArticle(Building building, Article article) {
+ public E findByArticle(Building building, Article article) {
TypedQuery<E> query = createQuery("from UnavailableArticle ua where ua.article = :article and ua.building = :building");
query.setParameter(UnavailableArticle.PROPERTY_ARTICLE, article);
query.setParameter(UnavailableArticle.PROPERTY_BUILDING, building);
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractWarehouseJpaDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractWarehouseJpaDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/AbstractWarehouseJpaDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -38,10 +38,10 @@
}
@Override
- public List<Warehouse> findAllWithoutLocations(Building building) {
- TypedQuery<E> query = entityManager.createQuery("from Warehouse w where w.building = :building and w in (select l.warehouse from Location l where l.code = :code)", getEntityClass());
+ public List<E> findAllWithoutLocations(Building building) {
+ TypedQuery<E> query = createQuery("from Warehouse w where w.building = :building and w in (select l.warehouse from Location l where l.code = :code)");
query.setParameter(Warehouse.PROPERTY_BUILDING, building);
query.setParameter(Warehouse.PROPERTY_CODE, Locations.codeForWarehouseWithoutLocations());
- return (List<Warehouse>) query.getResultList();
+ return query.getResultList();
}
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/ArticleDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -26,8 +26,8 @@
import com.franciaflex.magalie.persistence.entity.Article;
/** @author bleny */
-public interface ArticleDao {
+public interface ArticleDao<E extends Article> {
- Article findByCode(String articleCode);
+ E findByCode(String articleCode);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/BuildingDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -23,7 +23,9 @@
* #L%
*/
+import com.franciaflex.magalie.persistence.entity.Building;
+
/** @author bleny */
-public interface BuildingDao {
+public interface BuildingDao<E extends Building> {
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedArticleDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -30,10 +30,10 @@
import java.util.List;
/** @author bleny */
-public interface DeliveredRequestedArticleDao {
+public interface DeliveredRequestedArticleDao<E extends DeliveredRequestedArticle> {
- DeliveredRequestedArticle find(StorageMovementOrder storageMovementOrder);
+ E find(StorageMovementOrder storageMovementOrder);
- List<DeliveredRequestedArticle> findAll(RequestedList requestedList);
+ List<E> findAll(RequestedList requestedList);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/DeliveredRequestedListDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -28,10 +28,10 @@
import com.franciaflex.magalie.persistence.entity.RequestedList;
/** @author bleny */
-public interface DeliveredRequestedListDao {
+public interface DeliveredRequestedListDao<E extends DeliveredRequestedList> {
- DeliveredRequestedList findByAffectedTo(MagalieUser affectedTo);
+ E findByAffectedTo(MagalieUser affectedTo);
- DeliveredRequestedList findByRequestedList(RequestedList requestedList);
+ E findByRequestedList(RequestedList requestedList);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/KanbanDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -28,8 +28,8 @@
import com.franciaflex.magalie.persistence.entity.Warehouse;
/** @author bleny */
-public interface KanbanDao {
+public interface KanbanDao<E extends Kanban> {
- public Kanban find(Article article, Warehouse warehouse);
+ public E find(Article article, Warehouse warehouse);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -29,11 +29,11 @@
import java.util.List;
-public interface LocationDao {
+public interface LocationDao<E extends Location> {
- Location find(String code, Warehouse warehouse);
+ E find(String code, Warehouse warehouse);
- List<Location> findAllWithoutReception(Building building);
+ List<E> findAllWithoutReception(Building building);
- List<Location> findAllWithoutReception(Warehouse warehouse);
+ List<E> findAllWithoutReception(Warehouse warehouse);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/LocationErrorDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -30,12 +30,12 @@
import java.util.List;
/** @author bleny */
-public interface LocationErrorDao {
+public interface LocationErrorDao<E extends LocationError> {
- LocationError findByLocation(Location location);
+ E findByLocation(Location location);
List<Location> getAllLocationsInError(Article article);
-// List<LocationError> findAll();
+ List<E> findAll();
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/MagalieUserDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -25,11 +25,13 @@
import com.franciaflex.magalie.persistence.entity.MagalieUser;
+import java.util.List;
+
/** @author bleny */
-public interface MagalieUserDao {
+public interface MagalieUserDao<E extends MagalieUser> {
- MagalieUser findByLogin(String login);
+ E findByLogin(String login);
-// List<MagalieUser> findAll();
+ List<E> findAll();
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/PreparedArticleReceptionDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -3,8 +3,7 @@
import com.franciaflex.magalie.persistence.entity.PreparedArticleReception;
/** @author bleny */
-public interface PreparedArticleReceptionDao {
+public interface PreparedArticleReceptionDao<E extends PreparedArticleReception> {
- PreparedArticleReception findByBarcode(String barcode);
-
+ E findByBarcode(String barcode);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedArticleDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -31,10 +31,10 @@
import java.util.List;
/** @author bleny */
-public interface RequestedArticleDao {
+public interface RequestedArticleDao<E extends RequestedArticle> {
- List<RequestedArticle> findAllUndelivered(Building building, MagalieUser affectedTo, String listType);
+ List<E> findAllUndelivered(Building building, MagalieUser affectedTo, String listType);
- List<RequestedArticle> findAll(RequestedList requestedList);
+ List<E> findAll(RequestedList requestedList);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/RequestedListDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -23,10 +23,12 @@
* #L%
*/
+import com.franciaflex.magalie.persistence.entity.RequestedList;
+
import java.util.List;
/** @author bleny */
-public interface RequestedListDao {
+public interface RequestedListDao<E extends RequestedList> {
List<String> findAllDistinctListTypes();
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -30,11 +30,11 @@
import java.util.List;
/** @author bleny */
-public interface StorageMovementDao {
+public interface StorageMovementDao <E extends StorageMovement>{
- List<StorageMovement> findAllByArticle(Article article);
+ List<E> findAllByArticle(Article article);
-// List<StorageMovement> findAll();
+ List<E> findAll();
- List<StorageMovement> findAllInReception(Building building);
+ List<E> findAllInReception(Building building);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StorageMovementOrderDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -29,8 +29,8 @@
import java.util.List;
-public interface StorageMovementOrderDao {
+public interface StorageMovementOrderDao<E extends StorageMovementOrder> {
- public List<StorageMovementOrder> findNotConfirmedByUser(MagalieUser magalieUser, Building building);
+ public List<E> findNotConfirmedByUser(MagalieUser magalieUser, Building building);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/StoredArticleDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -29,11 +29,11 @@
import java.util.List;
-public interface StoredArticleDao {
+public interface StoredArticleDao<E extends StoredArticle> {
- List<StoredArticle> findAllForArticleInBuilding(Article article, Building building);
+ List<E> findAllForArticleInBuilding(Article article, Building building);
- List<StoredArticle> findAllReceivedForAllSupplier(Building building);
+ List<E> findAllReceivedForAllSupplier(Building building);
- List<StoredArticle> findAllReceivedForSupplier(Building building, String supplierId);
+ List<E> findAllReceivedForSupplier(Building building, String supplierId);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/SupplierDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -29,8 +29,8 @@
import java.util.List;
/** @author bleny */
-public interface SupplierDao {
+public interface SupplierDao<E extends Supplier> {
- List<Supplier> findAllWithReceivedArticles(Building building);
+ List<E> findAllWithReceivedArticles(Building building);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/UnavailableArticleDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -28,8 +28,8 @@
import com.franciaflex.magalie.persistence.entity.UnavailableArticle;
/** @author bleny */
-public interface UnavailableArticleDao {
+public interface UnavailableArticleDao<E extends UnavailableArticle> {
- UnavailableArticle findByArticle(Building building, Article article);
+ E findByArticle(Building building, Article article);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/java/com/franciaflex/magalie/persistence/dao/WarehouseDao.java 2013-05-29 08:55:37 UTC (rev 207)
@@ -29,8 +29,8 @@
import java.util.List;
/** @author bleny */
-public interface WarehouseDao {
+public interface WarehouseDao<E extends Warehouse> {
- List<Warehouse> findAllWithoutLocations(Building building);
+ List<E> findAllWithoutLocations(Building building);
}
Modified: branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties
===================================================================
--- branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties 2013-05-29 07:29:15 UTC (rev 206)
+++ branches/magalie-eugene/magalie-persistence/src/main/xmi/magalie.properties 2013-05-29 08:55:37 UTC (rev 207)
@@ -1,8 +1,12 @@
com.franciaflex.magalie.persistence.entity.Article.attribute.fixedLocations.stereotype=unique
-com.franciaflex.magalie.persistence.entity.DeliveredRequestedArticle.class.stereotype=generatedValue
-com.franciaflex.magalie.persistence.entity.DeliveredRequestedList.class.stereotype=generatedValue
-com.franciaflex.magalie.persistence.entity.Kanban.class.stereotype=generatedValue
-com.franciaflex.magalie.persistence.entity.LocationError.class.stereotype=generatedValue
-com.franciaflex.magalie.persistence.entity.StorageMovement.class.stereotype=generatedValue
-com.franciaflex.magalie.persistence.entity.StorageMovementOrder.class.stereotype=generatedValue
-com.franciaflex.magalie.persistence.entity.UnavailableArticle.class.stereotype=generatedValue
+
+com.franciaflex.magalie.persistence.entity.Article.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.Building.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.Location.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.MagalieUser.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.PreparedArticleReception.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.RequestedArticle.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.RequestedList.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.StoredArticle.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.Supplier.class.stereotype=notGeneratedValue
+com.franciaflex.magalie.persistence.entity.Warehouse.class.stereotype=notGeneratedValue
1
0
29 May '13
Author: Bavencoff
Date: 2013-05-29 09:29:15 +0200 (Wed, 29 May 2013)
New Revision: 206
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
refs #2164 : debug
Modified:
trunk/magalie-web/src/main/webapp/js/storage-transfer-input.js
Modified: trunk/magalie-web/src/main/webapp/js/storage-transfer-input.js
===================================================================
--- trunk/magalie-web/src/main/webapp/js/storage-transfer-input.js 2013-05-29 07:23:59 UTC (rev 205)
+++ trunk/magalie-web/src/main/webapp/js/storage-transfer-input.js 2013-05-29 07:29:15 UTC (rev 206)
@@ -26,7 +26,11 @@
$('#storage-transfer_quantity').next('span').text(model.getUnit());
},
+ refreshLocation : function() {
+ $('#storage-transfer_destinationBarCode').val('');
+ }
+
};
var controller = {
@@ -35,6 +39,7 @@
var StoredArticleId = $('input[type=radio][name=storedArticleId]:checked').attr('value');
model.setArticle(StoredArticleId);
view.refreshQuantity();
+ view.refreshLocation();
$('#storage-transfer_destinationBarCode').focus();
}
1
0
29 May '13
Author: Bavencoff
Date: 2013-05-29 09:23:59 +0200 (Wed, 29 May 2013)
New Revision: 205
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
refs #2164 : debug
Modified:
trunk/magalie-web/src/main/webapp/js/magalie.js
Modified: trunk/magalie-web/src/main/webapp/js/magalie.js
===================================================================
--- trunk/magalie-web/src/main/webapp/js/magalie.js 2013-05-29 07:19:10 UTC (rev 204)
+++ trunk/magalie-web/src/main/webapp/js/magalie.js 2013-05-29 07:23:59 UTC (rev 205)
@@ -75,8 +75,7 @@
function bindKey(key, handler) {
$(document).keydown(function(event) {
if (event.which == KEYS[key] && !($(document.activeElement).is(":input") && SHORTCUTS.indexOf(key) >= 0)) {
- alert("Key : " + key + "\n is input ? " + $(document.activeElement).is(":input") + "\n shortcuts ? " + (SHORTCUTS.indexOf(key) >= 0));
- /*event.preventDefault();*/
+ event.preventDefault();
handler();
}
})
1
0
r204 - in trunk/magalie-web/src/main: java/com/franciaflex/magalie/web/action webapp/js
by Bavencoff@users.forge.codelutin.com 29 May '13
by Bavencoff@users.forge.codelutin.com 29 May '13
29 May '13
Author: Bavencoff
Date: 2013-05-29 09:19:10 +0200 (Wed, 29 May 2013)
New Revision: 204
Url: http://forge.codelutin.com/projects/franciaflex-magalie/repository/revision…
Log:
refs #2164 : user experience and debug
Modified:
trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/StorageTransferAction.java
trunk/magalie-web/src/main/webapp/js/magalie.js
Modified: trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/StorageTransferAction.java
===================================================================
--- trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/StorageTransferAction.java 2013-05-28 15:41:17 UTC (rev 203)
+++ trunk/magalie-web/src/main/java/com/franciaflex/magalie/web/action/StorageTransferAction.java 2013-05-29 07:19:10 UTC (rev 204)
@@ -83,6 +83,10 @@
return storedArticleId;
}
+ public double getQuantity() {
+ return quantity;
+ }
+
public void setStoredArticleId(String storedArticleId) {
this.storedArticleId = storedArticleId;
}
Modified: trunk/magalie-web/src/main/webapp/js/magalie.js
===================================================================
--- trunk/magalie-web/src/main/webapp/js/magalie.js 2013-05-28 15:41:17 UTC (rev 203)
+++ trunk/magalie-web/src/main/webapp/js/magalie.js 2013-05-29 07:19:10 UTC (rev 204)
@@ -74,8 +74,9 @@
function bindKey(key, handler) {
$(document).keydown(function(event) {
- if (event.which == KEYS[key] && !($(document.activeElement).is(":input") && SHORTCUTS.indexOf(KEYS[key]) >= 0)) {
- event.preventDefault();
+ if (event.which == KEYS[key] && !($(document.activeElement).is(":input") && SHORTCUTS.indexOf(key) >= 0)) {
+ alert("Key : " + key + "\n is input ? " + $(document.activeElement).is(":input") + "\n shortcuts ? " + (SHORTCUTS.indexOf(key) >= 0));
+ /*event.preventDefault();*/
handler();
}
})
1
0