Commit 207c420e authored by prane's avatar prane

to check duplicate item in adpelement

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@184317 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 7941b165
...@@ -339,14 +339,11 @@ class ADPElement implements Cloneable ...@@ -339,14 +339,11 @@ class ADPElement implements Cloneable
//changed method arguments by sabyasachi 29-03-2011 //changed method arguments by sabyasachi 29-03-2011
public void setDemand(java.sql.Timestamp dueDate, double demand, String saleOrder, String itemCode) throws ITMException, Exception public void setDemand(java.sql.Timestamp dueDate, double demand, String saleOrder, String itemCode) throws ITMException, Exception
//public void setDemand(java.sql.Timestamp dueDate, double demand) //public void setDemand(java.sql.Timestamp dueDate, double demand)
{ {
System.out.println("Calling setDemand() for saleOrder["+saleOrder+"]itemCode["+itemCode+"]this.refId["+this.refId+"]"); System.out.println("--1--calling setDemand() itemCode["+this.getItemCode()+"]dueDate["+dueDate+"]siteCode["+this.getSiteCode()+"]planSupply["+this.planSupply+"]");
this.demand += demand; this.demand += demand;
//this.saleOrder = saleOrder;//Uncommented by manoj dtd 25/12/2014 //this.saleOrder = saleOrder;//Uncommented by manoj dtd 25/12/2014
//this.lineNo = lineNo;//Uncommented by manoj dtd 25/12/2014 //this.lineNo = lineNo;//Uncommented by manoj dtd 25/12/2014
System.out.println("this.refId---"+this.refId);
System.out.println("saleOrder---"+saleOrder);
System.out.println("demand---["+demand+"]");
//Commented by manoj dtd 25/12/2014 //Commented by manoj dtd 25/12/2014
String dueDateStr=""; String dueDateStr="";
//genericUtility = GenericUtility.getInstance(); //genericUtility = GenericUtility.getInstance();
...@@ -354,8 +351,7 @@ class ADPElement implements Cloneable ...@@ -354,8 +351,7 @@ class ADPElement implements Cloneable
SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
if( dueDate != null) if( dueDate != null)
{ {
dueDateStr = sdf.format(dueDate); dueDateStr = sdf.format(dueDate);
System.out.println("@@@@@ dueDateStr["+dueDateStr+"]");
} }
if(saleOrder!=null && saleOrder.trim().length()>0) if(saleOrder!=null && saleOrder.trim().length()>0)
...@@ -375,7 +371,7 @@ class ADPElement implements Cloneable ...@@ -375,7 +371,7 @@ class ADPElement implements Cloneable
public void setDemand(java.sql.Timestamp dueDate, double demand, String saleOrder, String lineNo,boolean isDetailReq) public void setDemand(java.sql.Timestamp dueDate, double demand, String saleOrder, String lineNo,boolean isDetailReq)
//public void setDemand(java.sql.Timestamp dueDate, double demand) //public void setDemand(java.sql.Timestamp dueDate, double demand)
{ {
System.out.println("Calling setDemand() for saleOrder["+saleOrder+"]lineNo["+lineNo+"]this.refId["+this.refId+"]"); System.out.println("--2--calling setDemand() itemCode["+this.getItemCode()+"]dueDate["+dueDate+"]siteCode["+this.getSiteCode()+"]planSupply["+this.planSupply+"]");
if(isDetailReq) if(isDetailReq)
{ {
this.demand+= demand; this.demand+= demand;
...@@ -383,10 +379,7 @@ class ADPElement implements Cloneable ...@@ -383,10 +379,7 @@ class ADPElement implements Cloneable
} }
//this.saleOrder = saleOrder; //this.saleOrder = saleOrder;
//this.lineNo = lineNo; //this.lineNo = lineNo;
System.out.println("this.refId---"+this.refId);
System.out.println("saleOrder---"+saleOrder);
System.out.println("demand---["+demand+"]");
if(saleOrder!=null && saleOrder.trim().length()>0) if(saleOrder!=null && saleOrder.trim().length()>0)
{ {
if(this.refId==null ||this.refId.trim().length()==0) if(this.refId==null ||this.refId.trim().length()==0)
...@@ -895,11 +888,12 @@ class ADPElement implements Cloneable ...@@ -895,11 +888,12 @@ class ADPElement implements Cloneable
//timeMRP.setDemand(demand,saleOrder,lineNo); //timeMRP.setDemand(demand,saleOrder,lineNo);
System.out.println("before setDemand() [" + demand + "] supply [" + supply + "]timeMRP.getDemand()["+timeMRP.getDemand()+"]" ); System.out.println("before setDemand() [" + demand + "] supply [" + supply + "]timeMRP.getDemand()["+timeMRP.getDemand()+"]" );
//Commented by Pavan R on 05/DEC/17 Start //Commented by Pavan R on 05/DEC/17 Start
// if(! (demand > 0 && timeMRP.getDemand() > 0 ))
// if(! (demand > 0 && timeMRP.getDemand() > 0 ))
// { // {
System.out.println("before set demand..."+demand); System.out.println("before set demand..."+demand);
timeMRP.setDemand(demand); timeMRP.setDemand(demand);
// } // }
//Commented by Pavan R on 05/DEC/17 End //Commented by Pavan R on 05/DEC/17 End
//end added by sabyasachi 29.03.2011 //end added by sabyasachi 29.03.2011
timeMRP.setSupply(supply); timeMRP.setSupply(supply);
...@@ -1039,8 +1033,9 @@ class ADPElement implements Cloneable ...@@ -1039,8 +1033,9 @@ class ADPElement implements Cloneable
//Added By Pavan Rane on 28MAR18[To Sort the TimeMRPList][Start] //Added By Pavan Rane on 28MAR18[To Sort the TimeMRPList][Start]
System.out.println("Collections.sorting...."+dueDate); System.out.println("Collections.sorting...."+dueDate);
Collections.sort(timeMRPArr, TimeMRP.timeMRPComparator); Collections.sort(timeMRPArr, TimeMRP.timeMRPComparator);
//Added By Pavan Rane on 28MAR18[To Sort the TimeMRPList][End] //Added By Pavan Rane on 28MAR18[End]
for (int ctr = 0; ctr < timeMRPArr.size(); ctr++) //commented by Pavan R on 27-apr-18 for to check duplicate item in adpelement
/*for (int ctr = 0; ctr < timeMRPArr.size(); ctr++)
{ {
timeMRP = (TimeMRP)timeMRPArr.get(ctr); timeMRP = (TimeMRP)timeMRPArr.get(ctr);
if (timeMRP.getDueDate().equals(dueDate)) if (timeMRP.getDueDate().equals(dueDate))
...@@ -1055,6 +1050,8 @@ class ADPElement implements Cloneable ...@@ -1055,6 +1050,8 @@ class ADPElement implements Cloneable
// end 10-04-2006 manoharan // end 10-04-2006 manoharan
} }
System.out.println("@@@@@@@1044 index["+index+"]timeMRPArr.size()["+timeMRPArr.size()+"]"); System.out.println("@@@@@@@1044 index["+index+"]timeMRPArr.size()["+timeMRPArr.size()+"]");
*/
//commented by Pavan R on 27-apr-18 end
for (int ctr = index; ctr < timeMRPArr.size(); ctr++) for (int ctr = index; ctr < timeMRPArr.size(); ctr++)
{ {
timeMRP = (TimeMRP)timeMRPArr.get(ctr); timeMRP = (TimeMRP)timeMRPArr.get(ctr);
...@@ -1064,11 +1061,10 @@ class ADPElement implements Cloneable ...@@ -1064,11 +1061,10 @@ class ADPElement implements Cloneable
timeMRP.setRunningDemand(runningDemand); timeMRP.setRunningDemand(runningDemand);
timeMRP.setRunningSupply(runningSupply); timeMRP.setRunningSupply(runningSupply);
// 10-04-2006 manoharan // 10-04-2006 manoharan
planSupply = timeMRP.getPlanSupply(); planSupply = timeMRP.getPlanSupply();
System.out.println("@@@@@@1055 planSupply["+planSupply+"]");
runningPlanSupply = runningPlanSupply + planSupply; runningPlanSupply = runningPlanSupply + planSupply;
timeMRP.setRunningPlanSupply(runningPlanSupply); timeMRP.setRunningPlanSupply(runningPlanSupply);
System.out.println("1069 runningPlanSupply ["+runningPlanSupply+"]"); System.out.println("updateRunningDemandSupply::itemCode["+this.getItemCode()+"]dueDate["+dueDate+"]siteCode["+this.getSiteCode()+"]runningDemand["+runningDemand+"] runningSupply["+runningSupply+"] planSupply["+planSupply+"] runningPlanSupply["+runningPlanSupply+"]");
// end 10-04-2006 manoharan // end 10-04-2006 manoharan
timeMRPArr.set(ctr, timeMRP); timeMRPArr.set(ctr, timeMRP);
} }
......
...@@ -277,9 +277,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -277,9 +277,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Pavan R on 09/oct/17 end //Pavan R on 09/oct/17 end
//added by Pavan R on 22/NOV/17 //added by Pavan R on 22/NOV/17
Map<String, ArrayList<String>> rmpmMap = new LinkedHashMap(); Map<String, ArrayList<String>> rmpmMap = new LinkedHashMap();
String mfgType1 = "";
//End added by Pavan R on 22/NOV/17 //End added by Pavan R on 22/NOV/17
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start] //Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
String Stksql = null; String Stksql = null;
PreparedStatement stkpstmt = null; PreparedStatement stkpstmt = null;
...@@ -287,7 +286,6 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -287,7 +286,6 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
Timestamp stockDate = null; Timestamp stockDate = null;
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End] //Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException, ITMException public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException, ITMException
{ {
System.out.println("Called process(string, string).....xtraParams["+xtraParams+"]"); System.out.println("Called process(string, string).....xtraParams["+xtraParams+"]");
...@@ -426,6 +424,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -426,6 +424,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
soItemList = genericUtility.getColumnValue("soItemList", dom); // added by cpatil soItemList = genericUtility.getColumnValue("soItemList", dom); // added by cpatil
System.out.println("@@@@@@soItemList["+soItemList+"]"); System.out.println("@@@@@@soItemList["+soItemList+"]");
yield = genericUtility.getColumnValue("yield", dom);//added by chandrashekar on 05-Feb-2015 yield = genericUtility.getColumnValue("yield", dom);//added by chandrashekar on 05-Feb-2015
//added by sagar on 28/05/2015, Start //added by sagar on 28/05/2015, Start
...@@ -1709,6 +1708,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -1709,6 +1708,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
} }
} }
//code added by sagar on 01/06/15, End.
//Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start] //Added by Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[Start]
System.out.println("dateFrom:["+dateFrom+"]"); System.out.println("dateFrom:["+dateFrom+"]");
Stksql = "select FN_MRP_DUEDATE(?) from dual"; Stksql = "select FN_MRP_DUEDATE(?) from dual";
...@@ -2024,7 +2024,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2024,7 +2024,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Added by Pavan R on 23/NOV/17 START //Added by Pavan R on 23/NOV/17 START
PreparedStatement pstmt1 = null; PreparedStatement pstmt1 = null;
ResultSet rs1 = null; ResultSet rs1 = null;
String sql1 = "", sqlFileName = "", adpQuery = "", masterSh = "", mfgType1 = ""; String sql1 = "", sqlFileName = "", adpQuery = "", masterSh = "";//, mfgType1 = "";
//Added by Pavan R on 23/NOV/17 END //Added by Pavan R on 23/NOV/17 END
// System.out.println("Database Name:............"+CommonConstants.DB_NAME); // System.out.println("Database Name:............"+CommonConstants.DB_NAME);
try try
...@@ -2104,7 +2104,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2104,7 +2104,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
sql = sql + "AND C.ITEM_SER <= ? "+subQuery+" ORDER BY ITEM_CODE ASC"; sql = sql + "AND C.ITEM_SER <= ? "+subQuery+" ORDER BY ITEM_CODE ASC";
} }
//System.out.println("BASE@@@@@ sql :["+sql+"]"); //System.out.println("BASE@@@@@ sql :["+sql+"]");
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCodeFrom); pstmt.setString(1, itemCodeFrom);
...@@ -3642,8 +3642,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3642,8 +3642,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// by Jiten 09/11/06 // by Jiten 09/11/06
if (adpElement != null) if (adpElement != null)
//Added by Pavan R 27-apr-18 to check duplicate item in adpelement
if("TPBP0822".equalsIgnoreCase(adpElement.getItemCode().trim()))
{
System.out.println("[0]adpeList.add found");
}
adpeList.add(adpElement); adpeList.add(adpElement);
System.out.println("adpeList@3514=["+adpeList+"]"); //Added by Pavan R 27-apr-18 end
//System.out.println("adpeList@3514=["+adpeList+"]");
//} //}
//Else Ended by Pavan R on 22/NOV/17 //Else Ended by Pavan R on 22/NOV/17
} }
...@@ -4406,6 +4412,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4406,6 +4412,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int ctr = 0; ctr < adpeList.size(); ctr++) for (int ctr = 0; ctr < adpeList.size(); ctr++)
{ {
ADPElement adpElement = (ADPElement) adpeList.get(ctr); ADPElement adpElement = (ADPElement) adpeList.get(ctr);
//Added by Pavan R 27-apr-18 to check duplicate item in adpelement
if("TPBP0822".equalsIgnoreCase(adpElement.getItemCode().trim()))
{
System.out.println("[1]---populateADPList()...");
}
//Added by Pavan R 27-apr-18 end
tempList.add(adpElement); tempList.add(adpElement);
} }
// adpeList.clear(); // adpeList.clear();
...@@ -6067,12 +6079,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6067,12 +6079,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//adpElement.setLineNo(lineNo); //adpElement.setLineNo(lineNo);
// cpatil end // cpatil end
//Commented by Pavan R on 19/JAN/2K18[Start]do not changes the dueDate from dateFrom //Commented by Pavan R on 19/JAN/2K18[Start]do not changes the dueDate from dateFrom
/*if (dueDate.compareTo(dateFrom) < 0) /*if (dueDate.compareTo(dateFrom) < 0)
{ {
dueDate = dateFrom; dueDate = dateFrom;
}*/ }*/
//[End]Pavan R on 19/JAN/2K18 //[End]Pavan R on 19/JAN/2K18
String bomitemCode1=""; //031016 String bomitemCode1=""; //031016
for(int ctr=0;ctr<adpeList.size();ctr++) for(int ctr=0;ctr<adpeList.size();ctr++)
{ {
...@@ -6138,6 +6152,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6138,6 +6152,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
int ctr = indexOfADPElement(siteCode, rsItemCode, saleOrder, lineNo); int ctr = indexOfADPElement(siteCode, rsItemCode, saleOrder, lineNo);
// 27-apr-18 manoharan in case not found for so/line get for site/item only
if (ctr == -1)
{
ctr = indexOfADPElement(siteCode, rsItemCode);
}
System.out.println("01/04/11---BHU saleOrder [" + saleOrder + "]rsItemCode["+rsItemCode+"] itemCode["+itemCode+"]lineNo [" + lineNo + "] ctr [" + ctr + "] [--"+rsItemCode+"]"); System.out.println("01/04/11---BHU saleOrder [" + saleOrder + "]rsItemCode["+rsItemCode+"] itemCode["+itemCode+"]lineNo [" + lineNo + "] ctr [" + ctr + "] [--"+rsItemCode+"]");
if (ctr > -1) if (ctr > -1)
...@@ -6193,9 +6212,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6193,9 +6212,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
*/ */
newADPElement.setSupply(dueDate, supply); newADPElement.setSupply(dueDate, supply);
//Added by Pavan R 27-apr-18 to check duplicate item in adpelement
if("TPBP0822".equalsIgnoreCase(newADPElement.getItemCode().trim()))
{
System.out.println("[1]adpeList.add found");
}
//Added by Pavan R 27-apr-18 end
adpeList.add(newADPElement); adpeList.add(newADPElement);
System.out.println("01/04/11 BHU not found adding saleOrder [" + saleOrder + "] lineNo [" + lineNo + "] ctr [" + ctr + "] rsItemCode ["+rsItemCode+""); //System.out.println("01/04/11 BHU not found adding saleOrder [" + saleOrder + "] lineNo [" + lineNo + "] ctr [" + ctr + "] rsItemCode ["+rsItemCode+"");
} }
/* /*
System.out.println("@@@@@@@@@ cpatil---------startadpeList.size()["+adpeList.size()+"]"); System.out.println("@@@@@@@@@ cpatil---------startadpeList.size()["+adpeList.size()+"]");
...@@ -6530,15 +6554,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6530,15 +6554,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
ADPElement adpElement = null; ADPElement adpElement = null;
try try
{ {
System.out.println("12/06/14 adpeList.size() [" + adpeList.size() + "]"); System.out.println("12/06/14 adpeList.size() [" + adpeList.size() + "]");
/*for (int ctr = 0; ctr < adpeList.size(); ctr++) /*for (int ctr = 0; ctr < adpeList.size(); ctr++)
{ {
adpElement = (ADPElement) adpeList.get(ctr); adpElement = (ADPElement) adpeList.get(ctr);
System.out.println("3237---"+adpElement.getSiteCode()+"---"+adpElement.getItemCode()+"---"+adpElement.getDemand()+"---"+adpElement.getSupply()+"---"+adpElement.getStockQty()+"---"+adpElement.getSaleOrder()); System.out.println("3237---"+adpElement.getSiteCode()+"---"+adpElement.getItemCode()+"---"+adpElement.getDemand()+"---"+adpElement.getSupply()+"---"+adpElement.getStockQty()+"---"+adpElement.getSaleOrder());
}*/ }*/
for (int cycle = 1; cycle <= processCycle; cycle++) for (int cycle = 1; cycle <= processCycle; cycle++)
{ {
System.out.println("12/06/14 Processing level no : [" + cycle + "] of [" + processCycle + "] adpeList.size() ["+ adpeList.size() + "]" ); System.out.println("12/06/14 Processing level no : [" + cycle + "] of [" + processCycle + "] adpeList.size() ["+ adpeList.size() + "]" );
...@@ -6561,6 +6582,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6561,6 +6582,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpeList.set(adpeCtr, adpElement); adpeList.set(adpeCtr, adpElement);
System.out.println("~~~~adpeList~~~~["+adpeList+"]"); System.out.println("~~~~adpeList~~~~["+adpeList+"]");
/*if(!isDetailReq) /*if(!isDetailReq)
{ {
adpElement = mrpOptimize(adpElement); adpElement = mrpOptimize(adpElement);
...@@ -6661,9 +6683,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6661,9 +6683,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if ((( supply - demand ) < reorderLevel && reorderLevel>0) || ((demand - supply)>0 && reorderLevel==0) ) if ((( supply - demand ) < reorderLevel && reorderLevel>0) || ((demand - supply)>0 && reorderLevel==0) )
{ {
ArrayList timeMRParr = adpElement.getTimeMrpList(); ArrayList timeMRParr = adpElement.getTimeMrpList();
System.out.println(" 6665----timeMRParr.size()---"+timeMRParr.size()); System.out.println("6667----timeMRParr.size()---"+timeMRParr.size());
System.out.println(" 6666----timeMRParr---"+timeMRParr);
//Added By Pavan R on 27/DEC/17 End
//Added By Pavan R on 27/DEC/17 Start for sorting the timeMRParr by dueDate for madeToOrder item //Added By Pavan R on 27/DEC/17 Start for sorting the timeMRParr by dueDate for madeToOrder item
//if(madeToOrder.equalsIgnoreCase("0") && (mfgType1.trim().equalsIgnoreCase("O") || mfgType1.trim().equalsIgnoreCase("D"))) //if(madeToOrder.equalsIgnoreCase("0") && (mfgType1.trim().equalsIgnoreCase("O") || mfgType1.trim().equalsIgnoreCase("D")))
//{ //{
...@@ -6673,12 +6693,15 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6673,12 +6693,15 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
*/ */
//Collections.sort(timeMRParr, TimeMRP.timeMRPComparator); //Collections.sort(timeMRParr, TimeMRP.timeMRPComparator);
//} //}
System.out.println("~~~~~~~~~~~~~~~before Sort~~~~~~~~~~~~~~~");
for (Object obj : timeMRParr) for (Object obj : timeMRParr)
{ {
TimeMRP timemrp =(TimeMRP)obj; TimeMRP timemrp =(TimeMRP)obj;
System.out.println("**** itemCode:["+itemCode+"] Demand:["+timemrp.getDemand()+"] Supply:["+timemrp.getSupply()+"] DueDate:["+timemrp.getDueDate()+"] PlanSupply["+timemrp.getPlanSupply()+"] RunningDemand:["+timemrp.getRunningDemand()+"] RunningSupply:["+timemrp.getRunningSupply()+"] RunningPlanSupply:["+timemrp.getRunningPlanSupply()+"]"); //Added by Pavan R 27-apr-18 to check duplicate item in adpelement
if("TPBP0822".equalsIgnoreCase(itemCode.trim()))
{
System.out.println("** 2 ** itemCode:["+itemCode+"] Demand:["+timemrp.getDemand()+"] Supply:["+timemrp.getSupply()+"] DueDate:["+timemrp.getDueDate()+"] PlanSupply["+timemrp.getPlanSupply()+"] RunningDemand:["+timemrp.getRunningDemand()+"] RunningSupply:["+timemrp.getRunningSupply()+"] RunningPlanSupply:["+timemrp.getRunningPlanSupply()+"]");
}
} }
//Added By Pavan R on 27/DEC/17 End //Added By Pavan R on 27/DEC/17 End
...@@ -7299,6 +7322,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7299,6 +7322,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End] //Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
adpElement.setDemand(dueDate, quantity, " ", " "); adpElement.setDemand(dueDate, quantity, " ", " ");
//Added by Pavan R 27-apr-18 to check duplicate item in adpelement
if("TPBP0822".equalsIgnoreCase(adpElement.getItemCode().trim()))
{
System.out.println("[2]adpeList.add found");
}
adpeList.add(adpElement); adpeList.add(adpElement);
} }
} catch (Exception e) } catch (Exception e)
...@@ -7337,6 +7365,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7337,6 +7365,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement = setAdpeValues(adpElement); adpElement = setAdpeValues(adpElement);
adpElement.setIndependentDemand(dueDate, quantity); adpElement.setIndependentDemand(dueDate, quantity);
adpElement.setSiteCodeCust(siteCodeCust); adpElement.setSiteCodeCust(siteCodeCust);
//Added by Pavan R 27-apr-18 to check duplicate item in adpelement
if("TPBP0822".equalsIgnoreCase(adpElement.getItemCode().trim()))
{
System.out.println("[3]adpeList.add found");
}
adpeList.add(adpElement); adpeList.add(adpElement);
System.out.println("adpeList@7117=["+adpeList+"]"); System.out.println("adpeList@7117=["+adpeList+"]");
} }
...@@ -7971,6 +8004,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7971,6 +8004,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
else else
{ {
//Commented by Pavan R 27-apr-18 to check duplicate item in adpelement
/*
if (saleOrder == null || saleOrder.trim().length() == 0 || !"M".equals(adpElement.getSuppSour())) if (saleOrder == null || saleOrder.trim().length() == 0 || !"M".equals(adpElement.getSuppSour()))
//if (saleOrder == null || saleOrder.trim().length() == 0 ) //if (saleOrder == null || saleOrder.trim().length() == 0 )
{ {
...@@ -8032,9 +8067,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8032,9 +8067,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End] //Pavan R on 2k18-JAN-29 to check where dueDate is less than stockDate[End]
newADPElement.setDemand(dueDate, quantity, saleOrder, lineNo); newADPElement.setDemand(dueDate, quantity, saleOrder, lineNo);
} }
if("TPBP0822".equalsIgnoreCase(newADPElement.getItemCode().trim()))
{
System.out.println("[4]adpeList.add found");
}
adpeList.add(newADPElement); adpeList.add(newADPElement);
} }*/
//Commented by Pavan R 27-apr-18 end
} }
//tmpadpList.add() //tmpadpList.add()
...@@ -8166,17 +8206,22 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8166,17 +8206,22 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
lineNo = " "; lineNo = " ";
} }
System.out.println("adpeList.size()------" + adpeList.size()); //System.out.println("adpeList.size()------" + adpeList.size());
for (ctr = 0; ctr < adpeList.size(); ctr++) for (ctr = 0; ctr < adpeList.size(); ctr++)
{ {
adpElement = (ADPElement) adpeList.get(ctr); adpElement = (ADPElement) adpeList.get(ctr);
//Added by Pavan R 27-apr-18 to check duplicate item in adpelement
if (itemCode.trim().equals("PMMS0035"))
{
System.out.println(" in indexOfADPElement ctr[" + ctr + "] item code [" + adpElement.getItemCode() + "]");
}
//System.out.println("BASEadpElement------getSiteCode" + adpElement.getSiteCode()); //System.out.println("BASEadpElement------getSiteCode" + adpElement.getSiteCode());
//System.out.println("BASEadpElement------getItemCode" + adpElement.getItemCode()); //System.out.println("BASEadpElement------getItemCode" + adpElement.getItemCode());
//System.out.println("BASEadpElement------getSaleOrder" + adpElement.getSaleOrder()); //System.out.println("BASEadpElement------getSaleOrder" + adpElement.getSaleOrder());
//System.out.println("BASEadpElement------getLineNo" + adpElement.getLineNo()); //System.out.println("BASEadpElement------getLineNo" + adpElement.getLineNo());
//System.out.println("BASEsiteCode["+siteCode+"]itemCode["+itemCode+"]saleOrder["+saleOrder+"]lineNo["+lineNo+"]"); //System.out.println("BASEsiteCode["+siteCode+"]itemCode["+itemCode+"]saleOrder["+saleOrder+"]lineNo["+lineNo+"]");
//if ((adpElement.getSiteCode().equals(siteCode)) && (adpElement.getItemCode().equals(itemCode)) && (adpElement.getSaleOrder().equals(saleOrder)) && (adpElement.getLineNo().equals(lineNo))) //if ((adpElement.getSiteCode().equals(siteCode)) && (adpElement.getItemCode().equals(itemCode)) && (adpElement.getSaleOrder().equals(saleOrder)) && (adpElement.getLineNo().equals(lineNo)))
if (( adpElement.getSiteCode().equals(siteCode)) && (adpElement.getItemCode().equals(itemCode)) && (adpElement.getSaleOrder().equals(saleOrder)) && ( (adpElement.getLineNo()==null?"":adpElement.getLineNo()).equals(lineNo))) if (( adpElement.getSiteCode().trim().equals(siteCode.trim())) && (adpElement.getItemCode().trim().equals(itemCode.trim())) && (adpElement.getSaleOrder().trim().equals(saleOrder.trim())) && ( (adpElement.getLineNo().trim()==null?"":adpElement.getLineNo().trim()).equals(lineNo.trim())))
{ {
retVal = ctr; retVal = ctr;
break; break;
...@@ -8187,12 +8232,18 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8187,12 +8232,18 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
private int indexOfADPElement(String siteCode, String itemCode) throws ITMException, Exception private int indexOfADPElement(String siteCode, String itemCode) throws ITMException, Exception
{ {
int retVal = -1, ctr = 0; int retVal = -1, ctr = 0;
ADPElement adpElement = null; ADPElement adpElement = null;
//retVal = indexOfADPElement(siteCode, itemCode, " ", " ");
//System.out.println("indexOfADPElement @ 8145 Called...");
System.out.println("adpeList.size()------" + adpeList.size()); System.out.println("adpeList.size()------" + adpeList.size());
for (ctr = 0; ctr < adpeList.size(); ctr++) for (ctr = 0; ctr < adpeList.size(); ctr++)
{ {
adpElement = (ADPElement) adpeList.get(ctr); adpElement = (ADPElement) adpeList.get(ctr);
//Added by Pavan R 27-apr-18 to check duplicate item in adpelement
if (itemCode.trim().equals("PMMS0035"))
{
System.out.println(" in indexOfADPElement ctr[" + ctr + "] item code [" + adpElement.getItemCode() + "]");
}
System.out.println("adpElement------" + adpElement.getSiteCode() + "----" + adpElement.getItemCode()); System.out.println("adpElement------" + adpElement.getSiteCode() + "----" + adpElement.getItemCode());
if ((adpElement.getSiteCode().equals(siteCode)) && (adpElement.getItemCode().equals(itemCode))) if ((adpElement.getSiteCode().equals(siteCode)) && (adpElement.getItemCode().equals(itemCode)))
{ {
...@@ -14053,6 +14104,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -14053,6 +14104,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
//System.out.println("BASEadpE.getBomCode()["+adpE1.getBomCode()+"]"); //System.out.println("BASEadpE.getBomCode()["+adpE1.getBomCode()+"]");
adpE1.setItemCodeParent(itemCodeParent); adpE1.setItemCodeParent(itemCodeParent);
//Added by Pavan R 27-apr-18 to check duplicate item in adpelement
if("TPBP0822".equalsIgnoreCase(adpE1.getItemCode().trim()))
{
System.out.println("[4]---childItems()...");
}
al1.add(adpE1); al1.add(adpE1);
//adpE.setDetList(null); //adpE.setDetList(null);
if((checkNull(adpE1.getBomCode()).trim()).length()>0) if((checkNull(adpE1.getBomCode()).trim()).length()>0)
......
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