sportata regola
This commit is contained in:
@@ -221,8 +221,7 @@ public class CommonRules extends QueryRules {
|
||||
return finalList;
|
||||
}
|
||||
|
||||
public static void updateDescrDistintaBase(Connection conn, EntityBase entityBase) throws Exception {
|
||||
MtbAart mtbAart = (MtbAart) entityBase;
|
||||
public static void updateDescrDistintaBase(Connection conn, MtbAart mtbAart) throws Exception {
|
||||
String sql =
|
||||
"SELECT descrizione, descrizione_estesa " +
|
||||
" FROM mtb_aart " +
|
||||
@@ -995,7 +994,11 @@ public class CommonRules extends QueryRules {
|
||||
return mtbAartMarchio;
|
||||
}
|
||||
|
||||
public static String getIdArtEqui(Connection conn, MtbAart entity) throws Exception {
|
||||
public static void setIdArtEqui(Connection conn, MtbAart entity) throws Exception {
|
||||
String sql = "select CAst( case when dbo.getGestSetup( 'MTB_AART', 'ID_ART_EQUI', 'INSERT_AUTO') = 'N' THEN 0 ELSE 1 END as BIT)";
|
||||
Boolean setSetIdArtEqui = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
if ( !setSetIdArtEqui ) return;
|
||||
|
||||
Map<String, Object> data = new HashMap<>();
|
||||
data.put("cod_mgrp", entity.getCodMgrp());
|
||||
data.put("cod_msgr", entity.getCodMsgr());
|
||||
@@ -1008,7 +1011,7 @@ public class CommonRules extends QueryRules {
|
||||
// Convertire in JSON
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
String jsonParm = objectMapper.writeValueAsString(data);
|
||||
String sql =
|
||||
sql =
|
||||
String.format(
|
||||
"SELECT * FROM dbo.suggestMtbArtEqui('%s') " ,
|
||||
jsonParm);
|
||||
@@ -1021,10 +1024,8 @@ public class CommonRules extends QueryRules {
|
||||
.setFlagEquiPrezzo("T");
|
||||
mtbAartEqui.setOperation(OperationType.INSERT_OR_UPDATE);
|
||||
}
|
||||
return idArtEqui;
|
||||
entity.setIdArtEqui(idArtEqui);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static MtbAartEqui insEqui(Connection conn, MtbAart entity) throws Exception {
|
||||
|
||||
@@ -303,8 +303,6 @@ public class MtbAart extends EntityBase implements EquatableEntityInterface<MtbA
|
||||
@SqlField(value = "tipo_codice_imballo", maxLength = 10)
|
||||
private String tipoCodiceImballo;
|
||||
|
||||
private Boolean setIdArtEqui;
|
||||
|
||||
@Priority(1)
|
||||
private MtbAartMarchio mtbAartMarchio;
|
||||
|
||||
@@ -1170,13 +1168,6 @@ public class MtbAart extends EntityBase implements EquatableEntityInterface<MtbA
|
||||
this.classificazioneAbc = classificazioneAbc;
|
||||
}
|
||||
|
||||
/*public List<MtbPart> getMtbPart() {
|
||||
return mtbPart;
|
||||
}
|
||||
|
||||
public void setMtbPart(List<MtbPart> mtbPart) {
|
||||
this.mtbPart = mtbPart;
|
||||
}*/
|
||||
public String getTipoCodiceImballo() {
|
||||
return tipoCodiceImballo;
|
||||
}
|
||||
@@ -1186,15 +1177,6 @@ public class MtbAart extends EntityBase implements EquatableEntityInterface<MtbA
|
||||
return this;
|
||||
}
|
||||
|
||||
public Boolean getSetIdArtEqui() {
|
||||
return setIdArtEqui;
|
||||
}
|
||||
|
||||
public MtbAart setSetIdArtEqui(Boolean setIdArtEqui) {
|
||||
this.setIdArtEqui = setIdArtEqui;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<MtbAartAnag> getMtbAartAnag() {
|
||||
return mtbAartAnag;
|
||||
}
|
||||
|
||||
@@ -127,18 +127,6 @@ then
|
||||
}
|
||||
end
|
||||
|
||||
rule "completeSetIdArtEquiAuto"
|
||||
no-loop
|
||||
when
|
||||
eval(completeRulesEnabled)
|
||||
$entity : MtbAart(idArtEqui == null && setIdArtEqui != null && setIdArtEqui && operation != OperationType.DELETE)
|
||||
then
|
||||
String idArtEqui = CommonRules.getIdArtEqui(conn, $entity);
|
||||
modify($entity){
|
||||
setIdArtEqui(idArtEqui)}
|
||||
|
||||
end
|
||||
|
||||
rule "completeInsEqui"
|
||||
no-loop
|
||||
when
|
||||
@@ -203,17 +191,6 @@ then
|
||||
modify ( $entity ) { setArticoloComposto("N") }
|
||||
end
|
||||
|
||||
rule "completeSetIdArtEqui"
|
||||
no-loop
|
||||
when
|
||||
eval(completeRulesEnabled)
|
||||
$entity : MtbAart(setIdArtEqui == null)
|
||||
then
|
||||
String sql = "select CAst( case when dbo.getGestSetup( 'MTB_AART', 'ID_ART_EQUI', 'INSERT_AUTO') = 'N' THEN 0 ELSE 1 END as BIT)";
|
||||
Boolean setSetIdArtEqui = UtilityDB.executeSimpleQueryOnlyFirstRowFirstColumn(conn, sql);
|
||||
modify ( $entity ) { setSetIdArtEqui(setSetIdArtEqui) }
|
||||
end
|
||||
|
||||
rule "completeDescrEstesaArt"
|
||||
when
|
||||
eval(completeRulesEnabled)
|
||||
|
||||
@@ -105,10 +105,9 @@ no-loop
|
||||
when
|
||||
eval(postRulesEnabled)
|
||||
$mtbAart: MtbAart()
|
||||
$entity : EntityBase() from $mtbAart
|
||||
then
|
||||
|
||||
CommonRules.updateDescrDistintaBase(conn, $entity);
|
||||
then
|
||||
CommonRules.setIdArtEqui(conn, $mtbAart);
|
||||
CommonRules.updateDescrDistintaBase(conn, $mtbAart);
|
||||
end
|
||||
|
||||
rule "completeIdRigaCtbScad"
|
||||
|
||||
Reference in New Issue
Block a user