IDEMPIERE-3799 Avoid users re-running a process that is already being processed / Peer review

This commit is contained in:
Carlos Ruiz 2018-10-06 20:25:26 +02:00
parent 0619c3d452
commit aacf45495f
2 changed files with 19 additions and 10 deletions

View File

@ -176,6 +176,7 @@ public class MPInstance extends X_AD_PInstance
if (!instanceParameter.equalParameter(para)) { if (!instanceParameter.equalParameter(para)) {
return false; return false;
} }
break;
} }
} }
} }

View File

@ -238,18 +238,26 @@ public class MPInstancePara extends X_AD_PInstance_Para
if (param == null) if (param == null)
return false; return false;
if (!Objects.equals(getP_String(),param.getP_String()) && !Objects.equals(getP_String_To(),param.getP_String_To())) String str = getP_String() == null ? "" : getP_String();
String strParam = param.getP_String() == null ? "" : param.getP_String();
String str2 = getP_String_To() == null ? "" : getP_String_To();
String str2Param = param.getP_String_To() == null ? "" : param.getP_String_To();
if (!Objects.equals(str, strParam) || !Objects.equals(str2, str2Param))
return false; return false;
BigDecimal bd = (BigDecimal)get_Value("P_Number"); BigDecimal bd = getP_Number();
BigDecimal bdParam = (BigDecimal)param.get_Value("P_Number"); BigDecimal bdParam = param.getP_Number();
BigDecimal bd2 = (BigDecimal)get_Value("P_Number_To"); BigDecimal bd2 = getP_Number_To();
BigDecimal bd2Param = (BigDecimal)param.get_Value("P_Number_To"); BigDecimal bd2Param = param.getP_Number_To();
if (!Objects.equals(bd,bdParam) && !Objects.equals(bd2,bd2Param)) if (!Objects.equals(bd, bdParam) || !Objects.equals(bd2, bd2Param))
return false; return false;
if (!Objects.equals(getP_Date(),param.getP_Date()) && !Objects.equals(getP_Date_To(),param.getP_Date_To())) Timestamp ts = getP_Date();
Timestamp tsParam = param.getP_Date();
Timestamp ts2 = getP_Date_To();
Timestamp ts2Param = param.getP_Date_To();
if (!Objects.equals(ts, tsParam) || !Objects.equals(ts2, ts2Param))
return false; return false;
return true; return true;