Merge branch 'master' into develop
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
Some checks failed
IntegryManagementSystem_Multi/pipeline/head There was a failure building this commit
This commit is contained in:
@@ -9,6 +9,7 @@ import it.integry.ems_model.base.EntityBase;
|
|||||||
import it.integry.ems_model.base.EquatableEntityInterface;
|
import it.integry.ems_model.base.EquatableEntityInterface;
|
||||||
import it.integry.ems_model.entity._enum.IBaseEnum;
|
import it.integry.ems_model.entity._enum.IBaseEnum;
|
||||||
import it.integry.ems_model.types.OperationType;
|
import it.integry.ems_model.types.OperationType;
|
||||||
|
import it.integry.ems_model.utility.UtilityBigDecimal;
|
||||||
import it.integry.ems_model.utility.UtilityString;
|
import it.integry.ems_model.utility.UtilityString;
|
||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
@@ -664,12 +665,13 @@ public class MtbColr extends EntityBase implements EquatableEntityInterface<MtbC
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasQuantity() {
|
||||||
|
return UtilityBigDecimal.isNullOrZero(qtaCol);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean hasDocument() {
|
public boolean hasDocument() {
|
||||||
MtbColt parent = (MtbColt) getParent();
|
MtbColt parent = (MtbColt) getParent();
|
||||||
if ( getOperation() == OperationType.DELETE && this.getQtaCol().equals(BigDecimal.ZERO))
|
return !(UtilityString.isNullOrEmpty(parent.getCodDtip()) && UtilityString.isNullOrEmpty(parent.getSerDoc()) && parent.getNumDoc() == null && parent.getDataDoc() == null);
|
||||||
return false;
|
|
||||||
else
|
|
||||||
return !(UtilityString.isNullOrEmpty(parent.getCodDtip()) && UtilityString.isNullOrEmpty(parent.getSerDoc()) && parent.getNumDoc() == null && parent.getDataDoc() == null );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void insertChilds() throws Exception {
|
protected void insertChilds() throws Exception {
|
||||||
@@ -695,7 +697,7 @@ public class MtbColr extends EntityBase implements EquatableEntityInterface<MtbC
|
|||||||
if (this == other)
|
if (this == other)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if(hashCodeKey() != other.hashCodeKey())
|
if (hashCodeKey() != other.hashCodeKey())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return Objects.equals(getDataCollo(), other.getDataCollo()) && Objects.equals(getGestione(), other.getGestione()) && Objects.equals(getSerCollo(), other.getSerCollo()) && Objects.equals(getNumCollo(), other.getNumCollo()) && Objects.equals(getRiga(), other.getRiga());
|
return Objects.equals(getDataCollo(), other.getDataCollo()) && Objects.equals(getGestione(), other.getGestione()) && Objects.equals(getSerCollo(), other.getSerCollo()) && Objects.equals(getNumCollo(), other.getNumCollo()) && Objects.equals(getRiga(), other.getRiga());
|
||||||
|
|||||||
@@ -308,7 +308,7 @@ rule "checkDeleteMtbColtWithDoc"
|
|||||||
no-loop
|
no-loop
|
||||||
when
|
when
|
||||||
eval(checkRulesEnabled)
|
eval(checkRulesEnabled)
|
||||||
$entity : MtbColt(operation == OperationType.DELETE && hasDocument)
|
$entity : MtbColt(operation == OperationType.DELETE && hasDocument && hasQuantity)
|
||||||
then
|
then
|
||||||
throw new CheckConstraintException("Impossibile eliminare un collo agganciato a documento");
|
throw new CheckConstraintException("Impossibile eliminare un collo agganciato a documento");
|
||||||
end
|
end
|
||||||
@@ -318,7 +318,7 @@ rule "checkDeleteMtbColtWithoutDoc"
|
|||||||
no-loop
|
no-loop
|
||||||
when
|
when
|
||||||
eval(checkRulesEnabled)
|
eval(checkRulesEnabled)
|
||||||
$entity : MtbColt(operation == OperationType.DELETE && !hasDocument)
|
$entity : MtbColt(operation == OperationType.DELETE && !hasDocument || !hasQuantity)
|
||||||
then
|
then
|
||||||
PackagesRules.checkForAnyColloRif(conn, $entity.getGestione(), $entity.getSerCollo(), $entity.getNumCollo(), $entity.getDataCollo());
|
PackagesRules.checkForAnyColloRif(conn, $entity.getGestione(), $entity.getSerCollo(), $entity.getNumCollo(), $entity.getDataCollo());
|
||||||
end
|
end
|
||||||
@@ -328,7 +328,7 @@ rule "checkDeleteMtbColrWithDoc"
|
|||||||
no-loop
|
no-loop
|
||||||
when
|
when
|
||||||
eval(checkRulesEnabled)
|
eval(checkRulesEnabled)
|
||||||
$entity : MtbColr(operation == OperationType.DELETE && hasDocument)
|
$entity : MtbColr(operation == OperationType.DELETE && hasDocument && hasQuantity)
|
||||||
then
|
then
|
||||||
throw new CheckConstraintException("Impossibile eliminare un collo agganciato a documento");
|
throw new CheckConstraintException("Impossibile eliminare un collo agganciato a documento");
|
||||||
end
|
end
|
||||||
@@ -338,7 +338,7 @@ rule "checkDeleteMtbColrWithoutDoc"
|
|||||||
no-loop
|
no-loop
|
||||||
when
|
when
|
||||||
eval(checkRulesEnabled)
|
eval(checkRulesEnabled)
|
||||||
$entity : MtbColr(operation == OperationType.DELETE && !hasDocument)
|
$entity : MtbColr(operation == OperationType.DELETE && !hasDocument || !hasQuantity)
|
||||||
then
|
then
|
||||||
PackagesRules.checkForAnyColloRif(conn, $entity.getGestione(), $entity.getSerCollo(), $entity.getNumCollo(), $entity.getDataCollo());
|
PackagesRules.checkForAnyColloRif(conn, $entity.getGestione(), $entity.getSerCollo(), $entity.getNumCollo(), $entity.getDataCollo());
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user