Merge branch 'develop' into feature/RefactoringGestioneColli
# Conflicts: # ems-core/src/main/java/it/integry/ems/migration/model/Migration_20241213163759.java # ems-engine/src/main/java/it/integry/ems/document/service/DocumentiDirettiService.java # ems-engine/src/main/java/it/integry/ems/retail/pvmRetail/service/PvmService.java
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
package it.integry.ems.dto;
|
package it.integry.ems.dto.info;
|
||||||
|
|
||||||
|
|
||||||
public class ApplicationInfoDTO {
|
public class ApplicationInfoDTO {
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package it.integry.ems.dto;
|
package it.integry.ems.dto.info;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package it.integry.ems.dto;
|
package it.integry.ems.dto.info;
|
||||||
|
|
||||||
public class DatabaseInfoDTO {
|
public class DatabaseInfoDTO {
|
||||||
|
|
||||||
114
ems-core/src/main/java/it/integry/ems/dto/info/PvmInfoDTO.java
Normal file
114
ems-core/src/main/java/it/integry/ems/dto/info/PvmInfoDTO.java
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
package it.integry.ems.dto.info;
|
||||||
|
|
||||||
|
public class PvmInfoDTO {
|
||||||
|
private String phpVersion;
|
||||||
|
private String timezone;
|
||||||
|
private String imagick;
|
||||||
|
private boolean sodiumMissing;
|
||||||
|
private int maxExecutionTime;
|
||||||
|
private boolean magicQuotesGpc;
|
||||||
|
private String defaultCharset;
|
||||||
|
private String memoryLimit;
|
||||||
|
private String postMaxSize;
|
||||||
|
private String uploadMaxSize;
|
||||||
|
private int maxInputVars;
|
||||||
|
|
||||||
|
public String getPhpVersion() {
|
||||||
|
return phpVersion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setPhpVersion(String phpVersion) {
|
||||||
|
this.phpVersion = phpVersion;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getTimezone() {
|
||||||
|
return timezone;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setTimezone(String timezone) {
|
||||||
|
this.timezone = timezone;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getImagick() {
|
||||||
|
return imagick;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setImagick(String imagick) {
|
||||||
|
this.imagick = imagick;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isSodiumMissing() {
|
||||||
|
return sodiumMissing;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setSodiumMissing(boolean sodiumMissing) {
|
||||||
|
this.sodiumMissing = sodiumMissing;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxExecutionTime() {
|
||||||
|
return maxExecutionTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setMaxExecutionTime(int maxExecutionTime) {
|
||||||
|
this.maxExecutionTime = maxExecutionTime;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isMagicQuotesGpc() {
|
||||||
|
return magicQuotesGpc;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setMagicQuotesGpc(boolean magicQuotesGpc) {
|
||||||
|
this.magicQuotesGpc = magicQuotesGpc;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getDefaultCharset() {
|
||||||
|
return defaultCharset;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setDefaultCharset(String defaultCharset) {
|
||||||
|
this.defaultCharset = defaultCharset;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getMemoryLimit() {
|
||||||
|
return memoryLimit;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setMemoryLimit(String memoryLimit) {
|
||||||
|
this.memoryLimit = memoryLimit;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getPostMaxSize() {
|
||||||
|
return postMaxSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setPostMaxSize(String postMaxSize) {
|
||||||
|
this.postMaxSize = postMaxSize;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getUploadMaxSize() {
|
||||||
|
return uploadMaxSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setUploadMaxSize(String uploadMaxSize) {
|
||||||
|
this.uploadMaxSize = uploadMaxSize;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getMaxInputVars() {
|
||||||
|
return maxInputVars;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PvmInfoDTO setMaxInputVars(int maxInputVars) {
|
||||||
|
this.maxInputVars = maxInputVars;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250729103953 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("alter table gtb_anag_note add flag_stampa_pkl bit not null default 0");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250729124207 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("alter table ctb_nc_intracee alter column taric varchar(10) null",
|
||||||
|
"alter table mtb_aart alter column taric varchar(10) null");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.IntegryCustomer;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250729170848 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (isCustomer(IntegryCustomer.FolliesGroup)) {
|
||||||
|
|
||||||
|
updateSetupValue("DATI_AZIENDA", "SETUP", "DELIMITED_IDENTIFIER", "1");
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250730152443 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("ALTER TABLE stb_posizioni ADD descrizione VARCHAR(50) NULL");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250730153210 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
executeStatement("ALTER TABLE stb_activity\n" +
|
||||||
|
" ADD id_posizione BIGINT\n" +
|
||||||
|
" CONSTRAINT fk_stb_activity_stb_posizioni REFERENCES dbo.stb_posizioni");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
package it.integry.ems.migration.model;
|
||||||
|
|
||||||
|
import it.integry.ems.migration._base.BaseMigration;
|
||||||
|
import it.integry.ems.migration._base.IntegryCustomer;
|
||||||
|
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||||
|
|
||||||
|
public class Migration_20250731175503 extends BaseMigration implements MigrationModelInterface {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void up() throws Exception {
|
||||||
|
if (isHistoryDB())
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (isCustomer(IntegryCustomer.Smetar)) enableSaveToRest("w_ppros_transfer_dlg");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void down() throws Exception {
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -918,10 +918,10 @@ public class CommonRules extends QueryRules {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static BigDecimal completeValUntULTC(Connection conn, String codMdep, String codMart, Date dataValidita, BigDecimal rapConv) throws Exception {
|
public static BigDecimal completeValUntULTC(Connection conn, String codMdep, String codMart, Date dataValidita, BigDecimal rapConv) throws Exception {
|
||||||
if (rapConv.compareTo(BigDecimal.ZERO) != 0) rapConv = BigDecimal.ONE;
|
if (rapConv.compareTo(BigDecimal.ZERO) == 0) rapConv = BigDecimal.ONE;
|
||||||
String sql = "SELECT Round(isNull(dbo.f_GetCostoUltArt_depo("
|
String sql = "SELECT Round(isNull(dbo.f_GetCostoUltArt_depo("
|
||||||
+ UtilityDB.valueDateToString(dataValidita, CommonConstants.DATE_FORMAT_YMD) + ","
|
+ UtilityDB.valueDateToString(dataValidita, CommonConstants.DATE_FORMAT_YMD) + ","
|
||||||
+ UtilityDB.valueToString(codMdep) + "," + UtilityDB.valueToString(codMart) + "), 0)/" + UtilityDB.valueToString(rapConv) + ", 5) as costo_ult";
|
+ UtilityDB.valueToString(codMdep) + "," + UtilityDB.valueToString(codMart) + "), 0)*" + UtilityDB.valueToString(rapConv) + ", 5) as costo_ult";
|
||||||
BigDecimal valUnt = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
BigDecimal valUnt = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||||
return valUnt;
|
return valUnt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ public class ConfigActivityRules extends QueryRules {
|
|||||||
public static boolean checkAttivita(Connection conn, StbActivity stbActivity) throws Exception {
|
public static boolean checkAttivita(Connection conn, StbActivity stbActivity) throws Exception {
|
||||||
boolean blocca = false;
|
boolean blocca = false;
|
||||||
if (stbActivity.getFlagTipologia().equalsIgnoreCase("P")) {
|
if (stbActivity.getFlagTipologia().equalsIgnoreCase("P")) {
|
||||||
|
if (stbActivity.getOperation() == OperationType.INSERT)
|
||||||
|
return false;
|
||||||
String sql =
|
String sql =
|
||||||
Query.format("SELECT parent_activity_id FROM stb_activity WHERE activity_id = %s", stbActivity.getActivityId());
|
Query.format("SELECT parent_activity_id FROM stb_activity WHERE activity_id = %s", stbActivity.getActivityId());
|
||||||
String parentActivityId = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
String parentActivityId = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||||
@@ -52,15 +54,7 @@ public class ConfigActivityRules extends QueryRules {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|
||||||
String sql =
|
blocca = checkAttivita(conn, stbActivity.getCodJcom(), dataCheck);
|
||||||
Query.format(
|
|
||||||
"SELECT CAST(COUNT(*) AS BIT)\n" +
|
|
||||||
"FROM stb_activity_check\n" +
|
|
||||||
"WHERE stb_activity_check.cod_jcom = %s\n" +
|
|
||||||
" AND %s BETWEEN stb_activity_check.data_iniz AND stb_activity_check.data_fine",
|
|
||||||
stbActivity.getCodJcom(), dataCheck);
|
|
||||||
|
|
||||||
blocca = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (blocca)
|
if (blocca)
|
||||||
@@ -69,6 +63,19 @@ public class ConfigActivityRules extends QueryRules {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean checkAttivita(Connection conn, String codJcom, Date dataCheck) throws Exception {
|
||||||
|
String sql =
|
||||||
|
Query.format(
|
||||||
|
"SELECT CAST(COUNT(*) AS BIT)\n" +
|
||||||
|
"FROM stb_activity_check\n" +
|
||||||
|
"WHERE stb_activity_check.cod_jcom = %s\n" +
|
||||||
|
" AND %s BETWEEN stb_activity_check.data_iniz AND stb_activity_check.data_fine",
|
||||||
|
codJcom, dataCheck);
|
||||||
|
|
||||||
|
return UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public static List<JtbRLavt> completeJtbRlavtActivity(Connection connection, StbActivity entity) throws Exception {
|
public static List<JtbRLavt> completeJtbRlavtActivity(Connection connection, StbActivity entity) throws Exception {
|
||||||
String sql =
|
String sql =
|
||||||
"SELECT jrl_flav_users.cod_jflav" +
|
"SELECT jrl_flav_users.cod_jflav" +
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ import it.integry.ems.Import.dto.AnomalieDTO;
|
|||||||
import it.integry.ems.Import.dto.ImportRequestDTO;
|
import it.integry.ems.Import.dto.ImportRequestDTO;
|
||||||
import it.integry.ems.Import.enums.EntityImportType;
|
import it.integry.ems.Import.enums.EntityImportType;
|
||||||
import it.integry.ems.dto.*;
|
import it.integry.ems.dto.*;
|
||||||
|
import it.integry.ems.dto.info.ApplicationInfoDTO;
|
||||||
|
import it.integry.ems.dto.info.DatabaseEngineInfoDTO;
|
||||||
|
import it.integry.ems.dto.info.DatabaseInfoDTO;
|
||||||
|
import it.integry.ems.dto.info.PvmInfoDTO;
|
||||||
import it.integry.ems.exception.MissingDataException;
|
import it.integry.ems.exception.MissingDataException;
|
||||||
import it.integry.ems.export.base.EntityExportResponse;
|
import it.integry.ems.export.base.EntityExportResponse;
|
||||||
import it.integry.ems.export.base.EntityExporterUtility;
|
import it.integry.ems.export.base.EntityExporterUtility;
|
||||||
@@ -855,6 +859,7 @@ public class EmsServices {
|
|||||||
|
|
||||||
arguments.put("databaseEngine", getDatabaseEngineInfo(multiDBTransactionManager));
|
arguments.put("databaseEngine", getDatabaseEngineInfo(multiDBTransactionManager));
|
||||||
arguments.put("applicationInfo", getApplicatinInfo(multiDBTransactionManager));
|
arguments.put("applicationInfo", getApplicatinInfo(multiDBTransactionManager));
|
||||||
|
arguments.put("pvmInfo", getPvmInfo(multiDBTransactionManager));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Properties jvmProperties = System.getProperties();
|
Properties jvmProperties = System.getProperties();
|
||||||
@@ -1022,6 +1027,84 @@ public class EmsServices {
|
|||||||
return applicationInfoDTOList;
|
return applicationInfoDTOList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private PvmInfoDTO getPvmInfo(MultiDBTransactionManager mdb) throws Exception {
|
||||||
|
String pvmUrl = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), "DATI_AZIENDA", "URL", "PVM");
|
||||||
|
|
||||||
|
if (UtilityString.isNullOrEmpty(pvmUrl)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
String url = String.format("%sphpinfo.php?get=1", pvmUrl.endsWith("/") ? pvmUrl : pvmUrl + "/");
|
||||||
|
|
||||||
|
StringBuilder srb = new StringBuilder();
|
||||||
|
int status = HttpRestWrapper.callGeneric(url, null, null, null, ContentType.APPLICATION_JSON, srb, null);
|
||||||
|
|
||||||
|
if (status != 200)
|
||||||
|
throw new Exception("La richiesta \"" + url + "\" ha generato status code: " + status + " [" + srb + "]");
|
||||||
|
|
||||||
|
PvmInfoDTO pvmInfoDTO = new PvmInfoDTO();
|
||||||
|
|
||||||
|
try {
|
||||||
|
ObjectMapper mapper = new ObjectMapper();
|
||||||
|
JsonNode jsonNode = mapper.readTree(srb.toString());
|
||||||
|
|
||||||
|
jsonNode.forEach(json -> {
|
||||||
|
String id = json.get("id").asText();
|
||||||
|
|
||||||
|
switch (id) {
|
||||||
|
case "php":
|
||||||
|
pvmInfoDTO.setPhpVersion(json.get("version").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "timezone":
|
||||||
|
pvmInfoDTO.setTimezone(json.get("version").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "imagick":
|
||||||
|
pvmInfoDTO.setImagick(json.get("version").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "sodium":
|
||||||
|
pvmInfoDTO.setSodiumMissing(json.get("is_missing").asBoolean());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "max_execution_time":
|
||||||
|
pvmInfoDTO.setMaxExecutionTime(json.get("value").asInt());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "magic_quotes_gpc":
|
||||||
|
pvmInfoDTO.setMagicQuotesGpc(json.get("value").asBoolean());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "default_charset":
|
||||||
|
pvmInfoDTO.setDefaultCharset(json.get("value").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "memory_limit":
|
||||||
|
pvmInfoDTO.setMemoryLimit(json.get("value").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "post_max_size":
|
||||||
|
pvmInfoDTO.setPostMaxSize(json.get("value").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "upload_max_filesize":
|
||||||
|
pvmInfoDTO.setUploadMaxSize(json.get("value").asText());
|
||||||
|
|
||||||
|
break;
|
||||||
|
case "max_input_vars":
|
||||||
|
pvmInfoDTO.setMaxInputVars(json.get("value").asInt());
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("getPvmInfo", e);
|
||||||
|
}
|
||||||
|
|
||||||
|
return pvmInfoDTO;
|
||||||
|
}
|
||||||
|
|
||||||
private void importClientieOrdiniQuore() throws Exception {
|
private void importClientieOrdiniQuore() throws Exception {
|
||||||
try (Connection connection = basicConnectionPool.getConnection(settingsModel.getDefaultProfile())) {
|
try (Connection connection = basicConnectionPool.getConnection(settingsModel.getDefaultProfile())) {
|
||||||
boolean enabled = Boolean.parseBoolean(setupGest.getSetup(connection,
|
boolean enabled = Boolean.parseBoolean(setupGest.getSetup(connection,
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import org.kie.api.definition.type.PropertyReactive;
|
|||||||
|
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@PropertyReactive
|
@PropertyReactive
|
||||||
@@ -58,6 +57,9 @@ public class GtbAnagNote extends EntityBase {
|
|||||||
@SqlField(value = "tipo_note", maxLength = 40)
|
@SqlField(value = "tipo_note", maxLength = 40)
|
||||||
private String tipoNote;
|
private String tipoNote;
|
||||||
|
|
||||||
|
@SqlField(value = "flag_stampa_pkl", nullable = false, defaultObjectValue = "0")
|
||||||
|
private Boolean flagStampaPkl;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private String idAttach;
|
private String idAttach;
|
||||||
|
|
||||||
@@ -176,6 +178,15 @@ public class GtbAnagNote extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Boolean getFlagStampaPkl() {
|
||||||
|
return flagStampaPkl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public GtbAnagNote setFlagStampaPkl(Boolean flagStampaPkl) {
|
||||||
|
this.flagStampaPkl = flagStampaPkl;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void insertChilds() throws Exception {
|
protected void insertChilds() throws Exception {
|
||||||
for (GrlAnagNoteFiles grlAnagNoteFiles : getGrlAnagNoteFiles()) {
|
for (GrlAnagNoteFiles grlAnagNoteFiles : getGrlAnagNoteFiles()) {
|
||||||
|
|||||||
@@ -196,6 +196,10 @@ public class StbActivity extends EntityBase {
|
|||||||
@SqlField(value = "plan_id", maxLength = 15)
|
@SqlField(value = "plan_id", maxLength = 15)
|
||||||
private Long planId;
|
private Long planId;
|
||||||
|
|
||||||
|
@FK(tableName = StbPosizioni.ENTITY, columnName = "id")
|
||||||
|
@SqlField(value = "id_posizione")
|
||||||
|
private Long idPosizione;
|
||||||
|
|
||||||
@EntityChild
|
@EntityChild
|
||||||
private List<StbActivityCosts> stbActivityCosts = new ArrayList<>();
|
private List<StbActivityCosts> stbActivityCosts = new ArrayList<>();
|
||||||
|
|
||||||
@@ -744,6 +748,15 @@ public class StbActivity extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Long getIdPosizione() {
|
||||||
|
return idPosizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbActivity setIdPosizione(Long idPosizione) {
|
||||||
|
this.idPosizione = idPosizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public List<StbActivityCosts> getStbActivityCosts() {
|
public List<StbActivityCosts> getStbActivityCosts() {
|
||||||
return stbActivityCosts;
|
return stbActivityCosts;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ public class StbPosizioni extends EntityBase {
|
|||||||
@SqlField(value = "id", nullable = false)
|
@SqlField(value = "id", nullable = false)
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
|
@SqlField(value = "descrizione", maxLength = 50)
|
||||||
|
private String descrizione;
|
||||||
|
|
||||||
@SqlField(value = "lat")
|
@SqlField(value = "lat")
|
||||||
private BigDecimal lat;
|
private BigDecimal lat;
|
||||||
|
|
||||||
@@ -60,6 +63,15 @@ public class StbPosizioni extends EntityBase {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDescrizione() {
|
||||||
|
return descrizione;
|
||||||
|
}
|
||||||
|
|
||||||
|
public StbPosizioni setDescrizione(String descrizione) {
|
||||||
|
this.descrizione = descrizione;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public BigDecimal getLat() {
|
public BigDecimal getLat() {
|
||||||
return lat;
|
return lat;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,6 +67,24 @@ then
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
rule "deleteDatiDocValV"
|
||||||
|
no-loop
|
||||||
|
when
|
||||||
|
eval(completeRulesEnabled)
|
||||||
|
$docT : DtbDoct(previstaFat == "S" && serDoc.equalsIgnoreCase(serDocVal) &&
|
||||||
|
numDoc.equals(numDocVal) && dataDoc.equals(dataDocVal) &&
|
||||||
|
codDtip.equalsIgnoreCase(codDtipVal))
|
||||||
|
then
|
||||||
|
modify ( $docT ) {
|
||||||
|
setDataDocVal(EmsRestConstants.DATE_NULL),
|
||||||
|
setSerDocVal(EmsRestConstants.NULL),
|
||||||
|
setNumDocVal(EmsRestConstants.INTEGER_NULL),
|
||||||
|
setCodDtipVal(EmsRestConstants.NULL)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
rule "completeIsReso"
|
rule "completeIsReso"
|
||||||
no-loop
|
no-loop
|
||||||
when
|
when
|
||||||
|
|||||||
@@ -943,7 +943,9 @@ public class SteUPService {
|
|||||||
logger.info("Uploading attachment activity ID: " + activityId);
|
logger.info("Uploading attachment activity ID: " + activityId);
|
||||||
String fileName = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".zip";
|
String fileName = new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".zip";
|
||||||
String pathFile = UtilityDirs.getEmsApiTempDirectoryPath() + File.separator + activityId + File.separator;
|
String pathFile = UtilityDirs.getEmsApiTempDirectoryPath() + File.separator + activityId + File.separator;
|
||||||
UtilityFile.createZipFromMultipartFile(pathFile, fileName, f);
|
//UtilityFile.createZipFromMultipartFile(pathFile, fileName, f);
|
||||||
|
|
||||||
|
UtilityFile.saveFile(pathFile, f.getOriginalFilename(), f.getBytes());
|
||||||
|
|
||||||
return activityService.uploadAttachment(activityId, f);
|
return activityService.uploadAttachment(activityId, f);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -620,7 +620,7 @@ public class ContabilImportService {
|
|||||||
"FROM gtb_anag\n" +
|
"FROM gtb_anag\n" +
|
||||||
" INNER JOIN ctb_anag ON gtb_anag.cod_anag = ctb_anag.cod_anag\n" +
|
" INNER JOIN ctb_anag ON gtb_anag.cod_anag = ctb_anag.cod_anag\n" +
|
||||||
" LEFT OUTER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag\n" +
|
" LEFT OUTER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag\n" +
|
||||||
"WHERE gtb_anag.diacod = %s\n" +
|
"WHERE IsNull(gtb_anag.diacod, ctb_anag.cod_ccon + gtb_anag.cod_anag) = %s\n" +
|
||||||
"UNION\n" +
|
"UNION\n" +
|
||||||
"SELECT NULL, ctb_cont.cod_ccon, NULL, ctb_cont.descrizione\n" +
|
"SELECT NULL, ctb_cont.cod_ccon, NULL, ctb_cont.descrizione\n" +
|
||||||
"FROM ctb_cont\n" +
|
"FROM ctb_cont\n" +
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ import org.apache.logging.log4j.Logger;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.annotation.Scope;
|
import org.springframework.context.annotation.Scope;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
import org.springframework.http.ContentDisposition;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
import org.springframework.http.MediaType;
|
import org.springframework.http.MediaType;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
import org.springframework.security.core.userdetails.UsernameNotFoundException;
|
||||||
@@ -1046,7 +1048,7 @@ public class DocumentController {
|
|||||||
|
|
||||||
@PostMapping(value = "allineaCostoSuddivisioni")
|
@PostMapping(value = "allineaCostoSuddivisioni")
|
||||||
public ServiceRestResponse allineaCostoSuddivisioni(@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
public ServiceRestResponse allineaCostoSuddivisioni(@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||||
@RequestParam ( required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate dataInizio) throws Exception {
|
@RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate dataInizio) throws Exception {
|
||||||
|
|
||||||
allinementoCostoSuddivisioneService.allineaCosto(dataInizio);
|
allinementoCostoSuddivisioneService.allineaCosto(dataInizio);
|
||||||
return ServiceRestResponse.createPositiveResponse();
|
return ServiceRestResponse.createPositiveResponse();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import it.integry.common.var.CommonConstants;
|
|||||||
import it.integry.ems.document.dto.CreateULFromDocumentsDTO;
|
import it.integry.ems.document.dto.CreateULFromDocumentsDTO;
|
||||||
import it.integry.ems.document.dto.ULRowDTO;
|
import it.integry.ems.document.dto.ULRowDTO;
|
||||||
import it.integry.ems.exception.PrimaryDatabaseNotPresentException;
|
import it.integry.ems.exception.PrimaryDatabaseNotPresentException;
|
||||||
|
import it.integry.ems.exception.PrimaryDatabaseNotPresentException;
|
||||||
import it.integry.ems.javabeans.RequestDataDTO;
|
import it.integry.ems.javabeans.RequestDataDTO;
|
||||||
import it.integry.ems.retail.wms.Utility.WMSUtility;
|
import it.integry.ems.retail.wms.Utility.WMSUtility;
|
||||||
import it.integry.ems.retail.wms.accettazione.service.WMSAccettazioneService;
|
import it.integry.ems.retail.wms.accettazione.service.WMSAccettazioneService;
|
||||||
@@ -23,8 +24,6 @@ import it.integry.ems.utility.UtilityEntity;
|
|||||||
import it.integry.ems_model.base.EntityBase;
|
import it.integry.ems_model.base.EntityBase;
|
||||||
import it.integry.ems_model.config.EmsRestConstants;
|
import it.integry.ems_model.config.EmsRestConstants;
|
||||||
import it.integry.ems_model.entity.*;
|
import it.integry.ems_model.entity.*;
|
||||||
import it.integry.ems_model.entity.key.MtbColtKey;
|
|
||||||
import it.integry.ems_model.exception.DataConverterNotFoundException;
|
|
||||||
import it.integry.ems_model.service.SetupGest;
|
import it.integry.ems_model.service.SetupGest;
|
||||||
import it.integry.ems_model.types.OperationType;
|
import it.integry.ems_model.types.OperationType;
|
||||||
import it.integry.ems_model.utility.*;
|
import it.integry.ems_model.utility.*;
|
||||||
|
|||||||
@@ -25,28 +25,28 @@ public class CrmController {
|
|||||||
|
|
||||||
@RequestMapping(value = "createContact", method = RequestMethod.POST)
|
@RequestMapping(value = "createContact", method = RequestMethod.POST)
|
||||||
public ServiceRestResponse createContact(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
public ServiceRestResponse createContact(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||||
@RequestBody CRMCreateContactRequestDTO createContactDTO) throws Exception {
|
@RequestBody CRMCreateContactRequestDTO createContactDTO) throws Exception {
|
||||||
|
|
||||||
return ServiceRestResponse.createPositiveResponse(crmService.createContact(createContactDTO));
|
return ServiceRestResponse.createPositiveResponse(crmService.createContact(createContactDTO));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "saveActivity", method = RequestMethod.POST)
|
@RequestMapping(value = "saveActivity", method = RequestMethod.POST)
|
||||||
public ServiceRestResponse saveActivity(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
public ServiceRestResponse saveActivity(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||||
@RequestBody CRMActivityDTO activityRequest) throws Exception {
|
@RequestBody CRMActivityDTO activityRequest) throws Exception {
|
||||||
|
|
||||||
return ServiceRestResponse.createPositiveResponse(crmService.saveActivity(activityRequest));
|
return ServiceRestResponse.createPositiveResponse(crmService.saveActivity(activityRequest));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "completeOrder", method = RequestMethod.POST)
|
@RequestMapping(value = "completeOrder", method = RequestMethod.POST)
|
||||||
public ServiceRestResponse completeOrder(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
public ServiceRestResponse completeOrder(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||||
@RequestBody CRMCompleteOrderRequestDTO completeOrder) throws Exception {
|
@RequestBody CRMCompleteOrderRequestDTO completeOrder) throws Exception {
|
||||||
|
|
||||||
return ServiceRestResponse.createPositiveResponse(crmService.completeOrder(completeOrder));
|
return ServiceRestResponse.createPositiveResponse(crmService.completeOrder(completeOrder));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "transferProspect", method = RequestMethod.POST)
|
@RequestMapping(value = "transferProspect", method = RequestMethod.POST)
|
||||||
public ServiceRestResponse transferProspect(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
public ServiceRestResponse transferProspect(@RequestParam(CommonConstants.PROFILE_DB) String config,
|
||||||
@RequestBody CRMTransferProspectRequestDTO prospectToTransfer) throws Exception {
|
@RequestBody CRMTransferProspectRequestDTO prospectToTransfer) throws Exception {
|
||||||
|
|
||||||
return ServiceRestResponse.createPositiveResponse(crmService.transferProspect(prospectToTransfer));
|
return ServiceRestResponse.createPositiveResponse(crmService.transferProspect(prospectToTransfer));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
package it.integry.ems.order.crm.dto;
|
package it.integry.ems.order.crm.dto;
|
||||||
|
|
||||||
|
import it.integry.ems_model.entity.StbPosizioni;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -29,6 +31,8 @@ public class CRMActivityDTO {
|
|||||||
|
|
||||||
private List<String> userNameList;
|
private List<String> userNameList;
|
||||||
|
|
||||||
|
private StbPosizioni stbPosizioni;
|
||||||
|
|
||||||
public String getActivityId() {
|
public String getActivityId() {
|
||||||
return activityId;
|
return activityId;
|
||||||
}
|
}
|
||||||
@@ -213,4 +217,13 @@ public class CRMActivityDTO {
|
|||||||
this.effectiveEndtime = effectiveEndtime;
|
this.effectiveEndtime = effectiveEndtime;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public StbPosizioni getStbPosizioni() {
|
||||||
|
return stbPosizioni;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CRMActivityDTO setStbPosizioni(StbPosizioni stbPosizioni) {
|
||||||
|
this.stbPosizioni = stbPosizioni;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -10,6 +10,7 @@ public class CRMCreateContactRequestDTO {
|
|||||||
private String codAnag;
|
private String codAnag;
|
||||||
private String tipoAnag;
|
private String tipoAnag;
|
||||||
private String codVdes;
|
private String codVdes;
|
||||||
|
private String codVage;
|
||||||
private String processActivityId;
|
private String processActivityId;
|
||||||
|
|
||||||
private CRMClienteDTO cliente;
|
private CRMClienteDTO cliente;
|
||||||
@@ -55,6 +56,15 @@ public class CRMCreateContactRequestDTO {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getCodVage() {
|
||||||
|
return codVage;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CRMCreateContactRequestDTO setCodVage(String codVage) {
|
||||||
|
this.codVage = codVage;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public String getProcessActivityId() {
|
public String getProcessActivityId() {
|
||||||
return processActivityId;
|
return processActivityId;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,57 @@
|
|||||||
package it.integry.ems.order.crm.dto.createContact;
|
package it.integry.ems.order.crm.dto.createContact;
|
||||||
|
|
||||||
import it.integry.ems_model.entity.JtbComt;
|
import it.integry.ems.order.crm.dto.AnagClieDTO;
|
||||||
import it.integry.ems_model.entity.StbActivity;
|
import it.integry.ems_model.entity.*;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
public class CRMCreateContactResponseDTO {
|
public class CRMCreateContactResponseDTO {
|
||||||
|
|
||||||
|
private AnagClieDTO anagClie;
|
||||||
|
private PtbPros ptbPros;
|
||||||
|
|
||||||
|
private List<VtbCliePersRif> vtbCliePersRif;
|
||||||
|
private List<PtbProsRif> ptbProsRifs;
|
||||||
|
|
||||||
private JtbComt jtbComt;
|
private JtbComt jtbComt;
|
||||||
private StbActivity stbActivity;
|
private StbActivity stbActivity;
|
||||||
|
|
||||||
|
public AnagClieDTO getAnagClie() {
|
||||||
|
return anagClie;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CRMCreateContactResponseDTO setAnagClie(AnagClieDTO anagClie) {
|
||||||
|
this.anagClie = anagClie;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PtbPros getPtbPros() {
|
||||||
|
return ptbPros;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CRMCreateContactResponseDTO setPtbPros(PtbPros ptbPros) {
|
||||||
|
this.ptbPros = ptbPros;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<VtbCliePersRif> getVtbCliePersRif() {
|
||||||
|
return vtbCliePersRif;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CRMCreateContactResponseDTO setVtbCliePersRif(List<VtbCliePersRif> vtbCliePersRif) {
|
||||||
|
this.vtbCliePersRif = vtbCliePersRif;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<PtbProsRif> getPtbProsRifs() {
|
||||||
|
return ptbProsRifs;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CRMCreateContactResponseDTO setPtbProsRifs(List<PtbProsRif> ptbProsRifs) {
|
||||||
|
this.ptbProsRifs = ptbProsRifs;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public JtbComt getJtbComt() {
|
public JtbComt getJtbComt() {
|
||||||
return jtbComt;
|
return jtbComt;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package it.integry.ems.order.crm.dto.transferProspect;
|
package it.integry.ems.order.crm.dto.transferProspect;
|
||||||
|
|
||||||
|
import it.integry.ems.order.crm.dto.AnagClieDTO;
|
||||||
import it.integry.ems_model.base.EntityBase;
|
import it.integry.ems_model.base.EntityBase;
|
||||||
import it.integry.ems_model.entity.*;
|
import it.integry.ems_model.entity.*;
|
||||||
|
|
||||||
@@ -7,16 +8,28 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class CRMTransferProspectResponseDTO {
|
public class CRMTransferProspectResponseDTO {
|
||||||
|
private String codAnag;
|
||||||
|
|
||||||
private GtbAnag gtbAnag;
|
private GtbAnag gtbAnag;
|
||||||
private CtbAnag ctbAnag;
|
private CtbAnag ctbAnag;
|
||||||
|
|
||||||
|
private AnagClieDTO anagClie;
|
||||||
|
|
||||||
private List<WdtbOrdt> wdtbOrdts = new ArrayList<>();
|
private List<WdtbOrdt> wdtbOrdts = new ArrayList<>();
|
||||||
private List<JtbComt> jtbComts = new ArrayList<>();
|
private List<JtbComt> jtbComts = new ArrayList<>();
|
||||||
private List<PtbPros> ptbPros = new ArrayList<>();
|
private List<PtbPros> ptbPros = new ArrayList<>();
|
||||||
private List<StbActivity> stbActivities = new ArrayList<>();
|
private List<StbActivity> stbActivities = new ArrayList<>();
|
||||||
private List<PtbPrevt> ptbPrevts = new ArrayList<>();
|
private List<PtbPrevt> ptbPrevts = new ArrayList<>();
|
||||||
|
|
||||||
|
public String getCodAnag() {
|
||||||
|
return codAnag;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CRMTransferProspectResponseDTO setCodAnag(String codAnag) {
|
||||||
|
this.codAnag = codAnag;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public GtbAnag getGtbAnag() {
|
public GtbAnag getGtbAnag() {
|
||||||
return gtbAnag;
|
return gtbAnag;
|
||||||
}
|
}
|
||||||
@@ -35,6 +48,15 @@ public class CRMTransferProspectResponseDTO {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AnagClieDTO getAnagClie() {
|
||||||
|
return anagClie;
|
||||||
|
}
|
||||||
|
|
||||||
|
public CRMTransferProspectResponseDTO setAnagClie(AnagClieDTO anagClie) {
|
||||||
|
this.anagClie = anagClie;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public List<WdtbOrdt> getWdtbOrdts() {
|
public List<WdtbOrdt> getWdtbOrdts() {
|
||||||
return wdtbOrdts;
|
return wdtbOrdts;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,10 +33,7 @@ import org.springframework.stereotype.Service;
|
|||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import static it.integry.ems_model.config.EmsRestConstants.DATE_NULL;
|
import static it.integry.ems_model.config.EmsRestConstants.DATE_NULL;
|
||||||
|
|
||||||
@@ -72,10 +69,13 @@ public class CrmService {
|
|||||||
CRMClienteDTO cliente = createContact.getCliente();
|
CRMClienteDTO cliente = createContact.getCliente();
|
||||||
CRMDestinazioneDTO crmDestinazione = createContact.getDestinazione();
|
CRMDestinazioneDTO crmDestinazione = createContact.getDestinazione();
|
||||||
|
|
||||||
|
List<VtbCliePersRif> vtbCliePersRif = null;
|
||||||
|
List<PtbProsRif> ptbProsRifs = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
switch (createContact.getTipoAnag()) {
|
switch (createContact.getTipoAnag()) {
|
||||||
case "C":
|
case "C":
|
||||||
List<VtbCliePersRif> vtbCliePersRif = CRMUtility.buildEntityPersRif(conn, codAnag, createContact.getPersRif(), VtbCliePersRif.class);
|
vtbCliePersRif = CRMUtility.buildEntityPersRif(conn, codAnag, createContact.getPersRif(), VtbCliePersRif.class);
|
||||||
|
|
||||||
GtbAnag gtbAnag = new GtbAnag()
|
GtbAnag gtbAnag = new GtbAnag()
|
||||||
.setCodAnag(createContact.getCodAnag())
|
.setCodAnag(createContact.getCodAnag())
|
||||||
@@ -100,7 +100,7 @@ public class CrmService {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "P":
|
case "P":
|
||||||
List<PtbProsRif> ptbProsRifs = CRMUtility.buildEntityPersRif(conn, codAnag, createContact.getPersRif(), PtbProsRif.class);
|
ptbProsRifs = CRMUtility.buildEntityPersRif(conn, codAnag, createContact.getPersRif(), PtbProsRif.class);
|
||||||
|
|
||||||
PtbPros ptbPros = CRMUtility.buildEntityCustomer(codAnag, cliente, PtbPros.class);
|
PtbPros ptbPros = CRMUtility.buildEntityCustomer(codAnag, cliente, PtbPros.class);
|
||||||
|
|
||||||
@@ -112,6 +112,8 @@ public class CrmService {
|
|||||||
if (codAnag == null && createContact.getCommessa() != null && !UtilityString.isNullOrEmpty(createContact.getCommessa().getCodJflav())) {
|
if (codAnag == null && createContact.getCommessa() != null && !UtilityString.isNullOrEmpty(createContact.getCommessa().getCodJflav())) {
|
||||||
ptbPros.setCodVage(CRMUtility.getCodVageFromCodJflav(conn, createContact.getCommessa().getCodJflav()))
|
ptbPros.setCodVage(CRMUtility.getCodVageFromCodJflav(conn, createContact.getCommessa().getCodJflav()))
|
||||||
.setCodVlis(getDefaultCodVlis());
|
.setCodVlis(getDefaultCodVlis());
|
||||||
|
} else if (!UtilityString.isNullOrEmpty(createContact.getCodVage())) {
|
||||||
|
ptbPros.setCodVage(createContact.getCodVage());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (crmDestinazione != null) {
|
if (crmDestinazione != null) {
|
||||||
@@ -174,6 +176,50 @@ public class CrmService {
|
|||||||
|
|
||||||
response.setStbActivity(newActivity);
|
response.setStbActivity(newActivity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Recupero il cliente o il prospect appena creato da inviare nella risposta
|
||||||
|
if ("C".equals(createContact.getTipoAnag())) {
|
||||||
|
String sql = Query.format(
|
||||||
|
"SELECT gtb_anag.cod_anag,\n" +
|
||||||
|
" vtb_clie.cod_vtip,\n" +
|
||||||
|
" vtb_clie.cod_vage,\n" +
|
||||||
|
" vtb_clie.flag_stato,\n" +
|
||||||
|
" rag_soc,\n" +
|
||||||
|
" indirizzo,\n" +
|
||||||
|
" cap,\n" +
|
||||||
|
" citta,\n" +
|
||||||
|
" prov,\n" +
|
||||||
|
" nazione,\n" +
|
||||||
|
" telefono,\n" +
|
||||||
|
" fax,\n" +
|
||||||
|
" part_iva,\n" +
|
||||||
|
" cod_fisc,\n" +
|
||||||
|
" gtb_anag.note,\n" +
|
||||||
|
" persona_rif,\n" +
|
||||||
|
" e_mail,\n" +
|
||||||
|
" nome,\n" +
|
||||||
|
" data_ins,\n" +
|
||||||
|
" num_cell,\n" +
|
||||||
|
" e_mail_pec,\n" +
|
||||||
|
" cognome,\n" +
|
||||||
|
" diacod,\n" +
|
||||||
|
" lat,\n" +
|
||||||
|
" lng,\n" +
|
||||||
|
" data_mod\n" +
|
||||||
|
"FROM gtb_anag\n" +
|
||||||
|
" INNER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag\n" +
|
||||||
|
"where gtb_anag.cod_anag = %s",
|
||||||
|
codAnag
|
||||||
|
);
|
||||||
|
|
||||||
|
response.setAnagClie(UtilityDB.executeSimpleQueryOnlyFirstRowDTO(conn, sql, AnagClieDTO.class));
|
||||||
|
response.setVtbCliePersRif(vtbCliePersRif);
|
||||||
|
} else if ("P".equals(createContact.getTipoAnag())) {
|
||||||
|
String sql = Query.format("SELECT * FROM ptb_pros WHERE cod_ppro = %s", codAnag);
|
||||||
|
|
||||||
|
response.setPtbPros(UtilityDB.executeSimpleQueryOnlyFirstRowDTO(conn, sql, PtbPros.class));
|
||||||
|
response.setPtbProsRifs(ptbProsRifs);
|
||||||
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Rollback in caso di errore
|
// Rollback in caso di errore
|
||||||
multiDBTransactionManager.rollbackAll();
|
multiDBTransactionManager.rollbackAll();
|
||||||
@@ -443,8 +489,8 @@ public class CrmService {
|
|||||||
WdtbOrds wdtbOrds = new WdtbOrds()
|
WdtbOrds wdtbOrds = new WdtbOrds()
|
||||||
.setCodSpes(spese.getCodSpes())
|
.setCodSpes(spese.getCodSpes())
|
||||||
.setImporto(spese.getImporto())
|
.setImporto(spese.getImporto())
|
||||||
.setDescrizione(spese.getDescrizione())
|
.setDescrizione(spese.getDescrizione());
|
||||||
.setCodAliq(spese.getCodAliq());
|
//.setCodAliq(spese.getCodAliq());
|
||||||
wdtbOrds.setOperation(OperationType.INSERT);
|
wdtbOrds.setOperation(OperationType.INSERT);
|
||||||
|
|
||||||
wdtbOrdt.getWdtbOrds().add(wdtbOrds);
|
wdtbOrdt.getWdtbOrds().add(wdtbOrds);
|
||||||
@@ -462,7 +508,7 @@ public class CrmService {
|
|||||||
return response;
|
return response;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GtbAnag transferProspect(CRMTransferProspectRequestDTO request) throws Exception {
|
public CRMTransferProspectResponseDTO transferProspect(CRMTransferProspectRequestDTO request) throws Exception {
|
||||||
CRMTransferProspectResponseDTO transferProspectResponse =
|
CRMTransferProspectResponseDTO transferProspectResponse =
|
||||||
CRMUtility.prospectToClie(
|
CRMUtility.prospectToClie(
|
||||||
multiDBTransactionManager.getPrimaryConnection(), request.getCodAnag(), request.getCodPpro()
|
multiDBTransactionManager.getPrimaryConnection(), request.getCodAnag(), request.getCodPpro()
|
||||||
@@ -470,7 +516,46 @@ public class CrmService {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
entityProcessor.processEntityList(transferProspectResponse.getEntityToProcess(), multiDBTransactionManager, true);
|
entityProcessor.processEntityList(transferProspectResponse.getEntityToProcess(), multiDBTransactionManager, true);
|
||||||
return transferProspectResponse.getGtbAnag();
|
transferProspectResponse.setCodAnag(transferProspectResponse.getGtbAnag().getCodAnag());
|
||||||
|
|
||||||
|
String sql = Query.format(
|
||||||
|
"SELECT gtb_anag.cod_anag,\n" +
|
||||||
|
" vtb_clie.cod_vtip,\n" +
|
||||||
|
" vtb_clie.cod_vage,\n" +
|
||||||
|
" vtb_clie.flag_stato,\n" +
|
||||||
|
" rag_soc,\n" +
|
||||||
|
" indirizzo,\n" +
|
||||||
|
" cap,\n" +
|
||||||
|
" citta,\n" +
|
||||||
|
" prov,\n" +
|
||||||
|
" nazione,\n" +
|
||||||
|
" telefono,\n" +
|
||||||
|
" fax,\n" +
|
||||||
|
" part_iva,\n" +
|
||||||
|
" cod_fisc,\n" +
|
||||||
|
" gtb_anag.note,\n" +
|
||||||
|
" persona_rif,\n" +
|
||||||
|
" e_mail,\n" +
|
||||||
|
" nome,\n" +
|
||||||
|
" data_ins,\n" +
|
||||||
|
" num_cell,\n" +
|
||||||
|
" e_mail_pec,\n" +
|
||||||
|
" cognome,\n" +
|
||||||
|
" diacod,\n" +
|
||||||
|
" lat,\n" +
|
||||||
|
" lng,\n" +
|
||||||
|
" data_mod\n" +
|
||||||
|
"FROM gtb_anag\n" +
|
||||||
|
" INNER JOIN vtb_clie ON gtb_anag.cod_anag = vtb_clie.cod_anag\n" +
|
||||||
|
"WHERE gtb_anag.cod_anag = %s",
|
||||||
|
transferProspectResponse.getCodAnag()
|
||||||
|
);
|
||||||
|
|
||||||
|
transferProspectResponse.setAnagClie(UtilityDB.executeSimpleQueryOnlyFirstRowDTO(
|
||||||
|
multiDBTransactionManager.getPrimaryConnection(), sql, AnagClieDTO.class
|
||||||
|
));
|
||||||
|
|
||||||
|
return transferProspectResponse;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Rollback in caso di errore
|
// Rollback in caso di errore
|
||||||
multiDBTransactionManager.rollbackAll();
|
multiDBTransactionManager.rollbackAll();
|
||||||
|
|||||||
@@ -229,7 +229,8 @@ public class CRMUtility {
|
|||||||
.setEffectiveDate(activityRequest.getEffectiveTime())
|
.setEffectiveDate(activityRequest.getEffectiveTime())
|
||||||
.setEffectiveTime(activityRequest.getEffectiveTime())
|
.setEffectiveTime(activityRequest.getEffectiveTime())
|
||||||
.setEffectiveEnddate(activityRequest.getEffectiveEndtime())
|
.setEffectiveEnddate(activityRequest.getEffectiveEndtime())
|
||||||
.setEffectiveEndtime(activityRequest.getEffectiveEndtime());
|
.setEffectiveEndtime(activityRequest.getEffectiveEndtime())
|
||||||
|
.setIdPosizione(activityRequest.getStbPosizioni() != null ? activityRequest.getStbPosizioni().getId() : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <T> T buildEntityCustomer(String codAnag, CRMClienteDTO cliente, Class<T> clazz) {
|
public static <T> T buildEntityCustomer(String codAnag, CRMClienteDTO cliente, Class<T> clazz) {
|
||||||
|
|||||||
@@ -170,7 +170,7 @@ public class ImportApuliaPromoService {
|
|||||||
dataIniz);
|
dataIniz);
|
||||||
|
|
||||||
LocalDate dataFinePromo = UtilityLocalDate.localDateFromDate(UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql));
|
LocalDate dataFinePromo = UtilityLocalDate.localDateFromDate(UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql));
|
||||||
if (dataFinePromo != null && dataFinePromo.equals(dataFine)) {
|
if (dataFinePromo != null && !dataFinePromo.equals(dataFine)) {
|
||||||
dataIniz = dataFinePromo;
|
dataIniz = dataFinePromo;
|
||||||
dataIniz = dataIniz.plusDays(1);
|
dataIniz = dataIniz.plusDays(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -860,6 +860,9 @@ public class VariazioniPvService {
|
|||||||
" FROM mtb_aart\n" +
|
" FROM mtb_aart\n" +
|
||||||
" UNION ALL\n" +
|
" UNION ALL\n" +
|
||||||
" SELECT cod_mart, cod_comp\n" +
|
" SELECT cod_mart, cod_comp\n" +
|
||||||
|
" FROM mtb_comp\n" +
|
||||||
|
" UNION ALL\n" +
|
||||||
|
" SELECT cod_comp, cod_mart\n" +
|
||||||
" FROM mtb_comp) kit ON mtb_aart.cod_mart = kit.cod_mart\n" +
|
" FROM mtb_comp) kit ON mtb_aart.cod_mart = kit.cod_mart\n" +
|
||||||
" INNER JOIN mtb_depo ON doc.cod_mdep = mtb_depo.cod_mdep\n" +
|
" INNER JOIN mtb_depo ON doc.cod_mdep = mtb_depo.cod_mdep\n" +
|
||||||
"WHERE CAST(doc.data_ins AS DATE) = DATEADD(DD, -1, '[DATA_VALIDITA]')\n" +
|
"WHERE CAST(doc.data_ins AS DATE) = DATEADD(DD, -1, '[DATA_VALIDITA]')\n" +
|
||||||
|
|||||||
@@ -70,22 +70,22 @@ public class GiacenzaService {
|
|||||||
|
|
||||||
String sql =
|
String sql =
|
||||||
(
|
(
|
||||||
"SELECT mtb_depo.cod_mdep,\n" +
|
"SELECT mtb_depo.cod_mdep,\n" +
|
||||||
" CAST(IIF(stb_gest_setup_depo.value IS NOT NULL AND stb_gest_setup_depo.value = 'S', 1, 0) AS BIT) AS flag_attivo\n" +
|
" CAST(IIF(stb_gest_setup_depo.value IS NOT NULL AND stb_gest_setup_depo.value = 'S', 1, 0) AS BIT) AS flag_attivo\n" +
|
||||||
"FROM mtb_depo\n" +
|
"FROM mtb_depo\n" +
|
||||||
" LEFT OUTER JOIN stb_gest_setup_depo\n" +
|
" LEFT OUTER JOIN stb_gest_setup_depo\n" +
|
||||||
" ON stb_gest_setup_depo.cod_mdep = mtb_depo.cod_mdep \n" +
|
" ON stb_gest_setup_depo.cod_mdep = mtb_depo.cod_mdep \n" +
|
||||||
" AND gest_name = '[GEST_NAME]'\n" +
|
" AND gest_name = '[GEST_NAME]'\n" +
|
||||||
" AND section = '[SECTION]'\n" +
|
" AND section = '[SECTION]'\n" +
|
||||||
" AND key_section = 'ATTIVO'\n" +
|
" AND key_section = 'ATTIVO'\n" +
|
||||||
"WHERE mtb_depo.flag_movimentabile = 'S'\n" +
|
"WHERE mtb_depo.flag_movimentabile = 'S'\n" +
|
||||||
" AND mtb_depo.cod_vlis IS NOT NULL\n" +
|
" AND mtb_depo.cod_vlis IS NOT NULL\n" +
|
||||||
" AND NOT EXISTS(SELECT *\n" +
|
" AND NOT EXISTS(SELECT *\n" +
|
||||||
" FROM stb_gest_setup_depo\n" +
|
" FROM stb_gest_setup_depo\n" +
|
||||||
" WHERE gest_name = '[GEST_NAME]'\n" +
|
" WHERE gest_name = '[GEST_NAME]'\n" +
|
||||||
" AND section = '[SECTION]'\n" +
|
" AND section = '[SECTION]'\n" +
|
||||||
" AND key_section = 'REPLACE_DEPO'\n" +
|
" AND key_section = 'REPLACE_DEPO'\n" +
|
||||||
" AND stb_gest_setup_depo.cod_mdep = mtb_depo.cod_mdep)")
|
" AND stb_gest_setup_depo.cod_mdep = mtb_depo.cod_mdep)")
|
||||||
.replace("[GEST_NAME]", gestName)
|
.replace("[GEST_NAME]", gestName)
|
||||||
.replace("[SECTION]", section);
|
.replace("[SECTION]", section);
|
||||||
|
|
||||||
@@ -140,10 +140,10 @@ public class GiacenzaService {
|
|||||||
elencoDepositi.add(codMdep);
|
elencoDepositi.add(codMdep);
|
||||||
|
|
||||||
String sql = Query.format(
|
String sql = Query.format(
|
||||||
"SELECT cod_mdep\n" +
|
"SELECT cod_mdep\n" +
|
||||||
"FROM stb_gest_setup_depo \n" +
|
"FROM stb_gest_setup_depo \n" +
|
||||||
"WHERE gest_name = 'DATI_AZIENDA' and section = 'GIACENZA_DA_INV' and key_section = 'REPLACE_DEPO' and value = %s\n",
|
"WHERE gest_name = 'DATI_AZIENDA' and section = 'GIACENZA_DA_INV' and key_section = 'REPLACE_DEPO' and value = %s\n",
|
||||||
codMdep);
|
codMdep);
|
||||||
|
|
||||||
elencoDepositi.addAll(UtilityDB.executeSimpleQueryOnlyFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql));
|
elencoDepositi.addAll(UtilityDB.executeSimpleQueryOnlyFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql));
|
||||||
return elencoDepositi;
|
return elencoDepositi;
|
||||||
@@ -190,7 +190,7 @@ public class GiacenzaService {
|
|||||||
" INNER JOIN (" + queryArt + ") a ON g.cod_mart = a.cod_mart\n" +
|
" INNER JOIN (" + queryArt + ") a ON g.cod_mart = a.cod_mart\n" +
|
||||||
" INNER JOIN mtb_aart ON a.cod_mart_mov = mtb_aart.cod_mart\n" +
|
" INNER JOIN mtb_aart ON a.cod_mart_mov = mtb_aart.cod_mart\n" +
|
||||||
"WHERE g.tipo_variazione <> 'D'\n" +
|
"WHERE g.tipo_variazione <> 'D'\n" +
|
||||||
" AND g.cod_mdep IN ([elencoDepositi]) "+
|
" AND g.cod_mdep IN ([elencoDepositi]) " +
|
||||||
" AND NOT EXISTS\n" +
|
" AND NOT EXISTS\n" +
|
||||||
" (SELECT cod_mart\n" +
|
" (SELECT cod_mart\n" +
|
||||||
" FROM carelli_giacenza_prog\n" +
|
" FROM carelli_giacenza_prog\n" +
|
||||||
@@ -282,7 +282,7 @@ public class GiacenzaService {
|
|||||||
"GROUP BY movimenti.cod_mdep, art.cod_mart_mov,\n" +
|
"GROUP BY movimenti.cod_mdep, art.cod_mart_mov,\n" +
|
||||||
" giac.qta_iniz\n")
|
" giac.qta_iniz\n")
|
||||||
.replace("[COD_MDEP]", codMdep)
|
.replace("[COD_MDEP]", codMdep)
|
||||||
.replace("[ELENCO_DEPOSITI]", UtilityDB.listValueToString(elencoDepositi) );
|
.replace("[ELENCO_DEPOSITI]", UtilityDB.listValueToString(elencoDepositi));
|
||||||
|
|
||||||
List<CarelliGiacenzaProg> carelliGiacenzaProgs = new ResultSetMapper().mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, CarelliGiacenzaProg.class);
|
List<CarelliGiacenzaProg> carelliGiacenzaProgs = new ResultSetMapper().mapQuerySetToList(multiDBTransactionManager.getPrimaryConnection(), sql, CarelliGiacenzaProg.class);
|
||||||
|
|
||||||
@@ -730,117 +730,72 @@ public class GiacenzaService {
|
|||||||
if (!UtilityString.isNullOrEmpty(listiniAcquisto)) {
|
if (!UtilityString.isNullOrEmpty(listiniAcquisto)) {
|
||||||
listini = Arrays.asList(listiniAcquisto.split("\\|"));
|
listini = Arrays.asList(listiniAcquisto.split("\\|"));
|
||||||
}
|
}
|
||||||
if (readOrdini ) {
|
if (readOrdini) {
|
||||||
|
sql =
|
||||||
sql = "WITH incoming_stock_documenti AS (\n" +
|
"WITH ordine AS (SELECT dtb_ordt.cod_mdep,\n" +
|
||||||
"/*\n" +
|
" dtb_ordr.cod_mart,\n" +
|
||||||
"Estrazione dei documenti (bolle web) di merce consegnata\n" +
|
" dtb_ordr.qta_ord,\n" +
|
||||||
"*/\n" +
|
" dtb_ordr.data_cons\n" +
|
||||||
"\n" +
|
" FROM dtb_ordt\n" +
|
||||||
" SELECT wdtb_doct.cod_mdep,\n" +
|
" INNER JOIN dtb_ordr ON dtb_ordt.gestione = dtb_ordr.gestione\n" +
|
||||||
" wdtb_docr.cod_mart,\n" +
|
" AND dtb_ordt.data_ord = dtb_ordr.data_ord\n" +
|
||||||
" wdtb_docr.data_ord,\n" +
|
" AND dtb_ordt.num_ord = dtb_ordr.num_ord\n" +
|
||||||
" wdtb_docr.num_ord,\n" +
|
" WHERE dtb_ordt.gestione = 'A'\n" +
|
||||||
" riga_ord,\n" +
|
" AND dtb_ordt.flag_annulla = 'N'\n" +
|
||||||
" wdtb_doct.cod_anag,\n" +
|
" AND dtb_ordt.flag_sospeso = 'N'\n" +
|
||||||
" wdtb_docr.qta_doc * wdtb_docr.rap_conv AS qta_doc,\n" +
|
" AND dtb_ordt.cod_mdep = " + UtilityDB.valueToString(codMdep) + "\n" +
|
||||||
" wdtb_doct.flag_elaborato\n" +
|
(listini != null && !listini.isEmpty() ? " AND dtb_ordt.listino IN (" + UtilityDB.listValueToString(listini) + ")\n" : "") +
|
||||||
" FROM wdtb_doct\n" +
|
" AND dtb_ordr.cod_mart IS NOT NULL\n" +
|
||||||
" INNER JOIN wdtb_docr\n" +
|
" AND (dtb_ordr.data_cons >= CAST(GETDATE() AS DATE) OR\n" +
|
||||||
" ON wdtb_doct.cod_anag = wdtb_docr.cod_anag AND wdtb_doct.cod_dtip = wdtb_docr.cod_dtip AND\n" +
|
" (\n" +
|
||||||
" wdtb_doct.data_doc = wdtb_docr.data_doc AND wdtb_doct.ser_doc = wdtb_docr.ser_doc AND\n" +
|
" dtb_ordr.data_cons = dtb_ordr.data_ord\n" +
|
||||||
" wdtb_doct.num_doc = wdtb_docr.num_doc\n" +
|
" AND dtb_ordr.flag_evaso = 'I'\n" +
|
||||||
" WHERE wdtb_doct.data_ins >= dateadd(DAY, - 21, CAST(getdate() AS DATE))\n" +
|
" AND dtb_ordr.data_ord >= DATEADD(DAY, - 3, CAST(GETDATE() AS DATE))\n" +
|
||||||
" AND wdtb_doct.cod_mdep = " + UtilityDB.valueToString(codMdep) + ")\n" +
|
" )\n" +
|
||||||
" , incoming_stock_ordini AS (\n" +
|
" )\n" +
|
||||||
"/*\n" +
|
" AND NOT EXISTS (SELECT *\n" +
|
||||||
"Estrazione degli ordini d'acquisto in consegna\n" +
|
" FROM wdtb_doct\n" +
|
||||||
"*/\n" +
|
" INNER JOIN wdtb_docr ON wdtb_doct.cod_dtip = wdtb_docr.cod_dtip\n" +
|
||||||
" SELECT r.cod_mdep,\n" +
|
" AND wdtb_docr.cod_anag = wdtb_doct.cod_anag\n" +
|
||||||
" r.cod_mart,\n" +
|
" AND wdtb_docr.data_doc = wdtb_doct.data_doc\n" +
|
||||||
" CASE\n" +
|
" AND wdtb_docr.ser_doc = wdtb_doct.ser_doc\n" +
|
||||||
" WHEN r.data_cons = r.data_ord\n" +
|
" AND wdtb_docr.num_doc = wdtb_doct.num_doc\n" +
|
||||||
" THEN CAST(getdate() AS DATE)\n" +
|
" WHERE wdtb_docr.data_ord = dtb_ordr.data_ord\n" +
|
||||||
" ELSE r.data_cons\n" +
|
" AND wdtb_docr.num_ord = dtb_ordr.num_ord))\n" +
|
||||||
" END AS data_cons,\n" +
|
"\n" +
|
||||||
" r.qta_ord,\n" +
|
" , doc AS (SELECT wdtb_doct.cod_mdep,\n" +
|
||||||
" r.data_ord,\n" +
|
" wdtb_docr.cod_mart,\n" +
|
||||||
" r.riga_ord,\n" +
|
" wdtb_docr.qta_doc\n" +
|
||||||
" r.num_ord,\n" +
|
" FROM wdtb_doct\n" +
|
||||||
" cod_anag\n" +
|
" INNER JOIN wdtb_docr ON wdtb_doct.cod_dtip = wdtb_docr.cod_dtip\n" +
|
||||||
" FROM dtb_ordt t\n" +
|
" AND wdtb_docr.cod_anag = wdtb_doct.cod_anag\n" +
|
||||||
" INNER JOIN dtb_ordr r\n" +
|
" AND wdtb_docr.data_doc = wdtb_doct.data_doc\n" +
|
||||||
" ON t.gestione = r.gestione\n" +
|
" AND wdtb_docr.ser_doc = wdtb_doct.ser_doc\n" +
|
||||||
" AND t.data_ord = r.data_ord\n" +
|
" AND wdtb_docr.num_doc = wdtb_doct.num_doc\n" +
|
||||||
" AND t.num_ord = r.num_ord\n" +
|
" AND wdtb_docr.cod_mart IS NOT NULL\n" +
|
||||||
" WHERE\n" +
|
(listini != null && !listini.isEmpty() ? " AND wdtb_doct.listino IN (" + UtilityDB.listValueToString(listini) + ")\n" : "") +
|
||||||
" -- ordini acquisto\n" +
|
" WHERE wdtb_doct.cod_mdep = " + UtilityDB.valueToString(codMdep) + "\n" +
|
||||||
" t.gestione = 'A'\n" +
|
" AND wdtb_doct.flag_elaborato = 'I')\n" +
|
||||||
" -- ordini non annullati\n" +
|
"\n" +
|
||||||
" AND t.flag_annulla = 'N'\n" +
|
"SELECT ISNULL(doc.cod_mdep, ordine.cod_mdep) AS cod_mdep,\n" +
|
||||||
" -- ordii non sospesi\n" +
|
" ISNULL(doc.cod_mart, ordine.cod_mart) AS cod_mart,\n" +
|
||||||
" AND t.flag_sospeso = 'N'\n" +
|
" ISNULL(doc.qta_doc, 0) + ISNULL(ordine.qta_ord, 0) AS merce_in_arrivo\n" +
|
||||||
" AND (\n" +
|
"FROM doc\n" +
|
||||||
" -- ordini futuri\n" +
|
" FULL OUTER JOIN ordine ON doc.cod_mart = ordine.cod_mart\n" +
|
||||||
" (r.data_cons >= CAST(getdate() AS DATE))\n" +
|
" AND doc.cod_mdep = ordine.cod_mdep\n" +
|
||||||
" OR\n" +
|
" AND doc.cod_mdep = ordine.cod_mdep";
|
||||||
" -- ordini fuori piano logistico (r.data_cons = r.data_ord), inevasi e fatti negli ultimi 3 giorni\n" +
|
|
||||||
" (\n" +
|
|
||||||
" r.data_cons = r.data_ord\n" +
|
|
||||||
" AND flag_evaso = 'I'\n" +
|
|
||||||
" AND r.data_ord >= dateadd(DAY, - 3, CAST(getdate() AS DATE))\n" +
|
|
||||||
" )\n" +
|
|
||||||
" )\n" +
|
|
||||||
" -- prendiamo i soli ordini del SECCO, sarà da modificare quando inizieranno ad ordinare anche altri (es. APULD)\n" +
|
|
||||||
( listini != null && !listini.isEmpty() ?" AND t.listino IN (" + UtilityDB.listValueToString(listini) + ")\n":"") +
|
|
||||||
" -- ordine non ancora evaso\n" +
|
|
||||||
" AND flag_evaso <> 'E'\n" +
|
|
||||||
" -- filtro solamente un Pdv\n" +
|
|
||||||
" AND r.cod_mdep = " + UtilityDB.valueToString(codMdep) + ")\n" +
|
|
||||||
" , incoming_stock_doc_consegnati AS (\n" +
|
|
||||||
"/*\n" +
|
|
||||||
"Estrazione dei documenti consegnati\n" +
|
|
||||||
"*/\n" +
|
|
||||||
" SELECT DISTINCT wdtb_docr.num_ord, wdtb_docr.data_ord, wdtb_doct.cod_anag\n" +
|
|
||||||
" FROM wdtb_doct\n" +
|
|
||||||
" INNER JOIN wdtb_docr\n" +
|
|
||||||
" ON wdtb_doct.cod_anag = wdtb_docr.cod_anag AND wdtb_doct.cod_dtip = wdtb_docr.cod_dtip AND\n" +
|
|
||||||
" wdtb_doct.data_doc = wdtb_docr.data_doc AND wdtb_doct.ser_doc = wdtb_docr.ser_doc AND\n" +
|
|
||||||
" wdtb_doct.num_doc = wdtb_docr.num_doc\n" +
|
|
||||||
" WHERE wdtb_doct.data_ins >= dateadd(DAY, - 7, CAST(getdate() AS DATE))\n" +
|
|
||||||
" AND wdtb_doct.flag_elaborato = 'N')\n" +
|
|
||||||
"\n" +
|
|
||||||
"-- Step 4) Unione delle estrazioni precedenti [MySQL]\n" +
|
|
||||||
"\n" +
|
|
||||||
"SELECT ISNULL(d.cod_mdep, o.cod_mdep) AS store_code,\n" +
|
|
||||||
" ISNULL(d.cod_mart, o.cod_mart) AS art_code,\n" +
|
|
||||||
" data_cons,\n" +
|
|
||||||
" SUM(ISNULL(qta_doc, qta_ord)) AS incoming_stock\n" +
|
|
||||||
"FROM incoming_stock_ordini o\n" +
|
|
||||||
" FULL OUTER JOIN incoming_stock_documenti d\n" +
|
|
||||||
" ON o.cod_mdep = d.cod_mdep AND o.cod_mart = d.cod_mart AND o.data_ord = d.data_ord AND\n" +
|
|
||||||
" o.num_ord = d.num_ord AND o.cod_anag = d.cod_anag AND o.riga_ord = d.riga_ord\n" +
|
|
||||||
" LEFT JOIN incoming_stock_doc_consegnati k\n" +
|
|
||||||
" ON o.num_ord = k.num_ord AND o.cod_anag = k.cod_anag AND o.data_ord = k.data_ord\n" +
|
|
||||||
"WHERE (flag_elaborato = 'I' OR flag_elaborato IS NULL)\n" +
|
|
||||||
" AND ((d.cod_mart IS NOT NULL) OR (d.cod_mart IS NULL AND k.num_ord IS NULL))\n" +
|
|
||||||
"GROUP BY ISNULL(d.cod_mdep, o.cod_mdep), ISNULL(d.cod_mart, o.cod_mart), data_cons, k.num_ord\n";
|
|
||||||
|
|
||||||
List<HashMap<String, Object>> merceInArrivo = UtilityDB.executeSimpleQuery(multiDBTransactionManager.getPrimaryConnection(), sql);
|
List<HashMap<String, Object>> merceInArrivo = UtilityDB.executeSimpleQuery(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||||
|
|
||||||
if (listGiacenza != null) {
|
if (listGiacenza != null) {
|
||||||
|
|
||||||
merceInArrivo
|
merceInArrivo
|
||||||
.forEach(merce -> {
|
.forEach(merce -> {
|
||||||
String storeCode = (String) merce.get("store_code");
|
|
||||||
String artCode = (String) merce.get("art_code");
|
|
||||||
BigDecimal incomingStock = (BigDecimal) merce.get("incoming_stock");
|
|
||||||
|
|
||||||
listGiacenza.stream()
|
listGiacenza.stream()
|
||||||
.filter(x -> x.getCodMart().equals(artCode) && x.getCodMdep().equals(storeCode))
|
.filter(x -> x.getCodMart().equalsIgnoreCase((String) merce.get("cod_mart")) &&
|
||||||
|
x.getCodMdep().equalsIgnoreCase((String) merce.get("cod_mdep")))
|
||||||
.findFirst()
|
.findFirst()
|
||||||
.ifPresent(x -> {
|
.ifPresent(x -> {
|
||||||
x.setIncomingStock(incomingStock);
|
x.setIncomingStock((BigDecimal) merce.get("merce_in_arrivo"));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -853,10 +808,10 @@ public class GiacenzaService {
|
|||||||
LocalDate dataGiac = UtilityLocalDate.getNow();
|
LocalDate dataGiac = UtilityLocalDate.getNow();
|
||||||
String sql =
|
String sql =
|
||||||
Query.format(
|
Query.format(
|
||||||
"SELECT DISTINCT cod_mdep\n" +
|
"SELECT DISTINCT cod_mdep\n" +
|
||||||
"FROM carelli_giacenza_prog \n" +
|
"FROM carelli_giacenza_prog \n" +
|
||||||
"WHERE not exists (select * from carelli_giacenza_prog_gg where carelli_giacenza_prog_gg.cod_mdep = carelli_giacenza_prog.cod_mdep and data_giac = %S)",
|
"WHERE not exists (select * from carelli_giacenza_prog_gg where carelli_giacenza_prog_gg.cod_mdep = carelli_giacenza_prog.cod_mdep and data_giac = %S)",
|
||||||
dataGiac);
|
dataGiac);
|
||||||
|
|
||||||
List<String> codMdepList = UtilityDB.executeSimpleQueryOnlyFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
List<String> codMdepList = UtilityDB.executeSimpleQueryOnlyFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||||
|
|
||||||
@@ -879,7 +834,7 @@ public class GiacenzaService {
|
|||||||
UtilityEntity.throwEntitiesException(entityProcessor.processEntityList(ggArchivio, true));
|
UtilityEntity.throwEntitiesException(entityProcessor.processEntityList(ggArchivio, true));
|
||||||
multiDBTransactionManager.commitAll();
|
multiDBTransactionManager.commitAll();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(GiacenzaService.class + " Errore nell'aggiornamento della giacenza del deposito " +codMdep + " " + e.getMessage(), e);
|
logger.error(GiacenzaService.class + " Errore nell'aggiornamento della giacenza del deposito " + codMdep + " " + e.getMessage(), e);
|
||||||
multiDBTransactionManager.rollbackAll();
|
multiDBTransactionManager.rollbackAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import it.integry.ems.report.dto.JasperDTO;
|
|||||||
import it.integry.ems.report.dto.PairsDTO;
|
import it.integry.ems.report.dto.PairsDTO;
|
||||||
import it.integry.ems.response.*;
|
import it.integry.ems.response.*;
|
||||||
import it.integry.ems.retail.ReportVariazioni.dto.VariazioniDettaglioDTO;
|
import it.integry.ems.retail.ReportVariazioni.dto.VariazioniDettaglioDTO;
|
||||||
|
import it.integry.ems.rules.completing.ConfigActivityRules;
|
||||||
import it.integry.ems.service.EntityProcessor;
|
import it.integry.ems.service.EntityProcessor;
|
||||||
import it.integry.ems.service.MailService;
|
import it.integry.ems.service.MailService;
|
||||||
import it.integry.ems.service.PrinterService;
|
import it.integry.ems.service.PrinterService;
|
||||||
@@ -748,8 +749,12 @@ public class SystemController {
|
|||||||
stbActivity.setOperation(OperationType.INSERT);
|
stbActivity.setOperation(OperationType.INSERT);
|
||||||
|
|
||||||
if (activity.getActivityTypeId().equalsIgnoreCase("TICKET")) {
|
if (activity.getActivityTypeId().equalsIgnoreCase("TICKET")) {
|
||||||
stbActivity.setEstimatedTime(new Date())
|
Date dataAttivita = new Date();
|
||||||
.setEstimatedEndtime(UtilityDate.RelativeDateTime(new Date(), 14));
|
if (ConfigActivityRules.checkAttivita(multiDBTransactionManager.getPrimaryConnection(), stbActivity.getCodJcom(), dataAttivita)) {
|
||||||
|
dataAttivita = UtilityDate.dateFromPart(UtilityDate.getYear(dataAttivita), UtilityDate.datePart(Calendar.MONTH, dataAttivita) + 1, 1);
|
||||||
|
}
|
||||||
|
stbActivity.setEstimatedTime(dataAttivita)
|
||||||
|
.setEstimatedEndtime(UtilityDate.RelativeDateTime(dataAttivita, 14));
|
||||||
|
|
||||||
if (!activity.getUserName().equalsIgnoreCase("DEV") &&
|
if (!activity.getUserName().equalsIgnoreCase("DEV") &&
|
||||||
!activity.getUserName().equalsIgnoreCase("T0001") &&
|
!activity.getUserName().equalsIgnoreCase("T0001") &&
|
||||||
@@ -760,7 +765,7 @@ public class SystemController {
|
|||||||
.setCodJcom(activity.getCodJcom())
|
.setCodJcom(activity.getCodJcom())
|
||||||
.setUserCreator(activity.getUserCreator())
|
.setUserCreator(activity.getUserCreator())
|
||||||
.setUserName(activity.getUserName())
|
.setUserName(activity.getUserName())
|
||||||
.setEstimatedTime(new Date())
|
.setEstimatedTime(dataAttivita)
|
||||||
.setActivityResultId("DA FARE")
|
.setActivityResultId("DA FARE")
|
||||||
.setFlagTipologia("A")
|
.setFlagTipologia("A")
|
||||||
.setActivityTypeId("HELP DESK");
|
.setActivityTypeId("HELP DESK");
|
||||||
|
|||||||
Reference in New Issue
Block a user