Fix su ExchangeColli e job da caricare all'avvio
This commit is contained in:
16
.idea/runConfigurations/Tomcat__1__Rosso_Gargano_.xml
generated
Normal file
16
.idea/runConfigurations/Tomcat__1__Rosso_Gargano_.xml
generated
Normal file
@@ -0,0 +1,16 @@
|
||||
<component name="ProjectRunConfigurationManager">
|
||||
<configuration default="false" name="Tomcat #1 (Rosso Gargano)" type="Remote" folderName="Rosso Gargano">
|
||||
<module name="ems-engine" />
|
||||
<option name="USE_SOCKET_TRANSPORT" value="true" />
|
||||
<option name="SERVER_MODE" value="false" />
|
||||
<option name="SHMEM_ADDRESS" />
|
||||
<option name="HOST" value="192.168.1.13" />
|
||||
<option name="PORT" value="8001" />
|
||||
<option name="AUTO_RESTART" value="false" />
|
||||
<RunnerSettings RunnerId="Debug">
|
||||
<option name="DEBUG_PORT" value="8001" />
|
||||
<option name="LOCAL" value="false" />
|
||||
</RunnerSettings>
|
||||
<method v="2" />
|
||||
</configuration>
|
||||
</component>
|
||||
@@ -1,6 +1,5 @@
|
||||
package it.integry.ems.schedule.new_cron_job.service;
|
||||
|
||||
import com.annimon.stream.Optional;
|
||||
import com.annimon.stream.Stream;
|
||||
import it.integry.annotations.PostContextAutowired;
|
||||
import it.integry.annotations.PostWebServerConstruct;
|
||||
@@ -22,6 +21,8 @@ import org.springframework.web.context.ContextLoader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@Service
|
||||
public class DefaultAutomatedOperationHandlerComponent {
|
||||
@@ -45,13 +46,16 @@ public class DefaultAutomatedOperationHandlerComponent {
|
||||
|
||||
if (!UtilityDebug.isDebugExecution() && !UtilityDebug.isIntegryServer()) {
|
||||
deleteJobFileDeleter(multiDBTransactionManager);
|
||||
deleteChkScadenze(multiDBTransactionManager);
|
||||
|
||||
if (settingsModel.isPrimaryInstance()) {
|
||||
initServerInfoCheckJob();
|
||||
initRemoveFpxInvioFilesJob();
|
||||
initChkAutofatture();
|
||||
initChkInvioFE();
|
||||
initMinioOrphanFileCleaner(multiDBTransactionManager);
|
||||
initPassaggioAnno(multiDBTransactionManager);
|
||||
deleteChkScadenze(multiDBTransactionManager);
|
||||
initChkAutofatture();
|
||||
initChkInvioFE();
|
||||
}
|
||||
}
|
||||
|
||||
} catch (Exception ex) {
|
||||
@@ -126,6 +130,7 @@ public class DefaultAutomatedOperationHandlerComponent {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void initPassaggioAnno(MultiDBTransactionManager data) {
|
||||
try {
|
||||
List<AdvancedDataSource> activeConnections = data.getActiveConnections();
|
||||
@@ -176,15 +181,16 @@ public class DefaultAutomatedOperationHandlerComponent {
|
||||
if (!activeOperations.containsKey(AutomatedOperationTypeEnum.METHOD_CALLS))
|
||||
activeOperations.put(AutomatedOperationTypeEnum.METHOD_CALLS, new ArrayList<>());
|
||||
|
||||
activeConnections = Stream.of(activeConnections)
|
||||
activeConnections = activeConnections.stream()
|
||||
.filter(x -> x.isInternalDb() && x.getDataSource().getProfile().equalsIgnoreCase(x.getDataSource().getDbName()))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (AdvancedDataSource activeConnection : activeConnections) {
|
||||
final String operationName = "Controllo Scadenze " + activeConnection.getProfileName().toUpperCase();
|
||||
|
||||
Optional<BaseAutomatedOperationDTO> first = Stream.of(activeOperations.get(AutomatedOperationTypeEnum.METHOD_CALLS))
|
||||
.filter(iScheduledOperation -> iScheduledOperation.getName().equals(operationName)).findFirst();
|
||||
Optional<BaseAutomatedOperationDTO> first = activeOperations.get(AutomatedOperationTypeEnum.METHOD_CALLS).stream()
|
||||
.filter(iScheduledOperation -> iScheduledOperation.getName().equals(operationName))
|
||||
.findFirst();
|
||||
|
||||
if (first.isPresent()) {
|
||||
automatedOperationHandlerComponent.remove(first.get().getId());
|
||||
@@ -199,6 +205,7 @@ public class DefaultAutomatedOperationHandlerComponent {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void deleteJobFileDeleter(MultiDBTransactionManager data) {
|
||||
try {
|
||||
List<AdvancedDataSource> activeConnections = data.getActiveConnections();
|
||||
@@ -207,18 +214,18 @@ public class DefaultAutomatedOperationHandlerComponent {
|
||||
if (!activeOperations.containsKey(AutomatedOperationTypeEnum.METHOD_CALLS))
|
||||
activeOperations.put(AutomatedOperationTypeEnum.METHOD_CALLS, new ArrayList<>());
|
||||
|
||||
activeConnections = Stream.of(activeConnections)
|
||||
activeConnections = activeConnections.stream()
|
||||
.filter(x -> x.isInternalDb() && x.getDataSource().getProfile().equalsIgnoreCase(x.getDataSource().getDbName()))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (AdvancedDataSource activeConnection : activeConnections) {
|
||||
final String filesDeleterOperationName = "File deleter " + activeConnection.getProfileName().toUpperCase();
|
||||
|
||||
List<BaseAutomatedOperationDTO> list = Stream.of(activeOperations.get(AutomatedOperationTypeEnum.METHOD_CALLS))
|
||||
List<BaseAutomatedOperationDTO> list = activeOperations.get(AutomatedOperationTypeEnum.METHOD_CALLS).stream()
|
||||
.filter(iScheduledOperation -> iScheduledOperation.getName().equalsIgnoreCase(filesDeleterOperationName))
|
||||
.toList();
|
||||
.collect(Collectors.toList());
|
||||
|
||||
if (list != null && list.size() > 0) {
|
||||
if (!list.isEmpty()) {
|
||||
for (BaseAutomatedOperationDTO operationDTO : list) {
|
||||
automatedOperationHandlerComponent.remove(operationDTO.getId());
|
||||
}
|
||||
@@ -263,7 +270,7 @@ public class DefaultAutomatedOperationHandlerComponent {
|
||||
|
||||
SettingsModel settingsModel = ContextLoader.getCurrentWebApplicationContext().getBean(SettingsModel.class);
|
||||
|
||||
Stream.of(settingsModel.getAvailableConnections())
|
||||
settingsModel.getAvailableConnections().stream()
|
||||
.filter(x -> x.getInternalDb() && x.getProfileName().equalsIgnoreCase(x.getDbName()))
|
||||
.map(AvailableConnectionsModel::getProfileName)
|
||||
.forEach(profileDb -> {
|
||||
|
||||
@@ -708,6 +708,14 @@ public class MtbColt extends EntityBase implements EquatableEntityInterface<MtbC
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (this == obj) return true;
|
||||
if (!(obj instanceof MtbColt)) return false;
|
||||
MtbColt mtbColt = (MtbColt) obj;
|
||||
return equalsContent(mtbColt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equalsKey(MtbColt other) {
|
||||
if (this == other) return true;
|
||||
|
||||
@@ -67,6 +67,7 @@ public class ContabilController {
|
||||
|
||||
@Autowired
|
||||
private RossoGarganoSyncService rossoGarganoSyncService;
|
||||
|
||||
@RequestMapping(value = "/contabil/status", method = RequestMethod.GET)
|
||||
public @ResponseBody
|
||||
List<StatusResponse> status(HttpServletRequest request) {
|
||||
@@ -312,82 +313,45 @@ public class ContabilController {
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_CHK_AUTOFATTURA, method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse chkAutofattura(HttpServletRequest request) {
|
||||
|
||||
ServiceRestResponse response;
|
||||
try {
|
||||
ServiceRestResponse chkAutofattura(HttpServletRequest request) throws Exception {
|
||||
autofatturaService.chkAutofattura();
|
||||
response = ServiceRestResponse.createPositiveResponse();
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
response = new ServiceRestResponse(EsitoType.KO, "", e);
|
||||
}
|
||||
return response;
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
|
||||
@RequestMapping(value = "chkScadenze", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse chkScadenze(HttpServletRequest request) {
|
||||
|
||||
ServiceRestResponse response;
|
||||
try {
|
||||
ServiceRestResponse chkScadenze(HttpServletRequest request) throws Exception {
|
||||
scadenzeService.chkScadenze();
|
||||
response = ServiceRestResponse.createPositiveResponse();
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
response = new ServiceRestResponse(EsitoType.KO, "", e);
|
||||
}
|
||||
return response;
|
||||
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_PASSAGGIO_ANNO, method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse checkYear(HttpServletRequest request, @RequestParam(CommonConstants.PROFILE_DB) String configuration) {
|
||||
ServiceRestResponse checkYear(HttpServletRequest request, @RequestParam(CommonConstants.PROFILE_DB) String configuration) throws Exception {
|
||||
|
||||
ServiceRestResponse response;
|
||||
try {
|
||||
if (passaggioAnno.checkYear()) {
|
||||
response = ServiceRestResponse.createPositiveResponse();
|
||||
} else {
|
||||
response = ServiceRestResponse.createNegativeResponse();
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
response = new ServiceRestResponse(EsitoType.KO, "", e);
|
||||
}
|
||||
return response;
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "SyncDulciar", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse syncDulciar(HttpServletRequest request, @RequestParam(CommonConstants.PROFILE_DB) String configuration) {
|
||||
try {
|
||||
ServiceRestResponse syncDulciar(HttpServletRequest request, @RequestParam(CommonConstants.PROFILE_DB) String configuration) throws Exception {
|
||||
dulciarSincronizzazione.sync();
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
return ServiceRestResponse.createNegativeResponse(e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping(value = "syncRossoGargano", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse syncRossoGargano(HttpServletRequest request, @RequestParam(CommonConstants.PROFILE_DB) String configuration) {
|
||||
try {
|
||||
ServiceRestResponse syncRossoGargano(HttpServletRequest request, @RequestParam(CommonConstants.PROFILE_DB) String configuration) throws Exception {
|
||||
|
||||
rossoGarganoSyncService.sync();
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
return ServiceRestResponse.createNegativeResponse(e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -395,50 +359,27 @@ public class ContabilController {
|
||||
public @ResponseBody
|
||||
ServiceRestResponse calcolaAmmortamenti(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestBody CalcAmmortamentoDTO calcAmmortamentoDTO) {
|
||||
@RequestBody CalcAmmortamentoDTO calcAmmortamentoDTO) throws Exception {
|
||||
|
||||
ServiceRestResponse response;
|
||||
try {
|
||||
ServiceRestResponse.createPositiveResponse(ammortamentiService.calcAmmortamento(calcAmmortamentoDTO));
|
||||
response = ServiceRestResponse.createPositiveResponse();
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
response = new ServiceRestResponse(EsitoType.KO, configuration, e);
|
||||
}
|
||||
return response;
|
||||
return ServiceRestResponse.createPositiveResponse(ammortamentiService.calcAmmortamento(calcAmmortamentoDTO));
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = EmsRestConstants.PATH_REGISTRA_MOVCONV_AMMORTAMENTI, method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse registraMovContAmmortamenti(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration,
|
||||
@RequestBody RegMovConAmmortamentoDTO regMovConAmmortamentoDTO) {
|
||||
@RequestBody RegMovConAmmortamentoDTO regMovConAmmortamentoDTO) throws Exception {
|
||||
|
||||
ServiceRestResponse response;
|
||||
try {
|
||||
ServiceRestResponse.createPositiveResponse(ammortamentiService.registraMovContAmmortamenti(regMovConAmmortamentoDTO));
|
||||
response = ServiceRestResponse.createPositiveResponse();
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
response = new ServiceRestResponse(EsitoType.KO, configuration, e);
|
||||
return ServiceRestResponse.createPositiveResponse(ammortamentiService.registraMovContAmmortamenti(regMovConAmmortamentoDTO));
|
||||
}
|
||||
return response;
|
||||
|
||||
}
|
||||
@RequestMapping(value = "allineaPartiteContabili", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse allineaPartiteContabili(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration) {
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String configuration) throws Exception {
|
||||
|
||||
|
||||
try {
|
||||
contabilService.allineaPartitaContabili();
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
} catch (Exception e) {
|
||||
logger.error(request.getRequestURI(), e);
|
||||
return ServiceRestResponse.createNegativeResponse(e);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -767,14 +767,10 @@ public class DocumentController {
|
||||
@RequestMapping(value = EmsRestConstants.PATH_REMOVE_FPX_INVIO_FILES, method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse removeFpxInvioFiles(HttpServletRequest request,
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String profileDb) {
|
||||
try {
|
||||
@RequestParam(CommonConstants.PROFILE_DB) String profileDb) throws Exception {
|
||||
|
||||
documentService.removeFpxInvioFiles();
|
||||
return ServiceRestResponse.createPositiveResponse();
|
||||
} catch (Exception ex) {
|
||||
logger.error(request.getRequestURI(), ex);
|
||||
return new ServiceRestResponse(EsitoType.KO, profileDb, ex);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -998,6 +994,7 @@ public class DocumentController {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@RequestMapping(value = "updateDtbDoctPrevistaFat", method = RequestMethod.POST)
|
||||
public @ResponseBody
|
||||
ServiceRestResponse updateDtbDoctPrevistaFat(HttpServletRequest request,
|
||||
|
||||
@@ -171,14 +171,16 @@ public class ExchangeColliImportService {
|
||||
mtbColrLavTableName, null, retrieveAlreadyImported);
|
||||
|
||||
|
||||
|
||||
mtbColtLav
|
||||
.parallelStream()
|
||||
.forEach(x -> {
|
||||
x.setMtbColr(mtbColrLav.stream()
|
||||
mtbColrLav.stream()
|
||||
.filter(y -> y.getDataCollo().equals(x.getDataCollo()) &&
|
||||
y.getGestione().equalsIgnoreCase(x.getGestione()) &&
|
||||
y.getNumCollo().equals(x.getNumCollo()) &&
|
||||
y.getSerCollo().equalsIgnoreCase(x.getSerCollo()))
|
||||
.collect(Collectors.toList()));
|
||||
.forEach(mtbColr -> x.getMtbColr().add(mtbColr));
|
||||
});
|
||||
|
||||
return mtbColtLav;
|
||||
|
||||
Reference in New Issue
Block a user