Finish Hotfix-72

This commit is contained in:
2024-07-23 17:23:29 +02:00
5 changed files with 41 additions and 9 deletions

View File

@@ -400,12 +400,7 @@ public class DocumentCheckRules {
// IN CASO DI NUMERAZIONE MANUALE VIENE CONTROLLATA L'ESISTENZA DEL DOCUMENTO NELL'ANNO, NEL TIPO, NELLA SERIE,
// NEL NUMERO E NEL CLI/FOR DEL DOCUMENTO CHE SI STA SALVANDO SOLO SE SI TRATTA DI ACQUISTI DEVE CONTROLLARE ANCHE
// IL DESTINARIO MERCE (MITTENTE PER ACQUISTi) NECESSARIO PER CHI GESTISCE LA RIFATTURAZIONE
if ("DIRETTA".contentEquals(tipoEmissione) && codCcau == null && "A".equals(gestione)) {
if (!UtilityString.streNull(entity.getCodVdes()).equals("")) {
codVdes = UtilityDB.valueToString(UtilityString.streNull(entity.getCodVdes()));
} else {
codVdes = UtilityDB.valueToString(UtilityString.streNull(entity.getCodVdes()));
}
if ("DIRETTA".equalsIgnoreCase(tipoEmissione) && codCcau == null && "A".equalsIgnoreCase(gestione)) {
sql =
"SELECT cod_anag, " +
@@ -419,7 +414,7 @@ public class DocumentCheckRules {
" Datepart(year, dtb_doct.data_doc) = " + UtilityDB.valueToString(annoDoc) + " AND " +
" ser_doc = " + UtilityDB.valueToString(serDoc) + " AND " +
" num_doc = " + UtilityDB.valueToString(numDoc) + " AND " +
" IsNull(cod_vdes, '') = " + codVdes;
" IsNull(cod_vdes, '') = ISNULL(" + UtilityDB.valueToString(entity.getCodVdes())+",'')";
} else {
sql =
"SELECT cod_anag, " +

View File

@@ -3,6 +3,9 @@ package it.integry.ems.production.dto;
import it.integry.ems_model.annotation.SqlField;
public class PvmAuthorizationDTO {
@SqlField("user_name")
private String username;
@SqlField("authorization_name")
private String authorizationName;
@SqlField("editable")
@@ -12,6 +15,14 @@ public class PvmAuthorizationDTO {
@SqlField("visible")
private String visible;
public String getUsername() {
return username;
}
public PvmAuthorizationDTO setUsername(String username) {
this.username = username;
return this;
}
public String getAuthorizationName() {
return authorizationName;

View File

@@ -438,6 +438,7 @@ public class ProductionOrderDataHandlerService {
" dtb_ordt.descr_estesa_prod, " +
" dtb_ordr.num_cnf, " +
" mtb_aart.qta_cnf, " +
" mtb_aart.peso_kg, " +
" mtb_aart.gg_scad_partita, " +
" dtb_ordr.pos_riga, " +
" dtb_ordt.flag_evaso_prod, " +

View File

@@ -797,4 +797,14 @@ public class PvmController {
}
@RequestMapping(value = "pvm/gestione/{section}/utenti", method = RequestMethod.GET)
public @ResponseBody
ServiceRestResponse retrieveSectionUsers(@RequestParam(CommonConstants.PROFILE_DB) String profileDB,
@PathVariable String section) throws Exception {
return ServiceRestResponse.createPositiveResponse(pvmService.retrieveSectionUsers(section));
}
}

View File

@@ -3772,10 +3772,25 @@ public class PvmService {
String sql = "SELECT dw_colname AS authorization_name, display_only as editable, enabled, visible\n" +
"FROM stb_edit_limit\n" +
"WHERE gest_name = 'PVM'\n" +
" AND dw_name = "+UtilityDB.valueToString(section)+"\n" +
" AND user_name = "+ UtilityDB.valueToString(username)+" ";
" AND dw_name = " + UtilityDB.valueToString(section) + "\n" +
" AND user_name = " + UtilityDB.valueToString(username) + " ";
return UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, PvmAuthorizationDTO.class);
}
public Map<String, List<PvmAuthorizationDTO>> retrieveSectionUsers(String section) throws Exception {
String username = requestDataDTO.getUsername();
String sql = "SELECT stb_abil.user_name, dw_colname AS authorization_name,display_only as editable, enabled, visible\n" +
" FROM stb_abil\n" +
" INNER JOIN wtb_users ON stb_abil.user_name = Wtb_users.User_name\n" +
" LEFT OUTER JOIN stb_edit_limit ON stb_edit_limit.gest_name = 'PVM' AND dw_name = stb_abil.gest_name and stb_edit_limit.user_name = stb_abil.User_name \n" +
" WHERE stb_Abil.gest_name = " + UtilityDB.valueToString(section);
List<PvmAuthorizationDTO> permessi = UtilityDB.executeSimpleQueryDTO(multiDBTransactionManager.getPrimaryConnection(), sql, PvmAuthorizationDTO.class);
if (UtilityList.isNullOrEmpty(permessi))
return null;
return permessi.stream().collect(Collectors.groupingBy(PvmAuthorizationDTO::getUsername));
}
}