correzione importazione documenti infragruppo e cambio menu'
This commit is contained in:
@@ -26,8 +26,9 @@ public class MenuConfigurationController {
|
|||||||
|
|
||||||
@RequestMapping(value = "refresh", method = RequestMethod.GET)
|
@RequestMapping(value = "refresh", method = RequestMethod.GET)
|
||||||
public @ResponseBody
|
public @ResponseBody
|
||||||
ServiceRestResponse refresh(@RequestParam(CommonConstants.PROFILE_DB) String profileDB) throws Exception {
|
ServiceRestResponse refresh(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
|
||||||
menuConfigurationService.refresh(multiDBTransactionManager.getPrimaryConnection());
|
@RequestParam(required = false, defaultValue = "false") boolean forceRefresh) throws Exception {
|
||||||
|
menuConfigurationService.refresh(multiDBTransactionManager.getPrimaryConnection(), forceRefresh);
|
||||||
return ServiceRestResponse.createPositiveResponse();
|
return ServiceRestResponse.createPositiveResponse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,9 +74,9 @@ public class MenuConfigurationService {
|
|||||||
return historyProfileDB.equalsIgnoreCase(advancedDataSource.getProfileName());
|
return historyProfileDB.equalsIgnoreCase(advancedDataSource.getProfileName());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void refresh(Connection connection) throws Exception {
|
public void refresh(Connection connection, boolean forceRefresh) throws Exception {
|
||||||
final MenuConfigDTO menuConfig = loadMenuData();
|
final MenuConfigDTO menuConfig = loadMenuData();
|
||||||
internalRefresh(connection, menuConfig);
|
internalRefresh(connection, menuConfig, forceRefresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
private MenuConfigDTO loadMenuData() throws IOException {
|
private MenuConfigDTO loadMenuData() throws IOException {
|
||||||
@@ -91,9 +91,14 @@ public class MenuConfigurationService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void internalRefresh(Connection connection, MenuConfigDTO menuConfig) throws Exception {
|
private void internalRefresh(Connection connection, MenuConfigDTO menuConfig) throws Exception {
|
||||||
|
internalRefresh(connection, menuConfig, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void internalRefresh(Connection connection, MenuConfigDTO menuConfig, boolean forceRefresh) throws Exception {
|
||||||
final Azienda azienda = Azienda.getDefaultAzienda(connection);
|
final Azienda azienda = Azienda.getDefaultAzienda(connection);
|
||||||
int lastMenuUpd = Integer.parseInt(azienda.getLastUpgDbMenu().replace("QM", ""));
|
int lastMenuUpd = Integer.parseInt(azienda.getLastUpgDbMenu().replace("QM", ""));
|
||||||
|
|
||||||
|
if (!forceRefresh && lastMenuUpd > 0)
|
||||||
if (lastMenuUpd >= menuConfig.getVersion())
|
if (lastMenuUpd >= menuConfig.getVersion())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -58,15 +58,6 @@ then
|
|||||||
modify ( $docR ) { setCodMart(codMart) }
|
modify ( $docR ) { setCodMart(codMart) }
|
||||||
end
|
end
|
||||||
|
|
||||||
rule "completeInsPartitaMagDocA"
|
|
||||||
when
|
|
||||||
eval(completeRulesEnabled)
|
|
||||||
$docR : DtbDocr( partitaMag != null && partitaMag != "[NULL]" && codMart != null && gestione == "A")
|
|
||||||
then
|
|
||||||
MtbPartitaMag partitaMag = DocumentRules.insertPartitaMag(conn, $docR);
|
|
||||||
modify ( $docR ) { setMtbPartitaMag(partitaMag) }
|
|
||||||
end
|
|
||||||
|
|
||||||
rule "completeDatiListinoDocA"
|
rule "completeDatiListinoDocA"
|
||||||
no-loop
|
no-loop
|
||||||
salience 1
|
salience 1
|
||||||
|
|||||||
@@ -286,6 +286,15 @@ then
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
rule "completeInsPartitaMagDoc"
|
||||||
|
when
|
||||||
|
eval(completeRulesEnabled)
|
||||||
|
$docR : DtbDocr( partitaMag != null && partitaMag != "[NULL]" && codMart != null && gestione != null && gestione != "L")
|
||||||
|
then
|
||||||
|
MtbPartitaMag partitaMag = DocumentRules.insertPartitaMag(conn, $docR);
|
||||||
|
modify ( $docR ) { setMtbPartitaMag(partitaMag) }
|
||||||
|
end
|
||||||
|
|
||||||
rule "completeUntDoc"
|
rule "completeUntDoc"
|
||||||
salience -10
|
salience -10
|
||||||
no-loop
|
no-loop
|
||||||
|
|||||||
Reference in New Issue
Block a user