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
......@@ -340,13 +340,10 @@ class ADPElement implements Cloneable
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)
{
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.saleOrder = saleOrder;//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
String dueDateStr="";
//genericUtility = GenericUtility.getInstance();
......@@ -355,7 +352,6 @@ class ADPElement implements Cloneable
if( dueDate != null)
{
dueDateStr = sdf.format(dueDate);
System.out.println("@@@@@ dueDateStr["+dueDateStr+"]");
}
if(saleOrder!=null && saleOrder.trim().length()>0)
......@@ -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)
{
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)
{
this.demand+= demand;
......@@ -384,9 +380,6 @@ class ADPElement implements Cloneable
//this.saleOrder = saleOrder;
//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(this.refId==null ||this.refId.trim().length()==0)
......@@ -895,6 +888,7 @@ class ADPElement implements Cloneable
//timeMRP.setDemand(demand,saleOrder,lineNo);
System.out.println("before setDemand() [" + demand + "] supply [" + supply + "]timeMRP.getDemand()["+timeMRP.getDemand()+"]" );
//Commented by Pavan R on 05/DEC/17 Start
// if(! (demand > 0 && timeMRP.getDemand() > 0 ))
// {
System.out.println("before set demand..."+demand);
......@@ -1039,8 +1033,9 @@ class ADPElement implements Cloneable
//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++)
//Added By Pavan Rane on 28MAR18[End]
//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);
if (timeMRP.getDueDate().equals(dueDate))
......@@ -1055,6 +1050,8 @@ class ADPElement implements Cloneable
// end 10-04-2006 manoharan
}
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++)
{
timeMRP = (TimeMRP)timeMRPArr.get(ctr);
......@@ -1065,10 +1062,9 @@ class ADPElement implements Cloneable
timeMRP.setRunningSupply(runningSupply);
// 10-04-2006 manoharan
planSupply = timeMRP.getPlanSupply();
System.out.println("@@@@@@1055 planSupply["+planSupply+"]");
runningPlanSupply = runningPlanSupply + planSupply;
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
timeMRPArr.set(ctr, timeMRP);
}
......
......@@ -277,9 +277,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Pavan R on 09/oct/17 end
//added by Pavan R on 22/NOV/17
Map<String, ArrayList<String>> rmpmMap = new LinkedHashMap();
String mfgType1 = "";
//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]
String Stksql = null;
PreparedStatement stkpstmt = null;
......@@ -287,7 +286,6 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
Timestamp stockDate = null;
//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
{
System.out.println("Called process(string, string).....xtraParams["+xtraParams+"]");
......@@ -426,6 +424,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
soItemList = genericUtility.getColumnValue("soItemList", dom); // added by cpatil
System.out.println("@@@@@@soItemList["+soItemList+"]");
yield = genericUtility.getColumnValue("yield", dom);//added by chandrashekar on 05-Feb-2015
//added by sagar on 28/05/2015, Start
......@@ -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]
System.out.println("dateFrom:["+dateFrom+"]");
Stksql = "select FN_MRP_DUEDATE(?) from dual";
......@@ -2024,7 +2024,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Added by Pavan R on 23/NOV/17 START
PreparedStatement pstmt1 = 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
// System.out.println("Database Name:............"+CommonConstants.DB_NAME);
try
......@@ -3642,8 +3642,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// by Jiten 09/11/06
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);
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
}
......@@ -4406,6 +4412,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int ctr = 0; ctr < adpeList.size(); 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);
}
// adpeList.clear();
......@@ -6067,12 +6079,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//adpElement.setLineNo(lineNo);
// cpatil end
//Commented by Pavan R on 19/JAN/2K18[Start]do not changes the dueDate from dateFrom
/*if (dueDate.compareTo(dateFrom) < 0)
{
dueDate = dateFrom;
}*/
//[End]Pavan R on 19/JAN/2K18
String bomitemCode1=""; //031016
for(int ctr=0;ctr<adpeList.size();ctr++)
{
......@@ -6138,6 +6152,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
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+"]");
if (ctr > -1)
......@@ -6193,9 +6212,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
*/
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);
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()+"]");
......@@ -6530,15 +6554,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
ADPElement adpElement = null;
try
{
System.out.println("12/06/14 adpeList.size() [" + adpeList.size() + "]");
/*for (int ctr = 0; ctr < adpeList.size(); ctr++)
{
adpElement = (ADPElement) adpeList.get(ctr);
System.out.println("3237---"+adpElement.getSiteCode()+"---"+adpElement.getItemCode()+"---"+adpElement.getDemand()+"---"+adpElement.getSupply()+"---"+adpElement.getStockQty()+"---"+adpElement.getSaleOrder());
}*/
for (int cycle = 1; cycle <= processCycle; cycle++)
{
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
adpeList.set(adpeCtr, adpElement);
System.out.println("~~~~adpeList~~~~["+adpeList+"]");
/*if(!isDetailReq)
{
adpElement = mrpOptimize(adpElement);
......@@ -6661,9 +6683,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if ((( supply - demand ) < reorderLevel && reorderLevel>0) || ((demand - supply)>0 && reorderLevel==0) )
{
ArrayList timeMRParr = adpElement.getTimeMrpList();
System.out.println(" 6665----timeMRParr.size()---"+timeMRParr.size());
System.out.println(" 6666----timeMRParr---"+timeMRParr);
//Added By Pavan R on 27/DEC/17 End
System.out.println("6667----timeMRParr.size()---"+timeMRParr.size());
//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")))
//{
......@@ -6674,11 +6694,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Collections.sort(timeMRParr, TimeMRP.timeMRPComparator);
//}
System.out.println("~~~~~~~~~~~~~~~before Sort~~~~~~~~~~~~~~~");
for (Object obj : timeMRParr)
{
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
......@@ -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]
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);
}
} catch (Exception e)
......@@ -7337,6 +7365,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement = setAdpeValues(adpElement);
adpElement.setIndependentDemand(dueDate, quantity);
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);
System.out.println("adpeList@7117=["+adpeList+"]");
}
......@@ -7971,6 +8004,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
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 )
{
......@@ -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]
newADPElement.setDemand(dueDate, quantity, saleOrder, lineNo);
}
if("TPBP0822".equalsIgnoreCase(newADPElement.getItemCode().trim()))
{
System.out.println("[4]adpeList.add found");
}
adpeList.add(newADPElement);
}
}*/
//Commented by Pavan R 27-apr-18 end
}
//tmpadpList.add()
......@@ -8166,17 +8206,22 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
lineNo = " ";
}
System.out.println("adpeList.size()------" + adpeList.size());
//System.out.println("adpeList.size()------" + adpeList.size());
for (ctr = 0; ctr < adpeList.size(); 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------getItemCode" + adpElement.getItemCode());
//System.out.println("BASEadpElement------getSaleOrder" + adpElement.getSaleOrder());
//System.out.println("BASEadpElement------getLineNo" + adpElement.getLineNo());
//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()==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;
break;
......@@ -8188,11 +8233,17 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
int retVal = -1, ctr = 0;
ADPElement adpElement = null;
//retVal = indexOfADPElement(siteCode, itemCode, " ", " ");
//System.out.println("indexOfADPElement @ 8145 Called...");
System.out.println("adpeList.size()------" + adpeList.size());
for (ctr = 0; ctr < adpeList.size(); 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());
if ((adpElement.getSiteCode().equals(siteCode)) && (adpElement.getItemCode().equals(itemCode)))
{
......@@ -14053,6 +14104,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
//System.out.println("BASEadpE.getBomCode()["+adpE1.getBomCode()+"]");
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);
//adpE.setDetList(null);
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