Commit 50508a1c authored by prane's avatar prane

Changes merged to head

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@182739 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 2742a752
package ibase.webitm.ejb.mfg;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
......@@ -450,9 +451,11 @@ class ADPElement implements Cloneable
public void setPlanSupply(java.sql.Timestamp dueDate, double supply)
{
System.out.println("Before SetPlanSupply itemCode["+itemCode+"] dueDate:["+dueDate+"] supply["+supply+"] planSupply["+planSupply+"]");
this.planSupply += supply;
//updateTimeMrp(dueDate, 0, supply, 0, 0," "," ");
updateTimeMrp(dueDate, 0, supply, 0, 0);
System.out.println("After SetPlanSupply itemCode["+itemCode+"] dueDate:["+dueDate+"] supply["+supply+"] planSupply["+planSupply+"]");
}
public double getPlanSupply()
{
......@@ -1033,6 +1036,10 @@ class ADPElement implements Cloneable
TimeMRP timeMRP = null;
try
{
//Added By Pavan Rane on 28MAR18[To Sort the TimeMRPList][Start]
System.out.println("Collections.sorting...."+dueDate);
Collections.sort(timeMRPArr, TimeMRP.timeMRPComparator);
//Added By Pavan Rane on 28MAR18[To Sort the TimeMRPList][End]
for (int ctr = 0; ctr < timeMRPArr.size(); ctr++)
{
timeMRP = (TimeMRP)timeMRPArr.get(ctr);
......@@ -1061,6 +1068,7 @@ class ADPElement implements Cloneable
System.out.println("@@@@@@1055 planSupply["+planSupply+"]");
runningPlanSupply = runningPlanSupply + planSupply;
timeMRP.setRunningPlanSupply(runningPlanSupply);
System.out.println("1069 runningPlanSupply ["+runningPlanSupply+"]");
// end 10-04-2006 manoharan
timeMRPArr.set(ctr, timeMRP);
}
......
......@@ -4,9 +4,10 @@ import ibase.webitm.ejb.mfg.TimeMRP;
//import java.util.ArrayList;
//import java.sql.Timestamp;
import ibase.webitm.utility.ITMException;
import java.text.SimpleDateFormat;
import java.util.Comparator;
public class TimeMRP
{
private java.sql.Timestamp dueDate;
......@@ -124,9 +125,17 @@ public class TimeMRP
{
return this.runningSupply;
}
public void setPlanSupply(double supply)
public void setPlanSupply(double supply) throws ITMException
{
this.planSupply += supply;
//Pavan R on Marcch2018 added below chnages
System.out.println("runningDemand:["+this.runningDemand+"]planSupply["+this.planSupply+"]");
if(this.runningDemand <= 0 ) //this.planSupply)
{
throw new ITMException(new Exception("runningDemand is less than planSupply"));
}
//end
}
public double getPlanSupply()
{
......@@ -202,20 +211,20 @@ public class TimeMRP
//{
// return this.lineNo;
//}
//end added by sabyasachi 17.03.2011
//end added by sabyasachi 17.03.2011
//Added By Pavan R on 29/DEC/17 Start for sorting the timeMRParr by dueDate for madeToOrder item
public static Comparator<TimeMRP> timeMRPComparator = new Comparator<TimeMRP>() {
public static Comparator<TimeMRP> timeMRPComparator = new Comparator<TimeMRP>() {
public int compare(TimeMRP s1, TimeMRP s2)
{
System.out.println("inside comparator["+s1.getDueDate()+"]["+s2.getDueDate()+"]");
//ascending order
return s1.getDueDate().compareTo(s2.getDueDate());
//descending order
//return KeyMRPBean2.compareTo(KeyMRPBean1);
}
};
//Collections.sort(timeMRPArr, TimeMRP.timeMRPComparator);
//Added By Pavan R on 29/DEC/17 End
public int compare(TimeMRP s1, TimeMRP s2)
{
System.out.println("inside comparator["+s1.getDueDate()+"]["+s2.getDueDate()+"]");
//ascending order
return s1.getDueDate().compareTo(s2.getDueDate());
//descending order
//return KeyMRPBean2.compareTo(KeyMRPBean1);
}
};
//Collections.sort(timeMRPArr, TimeMRP.timeMRPComparator);
//Added By Pavan R on 29/DEC/17 End
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment