Finish Carelli_Inventari_ModificaDataOraInv

This commit is contained in:
2024-03-15 12:58:13 +01:00
3 changed files with 64 additions and 52 deletions

View File

@@ -477,61 +477,61 @@
<injection language="SpEL" injector-id="java">
<display-name>Spring @Cacheable and @CacheEvict</display-name>
<single-file value="true" />
<place><![CDATA[psiMethod().withName("condition").withParameters().definedInClass("org.springframework.cache.annotation.CacheEvict")]]></place>
<place><![CDATA[psiMethod().withName("condition").withParameters().definedInClass("org.springframework.cache.annotation.CachePut")]]></place>
<place><![CDATA[psiMethod().withName("condition").withParameters().definedInClass("org.springframework.cache.annotation.Cacheable")]]></place>
<place><![CDATA[psiMethod().withName("key").withParameters().definedInClass("org.springframework.cache.annotation.CacheEvict")]]></place>
<place><![CDATA[psiMethod().withName("key").withParameters().definedInClass("org.springframework.cache.annotation.CachePut")]]></place>
<place><![CDATA[psiMethod().withName("key").withParameters().definedInClass("org.springframework.cache.annotation.Cacheable")]]></place>
<place><![CDATA[psiMethod().withName("unless").withParameters().definedInClass("org.springframework.cache.annotation.CachePut")]]></place>
<place><![CDATA[psiMethod().withName("unless").withParameters().definedInClass("org.springframework.cache.annotation.Cacheable")]]></place>
<place>psiMethod().withName(&quot;condition&quot;).withParameters().definedInClass(&quot;org.springframework.cache.annotation.CacheEvict&quot;)</place>
<place>psiMethod().withName(&quot;condition&quot;).withParameters().definedInClass(&quot;org.springframework.cache.annotation.CachePut&quot;)</place>
<place>psiMethod().withName(&quot;condition&quot;).withParameters().definedInClass(&quot;org.springframework.cache.annotation.Cacheable&quot;)</place>
<place>psiMethod().withName(&quot;key&quot;).withParameters().definedInClass(&quot;org.springframework.cache.annotation.CacheEvict&quot;)</place>
<place>psiMethod().withName(&quot;key&quot;).withParameters().definedInClass(&quot;org.springframework.cache.annotation.CachePut&quot;)</place>
<place>psiMethod().withName(&quot;key&quot;).withParameters().definedInClass(&quot;org.springframework.cache.annotation.Cacheable&quot;)</place>
<place>psiMethod().withName(&quot;unless&quot;).withParameters().definedInClass(&quot;org.springframework.cache.annotation.CachePut&quot;)</place>
<place>psiMethod().withName(&quot;unless&quot;).withParameters().definedInClass(&quot;org.springframework.cache.annotation.Cacheable&quot;)</place>
</injection>
<injection language="http-header-reference" injector-id="java">
<display-name>Spring HttpHeaders (org.springframework.http)</display-name>
<single-file value="true" />
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("header").definedInClass("org.springframework.http.ResponseEntity.HeadersBuilder"))]]></place>
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("header").definedInClass("org.springframework.web.servlet.function.ServerResponse.HeadersBuilder"))]]></place>
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("set", "add", "addAll", "getFirst", "containsKey", "get", "put", "getFirstDate", "setDate", "setInstant", "setZonedDateTime").definedInClass("org.springframework.http.HttpHeaders"))]]></place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;header&quot;).definedInClass(&quot;org.springframework.http.ResponseEntity.HeadersBuilder&quot;))</place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;header&quot;).definedInClass(&quot;org.springframework.web.servlet.function.ServerResponse.HeadersBuilder&quot;))</place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;set&quot;, &quot;add&quot;, &quot;addAll&quot;, &quot;getFirst&quot;, &quot;containsKey&quot;, &quot;get&quot;, &quot;put&quot;, &quot;getFirstDate&quot;, &quot;setDate&quot;, &quot;setInstant&quot;, &quot;setZonedDateTime&quot;).definedInClass(&quot;org.springframework.http.HttpHeaders&quot;))</place>
</injection>
<injection language="SpEL" injector-id="java">
<display-name>Spring Integration/Messaging</display-name>
<single-file value="true" />
<place><![CDATA[psiMethod().withName("expression").withParameters().definedInClass("org.springframework.messaging.handler.annotation.Payload")]]></place>
<place><![CDATA[psiMethod().withName("value").withParameters().definedInClass("org.springframework.integration.annotation.Payload")]]></place>
<place><![CDATA[psiMethod().withName("value").withParameters().definedInClass("org.springframework.messaging.handler.annotation.Payload")]]></place>
<place>psiMethod().withName(&quot;expression&quot;).withParameters().definedInClass(&quot;org.springframework.messaging.handler.annotation.Payload&quot;)</place>
<place>psiMethod().withName(&quot;value&quot;).withParameters().definedInClass(&quot;org.springframework.integration.annotation.Payload&quot;)</place>
<place>psiMethod().withName(&quot;value&quot;).withParameters().definedInClass(&quot;org.springframework.messaging.handler.annotation.Payload&quot;)</place>
</injection>
<injection language="SQL" injector-id="java">
<display-name>Spring JDBC (org.springframework.jdbc.core.PreparedStatementCreatorFactory)</display-name>
<single-file value="true" />
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("PreparedStatementCreatorFactory").withParameters("java.lang.String").definedInClass("org.springframework.jdbc.core.PreparedStatementCreatorFactory"))]]></place>
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("PreparedStatementCreatorFactory").withParameters("java.lang.String", "int[]").definedInClass("org.springframework.jdbc.core.PreparedStatementCreatorFactory"))]]></place>
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("PreparedStatementCreatorFactory").withParameters("java.lang.String", "java.util.List").definedInClass("org.springframework.jdbc.core.PreparedStatementCreatorFactory"))]]></place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;PreparedStatementCreatorFactory&quot;).withParameters(&quot;java.lang.String&quot;).definedInClass(&quot;org.springframework.jdbc.core.PreparedStatementCreatorFactory&quot;))</place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;PreparedStatementCreatorFactory&quot;).withParameters(&quot;java.lang.String&quot;, &quot;int[]&quot;).definedInClass(&quot;org.springframework.jdbc.core.PreparedStatementCreatorFactory&quot;))</place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;PreparedStatementCreatorFactory&quot;).withParameters(&quot;java.lang.String&quot;, &quot;java.util.List&quot;).definedInClass(&quot;org.springframework.jdbc.core.PreparedStatementCreatorFactory&quot;))</place>
</injection>
<injection language="SQL" injector-id="java">
<display-name>Spring JDBC (org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator)</display-name>
<single-file value="true" />
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("createCustomException").withParameters("java.lang.String", "java.lang.String", "java.sql.SQLException", "java.lang.Class").definedInClass("org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator"))]]></place>
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("customTranslate").withParameters("java.lang.String", "java.lang.String", "java.sql.SQLException").definedInClass("org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator"))]]></place>
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("doTranslate").withParameters("java.lang.String", "java.lang.String", "java.sql.SQLException").definedInClass("org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator"))]]></place>
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("logTranslation").withParameters("java.lang.String", "java.lang.String", "java.sql.SQLException", "boolean").definedInClass("org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator"))]]></place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;createCustomException&quot;).withParameters(&quot;java.lang.String&quot;, &quot;java.lang.String&quot;, &quot;java.sql.SQLException&quot;, &quot;java.lang.Class&quot;).definedInClass(&quot;org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator&quot;))</place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;customTranslate&quot;).withParameters(&quot;java.lang.String&quot;, &quot;java.lang.String&quot;, &quot;java.sql.SQLException&quot;).definedInClass(&quot;org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator&quot;))</place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;doTranslate&quot;).withParameters(&quot;java.lang.String&quot;, &quot;java.lang.String&quot;, &quot;java.sql.SQLException&quot;).definedInClass(&quot;org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator&quot;))</place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;logTranslation&quot;).withParameters(&quot;java.lang.String&quot;, &quot;java.lang.String&quot;, &quot;java.sql.SQLException&quot;, &quot;boolean&quot;).definedInClass(&quot;org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator&quot;))</place>
</injection>
<injection language="SpEL" injector-id="java">
<display-name>Spring Security @PostAuthorize/@PostFilter/@PreAuthorize/@PreFilter/@AuthenticationPrincipal</display-name>
<single-file value="true" />
<place><![CDATA[psiMethod().withName("expression").withParameters().definedInClass("org.springframework.security.core.annotation.AuthenticationPrincipal")]]></place>
<place><![CDATA[psiMethod().withName("expression").withParameters().definedInClass("org.springframework.security.core.annotation.CurrentSecurityContext")]]></place>
<place><![CDATA[psiMethod().withName("value").withParameters().definedInClass("org.springframework.security.access.prepost.PostAuthorize")]]></place>
<place><![CDATA[psiMethod().withName("value").withParameters().definedInClass("org.springframework.security.access.prepost.PostFilter")]]></place>
<place><![CDATA[psiMethod().withName("value").withParameters().definedInClass("org.springframework.security.access.prepost.PreAuthorize")]]></place>
<place><![CDATA[psiMethod().withName("value").withParameters().definedInClass("org.springframework.security.access.prepost.PreFilter")]]></place>
<place>psiMethod().withName(&quot;expression&quot;).withParameters().definedInClass(&quot;org.springframework.security.core.annotation.AuthenticationPrincipal&quot;)</place>
<place>psiMethod().withName(&quot;expression&quot;).withParameters().definedInClass(&quot;org.springframework.security.core.annotation.CurrentSecurityContext&quot;)</place>
<place>psiMethod().withName(&quot;value&quot;).withParameters().definedInClass(&quot;org.springframework.security.access.prepost.PostAuthorize&quot;)</place>
<place>psiMethod().withName(&quot;value&quot;).withParameters().definedInClass(&quot;org.springframework.security.access.prepost.PostFilter&quot;)</place>
<place>psiMethod().withName(&quot;value&quot;).withParameters().definedInClass(&quot;org.springframework.security.access.prepost.PreAuthorize&quot;)</place>
<place>psiMethod().withName(&quot;value&quot;).withParameters().definedInClass(&quot;org.springframework.security.access.prepost.PreFilter&quot;)</place>
</injection>
<injection language="SpEL" injector-id="java">
<display-name>Spring State Machine</display-name>
<single-file value="true" />
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("event").withParameters("java.lang.String").definedInClass("org.springframework.statemachine.config.configurers.SecurityConfigurer"))]]></place>
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("guardExpression").withParameters("java.lang.String").definedInClass("org.springframework.statemachine.config.configurers.TransitionConfigurer"))]]></place>
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("secured").withParameters("java.lang.String").definedInClass("org.springframework.statemachine.config.configurers.TransitionConfigurer"))]]></place>
<place><![CDATA[psiParameter().ofMethod(0, psiMethod().withName("transition").withParameters("java.lang.String").definedInClass("org.springframework.statemachine.config.configurers.SecurityConfigurer"))]]></place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;event&quot;).withParameters(&quot;java.lang.String&quot;).definedInClass(&quot;org.springframework.statemachine.config.configurers.SecurityConfigurer&quot;))</place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;guardExpression&quot;).withParameters(&quot;java.lang.String&quot;).definedInClass(&quot;org.springframework.statemachine.config.configurers.TransitionConfigurer&quot;))</place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;secured&quot;).withParameters(&quot;java.lang.String&quot;).definedInClass(&quot;org.springframework.statemachine.config.configurers.TransitionConfigurer&quot;))</place>
<place>psiParameter().ofMethod(0, psiMethod().withName(&quot;transition&quot;).withParameters(&quot;java.lang.String&quot;).definedInClass(&quot;org.springframework.statemachine.config.configurers.SecurityConfigurer&quot;))</place>
</injection>
</component>
<component name="MavenProjectsManager">
@@ -1070,7 +1070,6 @@
</component>
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
<component name="WebServicesPlugin" addRequiredLibraries="true" />
<component name="libraryTable">

