Compare commits
15 Commits
feature-re
...
0ba9297f39
| Author | SHA1 | Date | |
|---|---|---|---|
| 0ba9297f39 | |||
| 7c036172d8 | |||
| bb47dd458e | |||
| 530b6af4ef | |||
| 6b71d6b784 | |||
| de4d8d225f | |||
| 755e7394b4 | |||
| ce06683722 | |||
| 7a5c024005 | |||
| c82f2a57d8 | |||
| b9e863a563 | |||
| 60e4429c3f | |||
| d7012d4e1f | |||
| 6a237ce4d9 | |||
| a64932d918 |
@@ -152,7 +152,7 @@ public class EntityCacheComponent implements ApplicationListener {
|
||||
snapshot = entityCache.get(customerDB)
|
||||
.get(tableName)
|
||||
.values()
|
||||
.stream()
|
||||
.parallelStream()
|
||||
.map(x -> (T) x.clone());
|
||||
|
||||
if (filterPredicate != null)
|
||||
|
||||
@@ -34,15 +34,7 @@ public class UtilityThread {
|
||||
int finalI = i;
|
||||
|
||||
calls.add(() -> {
|
||||
try {
|
||||
return runnables.get(finalI).run();
|
||||
} catch (Exception ex) {
|
||||
logger.error("executeParallel", ex);
|
||||
|
||||
//if (rethrowError) throw ex;
|
||||
}
|
||||
|
||||
return null;
|
||||
return runnables.get(finalI).run();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1654,13 +1654,18 @@ public class DocumentiDialogoImportServices {
|
||||
|
||||
boolean existOrd = isExistOrdA(codAnag, codMdep, dataOrd, numOrd);
|
||||
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(rifOrd)) {
|
||||
if (!existOrd) {
|
||||
//Vs. Ord. N. 11490 del 06-09-2013
|
||||
String[] datiOrdine = rifOrd.split(" ");
|
||||
numOrd = Integer.parseInt(datiOrdine[3]);
|
||||
dataOrd = UtilityString.parseDate(datiOrdine[5]);
|
||||
if ( UtilityString.isNumber(datiOrdine[3]))
|
||||
numOrd = Integer.parseInt(datiOrdine[3]);
|
||||
|
||||
try {
|
||||
dataOrd = UtilityString.parseDate(datiOrdine[5]);
|
||||
} catch (Exception e) {
|
||||
logger.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
existOrd = isExistOrdA(codAnag, codMdep, dataOrd, numOrd);
|
||||
|
||||
@@ -388,6 +388,8 @@ public class DocumentiExportManagerService {
|
||||
query = UtilityDB.addwhereCond(query, whereCondDoc, false);
|
||||
|
||||
List<HashMap<String, Object>> listaDoc = UtilityDB.executeSimpleQuery(conn, query);
|
||||
if (listaDoc == null || listaDoc.isEmpty())
|
||||
throw new Exception("Nessun documento esportato");
|
||||
|
||||
for (HashMap<String, Object> doc : listaDoc) {
|
||||
String codAnag = UtilityHashMap.getValueIfExists(doc, "cod_anag");
|
||||
@@ -731,7 +733,21 @@ public class DocumentiExportManagerService {
|
||||
query = UtilityDB.addwhereCond(query, whereCond, true);
|
||||
query = UtilityDB.addwhereCond(query, whereCondFiltro, true);
|
||||
|
||||
String stringFile = new ResultSetMapper().mapQueryToCSV(conn, query, DocumentiDialogoDTO.Export.class, '\t', true, true);
|
||||
PreparedStatement psRow = multiDBTransactionManager.getPrimaryConnection()
|
||||
.prepareStatement(query,
|
||||
ResultSet.TYPE_SCROLL_INSENSITIVE,
|
||||
ResultSet.CONCUR_READ_ONLY);
|
||||
ResultSet rsRow = psRow.executeQuery();
|
||||
rsRow.last();
|
||||
int count = rsRow.getRow(); // numero righe
|
||||
rsRow.beforeFirst();
|
||||
String stringFile = new ResultSetMapper().mapResultSetToCSV(rsRow, DocumentiDialogoDTO.Export.class, '\t', true, true);
|
||||
rsRow.close();
|
||||
psRow.close();
|
||||
|
||||
if (count == 0 ) {
|
||||
throw new Exception("La query di estrazione righe non ha ritornato nessun risultato");
|
||||
}
|
||||
|
||||
if (!UtilityString.isNullOrEmpty(stringFile)) {
|
||||
String filePath = pathFile + File.separator + fileName;
|
||||
|
||||
@@ -338,7 +338,7 @@ public class CrmService {
|
||||
);
|
||||
HashMap<String, Object> ordineImportato = UtilityDB.executeSimpleQueryOnlyFirstRow(conn, sql);
|
||||
|
||||
if ((ordineImportato != null || ordineImportato.get("activity_id") != null) && completeOrder.getActivityId() == null)
|
||||
if (completeOrder.getActivityId() == null && ordineImportato != null && ordineImportato.get("activity_id") != null)
|
||||
completeOrder.setActivityId(ordineImportato.get("activity_id").toString());
|
||||
|
||||
if ("S".equals(ordineImportato.get("flag_elaborato").toString()))
|
||||
|
||||
@@ -132,6 +132,24 @@ public class VariazioniPvService {
|
||||
String query = getQueryVariazioni(variazioniPvDTO, setup, datiLisv.getCodVlis(), UtilityHashMap.getValueIfExists(getSetupSectionDepo, "SELEZIONA_GRIGLIE"));
|
||||
variazioniLisv = UtilityDB.executeSimpleQueryDTO(mdb.getPrimaryConnection(), query, VariazioniDettaglioDTO.class);
|
||||
|
||||
boolean duplicati = variazioniLisv.stream()
|
||||
.filter(x->x.getIdPromo() !=null && !x.getIdPromo().isEmpty())
|
||||
.collect(Collectors.groupingBy(
|
||||
VariazioniDettaglioDTO::getIdPromo,
|
||||
Collectors.mapping(
|
||||
p -> p.getDataIniz() + "#" + p.getDataFine(),
|
||||
Collectors.toSet()
|
||||
)
|
||||
))
|
||||
.values().stream()
|
||||
.anyMatch(set -> set.size() > 1);
|
||||
|
||||
if (duplicati) {
|
||||
throw new Exception(String.format("Attenzione rigenerare il file del punto vendita %s ci sono articoli con dati promo errati.",
|
||||
datiLisv.getCodVlis()));
|
||||
}
|
||||
|
||||
|
||||
if (variazioniLisv != null) {
|
||||
variazioniLisv
|
||||
.forEach(
|
||||
@@ -324,7 +342,6 @@ public class VariazioniPvService {
|
||||
else if (setupDescr.equalsIgnoreCase("B"))
|
||||
descrizioneEstesa = var.getDescrCassa();
|
||||
}
|
||||
descrizioneEstesa = UtilityString.sanitizeXmlString(descrizioneEstesa);
|
||||
codMartType.getContent().add(objectFactory.createCodMartTypeDescrizioneEstesa(UtilityString.streNull(descrizioneEstesa)));
|
||||
codMartType.getContent().add(objectFactory.createCodMartTypeUntMis2(UtilityString.streNull(var.getUntMis2())));
|
||||
codMartType.getContent().add(objectFactory.createCodMartTypeUntMis(UtilityString.streNull(var.getUntMis())));
|
||||
@@ -615,8 +632,8 @@ public class VariazioniPvService {
|
||||
" mtb_aart_equi.descrizione AS 'descr_art_equi',\n" +
|
||||
" promozione.flag_tipo_promo,\n" +
|
||||
" CASE\n" +
|
||||
" WHEN promozione.flag_tipo_promo <> 'P' THEN promozione.data_iniz\n" +
|
||||
" ELSE NULL END AS 'data_iniz_promo',\n" +
|
||||
" WHEN promozione.flag_tipo_promo <> 'P' THEN ISNULL(vtb_list_data.data_iniz, listino.data_iniz)\n" +
|
||||
" ELSE NULL END AS 'data_iniz_promo',\n" +
|
||||
" CASE\n" +
|
||||
" WHEN promozione.cod_promo IS NOT NULL AND promozione.flag_tipo_promo <> 'P'\n" +
|
||||
" THEN listino.cod_vlis + '_' + CAST(promozione.versione AS VARCHAR)\n" +
|
||||
|
||||
@@ -26,14 +26,6 @@ public class AnomalieController {
|
||||
this.anomalieProdService = anomalieProdService;
|
||||
}
|
||||
|
||||
@GetMapping(value = "/lista")
|
||||
public ServiceRestResponse listaAnomalie(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@RequestBody PageableRequestDTO requestData) throws Exception {
|
||||
return ServiceRestResponse.createPositiveResponse(anomalieProdService.getAnomalieProd(requestData, multiDBTransactionManager.getPrimaryConnection()));
|
||||
|
||||
}
|
||||
|
||||
@GetMapping(value = "/livelli/lista")
|
||||
public ServiceRestResponse listaLivelliAnomalie(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String profileDB) throws Exception {
|
||||
@@ -53,6 +45,27 @@ public class AnomalieController {
|
||||
}
|
||||
|
||||
}
|
||||
@PostMapping(value = "/livelli/{id}/elimina")
|
||||
public ServiceRestResponse deleteLivelloAnomalia(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@PathVariable Long id) throws Exception {
|
||||
try {
|
||||
anomalieProdService.deleteLivelloAnomalia(multiDBTransactionManager, id);
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
} catch (Exception e) {
|
||||
multiDBTransactionManager.rollbackAll();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
|
||||
@GetMapping(value = "/lista")
|
||||
public ServiceRestResponse listaAnomalie(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@RequestBody PageableRequestDTO requestData) throws Exception {
|
||||
return ServiceRestResponse.createPositiveResponse(anomalieProdService.getAnomalieProd(requestData, multiDBTransactionManager.getPrimaryConnection()));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@GetMapping(value = "/{id}/ul")
|
||||
public ServiceRestResponse getUlAnomalia(HttpServletRequest request,
|
||||
@@ -66,7 +79,8 @@ public class AnomalieController {
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||
@PathVariable Long id) throws Exception {
|
||||
try {
|
||||
return ServiceRestResponse.createPositiveResponse(anomalieProdService.deleteAnomalia(multiDBTransactionManager, id));
|
||||
anomalieProdService.deleteAnomalia(multiDBTransactionManager, id);
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
} catch (Exception e) {
|
||||
multiDBTransactionManager.rollbackAll();
|
||||
throw e;
|
||||
|
||||
@@ -151,7 +151,7 @@ public class AnomalieUlService {
|
||||
return anomalia;
|
||||
}
|
||||
|
||||
public Object deleteAnomalia(MultiDBTransactionManager multiDBTransactionManager, Long id) throws Exception {
|
||||
public void deleteAnomalia(MultiDBTransactionManager multiDBTransactionManager, Long id) throws Exception {
|
||||
List<EntityBase> entities = new ArrayList<>();
|
||||
MtbAnomalieUl anomalia = new MtbAnomalieUl();
|
||||
anomalia.setId(id)
|
||||
@@ -160,13 +160,30 @@ public class AnomalieUlService {
|
||||
List<MtbColt> ulAnomalia = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(),
|
||||
"SELECT gestione,data_collo,ser_collo,num_collo, id_anomalia from mtb_colt where id_anomalia = " + id,
|
||||
MtbColt.class);
|
||||
|
||||
ulAnomalia.forEach(x -> AnomalieUlUtility.detachAnomaliaFromUl(x));
|
||||
entities.addAll(ulAnomalia);
|
||||
if (!UtilityList.isNullOrEmpty(ulAnomalia)) {
|
||||
ulAnomalia.forEach(x -> AnomalieUlUtility.detachAnomaliaFromUl(x));
|
||||
entities.addAll(ulAnomalia);
|
||||
}
|
||||
entities.add(anomalia);
|
||||
entityProcessor.processEntityList(entities, multiDBTransactionManager, true);
|
||||
UtilityEntity.throwEntitiesException(entities);
|
||||
return entities;
|
||||
}
|
||||
|
||||
public void deleteLivelloAnomalia(MultiDBTransactionManager multiDBTransactionManager, Long id) throws Exception {
|
||||
|
||||
|
||||
Integer count = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(),"SELECT count(*) from "+MtbAnomalieUl.ENTITY+" \n\r" +
|
||||
"where id_livello_anomalia = " + UtilityDB.valueToString(id) + "");
|
||||
|
||||
if (count > 0)
|
||||
throw new Exception("Impossibile eliminare il livello di anomalia se esistono anomalie associate");
|
||||
|
||||
|
||||
|
||||
MtbLivelliAnomalie anomalia = new MtbLivelliAnomalie();
|
||||
anomalia.setId(id)
|
||||
.setOperation(OperationType.DELETE);
|
||||
entityProcessor.processEntity(anomalia, true, multiDBTransactionManager);
|
||||
}
|
||||
|
||||
public List<MtbLivelliAnomalie> listaLivelliAnomalie(Connection connection) throws Exception {
|
||||
|
||||
@@ -580,16 +580,14 @@ public class GiacenzaService {
|
||||
}
|
||||
|
||||
public List<GiacenzaDTO> retrieveGiacenza(String codMdep, boolean readOrdini, String codMart) throws Exception {
|
||||
|
||||
String sql = Query.format(
|
||||
"SELECT cod_mdep FROM stb_gest_setup_depo WHERE gest_name = %s AND section = %s AND key_section = %S AND value = %S",
|
||||
gestName, section, "REPLACE_DEPO", codMdep);
|
||||
String codMdepNew = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(multiDBTransactionManager.getPrimaryConnection(), sql);
|
||||
String whereCond = UtilityDB.valueToString(codMdep);
|
||||
|
||||
if (codMdepNew != null) {
|
||||
if (codMdepNew != null)
|
||||
whereCond += ", " + UtilityDB.valueToString(codMdepNew);
|
||||
}
|
||||
|
||||
sql = "WITH art AS (SELECT mtb_aart.cod_mart AS cod_mart,\n" +
|
||||
" IIF(mtb_aart.articolo_composto = 'S'\n" +
|
||||
|
||||
@@ -504,6 +504,10 @@ public class WMSUtility {
|
||||
public static InsertUDCRowResponseDTO insertUDCRow(InsertUDCRowRequestDTO insertUDCRowRequestDTO, EntityProcessor entityProcessor, MultiDBTransactionManager multiDBTransactionManager) throws Exception {
|
||||
|
||||
MtbColt targetMtbColt = insertUDCRowRequestDTO.getTargetMtbColt();
|
||||
|
||||
if (targetMtbColt == null)
|
||||
throw new MissingDataException("UL di destinazione non presente");
|
||||
|
||||
targetMtbColt.setOperation(OperationType.SELECT_OBJECT);
|
||||
entityProcessor.processEntity(targetMtbColt, true, multiDBTransactionManager);
|
||||
|
||||
@@ -577,10 +581,14 @@ public class WMSUtility {
|
||||
public static List<MtbAart> getArticoliByCodMarts(List<String> codMarts, Connection connection) throws Exception {
|
||||
if (codMarts == null || codMarts.isEmpty()) return null;
|
||||
|
||||
codMarts.replaceAll(String::toUpperCase);
|
||||
|
||||
Thread.sleep(5000);
|
||||
|
||||
final EntityCacheComponent entityCacheComponent = ApplicationContextProvider.getApplicationContext().getBean(EntityCacheComponent.class);
|
||||
|
||||
List<MtbAart> listMtbAart = entityCacheComponent.getCachedEntitiesList(
|
||||
connection.getIntegryCustomerDB(), MtbAart.ENTITY, x -> codMarts.parallelStream().anyMatch(y -> y.equalsIgnoreCase(x.getCodMart())));
|
||||
connection.getIntegryCustomerDB(), MtbAart.ENTITY, x -> codMarts.contains(x.getCodMart().toUpperCase()));
|
||||
|
||||
List<MtbAartBarCode> barCodeFromCod = getAlternativeMtbAartBarCodes(codMarts, connection);
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ public class WMSAccettazioneService {
|
||||
.setCodVdes(createUDCRequestDTO.getCodVdes())
|
||||
.setDataCollo(createUDCRequestDTO.getDataCollo())
|
||||
.setOraInizPrep(new Date())
|
||||
.setPreparatoDa(requestDataDTO.getUsername())
|
||||
.setPreparatoDa(userSession.getUsername())
|
||||
.setPosizione(UtilityString.isNullOrEmpty(createUDCRequestDTO.getPosizione()) ? defaultPosizioneColliAccettazione : createUDCRequestDTO.getPosizione())
|
||||
.setCodTcol(createUDCRequestDTO.getCodTcol())
|
||||
.setAnnotazioni(createUDCRequestDTO.getAnnotazioni())
|
||||
@@ -162,7 +162,9 @@ public class WMSAccettazioneService {
|
||||
udcMtbColt.setOperation(OperationType.INSERT);
|
||||
entityProcessor.processEntity(udcMtbColt, multiDBTransactionManager);
|
||||
|
||||
udcMtbColt.setOnlyPkMaster(false);
|
||||
udcMtbColt
|
||||
.setMtbCols(new ArrayList<>())
|
||||
.setOnlyPkMaster(false);
|
||||
return udcMtbColt;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,10 +28,11 @@ public class WMSVerificaGiacenzeController {
|
||||
private SetupGest setupGest;
|
||||
|
||||
@GetMapping("retrieve")
|
||||
public @ResponseBody ServiceRestResponse retrieveGiacenze(@RequestParam String codMdep) throws Exception {
|
||||
public @ResponseBody ServiceRestResponse retrieveGiacenze(@RequestParam String codMdep,
|
||||
@RequestParam(required = false) String codMart) throws Exception {
|
||||
wmsVerificaGiacenzeService.setPrimaryDs(codMdep);
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse(giacenzaService.retrieveGiacenza(codMdep, false, null));
|
||||
return ServiceRestResponse.createPositiveResponse(giacenzaService.retrieveGiacenza(codMdep, false, codMart));
|
||||
}
|
||||
|
||||
@PostMapping(value = "save_new_row")
|
||||
|
||||
@@ -45,7 +45,7 @@ public class WMSVerificaGiacenzeService {
|
||||
String profileDb = UtilityString.isNull(setupGest.getSetupDepo(multiDBTransactionManager.getPrimaryConnection(), "DATI_AZIENDA", "DATI_DEPOSITO", "PROFILE_DB", codMdep),
|
||||
multiDBTransactionManager.getPrimaryConnection().getProfileName());
|
||||
|
||||
if (!multiDBTransactionManager.getPrimaryConnection().getProfileName().equals(profileDb))
|
||||
if (!multiDBTransactionManager.getPrimaryConnection().getProfileName().equalsIgnoreCase(profileDb))
|
||||
multiDBTransactionManager.setPrimaryDB(profileDb);
|
||||
}
|
||||
|
||||
|
||||
@@ -467,6 +467,7 @@ public class WMSSpedizioneService {
|
||||
.setDataVers(null)
|
||||
.setDataOrd(null)
|
||||
.setNumOrd(null)
|
||||
.setBarcodeUl(null)
|
||||
.setOperation(OperationType.INSERT);
|
||||
|
||||
mtbColt.getMtbColr().stream().peek(x -> {
|
||||
|
||||
Reference in New Issue
Block a user