Merge branch 'develop' into feature/SpostaUl
This commit is contained in:
@@ -117,6 +117,10 @@ public class RequestDataDTO {
|
||||
}
|
||||
|
||||
public boolean isValidPassword() {
|
||||
Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
|
||||
if (authentication != null && !(authentication instanceof AnonymousAuthenticationToken))
|
||||
return true;
|
||||
|
||||
return !UtilityString.isNullOrEmpty(password);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
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_20250218102304 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
if (isCustomer(IntegryCustomer.RossoGargano)) {
|
||||
|
||||
updateSetupValue("w_mgiac_part_disp", "DATAWINDOW", "D_MGIAC_PART_DEP_REP", "d_mgiac_part_dep_rossogargano_rep");
|
||||
updateSetupValue("w_mgiac_part_disp", "DATAWINDOW", "D_MGIAC_PART_REP", "d_mgiac_part_rossogargano_rep");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@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_20250218120808 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("ALTER TABLE atb_forn ADD cod_dtip_sped VARCHAR(5)",
|
||||
"ALTER TABLE atb_forn ADD CONSTRAINT [FK_atb_forn_dtb_tipi] FOREIGN KEY (cod_dtip_sped) REFERENCES dtb_tipi(cod_dtip)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.IntegryCustomerDB;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250219103752 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetup("EXPORT_DOCUMENTI", "INTESA", "SET_FLAG_ERRORE", "N",
|
||||
"Imposta flag errore in DtbDocuLog", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
|
||||
if (isCustomerDb(IntegryCustomerDB.Salpar_VgAlimenti)){
|
||||
updateSetupValue("EXPORT_DOCUMENTI", "INTESA", "SET_FLAG_ERRORE", "S");
|
||||
}
|
||||
}
|
||||
|
||||
@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_20250219120547 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("UPDATE stb_gest_setup SET description = 'Nel raggruppare gli articoli presenti nei colli ignora tipo pedana e colli per pedana del collo e li prende dall''ordine'" +
|
||||
" WHERE gest_name = 'w_ddocu_rc' AND section = 'LOAD_COLLI' AND key_section = 'IGNORA_TIPO_PEDANA'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250220144413 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetup("PVM", "MRP", "ASSEGNA_BUDGET", "S",
|
||||
"Se impostata a S considera la colonna budget nel calcolo della disponibilità", false, "SI_NO", false, true,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
}
|
||||
|
||||
@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_20250221090218 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
executeStatement(
|
||||
"alter table ctb_ireg add flag_extracee varchar(1) not null default 'N'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
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_20250221104043 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
createSetupQuery("SI_NO", "SI_NO", "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetup("SEPA", "BONIFICI", "CREATE_READ_ONLY_FILE", "N",
|
||||
"Crea il file sepa in sola lettura", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
createSetup("SEPA", "SDD", "CREATE_READ_ONLY_FILE", "N",
|
||||
"Crea il file sepa in sola lettura", false, "SI_NO", false, false,
|
||||
false, false, false, null, false, "SELECT 'S' UNION ALL SELECT 'N'");
|
||||
|
||||
|
||||
if (isCustomer(IntegryCustomer.Carelli))
|
||||
updateSetupValue("SEPA", "BONIFICI", "CREATE_READ_ONLY_FILE", "S");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package it.integry.ems.migration.model;
|
||||
|
||||
import it.integry.ems.migration._base.BaseMigration;
|
||||
import it.integry.ems.migration._base.MigrationModelInterface;
|
||||
|
||||
public class Migration_20250221131613 extends BaseMigration implements MigrationModelInterface {
|
||||
|
||||
@Override
|
||||
public void up() throws Exception {
|
||||
if (isHistoryDB())
|
||||
return;
|
||||
|
||||
executeStatement("UPDATE stb_gest_setup\n" +
|
||||
"SET tipo_setup = 'mtb_grup', key_section = 'INCLUDI_BUDGET', flag_setup_depo = 'N'\n" +
|
||||
"WHERE gest_name = 'PVM'\n" +
|
||||
" AND section = 'MRP'\n" +
|
||||
" AND key_section = 'ASSEGNA_BUDGET'");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void down() throws Exception {
|
||||
}
|
||||
}
|
||||
@@ -611,13 +611,8 @@ public class LoadColliService {
|
||||
" SUM(mvw_colr_sum.num_cnf) AS 'num_cnf',\n" +
|
||||
" SUM(mvw_colr_sum.peso_netto_kg_riga) AS 'peso_netto',\n" +
|
||||
" SUM(mvw_colr_sum.peso_lordo_kg_riga) AS 'peso_lordo',\n" +
|
||||
(ignoreTipoPedana?
|
||||
" sum(CONVERT(NUMERIC(20, 5), CASE WHEN [gestione] = 'L' THEN NULL ELSE mvw_colr_sum.colli_pedana END))/count(*) AS 'colli_pedana',\n" +
|
||||
" null AS 'cod_tcol',\n"
|
||||
:
|
||||
" CONVERT(NUMERIC(20, 5), CASE WHEN [gestione] = 'L' THEN NULL ELSE mvw_colr_sum.colli_pedana END) AS 'colli_pedana',\n" +
|
||||
" mvw_colr_sum.cod_tcol AS 'cod_tcol',\n"
|
||||
) +
|
||||
" CONVERT(NUMERIC(20, 5), CASE WHEN [gestione] = 'L' THEN NULL ELSE " + (ignoreTipoPedana?"dtb_ordr.colli_pedana":"mvw_colr_sum.colli_pedana") + " END) AS 'colli_pedana',\n" +
|
||||
" " + (ignoreTipoPedana?"dtb_ordr.cod_tcol_UL":"mvw_colr_sum.cod_tcol") + " AS 'cod_tcol',\n" +
|
||||
" mvw_colr_sum.cod_dtip_comp AS 'cod_dtip_comp',\n" +
|
||||
" mvw_colr_sum.data_doc_comp AS 'data_doc_comp',\n" +
|
||||
" mvw_colr_sum.ser_doc_comp AS 'ser_doc_comp',\n" +
|
||||
@@ -655,9 +650,8 @@ public class LoadColliService {
|
||||
" mtb_aart.flag_stato, dtb_ordr.cod_art_for, mvw_kit.flag_kit, dtb_ordr.cod_jcom,\n" +
|
||||
" ISNULL(dtb_ordr.unt_ord2, mtb_aart.unt_mis2), ISNULL(dtb_ordr.unt_ord3, mtb_aart.unt_mis3), mtb_aart.tara_kg,\n" +
|
||||
" dtb_ordr.cod_kit, dtb_ordr.cod_alis, dtb_ordr.note,\n" +
|
||||
(ignoreTipoPedana?"":
|
||||
" CASE WHEN [gestione] = 'L' THEN NULL ELSE mvw_colr_sum.colli_pedana END, mvw_colr_sum.cod_tcol,\n"
|
||||
) +
|
||||
" CONVERT(NUMERIC(20, 5), CASE WHEN [gestione] = 'L' THEN NULL ELSE " + (ignoreTipoPedana?"dtb_ordr.colli_pedana":"mvw_colr_sum.colli_pedana") + " END),\n" +
|
||||
" " + (ignoreTipoPedana?"dtb_ordr.cod_tcol_UL":"mvw_colr_sum.cod_tcol") + ",\n" +
|
||||
" mtb_aart.flag_qta_cnf_fissa, dtb_ordr.cod_mart, mvw_colr_sum.cod_dtip_comp, mvw_colr_sum.data_doc_comp,\n" +
|
||||
" mvw_colr_sum.ser_doc_comp, mvw_colr_sum.num_doc_comp, mvw_colr_sum.id_riga_doc_comp, dtb_ordr.id_contratto,\n" +
|
||||
" dtb_ordr.riga_ord, mvw_colr_sum.cod_jcom\n" +
|
||||
|
||||
@@ -1026,15 +1026,14 @@ public class AccountingRules extends QueryRules {
|
||||
if ( ctbMovi.getParent() instanceof CtbMovt) {
|
||||
String sql =
|
||||
Query.format(
|
||||
"SELECT CAST(IIF((SELECT segno_liquid FROM ctb_ireg WHERE cod_ireg = %s) = -1 AND flag_iva_acq_merci = 'S', 1, 0) AS BIT)\n" +
|
||||
"FROM gtb_aliq\n" +
|
||||
"SELECT CAST(IIF((registro.segno_liquid = -1 AND flag_iva_acq_merci = 'S') OR ( registro.segno_liquid = 1 AND flag_iva_da_ventilare = 'S'), 1, 0) AS BIT)\n" +
|
||||
"FROM gtb_aliq,\n" +
|
||||
" (SELECT segno_liquid FROM ctb_ireg WHERE cod_ireg = %s) registro \n" +
|
||||
"WHERE cod_aliq = %s",
|
||||
((CtbMovt) ctbMovi.getParent()).getCodIreg(),
|
||||
ctbMovi.getCodAliq());
|
||||
|
||||
ventilazione = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(connection, sql);
|
||||
|
||||
|
||||
} else {
|
||||
ventilazione = ctbMovi.getVentilazione()==null?false:ctbMovi.getVentilazione();
|
||||
}
|
||||
|
||||
@@ -112,6 +112,9 @@ public class AtbForn extends EntityBase implements EquatableEntityInterface<AtbF
|
||||
@SqlField(value = "flag_autofattura", maxLength = 1, defaultObjectValue = "N")
|
||||
private String flagAutofattura;
|
||||
|
||||
@SqlField(value = "cod_dtip_sped", maxLength = 5)
|
||||
private String codDtipSped;
|
||||
|
||||
@Priority(1)
|
||||
private GtbAnag gtbAnag;
|
||||
|
||||
@@ -424,6 +427,13 @@ public class AtbForn extends EntityBase implements EquatableEntityInterface<AtbF
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getCodDtipSped() { return codDtipSped; }
|
||||
|
||||
public AtbForn setCodDtipSped(String codDtipSped) {
|
||||
this.codDtipSped = codDtipSped;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCodeKey() {
|
||||
return Objects.hash(getCodAnag());
|
||||
|
||||
@@ -44,6 +44,9 @@ public class CtbIreg extends EntityBase {
|
||||
@SqlField(value = "flag_iva_da_ventilare", maxLength = 1, nullable = false, defaultObjectValue = "N")
|
||||
private String flagIvaDaVentilare;
|
||||
|
||||
@SqlField(value = "flag_extracee", maxLength = 1, nullable = false, defaultObjectValue = "N")
|
||||
private String flagExtracee;
|
||||
|
||||
@EntityChild
|
||||
private List<CtbInum> ctbInum = new ArrayList<>();
|
||||
|
||||
@@ -110,6 +113,14 @@ public class CtbIreg extends EntityBase {
|
||||
this.flagIvaDaVentilare = flagIvaDaVentilare;
|
||||
}
|
||||
|
||||
public String getFlagExtracee() {
|
||||
return flagExtracee;
|
||||
}
|
||||
|
||||
public void setFlagExtracee(String flagExtracee) {
|
||||
this.flagExtracee = flagExtracee;
|
||||
}
|
||||
|
||||
public List<CtbInum> getCtbInum() {
|
||||
return ctbInum;
|
||||
}
|
||||
|
||||
@@ -4,13 +4,11 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems_model.annotation.*;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.kie.api.definition.type.PropertyReactive;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Master
|
||||
@PropertyReactive
|
||||
@@ -104,10 +102,6 @@ public class StbAuthToken extends EntityBase {
|
||||
@Override
|
||||
public void delete() throws Exception {
|
||||
logger.debug("Cancello token " + "[Expiration: " + CommonConstants.DATETIME_YMD_DASHED_FORMATTER.format(getExpiryDate()) + " - " + "Refresh: " + getRefreshToken() + " - " + "Device ID: " + getDeviceId() + "]");
|
||||
StringWriter stringWriter = new StringWriter();
|
||||
PrintWriter stacktraceWriter = new PrintWriter(stringWriter);
|
||||
new Throwable().printStackTrace(stacktraceWriter);
|
||||
logger.debug("STACKTRACE: " + stringWriter);
|
||||
super.delete();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ public class SetupGest {
|
||||
//
|
||||
// return stbGestSetup.getValue();
|
||||
|
||||
String query = "SELECT value FROM stb_gest_setup"
|
||||
String query = "SELECT ISNULL(value, '') AS value FROM stb_gest_setup"
|
||||
+ " WHERE gest_name = " + UtilityDB.valueToString(gestName)
|
||||
+ " AND section = " + UtilityDB.valueToString(section)
|
||||
+ " AND key_section = " + UtilityDB.valueToString(keySection);
|
||||
|
||||
@@ -229,18 +229,20 @@ public class UtilityDate {
|
||||
.atZone(currentZone)
|
||||
.toInstant());
|
||||
}
|
||||
public static XMLGregorianCalendar convertDateToXMLGregorianCalendar(Date parsedDate, String format) throws Exception {
|
||||
GregorianCalendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(parsedDate);
|
||||
XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar);
|
||||
xmlGregorianCalendar.setTimezone(DatatypeConstants.FIELD_UNDEFINED);
|
||||
return xmlGregorianCalendar;
|
||||
}
|
||||
|
||||
public static XMLGregorianCalendar convertStringToXMLGregorianCalendar(String date, String format) throws Exception {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat(format);
|
||||
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
|
||||
Date parsedDate = sdf.parse(date);
|
||||
|
||||
GregorianCalendar calendar = new GregorianCalendar();
|
||||
calendar.setTime(parsedDate);
|
||||
|
||||
XMLGregorianCalendar xmlGregorianCalendar = DatatypeFactory.newInstance().newXMLGregorianCalendar(calendar);
|
||||
xmlGregorianCalendar.setTimezone(DatatypeConstants.FIELD_UNDEFINED);
|
||||
return xmlGregorianCalendar;
|
||||
return convertDateToXMLGregorianCalendar(parsedDate, format);
|
||||
}
|
||||
|
||||
public static int datePart(int datepart, @Nonnull Date date) {
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
package it.integry.security.jwt;
|
||||
|
||||
import io.jsonwebtoken.Claims;
|
||||
import io.jsonwebtoken.Jws;
|
||||
import io.jsonwebtoken.Jwts;
|
||||
import io.jsonwebtoken.SignatureAlgorithm;
|
||||
import io.jsonwebtoken.*;
|
||||
import it.integry.ems.json.ResponseJSONObjectMapper;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.security.cache.SecretKeyCacheComponent;
|
||||
@@ -103,11 +100,16 @@ public class AccessTokenProvider implements InitializingBean {
|
||||
|
||||
public boolean validateToken(String profileDb, String token) {
|
||||
String dbName = settingsModel.getDbNameFromProfileDb(profileDb);
|
||||
|
||||
try {
|
||||
final Jws<Claims> claimsJws = Jwts
|
||||
.parserBuilder()
|
||||
.setSigningKey(this.secretKeyCacheComponent.getKey(dbName))
|
||||
.build()
|
||||
.parseClaimsJws(token);
|
||||
} catch (MalformedJwtException mjex) {
|
||||
throw new RuntimeException("Token malformato: [" + token + "]", mjex);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ public class SteUPService {
|
||||
private HashMap<String, Object> authUserFromRequest(String md5User) throws Exception {
|
||||
String userName = requestDataDTO.getUsername();
|
||||
String password = requestDataDTO.getPassword();
|
||||
String profileDB = multiDBTransactionManager.getPrimaryDatasource().getProfile();
|
||||
String profileDB = requestDataDTO.getProfileDB();
|
||||
return systemService.login(userName, password, md5User, profileDB);
|
||||
}
|
||||
|
||||
|
||||
@@ -68,10 +68,12 @@ import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.service.MapService;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.config.EmsRestConstants;
|
||||
import it.integry.ems_model.entity.VtbDist;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.UtilityDB;
|
||||
import it.integry.ems_model.utility.UtilityDate;
|
||||
import it.integry.ems_model.utility.UtilityString;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
@@ -531,9 +533,11 @@ public class SEPAService {
|
||||
paymList.add(payment);
|
||||
}
|
||||
|
||||
GregorianCalendar dataValGreg = new GregorianCalendar();
|
||||
dataValGreg.setTime(rs.getDate("data_valuta"));
|
||||
XMLGregorianCalendar dataExec = DatatypeFactory.newInstance().newXMLGregorianCalendar(dataValGreg);
|
||||
XMLGregorianCalendar dataExec =UtilityDate.convertDateToXMLGregorianCalendar(rs.getDate("data_valuta"), CommonConstants.DATE_FORMAT_YMD);
|
||||
// GregorianCalendar dataValGreg = new GregorianCalendar();
|
||||
// dataValGreg.setTimeZone(TimeZone.getTimeZone("GMT"));
|
||||
// dataValGreg.setTime(rs.getDate("data_valuta"));
|
||||
// XMLGregorianCalendar dataExec = DatatypeFactory.newInstance().newXMLGregorianCalendar(dataValGreg);
|
||||
|
||||
it.integry.ems.contabil.sepa.dto.Bonifico_v00_04_01.CBIPaymentInstructionInformation pmtInf = new it.integry.ems.contabil.sepa.dto.Bonifico_v00_04_01.CBIPaymentInstructionInformation();
|
||||
DateAndDateTime2Choice dateAndDateTime2Choice = new DateAndDateTime2Choice();
|
||||
|
||||
@@ -34,7 +34,6 @@ import it.integry.ems.rules.businessLogic.dto.LoadColliDTO;
|
||||
import it.integry.ems.service.EmsServices;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.service.ReportProcessor;
|
||||
import it.integry.ems.service.dto.AttachmentDTO;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityEntity;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
@@ -301,7 +300,7 @@ public class DocumentController {
|
||||
dtbDocPdf.setSerDoc(dtbDoctRet.getSerDoc());
|
||||
dtbDocPdf.setCodDtip(dtbDoctRet.getCodDtip());
|
||||
dtbDocPdf.setCodAnag(dtbDoctRet.getCodAnag());
|
||||
dtbDocPdf.setUtente(request.getHeader("username"));
|
||||
dtbDocPdf.setUtente(requestDataDTO.getUsername());
|
||||
dtbDocPdf.setFilesize(new BigDecimal(bytes.length));
|
||||
dtbDocPdf.setFilecontent(Base64.encodeBase64String(bytes));
|
||||
|
||||
|
||||
@@ -134,6 +134,7 @@ public class DocumentiExporter extends BaseEntityExporter implements IEntityExpo
|
||||
public void postSend(EntityExportResponse entityExportResponse) throws Exception {
|
||||
|
||||
boolean insertLog = setupGest.getExportSetupBoolean(multiDBTransactionManager.getPrimaryConnection(), type, format, "INSERT_LOG");
|
||||
boolean flagErrore = setupGest.getExportSetupBoolean(multiDBTransactionManager.getPrimaryConnection(), type, format, "SET_FLAG_ERRORE");
|
||||
boolean aggiornaNumFile = setupGest.getExportSetupBoolean(multiDBTransactionManager.getPrimaryConnection(), type, format, "AGGIORNA_NUM_FILE");
|
||||
List<EntityBase> entityList = new ArrayList<>();
|
||||
if (insertLog && entityExportResponse != null && entityExportResponse.getExtraInfo() != null && entityExportResponse.getExtraInfo() instanceof List) {
|
||||
@@ -155,6 +156,7 @@ public class DocumentiExporter extends BaseEntityExporter implements IEntityExpo
|
||||
dtbDocuLog.setSerDoc(dtbDoct.getSerDoc());
|
||||
dtbDocuLog.setNumDoc(dtbDoct.getNumDoc());
|
||||
dtbDocuLog.setFlagType("E");
|
||||
dtbDocuLog.setFlagErrore(flagErrore);
|
||||
dtbDocuLog.setUserName(dtbDoct.getUsername());
|
||||
dtbDocuLog.setFormatFile(format);
|
||||
dtbDocuLog.setDocType(type);
|
||||
|
||||
@@ -7,12 +7,14 @@ import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems_model.entity.DtbDocPdf;
|
||||
import it.integry.ems_model.entity.DtbDoct;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
import it.integry.ems_model.types.OperationType;
|
||||
import it.integry.ems_model.utility.*;
|
||||
import org.apache.commons.codec.binary.Base64;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
import org.springframework.stereotype.Service;
|
||||
@@ -40,7 +42,7 @@ public class DocumentiIntesaExportService {
|
||||
EntityExportResponse<List<FileItem>> entityExportResponse = new EntityExportResponse<>();
|
||||
Connection conn = multiDBTransactionManager.getPrimaryConnection();
|
||||
|
||||
Date dataDoc = UtilityDate.StringToDate("20/01/2025", CommonConstants.DATE_FORMAT_DMY);
|
||||
Date dataDoc = UtilityDate.StringToDate("17/01/2025", CommonConstants.DATE_FORMAT_DMY);
|
||||
char charSeparator = ';';
|
||||
String fileName = "index";
|
||||
String ext = "csv";
|
||||
@@ -53,6 +55,12 @@ public class DocumentiIntesaExportService {
|
||||
String tipoDoc = setup.get("TIPO_DOC");
|
||||
|
||||
String sql = Query.format(
|
||||
"WITH RankedPDF AS (SELECT pdf.*,\n" +
|
||||
" ROW_NUMBER() OVER (\n" +
|
||||
" PARTITION BY pdf.data_doc, pdf.num_doc, pdf.ser_doc, pdf.cod_anag, pdf.cod_dtip\n" +
|
||||
" ORDER BY pdf.versione DESC) AS rn\n" +
|
||||
" FROM dtb_doc_pdf pdf\n" +
|
||||
" WHERE pdf.filename LIKE %s)\n" +
|
||||
"SELECT %s AS piattaforma,\n" +
|
||||
" %s AS comunita,\n" +
|
||||
" %s AS azienda,\n" +
|
||||
@@ -77,21 +85,27 @@ public class DocumentiIntesaExportService {
|
||||
" INNER JOIN dtb_tipi ON doc.cod_dtip = dtb_tipi.cod_dtip\n" +
|
||||
" INNER JOIN gtb_anag ON doc.cod_anag = gtb_anag.cod_anag\n" +
|
||||
" LEFT OUTER JOIN vtb_dest ON doc.cod_anag = vtb_dest.cod_anag AND doc.cod_vdes = vtb_dest.cod_vdes\n" +
|
||||
" INNER JOIN dtb_doc_pdf pdf\n" +
|
||||
" INNER JOIN RankedPDF pdf\n" +
|
||||
" ON doc.data_doc = pdf.data_doc AND doc.num_doc = pdf.num_doc AND doc.ser_doc = pdf.ser_doc\n" +
|
||||
" AND doc.cod_anag = pdf.cod_anag AND doc.cod_dtip = pdf.cod_dtip,\n" +
|
||||
" azienda\n" +
|
||||
" AND doc.cod_anag = pdf.cod_anag AND doc.cod_dtip = pdf.cod_dtip\n" +
|
||||
" CROSS APPLY azienda\n" +
|
||||
"WHERE doc.data_doc = %s\n" +
|
||||
" AND doc.gestione = 'V'\n" +
|
||||
" AND dtb_tipi.tipo_emissione = 'DIRETTA'\n" +
|
||||
" AND filename LIKE %s",
|
||||
piattaforma, comunita, azienda, dataDoc, filenameToFilter
|
||||
" AND pdf.rn = 1",
|
||||
filenameToFilter, piattaforma, comunita, azienda, dataDoc
|
||||
);
|
||||
|
||||
byte[] csvContent = UtilityQuery.mapQueryToCSV(conn, sql, charSeparator, false, false).getBytes();
|
||||
FileItem indexFile = new FileItem(fileName + "." + ext, csvContent, ext);
|
||||
|
||||
sql = Query.format(
|
||||
"WITH RankedPDF AS (SELECT pdf.*,\n" +
|
||||
" ROW_NUMBER() OVER (\n" +
|
||||
" PARTITION BY pdf.data_doc, pdf.num_doc, pdf.ser_doc, pdf.cod_anag, pdf.cod_dtip\n" +
|
||||
" ORDER BY pdf.versione DESC) AS rn\n" +
|
||||
" FROM dtb_doc_pdf pdf\n" +
|
||||
" WHERE pdf.filename LIKE %s)\n" +
|
||||
"SELECT pdf.data_doc,\n" +
|
||||
" pdf.ser_doc,\n" +
|
||||
" pdf.num_doc,\n" +
|
||||
@@ -100,30 +114,47 @@ public class DocumentiIntesaExportService {
|
||||
" pdf.versione\n" +
|
||||
"FROM dtb_doct doc\n" +
|
||||
" INNER JOIN dtb_tipi ON doc.cod_dtip = dtb_tipi.cod_dtip\n" +
|
||||
" INNER JOIN dtb_doc_pdf pdf\n" +
|
||||
" INNER JOIN RankedPDF pdf\n" +
|
||||
" ON doc.data_doc = pdf.data_doc AND doc.num_doc = pdf.num_doc AND doc.ser_doc = pdf.ser_doc\n" +
|
||||
" AND doc.cod_anag = pdf.cod_anag AND doc.cod_dtip = pdf.cod_dtip\n" +
|
||||
"WHERE doc.data_doc = %s\n" +
|
||||
" AND doc.gestione = 'V'\n" +
|
||||
" AND dtb_tipi.tipo_emissione = 'DIRETTA'\n" +
|
||||
" AND filename LIKE %s",
|
||||
dataDoc, filenameToFilter
|
||||
" AND pdf.rn = 1",
|
||||
filenameToFilter, dataDoc
|
||||
|
||||
);
|
||||
List<HashMap<String, Object>> resultQuery = UtilityDB.executeSimpleQuery(conn, sql);
|
||||
List<DtbDocPdf> dtbDocPdfList = new ArrayList<>();
|
||||
List<DtbDoct> dtbDoctList = new ArrayList<>();
|
||||
|
||||
for (HashMap<String, Object> result : resultQuery) {
|
||||
Date data = (Date) result.get("data_doc");
|
||||
String serDoc = (String) result.get("ser_doc");
|
||||
Integer numDoc = (Integer) result.get("num_doc");
|
||||
String codAnag = (String) result.get("cod_anag");
|
||||
String codDtip = (String) result.get("cod_dtip");
|
||||
|
||||
DtbDocPdf dtbDocPdf = new DtbDocPdf();
|
||||
dtbDocPdf.setDataDoc((Date) result.get("data_doc"));
|
||||
dtbDocPdf.setSerDoc((String) result.get("ser_doc"));
|
||||
dtbDocPdf.setNumDoc((Integer) result.get("num_doc"));
|
||||
dtbDocPdf.setCodAnag((String) result.get("cod_anag"));
|
||||
dtbDocPdf.setCodDtip((String) result.get("cod_dtip"));
|
||||
dtbDocPdf.setDataDoc(data);
|
||||
dtbDocPdf.setSerDoc(serDoc);
|
||||
dtbDocPdf.setNumDoc(numDoc);
|
||||
dtbDocPdf.setCodAnag(codAnag);
|
||||
dtbDocPdf.setCodDtip(codDtip);
|
||||
dtbDocPdf.setVersione((Integer) result.get("versione"));
|
||||
dtbDocPdf.setOperation(OperationType.SELECT_OBJECT);
|
||||
|
||||
dtbDocPdfList.add(dtbDocPdf);
|
||||
|
||||
DtbDoct dtbDoct = new DtbDoct();
|
||||
dtbDoct.setDataDoc(data);
|
||||
dtbDoct.setSerDoc(serDoc);
|
||||
dtbDoct.setNumDoc(numDoc);
|
||||
dtbDoct.setCodAnag(codAnag);
|
||||
dtbDoct.setCodDtip(codDtip);
|
||||
dtbDocPdf.setOperation(OperationType.SELECT_OBJECT);
|
||||
|
||||
dtbDoctList.add(dtbDoct);
|
||||
}
|
||||
|
||||
entityProcessor.processEntityList(dtbDocPdfList, true);
|
||||
@@ -152,6 +183,7 @@ public class DocumentiIntesaExportService {
|
||||
);
|
||||
|
||||
entityExportResponse
|
||||
.setExtraInfo(dtbDoctList)
|
||||
.setResponse(new ArrayList<>())
|
||||
.getResponse()
|
||||
.add(
|
||||
|
||||
@@ -3,6 +3,7 @@ package it.integry.ems.logistic.controller;
|
||||
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
|
||||
import com.fasterxml.jackson.databind.node.ObjectNode;
|
||||
import it.integry.common.var.CommonConstants;
|
||||
import it.integry.ems.javabeans.RequestDataDTO;
|
||||
import it.integry.ems.logistic.dto.sm2.WdtbDoctDTO;
|
||||
import it.integry.ems.logistic.service.*;
|
||||
import it.integry.ems.logistic.type.AccettazioneType;
|
||||
@@ -83,6 +84,9 @@ public class LogisticController {
|
||||
@Autowired
|
||||
private ServiceChecker serviceChecker;
|
||||
|
||||
@Autowired
|
||||
private RequestDataDTO requestDataDTO;
|
||||
|
||||
@RequestMapping(value = "/logistic/status", method = RequestMethod.GET)
|
||||
public @ResponseBody
|
||||
List<StatusResponse> status(HttpServletRequest request) {
|
||||
@@ -565,7 +569,7 @@ public class LogisticController {
|
||||
|
||||
ServiceRestResponse sr = null;
|
||||
try {
|
||||
String currentCodMdep = UtilityUser.getCodMdep(multiDBTransactionManager, request.getHeader("username"));
|
||||
String currentCodMdep = UtilityUser.getCodMdep(multiDBTransactionManager, requestDataDTO.getUsername());
|
||||
|
||||
JsonNodeFactory factory = JsonNodeFactory.instance;
|
||||
ObjectNode root = factory.objectNode();
|
||||
|
||||
@@ -10,7 +10,6 @@ import it.integry.ems.response.FileItem;
|
||||
import it.integry.ems.response.ServiceRestResponse;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.user.UtilityUser;
|
||||
import it.integry.ems.utility.BarcodeUtility;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.db.ResultSetMapper;
|
||||
@@ -334,8 +333,6 @@ public class SmartLogisticService {
|
||||
public FileItem getInfoArticolo(String username, String password,
|
||||
String codDepo, String codDepoClie, String barcode) throws Exception {
|
||||
|
||||
UtilityUser.checkUserWeb(multiDBTransactionManager.getPrimaryConnection(), username, password);
|
||||
|
||||
FileItem fileItem = null;
|
||||
|
||||
String sql = "select giacenza.cod_mart, giacenza.cod_col, giacenza.cod_tagl, " +
|
||||
|
||||
@@ -446,7 +446,8 @@ public class ImportListiniAcquistoApuliaCarrefourService {
|
||||
+ " um_frontalino varchar(80),"
|
||||
+ " um_peso varchar(80),"
|
||||
+ " espolodi_dist varchar(80),"
|
||||
+ " partita_iva_forn varchar(80))";
|
||||
+ " partita_iva_forn varchar(80),"
|
||||
+ " altro varchar(max))";
|
||||
}
|
||||
ps = conn.prepareStatement(sql);
|
||||
ps.executeUpdate();
|
||||
|
||||
@@ -5,11 +5,16 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
public class MRPDailySetupGruppiDTO {
|
||||
@JsonProperty("cod_mgrp")
|
||||
private String codMgrp;
|
||||
|
||||
@JsonProperty("includi_sospesi")
|
||||
private boolean includiSospesi;
|
||||
|
||||
@JsonProperty("agg_imp_prox")
|
||||
private boolean aggImpProx;
|
||||
|
||||
@JsonProperty("includi_budget")
|
||||
private boolean includiBudget;
|
||||
|
||||
public boolean isAggImpProx() {
|
||||
return aggImpProx;
|
||||
}
|
||||
@@ -36,4 +41,13 @@ public class MRPDailySetupGruppiDTO {
|
||||
this.includiSospesi = includiSospesi;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean isIncludiBudget() {
|
||||
return includiBudget;
|
||||
}
|
||||
|
||||
public MRPDailySetupGruppiDTO setIncludiBudget(boolean includiBudget) {
|
||||
this.includiBudget = includiBudget;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -349,29 +349,31 @@ public class MrpDailyMaterialReqDetDTO {
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public BigDecimal getFabbisogno(boolean includiSospesi) {
|
||||
public BigDecimal getFabbisogno(boolean includiSospesi, boolean includiBudget) {
|
||||
BigDecimal fabbisogno = getImpegni();
|
||||
if (includiSospesi) {
|
||||
fabbisogno = fabbisogno.add(getImpegniProx());
|
||||
fabbisogno = fabbisogno.add(getImpegniProx(includiBudget));
|
||||
}
|
||||
return fabbisogno;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public BigDecimal getImpegniProx() {
|
||||
BigDecimal qtaImpProx = getQtaContrVend().add(getQtaImpBudget()).add(getQtaImpProxOrd());
|
||||
public BigDecimal getImpegniProx(boolean includiBudget) {
|
||||
BigDecimal qtaImpProx = getQtaContrVend().add(getQtaImpProxOrd());
|
||||
if (includiBudget)
|
||||
qtaImpProx = qtaImpProx.add(getQtaImpBudget());
|
||||
return qtaImpProx;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public BigDecimal getDisponibilita(boolean includiSospesi, boolean includiArrivi) {
|
||||
public BigDecimal getDisponibilita(boolean includiSospesi, boolean includiArrivi, boolean includiBudget) {
|
||||
BigDecimal disponibilita = getGiacenza();
|
||||
|
||||
if (includiArrivi) {
|
||||
disponibilita = disponibilita.add(getArrivi());
|
||||
}
|
||||
|
||||
disponibilita = disponibilita.subtract(getFabbisogno(includiSospesi));
|
||||
disponibilita = disponibilita.subtract(getFabbisogno(includiSospesi, includiBudget));
|
||||
|
||||
return disponibilita;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@ public class RegisterSupervisorDTO {
|
||||
|
||||
private int supervisorServicePort = 10251;
|
||||
|
||||
private int printQuantity = 1;
|
||||
|
||||
private String lineaType;
|
||||
|
||||
public String getCodJfas() {
|
||||
@@ -76,4 +78,13 @@ public class RegisterSupervisorDTO {
|
||||
this.lineaType = lineaType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public int getPrintQuantity() {
|
||||
return printQuantity;
|
||||
}
|
||||
|
||||
public RegisterSupervisorDTO setPrintQuantity(int printQuantity) {
|
||||
this.printQuantity = printQuantity;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -814,7 +814,9 @@ public class MesProductionServiceV2 {
|
||||
}
|
||||
|
||||
|
||||
for (int i= 0;i<hmiData.getPrintQuantity();i++){
|
||||
printerService.print(printerName, new ByteArrayInputStream(bytes), "application/pdf", orientation);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
|
||||
@@ -111,6 +111,7 @@ public class MrpDailyMaterialReqService {
|
||||
|
||||
for (MrpDailyMaterialReqDTO art : datiArt) {
|
||||
boolean inclusiSospesi = getSetupIncluseSospesi(art.getCodMgrp(), setupGruppi);
|
||||
boolean includiBudget = getSetupIncludiBudget(art.getCodMgrp(), setupGruppi);
|
||||
List<MrpDailyMaterialReqDetDTO> dettagliArt = UtilityHashMap.getValueIfExists(listArticoli, art.getCodMart());
|
||||
if (dettagliArt == null) continue;
|
||||
|
||||
@@ -208,19 +209,19 @@ public class MrpDailyMaterialReqService {
|
||||
qtaImpProxOrd = qtaImpProxOrd.add(x.getQtaImpProxOrd());
|
||||
qtaOrdVSospesi = qtaOrdVSospesi.add(x.getQtaOrdVSospesi());
|
||||
qtaImpProxBudget = qtaImpProxBudget.add(x.getQtaImpBudget());
|
||||
disponibilita = disponibilita.add(x.getDisponibilita(inclusiSospesi, includiArrivi));
|
||||
disponibilita = disponibilita.add(x.getDisponibilita(inclusiSospesi, includiArrivi, includiBudget));
|
||||
disponibilitaImm = disponibilitaImm.add(x.getDisponibilitaImmediata());
|
||||
fabbisogno = fabbisogno.add(x.getFabbisogno(inclusiSospesi));
|
||||
fabbisogno = fabbisogno.add(x.getFabbisogno(inclusiSospesi, includiBudget));
|
||||
|
||||
mrpGiorno
|
||||
.addFabbisogno(x.getFabbisogno(inclusiSospesi))
|
||||
.addFabbisogno(x.getFabbisogno(inclusiSospesi, includiBudget))
|
||||
.addQtaImpegni(x.getImpegni())
|
||||
.addQtaArrivi(x.getArrivi())
|
||||
.addGiacenza(!datiGg.isEmpty() ? datiGg.get(datiGg.size() - 1).getDisponibilita() : x.getGiacenza())
|
||||
.addQtaImpegniProx(x.getImpegniProx());
|
||||
.addQtaImpegniProx(x.getImpegniProx(includiBudget));
|
||||
|
||||
if (depoArt != null)
|
||||
addDisponibilitaDepo((String) gg.getKey().get("codMdep"), depoArt, x.getDisponibilita(inclusiSospesi, includiArrivi));
|
||||
addDisponibilitaDepo((String) gg.getKey().get("codMdep"), depoArt, x.getDisponibilita(inclusiSospesi, includiArrivi, includiBudget));
|
||||
}
|
||||
|
||||
Integer stato = 0;
|
||||
@@ -301,6 +302,14 @@ public class MrpDailyMaterialReqService {
|
||||
|
||||
}
|
||||
|
||||
private boolean getSetupIncludiBudget(String codMgrp, List<MRPDailySetupGruppiDTO> setupGruppiDTO) {
|
||||
return
|
||||
Boolean.TRUE.equals(Stream.of(setupGruppiDTO).filter(x -> x.getCodMgrp().equalsIgnoreCase(codMgrp))
|
||||
.findFirst()
|
||||
.map(MRPDailySetupGruppiDTO::isIncludiBudget).orElse(true));
|
||||
|
||||
}
|
||||
|
||||
private boolean isSottoScorta(List<MRPDailyDatiDepoDTO> datiDepo) {
|
||||
if (datiDepo == null)
|
||||
return false;
|
||||
|
||||
@@ -7,6 +7,7 @@ import it.integry.ems.production.dto.MRP.MRPDailySetupSottogruppiDTO;
|
||||
import it.integry.ems.settings.Model.AvailableConnectionsModel;
|
||||
import it.integry.ems.settings.Model.SettingsModel;
|
||||
import it.integry.ems.settings.SettingsController;
|
||||
import it.integry.ems.sync.MultiDBTransaction.Connection;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.utility.UtilityDebug;
|
||||
import it.integry.ems_model.service.SetupGest;
|
||||
@@ -135,21 +136,27 @@ public class MrpSetupHandlerService {
|
||||
}
|
||||
|
||||
private List<MRPDailySetupGruppiDTO> getSetupGruppi(MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
||||
Connection conn = multiDBTransactionManager.getPrimaryConnection();
|
||||
final String gestName = "PVM";
|
||||
final String section = "MRP";
|
||||
final String keySectionSospesi = "USE_SOSPESI";
|
||||
String useSosepsi = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), gestName, section, keySectionSospesi);
|
||||
String useSosepsi = setupGest.getSetup(conn, gestName, section, keySectionSospesi);
|
||||
if (UtilityString.isNullOrEmpty(useSosepsi)) useSosepsi = "N";
|
||||
|
||||
final String keySectionAggImpProx = "AGGIORNA_IMP_PROX";
|
||||
String aggImpProx = setupGest.getSetup(multiDBTransactionManager.getPrimaryConnection(), gestName, section, keySectionAggImpProx);
|
||||
String aggImpProx = setupGest.getSetup(conn, gestName, section, keySectionAggImpProx);
|
||||
if (UtilityString.isNullOrEmpty(aggImpProx)) aggImpProx = "N";
|
||||
|
||||
final String keySectionIncludiBudget = "INCLUDI_BUDGET";
|
||||
String includiBudget = setupGest.getSetup(conn, gestName, section, keySectionIncludiBudget);
|
||||
if (UtilityString.isNullOrEmpty(includiBudget)) includiBudget = "N";
|
||||
|
||||
String sql =
|
||||
Query.format(
|
||||
"SELECT cod_mgrp, \n" +
|
||||
"CAST(CASE WHEN IsNull("+ keySectionSospesi +", %s) = 'S' THEN 1 ELSE 0 END as BIT) as includi_sospesi, \n" +
|
||||
"CAST(CASE WHEN IsNull("+ keySectionAggImpProx +", %s) = 'S' THEN 1 ELSE 0 END as BIT) as agg_imp_prox\n" +
|
||||
"CAST(CASE WHEN IsNull("+ keySectionIncludiBudget +", %s) = 'S' THEN 1 ELSE 0 END as BIT) as includi_budget\n" +
|
||||
"FROM (\n" +
|
||||
"SELECT mtb_grup.cod_mgrp, stb_gest_setup_det.key_section, stb_gest_setup_det.value \n" +
|
||||
"FROM mtb_grup\n" +
|
||||
@@ -160,10 +167,10 @@ public class MrpSetupHandlerService {
|
||||
" mtb_grup.cod_mgrp = stb_gest_setup_det.val_col_rif) t\n" +
|
||||
"PIVOT\n" +
|
||||
"( max(value) \n" +
|
||||
"FOR key_section IN (["+ keySectionAggImpProx +"],["+ keySectionSospesi +"])) AS PivotTable" ,
|
||||
useSosepsi, aggImpProx, gestName, section);
|
||||
"FOR key_section IN (["+ keySectionAggImpProx +"],["+ keySectionSospesi +"],["+ keySectionIncludiBudget +"])) AS PivotTable" ,
|
||||
useSosepsi, aggImpProx, includiBudget, gestName, section);
|
||||
|
||||
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, MRPDailySetupGruppiDTO.class);
|
||||
return UtilityDB.executeSimpleQueryDTO(conn, sql, MRPDailySetupGruppiDTO.class);
|
||||
}
|
||||
|
||||
private List<MRPDailySetupSottogruppiDTO> getSetupSottogruppi(MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
||||
|
||||
@@ -169,7 +169,7 @@ public class PvmController {
|
||||
|
||||
ServiceRestResponse response = null;
|
||||
try {
|
||||
String item = pvmService.getElencoArticoli(filtroXML, chiaveGriglia, request.getHeader("username"), outputEncoded);
|
||||
String item = pvmService.getElencoArticoli(filtroXML, chiaveGriglia, requestDataDTO.getUsername(), outputEncoded);
|
||||
response = new ServiceRestResponse(EsitoType.OK);
|
||||
response.setXmlString(item, outputEncoded);
|
||||
} catch (Exception e) {
|
||||
@@ -668,16 +668,9 @@ public class PvmController {
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_WMS_GET_DOC_INTERNI_SETUP, method = RequestMethod.GET)
|
||||
public ServiceRestResponse getDocInterniSetup(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration) {
|
||||
ServiceRestResponse response = new ServiceRestResponse(EsitoType.OK);
|
||||
try {
|
||||
String username = request.getHeader("username");
|
||||
response.setJsonObject(smartEnterpriseService.getDocInterniSetup(username));
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
response = new ServiceRestResponse(EsitoType.KO, configuration, e);
|
||||
}
|
||||
return response;
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration) throws Exception {
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(smartEnterpriseService.getDocInterniSetup(userSession.getUsername()));
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_GET_ELENCO_ARTICOLI, method = RequestMethod.GET)
|
||||
|
||||
@@ -51,8 +51,6 @@ public class PvmAccettazioneService {
|
||||
final String gestione = "A";
|
||||
List<EntityBase> entityList = new ArrayList<>();
|
||||
|
||||
UtilityUser.checkUserWeb(multiDBTransactionManager.getPrimaryConnection(), requestDataDTO.getUsername(), requestDataDTO.getPassword());
|
||||
|
||||
String codDtipFatNoRic = getAndCheckTipoDoc("COD_DTIP_FATT_NO_RIC");
|
||||
String codDtipFatNoRicNC = getAndCheckTipoDoc("COD_DTIP_FATT_NO_RIC_NC");
|
||||
String codDtipRicNoFatResa = getAndCheckTipoDoc("COD_DTIP_RIC_NO_FAT_RESA");
|
||||
|
||||
@@ -4,7 +4,6 @@ import it.integry.ems.javabeans.RequestDataDTO;
|
||||
import it.integry.ems.retail.pvmRetail.dto.save.PropostaOrdineDTO;
|
||||
import it.integry.ems.service.EntityProcessor;
|
||||
import it.integry.ems.sync.MultiDBTransaction.MultiDBTransactionManager;
|
||||
import it.integry.ems.user.UtilityUser;
|
||||
import it.integry.ems_model.base.EntityBase;
|
||||
import it.integry.ems_model.entity.DtbOrdr;
|
||||
import it.integry.ems_model.entity.DtbOrdt;
|
||||
@@ -40,7 +39,6 @@ public class PvmPropostaOrdineService {
|
||||
String username = requestDataDTO.getUsername();
|
||||
String password = requestDataDTO.getPassword();
|
||||
List<EntityBase> ordini = new ArrayList<EntityBase>();
|
||||
UtilityUser.checkUserWeb(multiDBTransactionManager.getPrimaryConnection(), username, password);
|
||||
String codMdep = pvmService.getCodMdep(username);
|
||||
|
||||
DtbOrdt dtbOrdt;
|
||||
|
||||
@@ -64,7 +64,6 @@ import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.Statement;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.time.LocalDate;
|
||||
import java.util.*;
|
||||
|
||||
import static it.integry.common.var.CommonConstants.DATE_FORMAT_YMD;
|
||||
@@ -100,8 +99,6 @@ public class PvmServiceSave {
|
||||
|
||||
|
||||
public List<ServiceRestResponse> SM2Save(SaveDTO saveDTO) throws Exception {
|
||||
UtilityUser.checkUserWeb(multiDBTransactionManager.getPrimaryConnection(), requestDataDTO.getUsername(), requestDataDTO.getPassword());
|
||||
|
||||
String gestione = saveDTO.getGestione();
|
||||
String idDisp = saveDTO.getIdDisp();
|
||||
String zona = saveDTO.getZona();
|
||||
@@ -161,9 +158,6 @@ public class PvmServiceSave {
|
||||
}
|
||||
|
||||
public List<ServiceRestResponse> saveTerminalino(String xmlInput) throws Exception {
|
||||
|
||||
UtilityUser.checkUserWeb(multiDBTransactionManager.getPrimaryConnection(), requestDataDTO.getUsername(), requestDataDTO.getPassword());
|
||||
|
||||
Document doc = UtilityXML.convertStringToDocument(xmlInput);
|
||||
XPath xPath = XPathFactory.newInstance().newXPath();
|
||||
|
||||
|
||||
@@ -379,7 +379,7 @@ public class GiacenzaService {
|
||||
" AND mtb_colt.data_collo >= %s\n" +
|
||||
" AND mtb_colt.data_distribuzione is null \n" +
|
||||
" AND mtb_colt.cod_mdep = %s\n" +
|
||||
" AND exists (select * from carelli_giacenza_prog c where c.cod_mdep = mtb_colt.cod_mdep and c.cod_mart = art.cod_mart_mov and (c.data_reg < mtb_colt.data_collo or IsNull(tipo_car, 'G') = 'G' ))\n " +
|
||||
" AND exists (select * from carelli_giacenza_prog c where c.cod_mdep = mtb_colt.cod_mdep and c.cod_mart = art.cod_mart_mov and (c.data_reg < mtb_colt.data_ins or IsNull(tipo_car, 'G') = 'G' ))\n " +
|
||||
"GROUP BY art.cod_mart_mov, mtb_colt.data_ins",
|
||||
codDtipRett, dataIniz, codMdep);
|
||||
|
||||
@@ -673,8 +673,10 @@ public class GiacenzaService {
|
||||
List<GiacenzaDTO> listGiacenza = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, GiacenzaDTO.class);
|
||||
|
||||
String listiniAcquisto = setupGest.getSetup("DATI_AZIENDA", "GIACENZA_DA_INV", "LISTINI_ACQUISTO");
|
||||
List<String> listini = Arrays.asList(listiniAcquisto.split("\\|"));
|
||||
|
||||
List<String> listini = new ArrayList<>();
|
||||
if (!UtilityString.isNullOrEmpty(listiniAcquisto)) {
|
||||
listini = Arrays.asList(listiniAcquisto.split("\\|"));
|
||||
}
|
||||
if (readOrdini ) {
|
||||
|
||||
sql = "WITH incoming_stock_documenti AS (\n" +
|
||||
|
||||
@@ -37,7 +37,7 @@ public class WMSUtility {
|
||||
|
||||
entityProcessor.processEntity(mtbDepoTipi, multiDBTransactionManager);
|
||||
|
||||
return mtbDepoTipi.getGestisciColli();
|
||||
return mtbDepoTipi == null || mtbDepoTipi.getGestisciColli() == null || mtbDepoTipi.getGestisciColli();
|
||||
}
|
||||
|
||||
public static void createDtbDocrFromMtbColrList(DtbDoct dtbDoct, List<MtbColr> mtbColrList) throws Exception {
|
||||
|
||||
@@ -125,7 +125,7 @@ public class WMSAccettazioneBollaService {
|
||||
" ( mtb_grup.tipo_mgrp is null or mtb_grup.tipo_mgrp <> 'FTT') \n";
|
||||
|
||||
if (excludeKg) {
|
||||
sql += " AND mtb_unt_mis.flag_unita_kg = 'S' \n";
|
||||
sql += " AND ISNULL(mtb_unt_mis.flag_unita_kg, '') <> 'S' \n";
|
||||
}
|
||||
|
||||
sql += " group by Wdtb_docr.num_doc,\n" +
|
||||
|
||||
@@ -353,7 +353,7 @@ public class SystemController {
|
||||
@RequestParam(required = false) String codMdep,
|
||||
@RequestBody List<StbGestSetup> stbGestSetupList) throws Exception {
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(systemService.getGestSetupList(stbGestSetupList, request.getHeader("username"), codMdep));
|
||||
return ServiceRestResponse.createPositiveResponse(systemService.getGestSetupList(stbGestSetupList, requestDataDTO.getUsername(), codMdep));
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
|
||||
Reference in New Issue
Block a user