View File

@@ -23,6 +23,9 @@ public class RowInventarioDTO {
@SqlField("rows_count")
private int rowsCount;
@SqlField("data_ora_inv")
private Date dataOraInv;
private String profileDb;
public Integer getIdInventario() {
@@ -78,6 +81,14 @@ public class RowInventarioDTO {
this.rowsCount = rowsCount;
}
public Date getDataOraInv() {
return dataOraInv;
}
public void setDataOraInv(Date dataOraInv) {
this.dataOraInv = dataOraInv;
}
public String getProfileDb() {
return profileDb;
}

View File

@@ -2250,7 +2250,7 @@ public class PvmService {
MtbColt mtbColt = getColloByExternalBarcode(codBarreCollo);
if(mtbColt == null) {
if (mtbColt == null) {
HashMap<String, Object> datiCollo = new HashMap<>();
if (codBarreCollo.startsWith("U")) {
@@ -3559,25 +3559,27 @@ public class PvmService {
}
String sql = "WITH TempResult AS (SELECT *, ROW_NUMBER() OVER (ORDER BY data_inventario DESC, id_inventario DESC) AS num_row\n" +
" FROM (SELECT id_inventario,\n" +
" data_inventario,\n" +
" filtro,\n" +
" cod_mdep,\n" +
" (SELECT COUNT(*)\n" +
" FROM mtb_invenr\n" +
" WHERE mtb_invent.id_inventario = mtb_invenr.id_inventario\n" +
" AND mtb_invent.cod_mdep = mtb_invenr.cod_mdep) AS num_righe\n" +
" FROM mtb_invent\n" +
" WHERE " + whereCond + "\n" +
" AND data_inventario >= DATEADD(MONTH, -2, GETDATE())) t),\n" +
" TempCount AS (SELECT COUNT(*) AS rows_count\n" +
" FROM TempResult)\n" +
"SELECT TempResult.*,\n" +
" TempCount.*\n" +
"FROM TempResult,\n" +
" TempCount\n" +
"ORDER BY 2 DESC, 1 DESC\n" +
"OFFSET (" + UtilityDB.valueToString(pageNum) + " - 1) * " + UtilityDB.valueToString(pageSize) + " ROWS FETCH NEXT " + UtilityDB.valueToString(pageSize) + " ROWS ONLY";
" FROM (SELECT id_inventario,\n" +
" data_inventario,\n" +
" filtro,\n" +
" cod_mdep,\n" +
" righe.num_righe,\n" +
" righe.data_ora_inv" +
" FROM mtb_invent\n" +
" OUTER APPLY (SELECT COUNT(*) AS num_righe, MIN(CAST(mtb_invenr.data_ora_inv AS DATE)) AS data_ora_inv\n" +
" FROM mtb_invenr\n" +
" WHERE mtb_invent.id_inventario = mtb_invenr.id_inventario\n" +
" AND mtb_invent.cod_mdep = mtb_invenr.cod_mdep) AS righe" +
" WHERE " + whereCond + "\n" +
" AND data_inventario >= DATEADD(MONTH, -2, GETDATE())) t),\n" +
" TempCount AS (SELECT COUNT(*) AS rows_count\n" +
" FROM TempResult)\n" +
"SELECT TempResult.*,\n" +
" TempCount.*\n" +
"FROM TempResult,\n" +
" TempCount\n" +
"ORDER BY 2 DESC, 1 DESC\n" +
"OFFSET (" + UtilityDB.valueToString(pageNum) + " - 1) * " + UtilityDB.valueToString(pageSize) + " ROWS FETCH NEXT " + UtilityDB.valueToString(pageSize) + " ROWS ONLY";
List<RowInventarioDTO> inventari = new ArrayList<>();