Commit b394729c authored by prane's avatar prane

changed cell styles instance creation outside loop and added BaseLogger

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@194973 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fc88a8b3
...@@ -5,6 +5,7 @@ import java.util.Collections; ...@@ -5,6 +5,7 @@ import java.util.Collections;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
import java.util.Set; import java.util.Set;
import ibase.utility.BaseLogger;
//import ibase.webitm.utility.ITMException; //import ibase.webitm.utility.ITMException;
//import ibase.webitm.utility.GenericUtility; //import ibase.webitm.utility.GenericUtility;
import ibase.utility.E12GenericUtility; import ibase.utility.E12GenericUtility;
...@@ -340,7 +341,8 @@ class ADPElement implements Cloneable ...@@ -340,7 +341,8 @@ 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, 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("--1--calling setDemand() itemCode["+this.getItemCode()+"]dueDate["+dueDate+"]siteCode["+this.getSiteCode()+"]planSupply["+this.planSupply+"]"); //System.out.println("--1--calling setDemand() itemCode["+this.getItemCode()+"]dueDate["+dueDate+"]siteCode["+this.getSiteCode()+"]planSupply["+this.planSupply+"]");
BaseLogger.log( "9", null, null, "--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
...@@ -371,7 +373,8 @@ class ADPElement implements Cloneable ...@@ -371,7 +373,8 @@ 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("--2--calling setDemand() itemCode["+this.getItemCode()+"]dueDate["+dueDate+"]siteCode["+this.getSiteCode()+"]planSupply["+this.planSupply+"]"); //System.out.println("--2--calling setDemand() itemCode["+this.getItemCode()+"]dueDate["+dueDate+"]siteCode["+this.getSiteCode()+"]planSupply["+this.planSupply+"]");
BaseLogger.log( "9", null, null, "--2--calling setDemand() itemCode["+this.getItemCode()+"]dueDate["+dueDate+"]siteCode["+this.getSiteCode()+"]planSupply["+this.planSupply+"]");
if(isDetailReq) if(isDetailReq)
{ {
this.demand+= demand; this.demand+= demand;
...@@ -403,7 +406,8 @@ class ADPElement implements Cloneable ...@@ -403,7 +406,8 @@ class ADPElement implements Cloneable
public void setSupply(java.sql.Timestamp dueDate, double supply) public void setSupply(java.sql.Timestamp dueDate, double supply)
{ {
this.supply += supply; this.supply += supply;
System.out.println("@@@@@020415:::this.reorderLevel["+this.reorderLevel+"]"); //System.out.println("@@@@@020415:::this.reorderLevel["+this.reorderLevel+"]");
BaseLogger.log( "9", null, null, "@@@@@020415:::this.reorderLevel["+this.reorderLevel+"]");
//updateTimeMrp(dueDate, 0, supply, 0, 0," "," "); //updateTimeMrp(dueDate, 0, supply, 0, 0," "," ");
/*if(this.reorderLevel>0) /*if(this.reorderLevel>0)
{ {
...@@ -444,11 +448,13 @@ class ADPElement implements Cloneable ...@@ -444,11 +448,13 @@ class ADPElement implements Cloneable
public void setPlanSupply(java.sql.Timestamp dueDate, double supply) public void setPlanSupply(java.sql.Timestamp dueDate, double supply)
{ {
System.out.println("Before SetPlanSupply itemCode["+itemCode+"] dueDate:["+dueDate+"] supply["+supply+"] planSupply["+planSupply+"]"); //System.out.println("Before SetPlanSupply itemCode["+itemCode+"] dueDate:["+dueDate+"] supply["+supply+"] planSupply["+planSupply+"]");
BaseLogger.log( "9", null, null, "Before SetPlanSupply itemCode["+itemCode+"] dueDate:["+dueDate+"] supply["+supply+"] planSupply["+planSupply+"]");
this.planSupply += supply; this.planSupply += supply;
//updateTimeMrp(dueDate, 0, supply, 0, 0," "," "); //updateTimeMrp(dueDate, 0, supply, 0, 0," "," ");
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+"]"); //System.out.println("After SetPlanSupply itemCode["+itemCode+"] dueDate:["+dueDate+"] supply["+supply+"] planSupply["+planSupply+"]");
BaseLogger.log( "9", null, null, "After SetPlanSupply itemCode["+itemCode+"] dueDate:["+dueDate+"] supply["+supply+"] planSupply["+planSupply+"]");
} }
public double getPlanSupply() public double getPlanSupply()
{ {
...@@ -843,7 +849,8 @@ class ADPElement implements Cloneable ...@@ -843,7 +849,8 @@ class ADPElement implements Cloneable
int timeEle = -1, ctr; int timeEle = -1, ctr;
SimpleDateFormat sdt=new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdt=new SimpleDateFormat("yyyy-MM-dd");
dueDate = java.sql.Timestamp.valueOf(sdt.format(dueDate) + " 00:00:00.000"); dueDate = java.sql.Timestamp.valueOf(sdt.format(dueDate) + " 00:00:00.000");
System.out.println("618---timeMRPArr.size() "+timeMRPArr.size() +"----"+dueDate+"---"+demand+"----"+supply+"----"+stockQty); //System.out.println("618---timeMRPArr.size() "+timeMRPArr.size() +"----"+dueDate+"---"+demand+"----"+supply+"----"+stockQty);
BaseLogger.log( "9", null, null, "618---timeMRPArr.size() "+timeMRPArr.size() +"----"+dueDate+"---"+demand+"----"+supply+"----"+stockQty);
try try
{ {
timeEle = -1; timeEle = -1;
...@@ -853,7 +860,8 @@ class ADPElement implements Cloneable ...@@ -853,7 +860,8 @@ class ADPElement implements Cloneable
{ {
timeMRP = (TimeMRP)timeMRPArr.get(ctr); timeMRP = (TimeMRP)timeMRPArr.get(ctr);
//if (timeMRP.getDueDate() != null && timeMRP.getSaleOrder().equals(saleOrder) && timeMRP.getLineNo().equals(lineNo)) //if (timeMRP.getDueDate() != null && timeMRP.getSaleOrder().equals(saleOrder) && timeMRP.getLineNo().equals(lineNo))
System.out.println("772--timeMRP.getDueDate()["+timeMRP.getDueDate()+"]"); //System.out.println("772--timeMRP.getDueDate()["+timeMRP.getDueDate()+"]");
BaseLogger.log( "9", null, null, "772--timeMRP.getDueDate()["+timeMRP.getDueDate()+"]");
if (timeMRP.getDueDate() != null) if (timeMRP.getDueDate() != null)
{ {
if (timeMRP.getDueDate().equals(dueDate)) if (timeMRP.getDueDate().equals(dueDate))
...@@ -864,14 +872,16 @@ class ADPElement implements Cloneable ...@@ -864,14 +872,16 @@ class ADPElement implements Cloneable
} }
} }
} }
System.out.println("637---timeEle---"+timeEle); //System.out.println("637---timeEle---"+timeEle);
BaseLogger.log( "9", null, null, "637---timeEle---"+timeEle);
if (timeEle == -1) if (timeEle == -1)
{ {
timeMRP = new TimeMRP(); timeMRP = new TimeMRP();
timeMRP.setDueDate(dueDate); timeMRP.setDueDate(dueDate);
//added by sabyasachi 29.03.2011 //added by sabyasachi 29.03.2011
//timeMRP.setDemand(demand,saleOrder,lineNo); //timeMRP.setDemand(demand,saleOrder,lineNo);
System.out.println("@@@@@@@@@@@ timeMRP -1 setdemand["+demand+"]"); //System.out.println("@@@@@@@@@@@ timeMRP -1 setdemand["+demand+"]");
BaseLogger.log( "9", null, null, "@@@@@@@@@@@ timeMRP -1 setdemand["+demand+"]");
timeMRP.setDemand(demand); timeMRP.setDemand(demand);
//end added by sabyasachi 29.03.2011 //end added by sabyasachi 29.03.2011
timeMRP.setSupply(supply); timeMRP.setSupply(supply);
...@@ -886,18 +896,21 @@ class ADPElement implements Cloneable ...@@ -886,18 +896,21 @@ class ADPElement implements Cloneable
timeMRP = (TimeMRP)this.timeMRPArr.get(timeEle); timeMRP = (TimeMRP)this.timeMRPArr.get(timeEle);
//added by sabyasachi 29.03.2011 //added by sabyasachi 29.03.2011
//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()+"]" );
BaseLogger.log( "9", null, null, "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);
BaseLogger.log( "9", null, null, "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);
System.out.println("after setSupply() timeMRP.getDemand()["+timeMRP.getDemand()+"]" ); //System.out.println("after setSupply() timeMRP.getDemand()["+timeMRP.getDemand()+"]" );
BaseLogger.log( "9", null, null, "after setSupply() timeMRP.getDemand()["+timeMRP.getDemand()+"]" );
// 12/04/10 manoharan MF90BHU001 // 12/04/10 manoharan MF90BHU001
timeMRP.setStockQty(stockQty); timeMRP.setStockQty(stockQty);
timeMRP.setOthSupply(othSupply); timeMRP.setOthSupply(othSupply);
...@@ -906,13 +919,16 @@ class ADPElement implements Cloneable ...@@ -906,13 +919,16 @@ class ADPElement implements Cloneable
//timeMRP.setLineNo(lineNo); //timeMRP.setLineNo(lineNo);
this.timeMRPArr.set(timeEle,timeMRP); this.timeMRPArr.set(timeEle,timeMRP);
} }
System.out.println("before updateRunningDemandSupply()...dueDate["+dueDate+"]" ); //System.out.println("before updateRunningDemandSupply()...dueDate["+dueDate+"]" );
BaseLogger.log( "9", null, null, "before updateRunningDemandSupply()...dueDate["+dueDate+"]");
updateRunningDemandSupply(dueDate); updateRunningDemandSupply(dueDate);
System.out.println("after updateRunningDemandSupply()" ); //System.out.println("after updateRunningDemandSupply()" );
BaseLogger.log( "9", null, null, "after updateRunningDemandSupply()");
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":"); //System.out.println("Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":");
BaseLogger.log( "0", null, null, "Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":");
errString = genericUtility.createErrorString(e); errString = genericUtility.createErrorString(e);
e.printStackTrace(); e.printStackTrace();
errString = e.getMessage(); errString = e.getMessage();
...@@ -928,7 +944,8 @@ class ADPElement implements Cloneable ...@@ -928,7 +944,8 @@ class ADPElement implements Cloneable
int timeEle = -1, ctr; int timeEle = -1, ctr;
SimpleDateFormat sdt=new SimpleDateFormat("yyyy-MM-dd"); SimpleDateFormat sdt=new SimpleDateFormat("yyyy-MM-dd");
dueDate = java.sql.Timestamp.valueOf(sdt.format(dueDate) + " 00:00:00.000"); dueDate = java.sql.Timestamp.valueOf(sdt.format(dueDate) + " 00:00:00.000");
System.out.println("618---timeMRPArr.size() "+timeMRPArr.size() +"----"+dueDate+"---"+demand+"----"+supply+"----"+stockQty); //System.out.println("618---timeMRPArr.size() "+timeMRPArr.size() +"----"+dueDate+"---"+demand+"----"+supply+"----"+stockQty);
BaseLogger.log( "9", null, null, "618---timeMRPArr.size() "+timeMRPArr.size() +"----"+dueDate+"---"+demand+"----"+supply+"----"+stockQty);
try try
{ {
timeEle = -1; timeEle = -1;
...@@ -938,7 +955,8 @@ class ADPElement implements Cloneable ...@@ -938,7 +955,8 @@ class ADPElement implements Cloneable
{ {
timeMRP = (TimeMRP)timeMRPArr.get(ctr); timeMRP = (TimeMRP)timeMRPArr.get(ctr);
//if (timeMRP.getDueDate() != null && timeMRP.getSaleOrder().equals(saleOrder) && timeMRP.getLineNo().equals(lineNo)) //if (timeMRP.getDueDate() != null && timeMRP.getSaleOrder().equals(saleOrder) && timeMRP.getLineNo().equals(lineNo))
System.out.println("772--timeMRP.getDueDate()["+timeMRP.getDueDate()+"]"); //System.out.println("772--timeMRP.getDueDate()["+timeMRP.getDueDate()+"]");
BaseLogger.log( "9", null, null, "772--timeMRP.getDueDate()["+timeMRP.getDueDate()+"]");
if (timeMRP.getDueDate() != null) if (timeMRP.getDueDate() != null)
{ {
if (timeMRP.getDueDate().equals(dueDate)) if (timeMRP.getDueDate().equals(dueDate))
...@@ -949,7 +967,8 @@ class ADPElement implements Cloneable ...@@ -949,7 +967,8 @@ class ADPElement implements Cloneable
} }
} }
} }
System.out.println("637---timeEle---"+timeEle); //System.out.println("637---timeEle---"+timeEle);
BaseLogger.log( "9", null, null, "637---timeEle---"+timeEle);
if (timeEle == -1) if (timeEle == -1)
{ {
...@@ -957,16 +976,19 @@ class ADPElement implements Cloneable ...@@ -957,16 +976,19 @@ class ADPElement implements Cloneable
timeMRP.setDueDate(dueDate); timeMRP.setDueDate(dueDate);
//added by sabyasachi 29.03.2011 //added by sabyasachi 29.03.2011
//timeMRP.setDemand(demand,saleOrder,lineNo); //timeMRP.setDemand(demand,saleOrder,lineNo);
System.out.println("@@@@@@@@@@@ timeMRP -1 setdemand["+demand+"]"); //System.out.println("@@@@@@@@@@@ timeMRP -1 setdemand["+demand+"]");
BaseLogger.log( "9", null, null, "@@@@@@@@@@@ timeMRP -1 setdemand["+demand+"]");
if( demand > 0 ) if( demand > 0 )
{ {
System.out.println("@@@@@010415:::demand["+demand+"]supply["+supply+"]-reorderLevel["+reorderLevel+"]"); //System.out.println("@@@@@010415:::demand["+demand+"]supply["+supply+"]-reorderLevel["+reorderLevel+"]");
BaseLogger.log( "9", null, null, "@@@@@010415:::demand["+demand+"]supply["+supply+"]-reorderLevel["+reorderLevel+"]");
timeMRP.setDemand( demand - supply + reorderLevel ) ; timeMRP.setDemand( demand - supply + reorderLevel ) ;
System.out.println("@@@@@010415:::tmp.getDemand()["+timeMRP.getDemand()+"]"); //System.out.println("@@@@@010415:::tmp.getDemand()["+timeMRP.getDemand()+"]");
BaseLogger.log( "9", null, null, "@@@@@010415:::tmp.getDemand()["+timeMRP.getDemand()+"]");
//tmp.setRunningDemand(reorderLevel); //tmp.setRunningDemand(reorderLevel);
timeMRP.setRunningDemand( demand - supply + reorderLevel ); timeMRP.setRunningDemand( demand - supply + reorderLevel );
System.out.println("@@@@@010415:::tmp.getRunningDemand()["+timeMRP.getRunningDemand()+"]"); //System.out.println("@@@@@010415:::tmp.getRunningDemand()["+timeMRP.getRunningDemand()+"]");
BaseLogger.log( "9", null, null, "@@@@@010415:::tmp.getRunningDemand()["+timeMRP.getRunningDemand()+"]");
} }
// timeMRP.setDemand(demand); // timeMRP.setDemand(demand);
//end added by sabyasachi 29.03.2011 //end added by sabyasachi 29.03.2011
...@@ -982,21 +1004,25 @@ class ADPElement implements Cloneable ...@@ -982,21 +1004,25 @@ class ADPElement implements Cloneable
timeMRP = (TimeMRP)this.timeMRPArr.get(timeEle); timeMRP = (TimeMRP)this.timeMRPArr.get(timeEle);
//added by sabyasachi 29.03.2011 //added by sabyasachi 29.03.2011
//timeMRP.setDemand(demand,saleOrder,lineNo); //timeMRP.setDemand(demand,saleOrder,lineNo);
System.out.println("before setDemand() [" + demand + "] supply [" + supply + "]" ); //System.out.println("before setDemand() [" + demand + "] supply [" + supply + "]" );
BaseLogger.log( "9", null, null, "before setDemand() [" + demand + "] supply [" + supply + "]");
if( demand > 0 ) if( demand > 0 )
{ {
System.out.println("@@@@@010415:::demand["+demand+"]supply["+supply+"]-reorderLevel["+reorderLevel+"]"); //System.out.println("@@@@@010415:::demand["+demand+"]supply["+supply+"]-reorderLevel["+reorderLevel+"]");
BaseLogger.log( "9", null, null, "@@@@@010415:::demand["+demand+"]supply["+supply+"]-reorderLevel["+reorderLevel+"]");
timeMRP.setDemand( demand - supply + reorderLevel ) ; timeMRP.setDemand( demand - supply + reorderLevel ) ;
System.out.println("@@@@@010415:::tmp.getDemand()["+timeMRP.getDemand()+"]"); //System.out.println("@@@@@010415:::tmp.getDemand()["+timeMRP.getDemand()+"]");
BaseLogger.log( "9", null, null, "@@@@@010415:::tmp.getDemand()["+timeMRP.getDemand()+"]");
//tmp.setRunningDemand(reorderLevel); //tmp.setRunningDemand(reorderLevel);
timeMRP.setRunningDemand( demand - supply + reorderLevel ); timeMRP.setRunningDemand( demand - supply + reorderLevel );
System.out.println("@@@@@010415:::tmp.getRunningDemand()["+timeMRP.getRunningDemand()+"]"); //System.out.println("@@@@@010415:::tmp.getRunningDemand()["+timeMRP.getRunningDemand()+"]");
BaseLogger.log( "9", null, null, "@@@@@010415:::tmp.getRunningDemand()["+timeMRP.getRunningDemand()+"]");
} }
//timeMRP.setDemand(demand); //timeMRP.setDemand(demand);
//end added by sabyasachi 29.03.2011 //end added by sabyasachi 29.03.2011
timeMRP.setSupply(supply); timeMRP.setSupply(supply);
System.out.println("after setSupply()" ); //System.out.println("after setSupply()" );
BaseLogger.log( "9", null, null, "after setSupply()");
// 12/04/10 manoharan MF90BHU001 // 12/04/10 manoharan MF90BHU001
timeMRP.setStockQty(stockQty); timeMRP.setStockQty(stockQty);
timeMRP.setOthSupply(othSupply); timeMRP.setOthSupply(othSupply);
...@@ -1005,13 +1031,16 @@ class ADPElement implements Cloneable ...@@ -1005,13 +1031,16 @@ class ADPElement implements Cloneable
//timeMRP.setLineNo(lineNo); //timeMRP.setLineNo(lineNo);
this.timeMRPArr.set(timeEle,timeMRP); this.timeMRPArr.set(timeEle,timeMRP);
} }
System.out.println("before updateRunningDemandSupply()" ); //System.out.println("before updateRunningDemandSupply()" );
BaseLogger.log( "9", null, null, "before updateRunningDemandSupply()" );
updateRunningDemandSupply(dueDate); updateRunningDemandSupply(dueDate);
System.out.println("after updateRunningDemandSupply()" ); //System.out.println("after updateRunningDemandSupply()" );
BaseLogger.log( "9", null, null, "after updateRunningDemandSupply()");
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":"); //System.out.println("Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":");
BaseLogger.log( "0", null, null, "Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":");
errString = genericUtility.createErrorString(e); errString = genericUtility.createErrorString(e);
e.printStackTrace(); e.printStackTrace();
errString = e.getMessage(); errString = e.getMessage();
...@@ -1031,7 +1060,8 @@ class ADPElement implements Cloneable ...@@ -1031,7 +1060,8 @@ class ADPElement implements Cloneable
try try
{ {
//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);
BaseLogger.log( "9", null, null, "Collections.sorting...."+dueDate+"]");
Collections.sort(timeMRPArr, TimeMRP.timeMRPComparator); Collections.sort(timeMRPArr, TimeMRP.timeMRPComparator);
//Added By Pavan Rane on 28MAR18[End] //Added By Pavan Rane on 28MAR18[End]
//commented by Pavan R on 27-apr-18 for to check duplicate item in adpelement //commented by Pavan R on 27-apr-18 for to check duplicate item in adpelement
...@@ -1064,14 +1094,16 @@ class ADPElement implements Cloneable ...@@ -1064,14 +1094,16 @@ class ADPElement implements Cloneable
planSupply = timeMRP.getPlanSupply(); planSupply = timeMRP.getPlanSupply();
runningPlanSupply = runningPlanSupply + planSupply; runningPlanSupply = runningPlanSupply + planSupply;
timeMRP.setRunningPlanSupply(runningPlanSupply); timeMRP.setRunningPlanSupply(runningPlanSupply);
System.out.println("updateRunningDemandSupply::itemCode["+this.getItemCode()+"]dueDate["+dueDate+"]siteCode["+this.getSiteCode()+"]runningDemand["+runningDemand+"] runningSupply["+runningSupply+"] planSupply["+planSupply+"] runningPlanSupply["+runningPlanSupply+"]"); //System.out.println("updateRunningDemandSupply::itemCode["+this.getItemCode()+"]dueDate["+dueDate+"]siteCode["+this.getSiteCode()+"]runningDemand["+runningDemand+"] runningSupply["+runningSupply+"] planSupply["+planSupply+"] runningPlanSupply["+runningPlanSupply+"]");
BaseLogger.log( "9", null, null, "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);
} }
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception :RunMRPPrcEJB : updateRunningDemandSupply(Timestamp Date):...." + e.getMessage() + ":"); //System.out.println("Exception :RunMRPPrcEJB : updateRunningDemandSupply(Timestamp Date):...." + e.getMessage() + ":");
BaseLogger.log( "0", null, null, "Exception :RunMRPPrcEJB : updateRunningDemandSupply(Timestamp Date):...." + e.getMessage() + ":");
errString = genericUtility.createErrorString(e); errString = genericUtility.createErrorString(e);
e.printStackTrace(); e.printStackTrace();
errString = e.getMessage(); errString = e.getMessage();
...@@ -1123,7 +1155,8 @@ class ADPElement implements Cloneable ...@@ -1123,7 +1155,8 @@ class ADPElement implements Cloneable
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":"); //System.out.println("Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":");
BaseLogger.log( "0", null, null, "Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":");
errString = genericUtility.createErrorString(e); errString = genericUtility.createErrorString(e);
e.printStackTrace(); e.printStackTrace();
errString = e.getMessage(); errString = e.getMessage();
...@@ -1132,7 +1165,8 @@ class ADPElement implements Cloneable ...@@ -1132,7 +1165,8 @@ class ADPElement implements Cloneable
//private void updatependPOIndQty(java.sql.Timestamp dueDate, double pendPOQty,double pendIndQty) //private void updatependPOIndQty(java.sql.Timestamp dueDate, double pendPOQty,double pendIndQty)
private void updatePendingDetails(java.sql.Timestamp dueDate, double pendPOQty,double pendIndQty, double pendDO, double pendDR) private void updatePendingDetails(java.sql.Timestamp dueDate, double pendPOQty,double pendIndQty, double pendDO, double pendDR)
{ {
System.out.println(">>>>In updatePendingDetails pendDR:"+ pendDR); //System.out.println(">>>>In updatePendingDetails pendDR:"+ pendDR);
BaseLogger.log( "9", null, null, ">>>>In updatePendingDetails pendDR:"+ pendDR);
String errString = ""; String errString = "";
TimeMRP timeMRP = null; TimeMRP timeMRP = null;
//genericUtility = GenericUtility.getInstance(); //genericUtility = GenericUtility.getInstance();
...@@ -1179,7 +1213,8 @@ class ADPElement implements Cloneable ...@@ -1179,7 +1213,8 @@ class ADPElement implements Cloneable
} }
catch(Exception e) catch(Exception e)
{ {
System.out.println("Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":"); //System.out.println("Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":");
BaseLogger.log( "0", null, null, "Exception :adpeLEMENT : updateTimeMrp(Date, supply, demand):...." + e.getMessage() + ":");
errString = genericUtility.createErrorString(e); errString = genericUtility.createErrorString(e);
e.printStackTrace(); e.printStackTrace();
errString = e.getMessage(); errString = e.getMessage();
......
...@@ -144,11 +144,12 @@ public class ExplodeBom ...@@ -144,11 +144,12 @@ public class ExplodeBom
leadTime = mfgLeadTime + qcLeadTime; leadTime = mfgLeadTime + qcLeadTime;
iLeadTime = (int)leadTime; iLeadTime = (int)leadTime;
System.out.println("Due Date Before.........."+dueDate) ; //System.out.println("Due Date Before.........."+dueDate) ;
BaseLogger.log( "0", null, null, "Due Date Before..........["+dueDate+"]" ); BaseLogger.log( "9", null, null, "Due Date Before..........["+dueDate+"]" );
//System.out.println("Due Date Before..........["+dueDate+"]bomCode["+bomCode+"]itemCode["+itemCode+"]siteCode["+siteCode+"]mfgLeadTime["+mfgLeadTime+"]qcLeadTime["+qcLeadTime+"]");
dueDate = utilMethods.RelativeDate(dueDate, iLeadTime * -1); // 10/12/07 manoharan dueDate = utilMethods.RelativeDate(dueDate, iLeadTime * -1); // 10/12/07 manoharan
System.out.println("Due Date After..........."+dueDate) ; //System.out.println("Due Date After..........."+dueDate) ;
BaseLogger.log( "0", null, null, "Due Date After..........["+dueDate+"]" ); BaseLogger.log( "9", null, null, "Due Date After..........["+dueDate+"]" );
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
sDueDate = simpleDateFormat.format(dueDate); sDueDate = simpleDateFormat.format(dueDate);
...@@ -189,10 +190,8 @@ public class ExplodeBom ...@@ -189,10 +190,8 @@ public class ExplodeBom
//pstmt.setString(2,siteCode); //pstmt.setString(2,siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
//System.out.println("Exploding " + siteCode + " " + itemCode + " " + bomCode +" for " + sQuantity ); //System.out.println("Exploding " + siteCode + " " + itemCode + " " + bomCode +" for " + sQuantity );
while (rs.next()) while (rs.next())
{ {
itemCodeBomDet = rs.getString(1); itemCodeBomDet = rs.getString(1);
itemRef = rs.getString(2); itemRef = rs.getString(2);
unit = rs.getString(3); unit = rs.getString(3);
...@@ -223,12 +222,14 @@ public class ExplodeBom ...@@ -223,12 +222,14 @@ public class ExplodeBom
itemCategory = rs.getString("ITEM_CATEGORY"); itemCategory = rs.getString("ITEM_CATEGORY");
considerPartAlt = rs.getString("CONSIDER_PARTIAL_ALT");//Changed by wasim on 17-05-2016 for firm plan considerPartAlt = rs.getString("CONSIDER_PARTIAL_ALT");//Changed by wasim on 17-05-2016 for firm plan
System.out.println("12/06/14 itemActive before[ " +itemActive + "]"); //System.out.println("12/06/14 itemActive before[ " +itemActive + "]");
BaseLogger.log( "9", null, null, "12/06/14 itemActive before[ " +itemActive + "]");
if (itemActive == null || "null".equals(itemActive)) if (itemActive == null || "null".equals(itemActive))
{ {
itemActive = "Y"; itemActive = "Y";
} }
System.out.println("12/06/14 itemActive after[ " +itemActive + "]"); //System.out.println("12/06/14 itemActive after[ " +itemActive + "]");
BaseLogger.log( "9", null, null, "12/06/14 itemActive after[ " +itemActive + "]");
sqlInner = "SELECT SUPP_SOUR, BOM_CODE ,UNIT,NET_WEIGHT,item_type,item_ser " //added unit,NET_WEIGHT by rajendra sqlInner = "SELECT SUPP_SOUR, BOM_CODE ,UNIT,NET_WEIGHT,item_type,item_ser " //added unit,NET_WEIGHT by rajendra
+ "FROM ITEM " + "FROM ITEM "
+ "WHERE ITEM_CODE = ?"; + "WHERE ITEM_CODE = ?";
...@@ -280,12 +281,12 @@ public class ExplodeBom ...@@ -280,12 +281,12 @@ public class ExplodeBom
rsInner = null;//Added by Jiten 13/11/06 - rsInner = null;//Added by Jiten 13/11/06 -
pstmtInner.close(); pstmtInner.close();
pstmtInner = null;//Added by Jiten 13/11/06 - pstmtInner = null;//Added by Jiten 13/11/06 -
System.out.println("12/06/14 siteItemActive [ " +siteItemActive + "]"); //System.out.println("12/06/14 siteItemActive [ " +siteItemActive + "]");
if (siteItemActive == null || "null".equals(siteItemActive)) if (siteItemActive == null || "null".equals(siteItemActive))
{ {
siteItemActive = "Y"; siteItemActive = "Y";
} }
System.out.println("12/06/14 siteItemActive after[ " +siteItemActive + "]"); //System.out.println("12/06/14 siteItemActive after[ " +siteItemActive + "]");
if ("N".equalsIgnoreCase(itemActive) || "N".equalsIgnoreCase(siteItemActive) ) if ("N".equalsIgnoreCase(itemActive) || "N".equalsIgnoreCase(siteItemActive) )
{ {
continue; continue;
...@@ -646,6 +647,11 @@ public class ExplodeBom ...@@ -646,6 +647,11 @@ public class ExplodeBom
} }
} }
}//loop end }//loop end
rs.close();//added by Pavan R 21dec18
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("</Root>"); valueXmlString.append("</Root>");
//rs.close(); //Below three lines commented by Jiten 31/10/06 //rs.close(); //Below three lines commented by Jiten 31/10/06
//pstmtInner.close(); //pstmtInner.close();
...@@ -736,7 +742,7 @@ public class ExplodeBom ...@@ -736,7 +742,7 @@ public class ExplodeBom
fmtStr = fmtStr + "." + "000000000".substring(0, prec); fmtStr = fmtStr + "." + "000000000".substring(0, prec);
} }
DecimalFormat decFormat = new DecimalFormat(fmtStr); DecimalFormat decFormat = new DecimalFormat(fmtStr);
System.out.println("getRequiredDecimal---["+actVal+"]"); //System.out.println("getRequiredDecimal---["+actVal+"]");
return decFormat.format(actVal); return decFormat.format(actVal);
} }
private String decFormat(double num) private String decFormat(double num)
......
...@@ -19,6 +19,7 @@ package ibase.webitm.ejb.mfg; ...@@ -19,6 +19,7 @@ package ibase.webitm.ejb.mfg;
6. in of case mfgtype = "O" create workorder instead of mps order 6. in of case mfgtype = "O" create workorder instead of mps order
*/ */
//import ibase.system.config.ConnDriver;//commented by pavan R on 12nov18 [to get conn from getConnection() instead of ConnDriver] //import ibase.system.config.ConnDriver;//commented by pavan R on 12nov18 [to get conn from getConnection() instead of ConnDriver]
import ibase.utility.BaseLogger;
import ibase.utility.CommonConstants; import ibase.utility.CommonConstants;
import ibase.utility.EMail; import ibase.utility.EMail;
import ibase.utility.UserInfoBean; import ibase.utility.UserInfoBean;
...@@ -296,7 +297,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -296,7 +297,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
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+"]");
BaseLogger.log("9", null, null, "Called process(string, string).....xtraParams["+xtraParams+"]");
String resultString = null; String resultString = null;
Document dom = null, dom1 = null; Document dom = null, dom1 = null;
String retString = null; String retString = null;
...@@ -307,7 +309,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -307,7 +309,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// - // -
try try
{ {
System.out.println(">>>>>xmlString:"+xmlString); //System.out.println(">>>>>xmlString:"+xmlString);
if (xmlString != null && xmlString.trim().length() != 0) if (xmlString != null && xmlString.trim().length() != 0)
{ {
// System.out.println("XML String :" + xmlString); // System.out.println("XML String :" + xmlString);
...@@ -320,14 +322,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -320,14 +322,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
retString = getData(dom, dom1, windowName, xtraParams); retString = getData(dom, dom1, windowName, xtraParams);
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
totalTime = endTime - startTime; totalTime = endTime - startTime;
System.out.println("Total Time Spend :: " + totalTime + " Milliseconds"); //System.out.println("Total Time Spend :: " + totalTime + " Milliseconds");
BaseLogger.log("9", null, null, "Total Time Spend :: " + totalTime + " Milliseconds");
totSecs = (int) (((double) 1 / 1000) * (totalTime)); totSecs = (int) (((double) 1 / 1000) * (totalTime));
totalHrs = (int) (totSecs / 3600); totalHrs = (int) (totSecs / 3600);
totlMts = (int) (((totSecs - (totalHrs * 3600)) / 60)); totlMts = (int) (((totSecs - (totalHrs * 3600)) / 60));
totSecs = (int) (totSecs - ((totalHrs * 3600) + (totlMts * 60))); totSecs = (int) (totSecs - ((totalHrs * 3600) + (totlMts * 60)));
System.out.println("Total Time Spend :: " + totalHrs + " Hours " + totlMts + " Minutes " + totSecs + " seconds"); //System.out.println("Total Time Spend :: " + totalHrs + " Hours " + totlMts + " Minutes " + totSecs + " seconds");
BaseLogger.log("9", null, null, "Total Time Spend :: " + totalHrs + " Hours " + totlMts + " Minutes " + totSecs + " seconds");
// End adding 13/11/06 - // End adding 13/11/06 -
} catch (Exception e) } catch (Exception e)
{ {
...@@ -342,7 +346,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -342,7 +346,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
mrpErrDetList.clear(); mrpErrDetList.clear();
errFields.clear(); errFields.clear();
} }
System.out.println("Returning from Process :: " + retString); //System.out.println("Returning from Process :: " + retString);
BaseLogger.log("9", null, null, "Returning from Process :: " + retString);
return retString; return retString;
} }
...@@ -404,7 +409,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -404,7 +409,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
try try
{ {
context = genericUtility.getColumnValue("wizard", dom); context = genericUtility.getColumnValue("wizard", dom);
System.out.println("context =[" + context + "]"); //System.out.println("context =[" + context + "]");
BaseLogger.log("9", null, null, "context =[" + context + "]");
/*Commented by Manoj dtd 06/06/2014 not required /*Commented by Manoj dtd 06/06/2014 not required
if (context != null && context.trim().length() > 0) if (context != null && context.trim().length() > 0)
{ {
...@@ -427,10 +433,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -427,10 +433,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
siteList = genericUtility.getColumnValue("site_list", dom); //added by chandrashekar siteList = genericUtility.getColumnValue("site_list", dom); //added by chandrashekar
itemCodeOnlyList = genericUtility.getColumnValue("item_code_only_list", dom); // added by cpatil itemCodeOnlyList = genericUtility.getColumnValue("item_code_only_list", dom); // added by cpatil
System.out.println("siteList@@@@@@"+siteList); //System.out.println("siteList@@@@@@"+siteList);
BaseLogger.log("9", null, null, "siteList@@@@@@"+siteList);
locGroupList = genericUtility.getColumnValue("locGroupList", dom); // added by cpatil locGroupList = genericUtility.getColumnValue("locGroupList", dom); // added by cpatil
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+"]");
BaseLogger.log("9", null, null, "@@@@@@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
...@@ -441,8 +449,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -441,8 +449,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Added by Pavan R on 09/oct/17 start //Added by Pavan R on 09/oct/17 start
bomLevelDetStr = bomLevelStr; bomLevelDetStr = bomLevelStr;
//Pavan R on 09/oct/17 end //Pavan R on 09/oct/17 end
System.out.println(">>>>>>In getData roundingRequired:"+roundingRequired); //System.out.println(">>>>>>In getData roundingRequired:"+roundingRequired);
System.out.println(">>>>>>In getData bomLevelStr:"+bomLevelStr); //System.out.println(">>>>>>In getData bomLevelStr:"+bomLevelStr);
if(bomLevelStr == null || bomLevelStr.trim().length()==0) if(bomLevelStr == null || bomLevelStr.trim().length()==0)
{ {
bomLevelStr="0"; bomLevelStr="0";
...@@ -452,14 +460,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -452,14 +460,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
roundingRequired="Y"; roundingRequired="Y";
} }
System.out.println(">>>>>>In getData roundingRequired:"+roundingRequired); //System.out.println(">>>>>>In getData roundingRequired:"+roundingRequired);
System.out.println(">>>>>>In getData bomLevel:"+bomLevel); //System.out.println(">>>>>>In getData bomLevel:"+bomLevel);
//added by sagar on 28/05/2015, End //added by sagar on 28/05/2015, End
if(yield == null || yield.trim().length() == 0) if(yield == null || yield.trim().length() == 0)
{ {
yield = "Y"; yield = "Y";
} }
System.out.println("yield>>>>>["+yield+"]"); //System.out.println("yield>>>>>["+yield+"]");
if( soItemList != null ) if( soItemList != null )
{ {
//System.out.println("BASE@@@@@ soItemList["+soItemList+"]"); //System.out.println("BASE@@@@@ soItemList["+soItemList+"]");
...@@ -548,7 +556,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -548,7 +556,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
lineNoReplaceBom = genericUtility.getColumnValue("lineNoReplaceBom", dom); // added by cpatil on 17/05/14 lineNoReplaceBom = genericUtility.getColumnValue("lineNoReplaceBom", dom); // added by cpatil on 17/05/14
} }
System.out.println("@@@@@@@@@@@ isBomReplace["+isBomReplace+"]bomReplaceDemand["+bomReplaceDemand+"]"); //System.out.println("@@@@@@@@@@@ isBomReplace["+isBomReplace+"]bomReplaceDemand["+bomReplaceDemand+"]");
BaseLogger.log("9", null, null, "@@@@@@@@@@@ isBomReplace["+isBomReplace+"]bomReplaceDemand["+bomReplaceDemand+"]");
// ADDEED BY CPATIL for remove null pointer exception on 26/05/14 // ADDEED BY CPATIL for remove null pointer exception on 26/05/14
if( dom1 != null ) if( dom1 != null )
...@@ -566,7 +575,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -566,7 +575,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
e1.printStackTrace(); e1.printStackTrace();
} }
this.wnName1=windowName1; this.wnName1=windowName1;
System.out.println("wnName1 ==>"+wnName1); //System.out.println("wnName1 ==>"+wnName1);
} }
} }
// end // end
...@@ -605,19 +614,22 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -605,19 +614,22 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
totalTime = endTime - startTime; totalTime = endTime - startTime;
System.out.println("Total Time Spend :: " + totalTime + " Milliseconds"); //System.out.println("Total Time Spend :: " + totalTime + " Milliseconds");
BaseLogger.log("9", null, null, "Total Time Spend :: " + totalTime + " Milliseconds");
totSecs = (int) (((double) 1 / 1000) * (totalTime)); totSecs = (int) (((double) 1 / 1000) * (totalTime));
totalHrs = (int) (totSecs / 3600); totalHrs = (int) (totSecs / 3600);
totlMts = (int) (((totSecs - (totalHrs * 3600)) / 60)); totlMts = (int) (((totSecs - (totalHrs * 3600)) / 60));
totSecs = (int) (totSecs - ((totalHrs * 3600) + (totlMts * 60))); totSecs = (int) (totSecs - ((totalHrs * 3600) + (totlMts * 60)));
System.out.println("Total Time Spend validateFilterParams[" + totalHrs + "] Hours [" + totlMts + "] Minutes [" + totSecs + "] seconds"); //System.out.println("Total Time Spend validateFilterParams[" + totalHrs + "] Hours [" + totlMts + "] Minutes [" + totSecs + "] seconds");
BaseLogger.log("9", null, null, "Total Time Spend validateFilterParams[" + totalHrs + "] Hours [" + totlMts + "] Minutes [" + totSecs + "] seconds");
if (errString != null && errString.trim().length() > 0) if (errString != null && errString.trim().length() > 0)
{ {
System.out.println("Error validating filter parameters:..." + errString); //System.out.println("Error validating filter parameters:..." + errString);
BaseLogger.log("9", null, null, "Error validating filter parameters:..." + errString);
return errString; return errString;
} }
...@@ -627,14 +639,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -627,14 +639,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
errString = populateCommonParameters(); errString = populateCommonParameters();
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
totalTime = endTime - startTime; totalTime = endTime - startTime;
System.out.println("Total Time Spend :: " + totalTime + " Milliseconds"); //System.out.println("Total Time Spend :: " + totalTime + " Milliseconds");
BaseLogger.log("9", null, null, "Total Time Spend :: " + totalTime + " Milliseconds");
totSecs = (int) (((double) 1 / 1000) * (totalTime)); totSecs = (int) (((double) 1 / 1000) * (totalTime));
totalHrs = (int) (totSecs / 3600); totalHrs = (int) (totSecs / 3600);
totlMts = (int) (((totSecs - (totalHrs * 3600)) / 60)); totlMts = (int) (((totSecs - (totalHrs * 3600)) / 60));
totSecs = (int) (totSecs - ((totalHrs * 3600) + (totlMts * 60))); totSecs = (int) (totSecs - ((totalHrs * 3600) + (totlMts * 60)));
System.out.println("Total Time Spend populateCommonParameters[" + totalHrs + "] Hours [" + totlMts + "] Minutes [" + totSecs + "] seconds"); //System.out.println("Total Time Spend populateCommonParameters[" + totalHrs + "] Hours [" + totlMts + "] Minutes [" + totSecs + "] seconds");
if (errString != null && errString.trim().length() > 0) if (errString != null && errString.trim().length() > 0)
{ {
...@@ -836,14 +848,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -836,14 +848,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String sourceItem = setDescription("item_code", "bom", "bom_code", bomCode1, conn); String sourceItem = setDescription("item_code", "bom", "bom_code", bomCode1, conn);
parentItemMap.put(itemCodeTo, sourceItem ); //18/06/14 parentItemMap.put(itemCodeTo, sourceItem ); //18/06/14
System.out.println("@@@@ 500 : sourceItem["+sourceItem+"]bomCode["+bomCode1+"]itemCodeTo["+itemCodeTo+"]parentItemMap["+parentItemMap+"]"); //System.out.println("@@@@ 500 : sourceItem["+sourceItem+"]bomCode["+bomCode1+"]itemCodeTo["+itemCodeTo+"]parentItemMap["+parentItemMap+"]");
BaseLogger.log("9", null, null, "@@@@ 500 : sourceItem["+sourceItem+"]bomCode["+bomCode1+"]itemCodeTo["+itemCodeTo+"]parentItemMap["+parentItemMap+"]");
//System.out.println("BASE13/06/14 adpeList.size() after 2 [" + adpeList.size() + "] itemBomMap [" + itemBomMap + "]"); //System.out.println("BASE13/06/14 adpeList.size() after 2 [" + adpeList.size() + "] itemBomMap [" + itemBomMap + "]");
} }
//else //else
//{ //{
System.out.println("680---"+adpeList.size()); //System.out.println("680---"+adpeList.size());
BaseLogger.log("9", null, null, "680---"+adpeList.size());
errString = populateADPElementList(); errString = populateADPElementList();
endTime = System.currentTimeMillis(); endTime = System.currentTimeMillis();
totalTime = endTime - startTime; totalTime = endTime - startTime;
...@@ -1986,7 +2000,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -1986,7 +2000,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// System.out.println(rs.getString(1)); // System.out.println(rs.getString(1));
} }
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} catch (SQLException se) } catch (SQLException se)
{ {
System.out.println("SQLException : RunMRPPrcEJB :populateSiteMap()" + se.getMessage()); System.out.println("SQLException : RunMRPPrcEJB :populateSiteMap()" + se.getMessage());
...@@ -2157,21 +2174,25 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2157,21 +2174,25 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pstmt1 = null; pstmt1 = null;
boolean isMtoS = false; boolean isMtoS = false;
boolean isMtoO = false; boolean isMtoO = false;
System.out.println("masterSh::["+masterSh+"] MFG_TYPE::["+mfgType1+"]"); //System.out.println("masterSh::["+masterSh+"] MFG_TYPE::["+mfgType1+"]");
BaseLogger.log( "9", null, null, "masterSh::["+masterSh+"] MFG_TYPE::["+mfgType1+"]");
if(masterSh.equalsIgnoreCase("Y")) if(masterSh.equalsIgnoreCase("Y"))
{ {
if(madeToStock.equalsIgnoreCase("0") && (!(mfgType1.trim().equalsIgnoreCase("O") || mfgType1.trim().equalsIgnoreCase("D")))) if(madeToStock.equalsIgnoreCase("0") && (!(mfgType1.trim().equalsIgnoreCase("O") || mfgType1.trim().equalsIgnoreCase("D"))))
{ {
sqlFileName = CommonConstants.JBOSSHOME + File.separator + "sql" + File.separator + "demandsupplyMS"; sqlFileName = CommonConstants.JBOSSHOME + File.separator + "sql" + File.separator + "demandsupplyMS";
System.out.println("BASEsqlFileName---"+sqlFileName); //System.out.println("BASEsqlFileName---"+sqlFileName);
//BaseLogger.log( "0", null, null, "BASEsqlFileName---"+sqlFileName);
if ((CommonConstants.DB_NAME).equalsIgnoreCase("oracle")) if ((CommonConstants.DB_NAME).equalsIgnoreCase("oracle"))
{ {
String adpQueryOriginal = readFile(sqlFileName + "Oracle.sql"); String adpQueryOriginal = readFile(sqlFileName + "Oracle.sql");
adpQuery = adpQueryOriginal; adpQuery = adpQueryOriginal;
System.out.println("siteCode:["+siteCode+"]\nitemCode:["+rs.getString(1)+"]\ndbDateFrom:["+dbDateFrom+"]\ndbDateTo["+dbDateTo+"]"); //System.out.println("siteCode:["+siteCode+"]\nitemCode:["+rs.getString(1)+"]\ndbDateFrom:["+dbDateFrom+"]\ndbDateTo["+dbDateTo+"]");
System.out.println("standingOrdTypes:["+standingOrdTypes+"]\nmadeToOrder:["+madeToOrder+"]\nmadeToStock:["+madeToStock+"]\ndbRunDate["+dbRunDate+"]"); //BaseLogger.log( "0", null, null, "siteCode:["+siteCode+"] itemCode:["+rs.getString(1)+"] dbDateFrom:["+dbDateFrom+"] dbDateTo["+dbDateTo+"]");
System.out.println("3309::Replacing Values.in SQL....."); //System.out.println("standingOrdTypes:["+standingOrdTypes+"]\nmadeToOrder:["+madeToOrder+"]\nmadeToStock:["+madeToStock+"]\ndbRunDate["+dbRunDate+"]");
//BaseLogger.log( "0", null, null, "standingOrdTypes:["+standingOrdTypes+"] madeToOrder:["+madeToOrder+"] madeToStock:["+madeToStock+"] dbRunDate["+dbRunDate+"]");
//System.out.println("3309::Replacing Values.in SQL.....");
//BaseLogger.log( "0", null, null, "3309::Replacing Values.in SQL.....");
adpQuery = adpQuery.replaceAll("@sitecode@", siteCode); adpQuery = adpQuery.replaceAll("@sitecode@", siteCode);
adpQuery = adpQuery.replaceAll("@itemcode@", rs.getString(1)); adpQuery = adpQuery.replaceAll("@itemcode@", rs.getString(1));
adpQuery = adpQuery.replaceAll("@fromdate@", dbDateFrom); adpQuery = adpQuery.replaceAll("@fromdate@", dbDateFrom);
...@@ -2180,14 +2201,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2180,14 +2201,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpQuery = adpQuery.replaceAll("@madetoorder@", madeToOrder); adpQuery = adpQuery.replaceAll("@madetoorder@", madeToOrder);
adpQuery = adpQuery.replaceAll("@madetostock@", madeToStock); adpQuery = adpQuery.replaceAll("@madetostock@", madeToStock);
adpQuery = adpQuery.replaceAll("@rundate@", dbRunDate); adpQuery = adpQuery.replaceAll("@rundate@", dbRunDate);
System.out.println("Replaced Values.in SQL....."); //System.out.println("Replaced Values.in SQL.....");
//BaseLogger.log( "0", null, null, "Replacing Values.in SQL.....");
} }
pstmt1 = conn.prepareStatement(adpQuery); pstmt1 = conn.prepareStatement(adpQuery);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if (rs1.next()) if (rs1.next())
{ {
isMtoS = true; isMtoS = true;
System.out.println("isMtoO=["+isMtoO+"]"); //System.out.println("isMtoO=["+isMtoO+"]");
BaseLogger.log("9", null, null, "isMtoO=["+isMtoO+"]");
} }
rs1.close(); rs1.close();
rs1 = null; rs1 = null;
...@@ -2197,7 +2220,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2197,7 +2220,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if(madeToOrder.equalsIgnoreCase("0") && (mfgType1.trim().equalsIgnoreCase("O") || mfgType1.trim().equalsIgnoreCase("D"))) if(madeToOrder.equalsIgnoreCase("0") && (mfgType1.trim().equalsIgnoreCase("O") || mfgType1.trim().equalsIgnoreCase("D")))
{ {
sqlFileName = CommonConstants.JBOSSHOME + File.separator + "sql" + File.separator + "madeToOrderMO"; sqlFileName = CommonConstants.JBOSSHOME + File.separator + "sql" + File.separator + "madeToOrderMO";
System.out.println("BASEsqlFileName---"+sqlFileName); //System.out.println("BASEsqlFileName---"+sqlFileName);
//BaseLogger.log( "0", null, null, "BASEsqlFileName---"+sqlFileName);
if ((CommonConstants.DB_NAME).equalsIgnoreCase("oracle")) if ((CommonConstants.DB_NAME).equalsIgnoreCase("oracle"))
{ {
String adpQueryOriginal = readFile(sqlFileName + "Oracle.sql"); String adpQueryOriginal = readFile(sqlFileName + "Oracle.sql");
...@@ -2241,7 +2265,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2241,7 +2265,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
} }
} }
rs.close();
rs = null;
} }
pstmt.close();
pstmt = null;
} catch (SQLException se) } catch (SQLException se)
{ {
//System.out.println("SQLException : RunMRPPrcEJB :populateItemMap()" + se.getMessage()); //System.out.println("SQLException : RunMRPPrcEJB :populateItemMap()" + se.getMessage());
...@@ -2259,15 +2287,25 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2259,15 +2287,25 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
try try
{ {
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null) if (pstmt != null)
{ {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if (rs != null) if(rs1 != null)
{ {
rs.close(); rs1.close();
rs = null; rs1 = null;
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
} }
} catch (Exception e) } catch (Exception e)
{ {
...@@ -2413,7 +2451,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2413,7 +2451,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
//System.out.println("confirmedBom---"+confirmedBom+"---activeBom---"+activeBom); //System.out.println("confirmedBom---"+confirmedBom+"---activeBom---"+activeBom);
rsValidBom.close(); rsValidBom.close();
rsValidBom = null;
pstmtValidBom.close(); pstmtValidBom.close();
pstmtValidBom = null;
// this.fwInvalidBom.write("Site Code Item Code Bom Code Message\r\n"); // this.fwInvalidBom.write("Site Code Item Code Bom Code Message\r\n");
if (confirmedBom == null || confirmedBom.trim().length() == 0 || confirmedBom.equalsIgnoreCase("N") || activeBom == null || activeBom.trim().length() == 0 || activeBom.equalsIgnoreCase("N")) if (confirmedBom == null || confirmedBom.trim().length() == 0 || confirmedBom.equalsIgnoreCase("N") || activeBom == null || activeBom.trim().length() == 0 || activeBom.equalsIgnoreCase("N"))
{ {
...@@ -2454,7 +2494,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2454,7 +2494,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
Set levelBom = new HashSet(); Set levelBom = new HashSet();
sql = "SELECT DISTINCT CASE WHEN ITEM.ITEM_CODE__PLAN IS NULL THEN ITEM.ITEM_CODE ELSE ITEM.ITEM_CODE__PLAN END " + " FROM BOMDET, ITEM " + " WHERE ITEM.ITEM_CODE = BOMDET.ITEM_CODE " + " AND BOMDET.BOM_CODE = '" + bomCode + "'"; sql = "SELECT DISTINCT CASE WHEN ITEM.ITEM_CODE__PLAN IS NULL THEN ITEM.ITEM_CODE ELSE ITEM.ITEM_CODE__PLAN END " + " FROM BOMDET, ITEM " + " WHERE ITEM.ITEM_CODE = BOMDET.ITEM_CODE " + " AND BOMDET.BOM_CODE = '" + bomCode + "'";
// pstmt = conn.prepareStatement(sql); // pstmt = conn.prepareStatement(sql);
System.out.println(sql); //System.out.println(sql);
pstmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); pstmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
// pstmt.setString(1,bomCode); // pstmt.setString(1,bomCode);
rs = pstmt.executeQuery(sql); rs = pstmt.executeQuery(sql);
...@@ -2464,7 +2504,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2464,7 +2504,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//End added by Pavan R on 22/NOV/17 //End added by Pavan R on 22/NOV/17
while (rs.next()) while (rs.next())
{ {
System.out.println("rs.getString(1)----" + rs.getString(1)); //System.out.println("rs.getString(1)----" + rs.getString(1));
//BaseLogger.log( "0", null, null, "rs.getString(1)----" + rs.getString(1));
levelBom.add(rs.getString(1)); levelBom.add(rs.getString(1));
ctr = 1; ctr = 1;
//added by Pavan R on 22/NOV/17 //added by Pavan R on 22/NOV/17
...@@ -2566,7 +2607,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2566,7 +2607,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
rmpmMap.put(bomCode, bomList); rmpmMap.put(bomCode, bomList);
//System.out.println("rmpmMAP::["+rmpmMap+"]"); //System.out.println("rmpmMAP::["+rmpmMap+"]");
//End added by Pavan R on 22/NOV/17 //End added by Pavan R on 22/NOV/17
System.out.println(">>>>>>>>Before increase level is:"+level); //System.out.println(">>>>>>>>Before increase level is:"+level);
BaseLogger.log("9", null, null, ">>>>>>>>Before increase level is:"+level);
level = level + ctr; level = level + ctr;
hmap.put(new Integer(level), levelBom); hmap.put(new Integer(level), levelBom);
//System.out.println(">>>>>>>>>level:"+level); //System.out.println(">>>>>>>>>level:"+level);
...@@ -2647,7 +2689,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2647,7 +2689,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String parentBom = itemCodeDetailMap.get(rs.getString(1)) == null ? "":itemCodeDetailMap.get(rs.getString(1)).toString(); String parentBom = itemCodeDetailMap.get(rs.getString(1)) == null ? "":itemCodeDetailMap.get(rs.getString(1)).toString();
itemCodeDetailMap.put(rs.getString(1), parentBom+"@"+bomCode); itemCodeDetailMap.put(rs.getString(1), parentBom+"@"+bomCode);
System.out.println(); //System.out.println();
String sourceItem = setDescription("item_code", "bom", "bom_code", bomCode, conn); String sourceItem = setDescription("item_code", "bom", "bom_code", bomCode, conn);
parentItemMap.put(rs.getString(1), sourceItem ); //18/06/14 parentItemMap.put(rs.getString(1), sourceItem ); //18/06/14
//System.out.println("BASE@@@@ 1589 : sourceItem["+sourceItem+"]bomCode["+bomCode+"]parentItemMap["+parentItemMap+"]"); //System.out.println("BASE@@@@ 1589 : sourceItem["+sourceItem+"]bomCode["+bomCode+"]parentItemMap["+parentItemMap+"]");
...@@ -2664,8 +2706,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2664,8 +2706,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// + rs.getString(1) + "'"); // + rs.getString(1) + "'");
if (rsCount.next() && rsCount.getInt(1) > 0) if (rsCount.next() && rsCount.getInt(1) > 0)
{ {
rsCount.close(); rsCount.close();rsCount = null;
pstmtInner1.close(); pstmtInner1.close(); pstmtInner1 = null;
// Add ItemCode in ItemCodeMap if it not present earlier // Add ItemCode in ItemCodeMap if it not present earlier
innerSuppSour = getSuppSour(siteCode, rs.getString(1)); innerSuppSour = getSuppSour(siteCode, rs.getString(1));
innerBomCode = getBomCode(siteCode, rs.getString(1)); innerBomCode = getBomCode(siteCode, rs.getString(1));
...@@ -2693,10 +2735,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2693,10 +2735,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("Cyclic Item Code is : " + rs.getString(1)); System.out.println("Cyclic Item Code is : " + rs.getString(1));
} else } else
{ {
System.out.println("Cyclic Item Code is : " + rs.getString(1)); //System.out.println("Cyclic Item Code is : " + rs.getString(1));
BaseLogger.log("9", null, null, "Cyclic Item Code is : " + rs.getString(1));
errString = itmDBAccessEJB.getErrorString("", "VTMRPITEME", "", "", conn); errString = itmDBAccessEJB.getErrorString("", "VTMRPITEME", "", "", conn);
rs.close(); rs.close();rs = null;
pstmt.close(); pstmt.close();pstmt = null;
if("Y".equalsIgnoreCase(verifier)) //for error_report @19/09/16 if("Y".equalsIgnoreCase(verifier)) //for error_report @19/09/16
{ {
msgStr = "Cyclic item "+cyclicItem.itemCode+" found in one of the bill of material. "; msgStr = "Cyclic item "+cyclicItem.itemCode+" found in one of the bill of material. ";
...@@ -2843,9 +2886,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2843,9 +2886,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if (errString != null && errString.trim().length() > 0) if (errString != null && errString.trim().length() > 0)
{ {
System.out.println("Error While Calling method bomExplode(String, String):..." + errString); //System.out.println("Error While Calling method bomExplode(String, String):..." + errString);
rs.close(); BaseLogger.log("9", null, null, "Error While Calling method bomExplode(String, String):..." + errString);
pstmt.close(); rs.close(); rs = null;
pstmt.close(); pstmt = null;
return errString; return errString;
} }
} }
...@@ -2853,7 +2897,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2853,7 +2897,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
else else
{ {
rsCount.close(); rsCount.close(); rsCount = null;
sqlInner2 = "SELECT COUNT(1) FROM BOM WHERE BOM_CODE = ?"; sqlInner2 = "SELECT COUNT(1) FROM BOM WHERE BOM_CODE = ?";
pstmtInner2 = conn.prepareStatement(sqlInner2); pstmtInner2 = conn.prepareStatement(sqlInner2);
pstmtInner2.setString(1, rs.getString(1)); pstmtInner2.setString(1, rs.getString(1));
...@@ -2863,38 +2907,51 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2863,38 +2907,51 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// + rs.getString(1) + "'"); // + rs.getString(1) + "'");
if (rsCount.next() && rsCount.getInt(1) > 0) if (rsCount.next() && rsCount.getInt(1) > 0)
{ {
rsCount.close(); rsCount.close();rsCount = null;
pstmtInner2.close(); pstmtInner2.close();pstmtInner2 = null;
validBomItemCode = "BOMDET:" + rs.getString(1); validBomItemCode = "BOMDET:" + rs.getString(1);
//System.out.println(">>>>Before calling bomExplode at line 2225 in bomExplode():"); //System.out.println(">>>>Before calling bomExplode at line 2225 in bomExplode():");
errString = bomExplode(siteCode, rs.getString(1)); errString = bomExplode(siteCode, rs.getString(1));
//System.out.println(">>>>>>errString from bomExplode at line 2225 in bomExplode():"+errString); //System.out.println(">>>>>>errString from bomExplode at line 2225 in bomExplode():"+errString);
if (errString != null && errString.trim().length() > 0) if (errString != null && errString.trim().length() > 0)
{ {
System.out.println("Error While Calling method bomExplode(String, String):..." + errString); //System.out.println("Error While Calling method bomExplode(String, String):..." + errString);
rs.close(); BaseLogger.log("9", null, null,"Error While Calling method bomExplode(String, String):..." + errString);
pstmt.close(); rs.close();rs = null;
pstmt.close();pstmt = null;
return errString; return errString;
} }
} }
rsCount.close(); //rsCount.close();
if(rsCount != null){
rsCount.close(); rsCount = null;
}
if(pstmtInner2 != null){pstmtInner2.close(); pstmtInner2 = null;
}
} }
} }
//System.out.println(">>>>>>Before decrease level--:"+level); //System.out.println(">>>>>>Before decrease level--:"+level);
level--; level--;
//System.out.println(">>>>>>After decrease level--:"+level); //System.out.println(">>>>>>After decrease level--:"+level);
rs.close(); if(rs != null){
rs = null;// Added by Jiten 09/11/06 -Sun rs.close(); rs = null;
}
if(pstmt != null){
pstmt.close(); pstmt = null;
}
// Added by Jiten 09/11/06 -Sun
} catch (SQLException se) } catch (SQLException se)
{ {
System.out.println("SQLException :RunMRPPrcEJB :bomExplode(String siteCode, String MatPlan, String bomCode).." + se.getMessage()); //System.out.println("SQLException :RunMRPPrcEJB :bomExplode(String siteCode, String MatPlan, String bomCode).." + se.getMessage());
BaseLogger.log("0", null, null,"SQLException :RunMRPPrcEJB :bomExplode(String siteCode, String MatPlan, String bomCode).." + se.getMessage());
se.printStackTrace(); se.printStackTrace();
errString = se.getMessage(); errString = se.getMessage();
throw new ITMException(se); throw new ITMException(se);
} catch (Exception e) } catch (Exception e)
{ {
System.out.println("Exception :RunMRPPrcEJB :bomExplode(String siteCode, String MatPlan, String bomCode):...." + e.getMessage() + ":"); //System.out.println("Exception :RunMRPPrcEJB :bomExplode(String siteCode, String MatPlan, String bomCode):...." + e.getMessage() + ":");
BaseLogger.log("0", null, null,"Exception :RunMRPPrcEJB :bomExplode(String siteCode, String MatPlan, String bomCode):...." + e.getMessage() + ":");
this.errString = genericUtility.createErrorString(e); this.errString = genericUtility.createErrorString(e);
e.printStackTrace(); e.printStackTrace();
errString = e.getMessage(); errString = e.getMessage();
...@@ -2918,10 +2975,6 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2918,10 +2975,6 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pstmtInner1.close(); pstmtInner1.close();
pstmtInner1 = null; pstmtInner1 = null;
} }
if (rsInner1 != null)
{
rsInner1 = null;
}
if (pstmtInner2 != null) if (pstmtInner2 != null)
{ {
pstmtInner2.close(); pstmtInner2.close();
...@@ -2935,7 +2988,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2935,7 +2988,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
this.fw.flush();// Added by Jiten 07/11/06 this.fw.flush();// Added by Jiten 07/11/06
} catch (Exception e) } catch (Exception e)
{ {
System.out.println(e); //System.out.println(e);
throw new ITMException(e); throw new ITMException(e);
} }
} }
...@@ -3140,8 +3193,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3140,8 +3193,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
bomCode = rs.getString(1); bomCode = rs.getString(1);
} else } else
{ {
rs.close(); rs.close();rs = null;
pstmt.close(); pstmt.close(); pstmt = null;
sql = "SELECT BOM_CODE FROM ITEM WHERE ITEM_CODE = ?"; sql = "SELECT BOM_CODE FROM ITEM WHERE ITEM_CODE = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode); pstmt.setString(1, itemCode);
...@@ -3203,6 +3256,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3203,6 +3256,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if (rs.next() && rs.getInt(1) > 1) if (rs.next() && rs.getInt(1) > 1)
{ {
count = rs.getInt(1); count = rs.getInt(1);
rs.close(); rs = null;
pstmt.close(); pstmt =null;
sql = "SELECT BOM_CODE FROM BOM WHERE ITEM_CODE = ? AND CONFIRMED = 'Y' AND ACTIVE = 'Y' " + "AND ? BWTWEEN MIN_BATCH_QTY AND MAX_BATCH_QTY "; sql = "SELECT BOM_CODE FROM BOM WHERE ITEM_CODE = ? AND CONFIRMED = 'Y' AND ACTIVE = 'Y' " + "AND ? BWTWEEN MIN_BATCH_QTY AND MAX_BATCH_QTY ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode); pstmt.setString(1, itemCode);
...@@ -3211,19 +3266,19 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3211,19 +3266,19 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if (rs.next()) if (rs.next())
{ {
bomCode = rs.getString(1); bomCode = rs.getString(1);
rs.close(); rs.close(); rs = null;
pstmt.close(); pstmt.close(); pstmt = null;
} else } else
{ {
rs.close(); rs.close();rs = null;
pstmt.close(); pstmt.close();pstmt = null;
bomCode = getBomCode(siteCode, itemCode); bomCode = getBomCode(siteCode, itemCode);
} }
} else } else
{ {
rs.close(); rs.close(); rs = null;
pstmt.close(); pstmt.close(); pstmt = null;
bomCode = getBomCode(siteCode, itemCode); bomCode = getBomCode(siteCode, itemCode);
} }
...@@ -3270,8 +3325,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3270,8 +3325,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
suppSour = checkNull(rs.getString(1)); suppSour = checkNull(rs.getString(1));
} else } else
{ {
rs.close(); rs.close(); rs = null;
pstmt.close(); pstmt.close(); pstmt = null;
sql = "SELECT SUPP_SOUR FROM ITEM WHERE ITEM_CODE = ? "; sql = "SELECT SUPP_SOUR FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode); pstmt.setString(1, itemCode);
...@@ -3281,9 +3336,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3281,9 +3336,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
suppSour = checkNull(rs.getString(1)); suppSour = checkNull(rs.getString(1));
} }
} }
rs.close();rs = null;
rs.close(); pstmt.close();pstmt = null;
pstmt.close();
} catch (SQLException se) } catch (SQLException se)
{ {
System.out.println("SQLException :RunMRPPrcEJB :getSuppSour(String siteCode, String ItemCode).." + se.getMessage()); System.out.println("SQLException :RunMRPPrcEJB :getSuppSour(String siteCode, String ItemCode).." + se.getMessage());
...@@ -3346,8 +3400,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3346,8 +3400,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
rs.close(); rs.close(); rs = null;
pstmt.close(); pstmt.close(); pstmt = null;
} catch (SQLException se) } catch (SQLException se)
{ {
System.out.println("SQLException :RunMRPPrcEJB :getSuppSour(String siteCode, String ItemCode).." + se.getMessage()); System.out.println("SQLException :RunMRPPrcEJB :getSuppSour(String siteCode, String ItemCode).." + se.getMessage());
...@@ -3967,9 +4021,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3967,9 +4021,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("*** No SiteItem *** " + siteCode + " " + itemCode); //System.out.println("*** No SiteItem *** " + siteCode + " " + itemCode);
// ***************************** 04-01-2007 manoharan take all // ***************************** 04-01-2007 manoharan take all
// values from item if no siteitem // values from item if no siteitem
if(rs != null){ rs.close(); rs = null;}
rs.close(); if(pstmt != null){pstmt.close(); pstmt = null;}
pstmt.close();
sql = "SELECT CASE WHEN B.SUPP_SOUR IS NULL THEN '' ELSE B.SUPP_SOUR END ," sql = "SELECT CASE WHEN B.SUPP_SOUR IS NULL THEN '' ELSE B.SUPP_SOUR END ,"
// 2 // 2
+ "CASE WHEN B.BOM_CODE IS NULL THEN '' ELSE B.BOM_CODE END, " + "CASE WHEN B.BOM_CODE IS NULL THEN '' ELSE B.BOM_CODE END, "
...@@ -4151,6 +4204,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4151,6 +4204,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// ***************************** end 04-01-2007 manoharan // ***************************** end 04-01-2007 manoharan
} }
if(rs != null){
rs.close(); rs = null;}
if(pstmt != null){
pstmt.close(); pstmt = null;}
if (adpElement.getSuppSour() == null) if (adpElement.getSuppSour() == null)
{ {
adpElement.setSuppSour(this.getSuppSour(siteCode, itemCode)); adpElement.setSuppSour(this.getSuppSour(siteCode, itemCode));
...@@ -4175,12 +4232,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4175,12 +4232,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
acctCodeWp = rs.getString(1); acctCodeWp = rs.getString(1);
cctrCodeWp = rs.getString(2); cctrCodeWp = rs.getString(2);
rs.close(); rs.close(); rs = null;
pstmt1.close(); pstmt1.close(); pstmt1 = null;
} else } else
{ {
rs.close(); rs.close(); rs = null;
pstmt1.close(); pstmt1.close(); pstmt1 = null;
sql = "SELECT ACCT_CODE__WP, CCTR_CODE__WP FROM ITEM_ACCT_DETR WHERE ITEM_SER = ' ' AND ITEM_CODE = ? AND TRAN_TYPE = ' '"; sql = "SELECT ACCT_CODE__WP, CCTR_CODE__WP FROM ITEM_ACCT_DETR WHERE ITEM_SER = ' ' AND ITEM_CODE = ? AND TRAN_TYPE = ' '";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemCode); pstmt1.setString(1, itemCode);
...@@ -4189,12 +4246,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4189,12 +4246,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
acctCodeWp = rs.getString(1); acctCodeWp = rs.getString(1);
cctrCodeWp = rs.getString(2); cctrCodeWp = rs.getString(2);
rs.close(); rs.close(); rs = null;
pstmt1.close(); pstmt1.close();pstmt1 = null;
} else } else
{ {
rs.close(); rs.close(); rs = null;
pstmt1.close(); pstmt1.close();pstmt1 = null;
sql = "SELECT ACCT_CODE__WP, CCTR_CODE__WP FROM ITEM_ACCT_DETR WHERE ITEM_SER = ? AND ITEM_CODE = ' ' AND TRAN_TYPE = ' '"; sql = "SELECT ACCT_CODE__WP, CCTR_CODE__WP FROM ITEM_ACCT_DETR WHERE ITEM_SER = ? AND ITEM_CODE = ' ' AND TRAN_TYPE = ' '";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemSer); // itemSer ??? pstmt1.setString(1, itemSer); // itemSer ???
...@@ -4203,12 +4260,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4203,12 +4260,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
acctCodeWp = rs.getString(1); acctCodeWp = rs.getString(1);
cctrCodeWp = rs.getString(2); cctrCodeWp = rs.getString(2);
rs.close(); rs.close(); rs = null;
pstmt1.close(); pstmt1.close();pstmt1 = null;
} else } else
{ {
rs.close(); rs.close(); rs = null;
pstmt1.close(); pstmt1.close();pstmt1 = null;
sql = "SELECT ACCT_CODE__WP, CCTR_CODE__WP FROM ITEMSER WHERE ITEM_SER = ? "; sql = "SELECT ACCT_CODE__WP, CCTR_CODE__WP FROM ITEMSER WHERE ITEM_SER = ? ";
pstmt1 = conn.prepareStatement(sql); pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemSer); pstmt1.setString(1, itemSer);
...@@ -4217,8 +4274,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4217,8 +4274,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
acctCodeWp = rs.getString(1); acctCodeWp = rs.getString(1);
cctrCodeWp = rs.getString(2); cctrCodeWp = rs.getString(2);
rs.close(); rs.close(); rs = null;
pstmt1.close(); pstmt1.close();pstmt1 = null;
} }
} }
} }
...@@ -4236,7 +4293,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4236,7 +4293,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
adpElement.setBatchQty(rsInner.getDouble(1)); adpElement.setBatchQty(rsInner.getDouble(1));
} }
rsInner.close(); rsInner.close(); rsInner = null;
pstmtInner.close(); pstmtInner = null;
if (orderOpt.equals("B") && batchQtyType.equals("F") && suppSour.equals("M")) if (orderOpt.equals("B") && batchQtyType.equals("F") && suppSour.equals("M"))
{ {
// adpElement.setReoQty(adpElement.getBatchQty()); // adpElement.setReoQty(adpElement.getBatchQty());
...@@ -4262,6 +4320,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4262,6 +4320,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
throw new ITMException(e); throw new ITMException(e);
} finally } finally
{ {
if (rs != null)
{
rs.close();
rs = null;
}
if (rsInner != null)
{
rsInner.close();
rsInner = null;
}
if (pstmt != null) if (pstmt != null)
{ {
pstmt.close(); pstmt.close();
...@@ -4276,16 +4344,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4276,16 +4344,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pstmtInner.close(); pstmtInner.close();
pstmtInner = null; pstmtInner = null;
} }
if (rs != null)
{
rs.close();
rs = null;
}
if (rsInner != null)
{
rsInner.close();
rsInner = null;
}
} }
return adpElement;// Moved here as Finally block does not complete return adpElement;// Moved here as Finally block does not complete
// normally - jiten -03/11/06 // normally - jiten -03/11/06
...@@ -4603,7 +4662,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4603,7 +4662,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement = populateDemandSupply(adpElement); adpElement = populateDemandSupply(adpElement);
adpeList.set(ctr, adpElement); adpeList.set(ctr, adpElement);
//System.out.println("Quarantine stock["+adpElement.getQtStk()+"]"); //System.out.println("Quarantine stock["+adpElement.getQtStk()+"]");
System.out.println("SaleSales order set in ADPElement---"+adpElement.getSiteCode()+"---"+adpElement.getItemCode()+"---"+adpElement.getSaleOrder()+"----"+adpElement.getLineNo()); //System.out.println("SaleSales order set in ADPElement---"+adpElement.getSiteCode()+"---"+adpElement.getItemCode()+"---"+adpElement.getSaleOrder()+"----"+adpElement.getLineNo());
BaseLogger.log("9", null, null, "SaleSales order set in ADPElement---"+adpElement.getSiteCode()+"---"+adpElement.getItemCode()+"---"+adpElement.getSaleOrder()+"----"+adpElement.getLineNo());
/*if(isDetailReq) /*if(isDetailReq)
{ {
ArrayList<HashMap<String, ADPElement>> detList=adpElement.getDetList(); ArrayList<HashMap<String, ADPElement>> detList=adpElement.getDetList();
...@@ -4712,8 +4772,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4712,8 +4772,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// 01/04/11 manoharan if made to order is selected and item is of // 01/04/11 manoharan if made to order is selected and item is of
// made to order // made to order
// don't process here // don't process here
System.out.println("BASEpopulateDemandSupply...called....siteCode--["+siteCode+"]itemCode-["+itemCode+"]itemCodeTo-["+itemCodeTo+"]"); //System.out.println("BASEpopulateDemandSupply...called....siteCode--["+siteCode+"]itemCode-["+itemCode+"]itemCodeTo-["+itemCodeTo+"]");
System.out.println("madeToOrder---"+madeToOrder+"----adpElement.getMfgType()----"+adpElement.getMfgType()); BaseLogger.log( "9", null, null, "BASEpopulateDemandSupply...called....siteCode--["+siteCode+"]itemCode-["+itemCode+"]itemCodeTo-["+itemCodeTo+"]");
//System.out.println("madeToOrder---"+madeToOrder+"----adpElement.getMfgType()----"+adpElement.getMfgType());
BaseLogger.log( "9", null, null, "madeToOrder---"+madeToOrder+"----adpElement.getMfgType()----"+adpElement.getMfgType());
/* Commented by Manoj dtd 30/12/2013 calling same method for all items /* Commented by Manoj dtd 30/12/2013 calling same method for all items
if ("0".equals(madeToOrder) && "O".equals(adpElement.getMfgType())) if ("0".equals(madeToOrder) && "O".equals(adpElement.getMfgType()))
{ {
...@@ -4929,8 +4991,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4929,8 +4991,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("BASE2804--isDetailReq------"+isDetailReq+"----"+rsItemCode+"---"+itemCode); //System.out.println("BASE2804--isDetailReq------"+isDetailReq+"----"+rsItemCode+"---"+itemCode);
if (rsItemCode != null && rsItemCode.trim().equalsIgnoreCase(itemCode.trim())) if (rsItemCode != null && rsItemCode.trim().equalsIgnoreCase(itemCode.trim()))
{ {
System.out.println("dueDate---demand---supply"+dueDate+"---"+demand+"---"+supply); //System.out.println("dueDate---demand---supply"+dueDate+"---"+demand+"---"+supply);
System.out.println("madeToOrder>>>>>>>"+madeToOrder+"mfg type>>>>>>"+adpElement.getMfgType()); //System.out.println("madeToOrder>>>>>>>"+madeToOrder+"mfg type>>>>>>"+adpElement.getMfgType());
BaseLogger.log("9", null, null, "dueDate---demand---supply"+dueDate+"---"+demand+"---"+supply+"madeToOrder>>>>>>>"+madeToOrder+"mfg type>>>>>>"+adpElement.getMfgType());
//Condition added by Manoj dtd 30/12/2013 to set emand =0 //Condition added by Manoj dtd 30/12/2013 to set emand =0
if(!isRequirement) if(!isRequirement)
{ {
...@@ -4946,7 +5009,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -4946,7 +5009,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//if(dueDate.before(stockDate)) //if(dueDate.before(stockDate))
if(demand != 0 && dueDate.before(stockDate)) if(demand != 0 && dueDate.before(stockDate))
{ {
System.out.println("4927>>>DueDate["+dueDate+"]----stockDate:["+stockDate+"]---demand["+demand+"]"); //System.out.println("4927>>>DueDate["+dueDate+"]----stockDate:["+stockDate+"]---demand["+demand+"]");
throw new ITMException(new Exception("dueDate is less than stockDate")); throw new ITMException(new Exception("dueDate is less than stockDate"));
} }
//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]
...@@ -5046,7 +5109,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -5046,7 +5109,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//if(dueDate.before(stockDate)) //if(dueDate.before(stockDate))
if(demand != 0 && dueDate.before(stockDate)) if(demand != 0 && dueDate.before(stockDate))
{ {
System.out.println("5027>>>DueDate["+dueDate+"]----stockDate:["+stockDate+"]---demand["+demand+"]"); //System.out.println("5027>>>DueDate["+dueDate+"]----stockDate:["+stockDate+"]---demand["+demand+"]");
throw new ITMException(new Exception("dueDate is less than stockDate")); throw new ITMException(new Exception("dueDate is less than stockDate"));
} }
//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]
...@@ -5119,9 +5182,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -5119,9 +5182,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
+ "demandsupplyDet"; + "demandsupplyDet";
} }
System.out.println("SQL File Name:::::" + sqlFileName); //System.out.println("SQL File Name:::::" + sqlFileName);
System.out.println("SQL Det File Name:::::" BaseLogger.log( "9", null, null, "SQL File Name:::::" + sqlFileName);
+ sqlFileNameDet); //System.out.println("SQL Det File Name:::::"
//+ sqlFileNameDet);
BaseLogger.log( "9", null, null, "SQL Det File Name:::::"+sqlFileNameDet);
if ((CommonConstants.DB_NAME).equalsIgnoreCase("oracle")) if ((CommonConstants.DB_NAME).equalsIgnoreCase("oracle"))
{ {
String adpDetQueryOriginal = readFile(sqlFileNameDet+ "Oracle.sql"); String adpDetQueryOriginal = readFile(sqlFileNameDet+ "Oracle.sql");
...@@ -5312,7 +5377,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -5312,7 +5377,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}else{ }else{
demandSupplyMap.put(14, " "); demandSupplyMap.put(14, " ");
} }
System.out.println("5321 indxCnt["+indxCnt+"]adpeList["+adpeList.size()+"]adpEle.getSuppSour()["+SuppSour+"]adpEle.getSiteCodeSupp()["+suppSite+"]"); //System.out.println("5321 indxCnt["+indxCnt+"]adpeList["+adpeList.size()+"]adpEle.getSuppSour()["+SuppSour+"]adpEle.getSiteCodeSupp()["+suppSite+"]");
BaseLogger.log("9", null, null, "5321 indxCnt["+indxCnt+"]adpeList["+adpeList.size()+"]adpEle.getSuppSour()["+SuppSour+"]adpEle.getSiteCodeSupp()["+suppSite+"]");
//pavan R on 28nov18 //pavan R on 28nov18
demandSupplyList.add(demandSupplyMap); demandSupplyList.add(demandSupplyMap);
} else } else
...@@ -5359,7 +5425,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -5359,7 +5425,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}else{ }else{
demandSupplyMap.put(14, " "); demandSupplyMap.put(14, " ");
} }
System.out.println("5372 indxCnt["+indxCnt+"]adpeList["+adpeList.size()+"]adpEle.getSuppSour()["+SuppSour+"]adpEle.getSiteCodeSupp()["+suppSite+"]"); //System.out.println("5372 indxCnt["+indxCnt+"]adpeList["+adpeList.size()+"]adpEle.getSuppSour()["+SuppSour+"]adpEle.getSiteCodeSupp()["+suppSite+"]");
//BaseLogger.log("9", null, null, "5372 indxCnt["+indxCnt+"]adpeList["+adpeList.size()+"]adpEle.getSuppSour()["+SuppSour+"]adpEle.getSiteCodeSupp()["+suppSite+"]");
//pavan R on 28nov18 //pavan R on 28nov18
demandSupplyList.add(demandSupplyMap); demandSupplyList.add(demandSupplyMap);
} }
...@@ -6224,7 +6291,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6224,7 +6291,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//if(dueDate.before(stockDate)) //if(dueDate.before(stockDate))
if(demand != 0 && dueDate.before(stockDate)) if(demand != 0 && dueDate.before(stockDate))
{ {
System.out.println("6153>>>DueDate["+dueDate+"]----stockDate:["+stockDate+"]---demand["+demand+"]"); //System.out.println("6153>>>DueDate["+dueDate+"]----stockDate:["+stockDate+"]---demand["+demand+"]");
throw new ITMException(new Exception("dueDate is less than stockDate")); throw new ITMException(new Exception("dueDate is less than stockDate"));
} }
//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]
...@@ -6592,7 +6659,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6592,7 +6659,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}else{ }else{
demandSupplyMap.put(14, " "); demandSupplyMap.put(14, " ");
} }
System.out.println("6617 indxCnt["+indxCnt+"]adpeList["+adpeList.size()+"]adpEle.getSuppSour()["+SuppSour+"]adpEle.getSiteCodeSupp()["+suppSite+"]"); //System.out.println("6617 indxCnt["+indxCnt+"]adpeList["+adpeList.size()+"]adpEle.getSuppSour()["+SuppSour+"]adpEle.getSiteCodeSupp()["+suppSite+"]");
BaseLogger.log( "9", null, null, "6617 indxCnt["+indxCnt+"]adpeList["+adpeList.size()+"]adpEle.getSuppSour()["+SuppSour+"]adpEle.getSiteCodeSupp()["+suppSite+"]");
//pavan R on 28nov18 //pavan R on 28nov18
demandSupplyList.add(demandSupplyMap); demandSupplyList.add(demandSupplyMap);
...@@ -6674,7 +6742,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6674,7 +6742,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
return errString; return errString;
} }
} }
System.out.println("3250---"+adpElement.getSiteCode()+"---"+adpElement.getItemCode()+"---"+adpElement.getDemand()+"---"+adpElement.getSupply()+"---"+adpElement.getStockQty()+"---"+adpElement.getSaleOrder()); //System.out.println("3250---"+adpElement.getSiteCode()+"---"+adpElement.getItemCode()+"---"+adpElement.getDemand()+"---"+adpElement.getSupply()+"---"+adpElement.getStockQty()+"---"+adpElement.getSaleOrder());
BaseLogger.log("9", null, null, "3250---"+adpElement.getSiteCode()+"---"+adpElement.getItemCode()+"---"+adpElement.getDemand()+"---"+adpElement.getSupply()+"---"+adpElement.getStockQty()+"---"+adpElement.getSaleOrder());
adpElement = mrpOptimize(adpElement); adpElement = mrpOptimize(adpElement);
adpeList.set(adpeCtr, adpElement); adpeList.set(adpeCtr, adpElement);
...@@ -6776,12 +6845,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6776,12 +6845,13 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("14012009 Optimize site 1 : " + siteCode + " Item : " + itemCode + " Demand : " + demand + " Supply : " + supply +"bomCode["+bomCode+"]"); //System.out.println("14012009 Optimize site 1 : " + siteCode + " Item : " + itemCode + " Demand : " + demand + " Supply : " + supply +"bomCode["+bomCode+"]");
try try
{ {
System.out.println("@@@@@ demand["+demand+"]supply["+supply+"]reorderLevel["+reorderLevel+"]"); //System.out.println("@@@@@ demand["+demand+"]supply["+supply+"]reorderLevel["+reorderLevel+"]");
BaseLogger.log("9", null, null, "@@@@@ demand["+demand+"]supply["+supply+"]reorderLevel["+reorderLevel+"]");
//if ((demand - supply) > 0 ) //if ((demand - supply) > 0 )
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("6667----timeMRParr.size()---"+timeMRParr.size()); //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 //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")))
//{ //{
...@@ -6974,7 +7044,6 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6974,7 +7044,6 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
mfgLeadBasis = "F"; mfgLeadBasis = "F";
} }
if ("B".equals(mfgLeadBasis) && quantity > batchSizeLead) if ("B".equals(mfgLeadBasis) && quantity > batchSizeLead)
{ {
//System.out.println("BASEmanohar mfgLeadTime before [" + mfgLeadTime + "]"); //System.out.println("BASEmanohar mfgLeadTime before [" + mfgLeadTime + "]");
...@@ -7011,6 +7080,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7011,6 +7080,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Changed By Priyankac on 21-SEP-2018. //Changed By Priyankac on 21-SEP-2018.
// retXMLStr = explodeBomObj.explodeBom(xmlString.toString()).toString(); // Added // retXMLStr = explodeBomObj.explodeBom(xmlString.toString()).toString(); // Added
System.out.println("Before explodeBom >>>>> Sitecode["+siteCode + "]itemCode[" + itemCode + "]bomCode[" + bomCode + "]sDueDate[" + sDueDate + "]qcLeadTime["+ qcLeadTime + "]calMfgLeadTime["+ calMfgLeadTime + "]quantity["+ quantity + "]lineType["+ lineType +"]");
retXMLStr = explodeBomObj.explodeBom(xmlString.toString(),conn).toString(); // Added retXMLStr = explodeBomObj.explodeBom(xmlString.toString(),conn).toString(); // Added
// by // by
...@@ -7680,7 +7750,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7680,7 +7750,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("BASE25022010 22->Item [" + adpElement.getItemCode() + "] reqQty [" + reqQty + "] reoQty [" + reoQty + "]] integralQty [" + integralQty + "] multiplier [" + multiplier + "]"); //System.out.println("BASE25022010 22->Item [" + adpElement.getItemCode() + "] reqQty [" + reqQty + "] reoQty [" + reoQty + "]] integralQty [" + integralQty + "] multiplier [" + multiplier + "]");
} }
System.out.println("25022010 23->Item [ return value --- reqQty [" + reqQty + "] "); //System.out.println("25022010 23->Item [ return value --- reqQty [" + reqQty + "] ");
return reqQty; return reqQty;
} }
...@@ -8065,18 +8135,21 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8065,18 +8135,21 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
index = indexOfADPElement(siteCode, itemCode, saleOrder,lineNo); index = indexOfADPElement(siteCode, itemCode, saleOrder,lineNo);
} }
//Added by Pavan On 13-Oct-17 start //Added by Pavan On 13-Oct-17 start
System.out.println("13-oct-17----index---before ["+index +"]"); //System.out.println("13-oct-17----index---before ["+index +"]");
BaseLogger.log("9", null, null, "--8123----index---before ["+index +"]");
if (index == -1) if (index == -1)
{ {
index = indexOfADPElement(siteCode, itemCode, " ", " "); index = indexOfADPElement(siteCode, itemCode, " ", " ");
} }
System.out.println("oct-17----index---after ["+index +"]"); //System.out.println("oct-17----index---after ["+index +"]");
BaseLogger.log("9", null, null, "--8129----index---before ["+index +"]");
//Added by Pavan R on 2K18-Feb-08 [Start] demand is not set for some item //Added by Pavan R on 2K18-Feb-08 [Start] demand is not set for some item
if (index == -1) if (index == -1)
{ {
index = indexOfADPElement(siteCode, itemCode); index = indexOfADPElement(siteCode, itemCode);
} }
System.out.println("feb-18----index---after ["+index +"]"); //System.out.println("feb-18----index---after ["+index +"]");
BaseLogger.log("9", null, null, "--8136----index---before ["+index +"]");
//Added by Pavan R on 2K18-Feb-08 [End] //Added by Pavan R on 2K18-Feb-08 [End]
//Added by Pavan On 13-Oct-17 end //Added by Pavan On 13-Oct-17 end
/*if (isBomReplace) /*if (isBomReplace)
...@@ -8419,7 +8492,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8419,7 +8492,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
adpElement = (ADPElement) adpeList.get(ctr); adpElement = (ADPElement) adpeList.get(ctr);
//Added by Pavan R 27-apr-18 to check duplicate item in adpelement //Added by Pavan R 27-apr-18 to check duplicate item in adpelement
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)))
{ {
retVal = ctr; retVal = ctr;
...@@ -8858,7 +8931,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -8858,7 +8931,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
runningPlanSupply = timeMrp.getRunningPlanSupply(); runningPlanSupply = timeMrp.getRunningPlanSupply();
independentDemand = timeMrp.getIndependentDemand(); independentDemand = timeMrp.getIndependentDemand();
dueDate = timeMrp.getDueDate(); dueDate = timeMrp.getDueDate();
System.out.println("@@@@ before MrpClubbingHorizon["+MrpClubbingHorizon+"]horizonDate["+horizonDate+"]dueDate["+dueDate+"]itemCode["+itemCode+"]"); //System.out.println("@@@@ before MrpClubbingHorizon["+MrpClubbingHorizon+"]horizonDate["+horizonDate+"]dueDate["+dueDate+"]itemCode["+itemCode+"]");
//BaseLogger.log( "0", null, null, "@@@@ before MrpClubbingHorizon["+MrpClubbingHorizon+"]horizonDate["+horizonDate+"]dueDate["+dueDate+"]itemCode["+itemCode+"]");
if (MrpClubbingHorizon > 0) if (MrpClubbingHorizon > 0)
{ {
Calendar calen = Calendar.getInstance(); Calendar calen = Calendar.getInstance();
...@@ -9117,7 +9191,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -9117,7 +9191,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
indList.add(newIndent); indList.add(newIndent);
} }
} }
System.out.println("orderOpt--------"+orderOpt+"---"); //System.out.println("orderOpt--------"+orderOpt+"---");
BaseLogger.log("9", null, null, "orderOpt--------"+orderOpt+"---");
} // (( suppSour.equals("P") || suppSour.equals("C") )&& } // (( suppSour.equals("P") || suppSour.equals("C") )&&
// matPlan.equals("Y") ) // matPlan.equals("Y") )
else if (suppSour.equals("M") && mfgPlan.equals("Y")) else if (suppSour.equals("M") && mfgPlan.equals("Y"))
...@@ -9518,8 +9593,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -9518,8 +9593,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int listCtr = mpsList.size() - 1; listCtr >= 0; listCtr--) for (int listCtr = mpsList.size() - 1; listCtr >= 0; listCtr--)
{ {
mpsOrder = (MPSOrder) mpsList.get(listCtr); mpsOrder = (MPSOrder) mpsList.get(listCtr);
System.out.println("dueDate["+dueDate+"]"); //System.out.println("dueDate["+dueDate+"]");
System.out.println("horizonDate["+horizonDate+"]"); //System.out.println("horizonDate["+horizonDate+"]");
//BaseLogger.log( "0", null, null, "dueDate["+dueDate+"]horizonDate["+horizonDate+"]");
//System.out.println("BASEdueDate.compareTo(horizonDate)["+dueDate.compareTo(horizonDate)+"]"); //System.out.println("BASEdueDate.compareTo(horizonDate)["+dueDate.compareTo(horizonDate)+"]");
//System.out.println("BASEmpsOrder.itemCode.trim()["+mpsOrder.itemCode.trim()+"]itemCode.trim()["+itemCode.trim()+"]"); //System.out.println("BASEmpsOrder.itemCode.trim()["+mpsOrder.itemCode.trim()+"]itemCode.trim()["+itemCode.trim()+"]");
//System.out.println("BASEmpsOrder.siteCode.trim()["+mpsOrder.siteCode.trim()+"]siteCode.trim()["+siteCode.trim()+"]"); //System.out.println("BASEmpsOrder.siteCode.trim()["+mpsOrder.siteCode.trim()+"]siteCode.trim()["+siteCode.trim()+"]");
...@@ -9532,7 +9608,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -9532,7 +9608,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
} }
} }
System.out.println("@@@@@findEle2["+findEle+"]"); //System.out.println("@@@@@findEle2["+findEle+"]");
BaseLogger.log( "9", null, null, "@@@@@findEle2["+findEle+"]");
if (findEle >= 0) if (findEle >= 0)
{ {
mpsOrder.quantity += reqQty; mpsOrder.quantity += reqQty;
...@@ -11392,7 +11469,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -11392,7 +11469,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
count++; count++;
valueXmlString.append("<Detail" + context + " domID='" + count + "' >\r\n"); valueXmlString.append("<Detail" + context + " domID='" + count + "' >\r\n");
System.out.println("cpatil--------IPD_MPS_ORDER["+IPD_MPS_ORDER+"]"); //System.out.println("cpatil--------IPD_MPS_ORDER["+IPD_MPS_ORDER+"]");
ArrayList IPD_MPS_ORDER_List = new ArrayList(); ArrayList IPD_MPS_ORDER_List = new ArrayList();
ArrayList IPD_INDENT_List = new ArrayList(); ArrayList IPD_INDENT_List = new ArrayList();
...@@ -11568,7 +11645,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -11568,7 +11645,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("BASE******((ADPElement) adpeList.get(c)).getSaleOrder()["+((ADPElement) adpeList.get(c)).getSaleOrder()+"]"); //System.out.println("BASE******((ADPElement) adpeList.get(c)).getSaleOrder()["+((ADPElement) adpeList.get(c)).getSaleOrder()+"]");
}*/ }*/
//SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat()); //SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
System.out.println("Printing adpeList.size()---" + adpeList.size()); //System.out.println("Printing adpeList.size()---" + adpeList.size());
BaseLogger.log( "9", null, null, "Printing adpeList.size()---" + adpeList.size());
//System.out.println("BASEparentItemMap["+parentItemMap+"]"); //System.out.println("BASEparentItemMap["+parentItemMap+"]");
//System.out.println("BASEitemCodeDetailMap["+itemCodeDetailMap+"]"); //System.out.println("BASEitemCodeDetailMap["+itemCodeDetailMap+"]");
//System.out.println("BASEitemBomMap["+itemBomMap+"]"); //System.out.println("BASEitemBomMap["+itemBomMap+"]");
...@@ -11713,8 +11791,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -11713,8 +11791,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("BASE@@@@@@@@itemCDDetailMap["+itemCDDetailMap+"]"); //System.out.println("BASE@@@@@@@@itemCDDetailMap["+itemCDDetailMap+"]");
//System.out.println("BASE@@@@@@@@itemCodeParent["+itemCodeParent+"]originalOrAltitem["+originalOrAltitem+"]adpElement.getBomCodeParent()["+adpElement.getBomCodeParent()+"]"); //System.out.println("BASE@@@@@@@@itemCodeParent["+itemCodeParent+"]originalOrAltitem["+originalOrAltitem+"]adpElement.getBomCodeParent()["+adpElement.getBomCodeParent()+"]");
ArrayList timeMRParr = adpElement.getTimeMrpList(); ArrayList timeMRParr = adpElement.getTimeMrpList();
System.out.println("timeMRParr>>>>>"+timeMRParr); //System.out.println("timeMRParr>>>>>"+timeMRParr);
System.out.println("Printing timeMRParr.size()---" + timeMRParr.size()); //System.out.println("Printing timeMRParr.size()---" + timeMRParr.size());
//detailMap=adpElement.getDetMap();//Added by Manoj dtd 02/11/2013 //detailMap=adpElement.getDetMap();//Added by Manoj dtd 02/11/2013
//HashMap<String,ADPElement> detailMap=adpElement.getDetMap(); //HashMap<String,ADPElement> detailMap=adpElement.getDetMap();
...@@ -11764,9 +11842,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -11764,9 +11842,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
if( timeMRParr.size() > 0) if( timeMRParr.size() > 0)
{ {
System.out.println("Printing timeCtr---" + timeCtr); //System.out.println("Printing timeCtr---" + timeCtr);
//BaseLogger.log( "0", null, null, "Printing timeCtr---" + timeCtr+"]");
TimeMRP timeMrp = (TimeMRP) timeMRParr.get(timeCtr); TimeMRP timeMrp = (TimeMRP) timeMRParr.get(timeCtr);
System.out.println("Printing timeMrp---" + timeMrp); //System.out.println("Printing timeMrp---" + timeMrp);
//BaseLogger.log( "0", null, null, "Printing timeMrp---" + timeMrp+"]");
demand = timeMrp.getDemand(); demand = timeMrp.getDemand();
demandSum = demandSum+demand; demandSum = demandSum+demand;
...@@ -12194,7 +12274,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -12194,7 +12274,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
tranSer2=""; tranSer2="";
*/ */
System.out.println("@@@@@@itemCode["+itemCode+"]itemCDDetailMap["+itemCDDetailMap+"]"); //System.out.println("@@@@@@itemCode["+itemCode+"]itemCDDetailMap["+itemCDDetailMap+"]");
if ( itemCDDetailMap != null && itemCDDetailMap.containsKey(itemCode)) if ( itemCDDetailMap != null && itemCDDetailMap.containsKey(itemCode))
{ {
String tempBomItem = itemCDDetailMap.get(itemCode)==null?"":itemCDDetailMap.get(itemCode).toString(); String tempBomItem = itemCDDetailMap.get(itemCode)==null?"":itemCDDetailMap.get(itemCode).toString();
...@@ -12499,7 +12579,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -12499,7 +12579,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
valueXmlString.append("<new_planned_supply protect = '1'>").append("N").append("</new_planned_supply>\r\n"); // added by cpatil on 27/08/14 for displaying diffenrent color for new planned valueXmlString.append("<new_planned_supply protect = '1'>").append("N").append("</new_planned_supply>\r\n"); // added by cpatil on 27/08/14 for displaying diffenrent color for new planned
} }
System.out.println("@@@@@@@@@@@@@@@["+itemCode+"] sourceSupplyFlag["+sourceSupplyFlag+"] "); //System.out.println("@@@@@@@@@@@@@@@["+itemCode+"] sourceSupplyFlag["+sourceSupplyFlag+"] ");
tranSer2=""; tranSer2="";
...@@ -12509,7 +12589,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -12509,7 +12589,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// System.out.println("@@@@@@@@@050115 inside Stock---stkKey.length["+stkKey.length+"]stkKey["+stkKey+"]"); // System.out.println("@@@@@@@@@050115 inside Stock---stkKey.length["+stkKey.length+"]stkKey["+stkKey+"]");
if(stkKey.length>0) if(stkKey.length>0)
{ {
System.out.println("@@@@@@@@050115 9780 site_code["+stkKey[0]+"]item_code["+stkKey[1]+"]lot_no["+stkKey[2]+"]lot_sl["+stkKey[3]+"]loc_code["+stkKey[4]+"]"); //System.out.println("@@@@@@@@050115 9780 site_code["+stkKey[0]+"]item_code["+stkKey[1]+"]lot_no["+stkKey[2]+"]lot_sl["+stkKey[3]+"]loc_code["+stkKey[4]+"]");
valueXmlString.append("<site_code protect = '1'>").append("<![CDATA[" + stkKey[0] + "]]>").append("</site_code>\r\n"); valueXmlString.append("<site_code protect = '1'>").append("<![CDATA[" + stkKey[0] + "]]>").append("</site_code>\r\n");
valueXmlString.append("<item_code protect = '1'>").append("<![CDATA[" + stkKey[1] + "]]>").append("</item_code>\r\n"); valueXmlString.append("<item_code protect = '1'>").append("<![CDATA[" + stkKey[1] + "]]>").append("</item_code>\r\n");
valueXmlString.append("<item_code_descr protect = '1'>").append("<![CDATA[" + setDescription("descr","item","item_code",stkKey[1],conn) + "]]>").append("</item_code_descr>\r\n"); valueXmlString.append("<item_code_descr protect = '1'>").append("<![CDATA[" + setDescription("descr","item","item_code",stkKey[1],conn) + "]]>").append("</item_code_descr>\r\n");
...@@ -12616,7 +12696,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -12616,7 +12696,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
valueXmlString = new StringBuffer(); valueXmlString = new StringBuffer();
System.out.println("context["+context+"]"); //System.out.println("context["+context+"]");
//reqValueXmlString = new StringBuffer("<?xml version = \"1.0\"?><Root>\r\n"); //reqValueXmlString = new StringBuffer("<?xml version = \"1.0\"?><Root>\r\n");
reqCount++; reqCount++;
reqValueXmlString.append("<Detail" + context + " domID='" + reqCount + "' >\r\n"); reqValueXmlString.append("<Detail" + context + " domID='" + reqCount + "' >\r\n");
...@@ -12677,11 +12757,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -12677,11 +12757,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
reqValueXmlString.append("</Root>"); reqValueXmlString.append("</Root>");
//System.out.println("Printing reqValueXmlString----" + reqValueXmlString);//commented By Pavan R on 26/OCT/17 //System.out.println("Printing reqValueXmlString----" + reqValueXmlString);//commented By Pavan R on 26/OCT/17
//System.out.println("Printing valueXmlString----2---" + valueXmlString);//commented By Pavan R on 26/OCT/17 //System.out.println("Printing valueXmlString----2---" + valueXmlString);//commented By Pavan R on 26/OCT/17
System.out.println("Printing context-------" + context); //System.out.println("Printing context-------" + context);
// context=2; // context=2;
//if (context != null && context.trim().length() > 0 && (context.equals("2") ||context.equals("3"))) //Commented by Manoj dtd 06/06/2014 to check on boolean value //if (context != null && context.trim().length() > 0 && (context.equals("2") ||context.equals("3"))) //Commented by Manoj dtd 06/06/2014 to check on boolean value
System.out.println("isWizard-------"+isWizard); //System.out.println("isWizard-------"+isWizard);
if(isWizard) if(isWizard)
{ {
resultString = valueXmlString.toString(); resultString = valueXmlString.toString();
...@@ -12693,18 +12773,22 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -12693,18 +12773,22 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
resultString = reqValueXmlString.toString(); resultString = reqValueXmlString.toString();
} }
System.out.println("resultString---" + resultString); //System.out.println("resultString---" + resultString);
//System.out.println("valueXmlStringDet---" + valueXmlStringDet);
BaseLogger.log( "9", null, null, "valueXmlStringDet---" + valueXmlStringDet);
// resultString = valueXmlString.toString(); // resultString = valueXmlString.toString();
// System.out.println("End of collected datas......"); // System.out.println("End of collected datas......");
// resultString = retTabSepStrBuff.toString(); // resultString = retTabSepStrBuff.toString();
} catch (SQLException se) } catch (SQLException se)
{ {
System.out.println("SQLException :RunMRPPrcEJB :setValuesInBrow():" + se.getMessage() + ":"); //System.out.println("SQLException :RunMRPPrcEJB :setValuesInBrow():" + se.getMessage() + ":");
BaseLogger.log( "0", null, null, "SQLException :RunMRPPrcEJB :setValuesInBrow():" + se.getMessage() + ":");
se.printStackTrace(); se.printStackTrace();
throw new ITMException(se); throw new ITMException(se);
} catch (Exception e) } catch (Exception e)
{ {
System.out.println("Exception :RunMRPPrcEJB :setValuesInBrow():" + e.getMessage() + ":"); //System.out.println("Exception :RunMRPPrcEJB :setValuesInBrow():" + e.getMessage() + ":");
BaseLogger.log( "0", null, null, "Exception :RunMRPPrcEJB :setValuesInBrow():" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} finally } finally
...@@ -12930,6 +13014,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -12930,6 +13014,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
HSSFCell cellDet = null; HSSFCell cellDet = null;
HSSFRow rowDet = null; HSSFRow rowDet = null;
HSSFCellStyle cellStyleDet = null; HSSFCellStyle cellStyleDet = null;
//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
HSSFCell cell1 = null; HSSFCell cell1 = null;
...@@ -12990,14 +13075,37 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -12990,14 +13075,37 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
HSSFRow headerRow = sheet.createRow(1); HSSFRow headerRow = sheet.createRow(1);
headerRow.setHeightInPoints(40); headerRow.setHeightInPoints(40);
HSSFCell headerCell; HSSFCell headerCell;
for (int cellCtr = 0; cellCtr < titles.length; cellCtr++) for (int cellCtr = 0; cellCtr < titles.length; cellCtr++)
{ {
//headerCell = headerRow.createCell((short) cellCtr); //headerCell = headerRow.createCell((short) cellCtr);
headerCell = headerRow.createCell((int) cellCtr); headerCell = headerRow.createCell((int) cellCtr);
headerCell.setCellValue(titles[cellCtr]); headerCell.setCellValue(titles[cellCtr]);
} }
//--------1stsheet---------------------------------
HSSFCellStyle styleDateClr = wb.createCellStyle();
HSSFCellStyle styleClr = wb.createCellStyle();
//--------1stsheet---------------------------------
//--------2nd sheet-start-------------------------
HSSFSheet sheetDet = wb.createSheet("MRPRun Input Data Detail");
HSSFRow titleRowDet = sheetDet.createRow(0);
titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();
//--------2nd sheet-start-------------------------
//--------3rd sheet-start-------------------------
HSSFSheet sheet3 = wb.createSheet("MRPRun BOM exploded detail");
HSSFRow titleRow3 = sheet3.createRow(0);
titleRow3.setHeightInPoints(45);
HSSFCellStyle cellStyle3 = wb.createCellStyle();
HSSFCellStyle style3 = wb.createCellStyle();
//--------3rd sheet-end-------------------------
//--------4th sheet-start-------------------------
HSSFSheet sheet4 = wb.createSheet("MRPRun Input Parameter");
HSSFRow titleRow4 = sheet4.createRow(0);
titleRow4.setHeightInPoints(45);
HSSFCellStyle style4 = wb.createCellStyle();
//--------4th sheet-end-------------------------
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getApplDateFormat());
int insertRow = 2; int insertRow = 2;
for (int adpeCount = 0; adpeCount < adpeList.size(); adpeCount++) for (int adpeCount = 0; adpeCount < adpeList.size(); adpeCount++)
...@@ -13030,7 +13138,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13030,7 +13138,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
String sql=""; String sql="";
System.out.println("@@@@@ itemCode["+itemCode+"]"); //System.out.println("@@@@@ itemCode["+itemCode+"]");
//BaseLogger.log( "0", null, null, "@@@@@ itemCode["+itemCode+"]");
sql = "select item_type from item where item_code = ? "; sql = "select item_type from item where item_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString( 1, itemCode ); pstmt.setString( 1, itemCode );
...@@ -13075,9 +13184,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13075,9 +13184,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
//cell = row.createCell((short) j); //cell = row.createCell((short) j);
cell = row.createCell((int) j); cell = row.createCell((int) j);
}*/ }
HSSFCellStyle styleDateClr = wb.createCellStyle(); HSSFCellStyle styleDateClr = wb.createCellStyle();
HSSFCellStyle styleClr = wb.createCellStyle(); HSSFCellStyle styleClr = wb.createCellStyle();*/
HSSFFont fontClr = wb.createFont(); HSSFFont fontClr = wb.createFont();
fontClr.setColor(HSSFColor.RED.index); fontClr.setColor(HSSFColor.RED.index);
styleClr.setFont(fontClr); styleClr.setFont(fontClr);
...@@ -13141,7 +13250,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13141,7 +13250,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
row.getCell(15).setCellValue(runningDemand); row.getCell(15).setCellValue(runningDemand);
row.getCell(16).setCellValue(runningSupply); row.getCell(16).setCellValue(runningSupply);
//Added by Pavan R on 14dec18 start [to highlight running plan supply column in Excel file] //Added by Pavan R on 14dec18 start [to highlight running plan supply column in Excel file]
System.out.println("Pavan R adpeList["+adpeList+"]adpeCount["+adpeCount+"]timeMRParr["+timeMRParr.size()+"]timeCtr["+timeCtr+"]"); /*System.out.println("Pavan R adpeList["+adpeList+"]adpeCount["+adpeCount+"]timeMRParr["+timeMRParr.size()+"]timeCtr["+timeCtr+"]");
if(adpeList.size() > 0) if(adpeList.size() > 0)
{ {
if(adpeList.size() > adpeCount+1) if(adpeList.size() > adpeCount+1)
...@@ -13187,8 +13296,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13187,8 +13296,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}else }else
{ {
row.getCell(17).setCellValue(runningPlanSupply); row.getCell(17).setCellValue(runningPlanSupply);
} }*/
//row.getCell(17).setCellValue(runningPlanSupply); row.getCell(17).setCellValue(runningPlanSupply);
//Added by Pavan R on 14dec18 end //Added by Pavan R on 14dec18 end
row.getCell(18).setCellValue(independentDemand); row.getCell(18).setCellValue(independentDemand);
...@@ -13215,6 +13324,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13215,6 +13324,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// flag = false; // 25/02/11 manoharan commented as BTPL // flag = false; // 25/02/11 manoharan commented as BTPL
// want the same to be repeated in the excel file // want the same to be repeated in the excel file
} }
cell = row.getCell(17);
cell.setCellStyle(styleBckgroud);
} }
//Added by Pavan R on 09/oct/17 start //Added by Pavan R on 09/oct/17 start
...@@ -13224,12 +13335,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13224,12 +13335,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
final String[] detTitles = { "Item Code", "Due Date", "Demand", final String[] detTitles = { "Item Code", "Due Date", "Demand",
"Supply", "Tran Id", "Tran Series" }; "Supply", "Tran Id", "Tran Series" };
HSSFSheet sheetDet = wb.createSheet("MRPRun Input Data Detail"); /*HSSFSheet sheetDet = wb.createSheet("MRPRun Input Data Detail");
HSSFRow titleRowDet = sheetDet.createRow(0); HSSFRow titleRowDet = sheetDet.createRow(0);
titleRowDet.setHeightInPoints(45); titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle(); cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle(); HSSFCellStyle styleDet = wb.createCellStyle();*/
styleDet.setBorderTop((short) 6); // double lines border styleDet.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border styleDet.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index); styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
...@@ -13291,12 +13402,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13291,12 +13402,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
"Pending DR", "Tran Id", "Tran Series", "Pending DR", "Tran Id", "Tran Series",
"Qt Stock ", "Site Code" ,"Supplier Site Code"}; "Qt Stock ", "Site Code" ,"Supplier Site Code"};
HSSFSheet sheetDet = wb.createSheet("MRPRun Input Data Detail"); /*HSSFSheet sheetDet = wb.createSheet("MRPRun Input Data Detail");
HSSFRow titleRowDet = sheetDet.createRow(0); HSSFRow titleRowDet = sheetDet.createRow(0);
titleRowDet.setHeightInPoints(45); titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle(); cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle(); HSSFCellStyle styleDet = wb.createCellStyle();*/
styleDet.setBorderTop((short) 6); // double lines border styleDet.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border styleDet.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index); styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
...@@ -13378,12 +13489,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13378,12 +13489,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
"Demand", "Supply", "Stock Qty", "Other Supply", "Demand", "Supply", "Stock Qty", "Other Supply",
"Pending PO", "Pending DO", "Pending Indent", "Pending PO", "Pending DO", "Pending Indent",
"Pending DR", "Tran Id", "Tran Series" }; "Pending DR", "Tran Id", "Tran Series" };
HSSFSheet sheetDet = wb.createSheet("MRPRun Input Data Detail"); /*HSSFSheet sheetDet = wb.createSheet("MRPRun Input Data Detail");
HSSFRow titleRowDet = sheetDet.createRow(0); HSSFRow titleRowDet = sheetDet.createRow(0);
titleRowDet.setHeightInPoints(45); titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle(); cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle(); HSSFCellStyle styleDet = wb.createCellStyle();*/
styleDet.setBorderTop((short) 6); // double lines border styleDet.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border styleDet.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index); styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
...@@ -13460,12 +13571,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13460,12 +13571,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
"Pending PO", "Pending DO", "Pending Indent", "Pending PO", "Pending DO", "Pending Indent",
"Pending DR", "Tran Id", "Tran Series", "Site Code","Supplier Site Code" }; "Pending DR", "Tran Id", "Tran Series", "Site Code","Supplier Site Code" };
HSSFSheet sheetDet = wb.createSheet("MRPRun Input Data Detail"); /*HSSFSheet sheetDet = wb.createSheet("MRPRun Input Data Detail");
HSSFRow titleRowDet = sheetDet.createRow(0); HSSFRow titleRowDet = sheetDet.createRow(0);
titleRowDet.setHeightInPoints(45); titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle(); cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle(); HSSFCellStyle styleDet = wb.createCellStyle();*/
styleDet.setBorderTop((short) 6); // double lines border styleDet.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border styleDet.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index); styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
...@@ -13539,12 +13650,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13539,12 +13650,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
"Pending PO", "Pending DO", "Pending Indent", "Pending PO", "Pending DO", "Pending Indent",
"Pending DR", "Tran Id", "Tran Series", "Site Code","Supplier Site Code" }; "Pending DR", "Tran Id", "Tran Series", "Site Code","Supplier Site Code" };
HSSFSheet sheetDet = wb.createSheet("MRPRun Input Data Detail"); /*HSSFSheet sheetDet = wb.createSheet("MRPRun Input Data Detail");
HSSFRow titleRowDet = sheetDet.createRow(0); HSSFRow titleRowDet = sheetDet.createRow(0);
titleRowDet.setHeightInPoints(45); titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle(); cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle(); HSSFCellStyle styleDet = wb.createCellStyle();*/
styleDet.setBorderTop((short) 6); // double lines border styleDet.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border styleDet.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index); styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
...@@ -13620,34 +13731,34 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13620,34 +13731,34 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
final String[] detTitles = { "Bom code", "Component code", "Item code", final String[] detTitles = { "Bom code", "Component code", "Item code",
"Batch quantity", "Component quantity", "quantity per batch" , "Required type","Demand","Due date" }; "Batch quantity", "Component quantity", "quantity per batch" , "Required type","Demand","Due date" };
HSSFSheet sheetDet = wb.createSheet("MRPRun BOM exploded detail"); /*HSSFSheet sheet3 = wb.createSheet("MRPRun BOM exploded detail");
HSSFRow titleRowDet = sheetDet.createRow(0); HSSFRow titleRowDet = sheet3.createRow(0);
titleRowDet.setHeightInPoints(45); titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle(); cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle(); HSSFCellStyle style3 = wb.createCellStyle();*/
styleDet.setBorderTop((short) 6); // double lines border style3.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border style3.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index); style3.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
HSSFFont fontDet = wb.createFont(); HSSFFont fontDet = wb.createFont();
fontDet.setFontName(HSSFFont.FONT_ARIAL); fontDet.setFontName(HSSFFont.FONT_ARIAL);
fontDet.setFontHeightInPoints((short) 20); fontDet.setFontHeightInPoints((short) 20);
fontDet.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); fontDet.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
fontDet.setColor(HSSFColor.BLUE.index); fontDet.setColor(HSSFColor.BLUE.index);
styleDet.setFont(fontDet); style3.setFont(fontDet);
HSSFCell titleCellDet = titleRowDet.createCell((int) 0); HSSFCell titleCellDet = titleRow3.createCell((int) 0);
titleCellDet.setCellValue("MRPRun - Input Detail Data"); titleCellDet.setCellValue("MRPRun - Input Detail Data");
titleCellDet.setCellStyle(style); titleCellDet.setCellStyle(style);
sheetDet.autoSizeColumn((short) 1); sheet3.autoSizeColumn((short) 1);
HSSFRow headerRowDet = sheetDet.createRow(1); HSSFRow headerRow3 = sheet3.createRow(1);
headerRowDet.setHeightInPoints(40); headerRow3.setHeightInPoints(40);
HSSFCell headerCellDet; HSSFCell headerCellDet;
for (int cellCtr = 0; cellCtr < detTitles.length; cellCtr++) for (int cellCtr = 0; cellCtr < detTitles.length; cellCtr++)
{ {
headerCellDet = headerRowDet.createCell((int) cellCtr); headerCellDet = headerRow3.createCell((int) cellCtr);
headerCellDet.setCellValue(detTitles[cellCtr]); headerCellDet.setCellValue(detTitles[cellCtr]);
} }
int insertRowDet = 1; int insertRowDet = 1;
...@@ -13656,7 +13767,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13656,7 +13767,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
insertRowDet++; insertRowDet++;
rowDet = sheetDet.createRow(insertRowDet); rowDet = sheet3.createRow(insertRowDet);
for (int j = 0; j < detTitles.length; j++) for (int j = 0; j < detTitles.length; j++)
{ {
cellDet = rowDet.createCell((int) j); cellDet = rowDet.createCell((int) j);
...@@ -13688,36 +13799,37 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13688,36 +13799,37 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
"Manufacturing Plan", "Material Plan", "Generate Indent", "Manufacturing Plan", "Material Plan", "Generate Indent",
"Made To Stock", "Made To Order", "Balance Intersite" }; "Made To Stock", "Made To Order", "Balance Intersite" };
HSSFSheet sheetDet = wb.createSheet("MRPRun Input Parameter"); /*HSSFSheet sheet4 = wb.createSheet("MRPRun Input Parameter");
HSSFRow titleRowDet = sheetDet.createRow(0); HSSFRow titleRow4 = sheet4.createRow(0);
titleRowDet.setHeightInPoints(45); titleRow4.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle(); //cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();
styleDet.setBorderTop((short) 6); //HSSFCellStyle style4 = wb.createCellStyle();*/
styleDet.setBorderBottom((short) 1); style4.setBorderTop((short) 6);
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index); style4.setBorderBottom((short) 1);
style4.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
HSSFFont fontDet = wb.createFont(); HSSFFont fontDet = wb.createFont();
fontDet.setFontName(HSSFFont.FONT_ARIAL); fontDet.setFontName(HSSFFont.FONT_ARIAL);
fontDet.setFontHeightInPoints((short) 20); fontDet.setFontHeightInPoints((short) 20);
fontDet.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD); fontDet.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
fontDet.setColor(HSSFColor.BLUE.index); fontDet.setColor(HSSFColor.BLUE.index);
styleDet.setFont(fontDet); style4.setFont(fontDet);
HSSFCell titleCellDet = titleRowDet.createCell((int) 0); HSSFCell titleCellDet = titleRow4.createCell((int) 0);
titleCellDet.setCellValue("MRPRun - Input Parameter"); titleCellDet.setCellValue("MRPRun - Input Parameter");
titleCellDet.setCellStyle(style); titleCellDet.setCellStyle(style);
sheetDet.autoSizeColumn((short) 1); sheet4.autoSizeColumn((short) 1);
HSSFRow headerRowDet = sheetDet.createRow(1); HSSFRow headerRow4 = sheet4.createRow(1);
headerRowDet.setHeightInPoints(40); headerRow4.setHeightInPoints(40);
HSSFCell headerCellDet; HSSFCell headerCellDet;
for (int cellCtr = 0; cellCtr < inputParam.length; cellCtr++) for (int cellCtr = 0; cellCtr < inputParam.length; cellCtr++)
{ {
headerCellDet = headerRowDet.createCell((int) cellCtr); headerCellDet = headerRow4.createCell((int) cellCtr);
headerCellDet.setCellValue(inputParam[cellCtr]); headerCellDet.setCellValue(inputParam[cellCtr]);
} }
int insertRowDet = 2; int insertRowDet = 2;
insertRowDet++; insertRowDet++;
rowDet = sheetDet.createRow(insertRowDet); rowDet = sheet4.createRow(insertRowDet);
for (int j = 0; j < inputParam.length; j++) for (int j = 0; j < inputParam.length; j++)
{ {
cellDet = rowDet.createCell((int) j); cellDet = rowDet.createCell((int) j);
...@@ -13836,7 +13948,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13836,7 +13948,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
catch (Exception e) catch (Exception e)
{ {
System.out.println("Exception :RunMRPPrcEJB :setValuesInBrow():" + e.getMessage() + ":"); //System.out.println("Exception :RunMRPPrcEJB :setValuesInBrow():" + e.getMessage() + ":");
BaseLogger.log("0", null, null, "Exception :RunMRPPrcEJB :setValuesInBrow():" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
...@@ -13858,29 +13971,35 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13858,29 +13971,35 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
String subDirs[] = mrpOutputLocation.split("\\\\"); String subDirs[] = mrpOutputLocation.split("\\\\");
subDirName = subDirs[0]; subDirName = subDirs[0];
System.out.println("windows stype path"); //System.out.println("windows stype path");
BaseLogger.log("9", null, null, "windows stype path");
for (int idx = 1; idx < subDirs.length; idx++) for (int idx = 1; idx < subDirs.length; idx++)
{ {
subDirName = subDirName + File.separator + subDirs[idx]; subDirName = subDirName + File.separator + subDirs[idx];
System.out.println("subDirs[ idx ] [" + subDirs[idx] + "]"); //System.out.println("subDirs[ idx ] [" + subDirs[idx] + "]");
BaseLogger.log("9", null, null, "subDirs[ idx ] [" + subDirs[idx] + "]");
} }
} else } else
{ {
String subDirs[] = mrpOutputLocation.split("/"); String subDirs[] = mrpOutputLocation.split("/");
subDirName = subDirs[0]; subDirName = subDirs[0];
System.out.println("Unix style path"); //System.out.println("Unix style path");
BaseLogger.log("9", null, null, "Unix style path");
for (int idx = 1; idx < subDirs.length; idx++) for (int idx = 1; idx < subDirs.length; idx++)
{ {
subDirName = subDirName + File.separator + subDirs[idx]; subDirName = subDirName + File.separator + subDirs[idx];
System.out.println("subDirs[ idx ] [" + subDirs[idx] + "]"); //System.out.println("subDirs[ idx ] [" + subDirs[idx] + "]");
BaseLogger.log("9", null, null, "subDirs[ idx ] [" + subDirs[idx] + "]");
} }
} }
subDirFile = new File(subDirName); subDirFile = new File(subDirName);
System.out.println("File path [" + subDirName + "]"); //System.out.println("File path [" + subDirName + "]");
BaseLogger.log("9", null, null, "File path [" + subDirName + "]");
if (!subDirFile.exists()) if (!subDirFile.exists())
{ {
System.out.println("creating folders [" + subDirName + "]"); //System.out.println("creating folders [" + subDirName + "]");
BaseLogger.log("9", null, null, "creating folders [" + subDirName + "]");
subDirFile.mkdirs(); subDirFile.mkdirs();
} }
} }
...@@ -13902,14 +14021,17 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13902,14 +14021,17 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
loginUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); loginUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
formatCode="MRPRPT";// send mail only for 'To'. formatCode="MRPRPT";// send mail only for 'To'.
mailMrpReport = mfgCommon.getEnvMfg("999999","MAIL_MRP_REPORT",conn); mailMrpReport = mfgCommon.getEnvMfg("999999","MAIL_MRP_REPORT",conn);
System.out.println("MAIL_MRP_REPORT"+mailMrpReport); //System.out.println("MAIL_MRP_REPORT"+mailMrpReport);
System.out.println("@@@@@ mailMrpReport["+mailMrpReport+"]loginUser["+loginUser+"]fileName["+fileName+"]mrpErrDetList["+mrpErrDetList+"]"); BaseLogger.log("9", null, null, "MAIL_MRP_REPORT"+mailMrpReport);
//System.out.println("@@@@@ mailMrpReport["+mailMrpReport+"]loginUser["+loginUser+"]fileName["+fileName+"]mrpErrDetList["+mrpErrDetList+"]");
BaseLogger.log("9", null, null, "@@@@@ mailMrpReport["+mailMrpReport+"]loginUser["+loginUser+"]fileName["+fileName+"]mrpErrDetList["+mrpErrDetList+"]");
if( mailMrpReport != null && "Y".equalsIgnoreCase(mailMrpReport) && (mrpErrDetList == null || mrpErrDetList.size()==0) ) if( mailMrpReport != null && "Y".equalsIgnoreCase(mailMrpReport) && (mrpErrDetList == null || mrpErrDetList.size()==0) )
{ {
//emailAddr = setDescription("email_id_off", "employee", "emp_code", loginUser, conn); //emailAddr = setDescription("email_id_off", "employee", "emp_code", loginUser, conn);
emailAddr = getEmailId(loginUser, conn); emailAddr = getEmailId(loginUser, conn);
System.out.println("@@@@@ emailAddr["+emailAddr+"]"); //System.out.println("@@@@@ emailAddr["+emailAddr+"]");
BaseLogger.log("9", null, null, "@@@@@ emailAddr["+emailAddr+"]");
commInfo.append("<ROOT>"); commInfo.append("<ROOT>");
commInfo.append("<MAIL><EMAIL_TYPE>page</EMAIL_TYPE><ENTITY_CODE>BASE</ENTITY_CODE>"); commInfo.append("<MAIL><EMAIL_TYPE>page</EMAIL_TYPE><ENTITY_CODE>BASE</ENTITY_CODE>");
...@@ -13931,20 +14053,30 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13931,20 +14053,30 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); String loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
UserInfoBean userInfo = dbAccess.createUserInfo(loginCode); UserInfoBean userInfo = dbAccess.createUserInfo(loginCode);
//mailRetStr=email.sendMail(commInfo.toString(), "ITM"); //mailRetStr=email.sendMail(commInfo.toString(), "ITM");
//Pavan R 25dec18[not to bypass ecxeption if mail details not config in ibase.xml]
try{
mailRetStr=email.sendMail(commInfo.toString(), "ITM", userInfo); mailRetStr=email.sendMail(commInfo.toString(), "ITM", userInfo);
//System.out.println("@V@ Mail return String :- ["+mailRetStr+"]");
BaseLogger.log("9", null, null, "@V@ Mail return String :- ["+mailRetStr+"]");
//Pavan R on 03dec18 end //Pavan R on 03dec18 end
System.out.println("@V@ Mail return String :- ["+mailRetStr+"]"); }catch(Exception e)
{
e.getMessage();
}
if(mailRetStr.contains("S")) if(mailRetStr.contains("S"))
{ {
System.out.println("@V@ loginUser :- [" + loginUser + "] Email Addres :- [" + emailAddr + "]");
//System.out.println("@V@ loginUser :- [" + loginUser + "] Email Addres :- [" + emailAddr + "]");
BaseLogger.log( "9", userInfo, null, "@V@ loginUser :- [" + loginUser + "] Email Addres :- [" + emailAddr + "]");
//fos1.write(("\n Email send SUCCESSFULLY for Customer code :- [" + custCode + "]").getBytes()); //fos1.write(("\n Email send SUCCESSFULLY for Customer code :- [" + custCode + "]").getBytes());
} }
else else
{ {
System.out.println("@V@ Email addr NOT FOUND for loginUser :- [" + loginUser + "]"); //System.out.println("@V@ Email addr NOT FOUND for loginUser :- [" + loginUser + "]");
BaseLogger.log( "9", userInfo, null, "@V@ Email addr NOT FOUND for loginUser :- [" + loginUser + "]");
//fos1.write(("\n Email sending FAIL for loginUser :- [" + loginUser + "]").getBytes()); //fos1.write(("\n Email sending FAIL for loginUser :- [" + loginUser + "]").getBytes());
} }
} }
// code for mail file to login user for sava M16FSAV001 end 16/09/16 // code for mail file to login user for sava M16FSAV001 end 16/09/16
...@@ -13955,12 +14087,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -13955,12 +14087,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
resultString = retTabSepStrBuff.toString(); resultString = retTabSepStrBuff.toString();
} catch (SQLException se) } catch (SQLException se)
{ {
System.out.println("SQLException :RunMRPPrcEJB :setValuesInBrow():" + se.getMessage() + ":"); //System.out.println("SQLException :RunMRPPrcEJB :setValuesInBrow():" + se.getMessage() + ":");
BaseLogger.log("0", null, null, "SQLException :RunMRPPrcEJB :Write2XSL:" + se.getMessage() + ":");
se.printStackTrace(); se.printStackTrace();
throw new ITMException(se); throw new ITMException(se);
} catch (Exception e) } catch (Exception e)
{ {
System.out.println("Exception :RunMRPPrcEJB :setValuesInBrow():" + e.getMessage() + ":"); //System.out.println("Exception :RunMRPPrcEJB :setValuesInBrow():" + e.getMessage() + ":");
BaseLogger.log("0", null, null, "Exception :RunMRPPrcEJB :Write2XSL:" + e.getMessage() + ":");
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} finally } finally
...@@ -14264,7 +14398,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -14264,7 +14398,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String rsItemCode = "", adpItemcode = ""; String rsItemCode = "", adpItemcode = "";
while (rs.next()) while (rs.next())
{ {
System.out.println("@@@@@@3766 sql executed....."); //System.out.println("@@@@@@3766 sql executed.....");
rsItemCode = rs.getString(1);// Added by JIten 02/11/06 as per rsItemCode = rs.getString(1);// Added by JIten 02/11/06 as per
dueDate = rs.getTimestamp(2); dueDate = rs.getTimestamp(2);
demand = rs.getDouble(3); demand = rs.getDouble(3);
...@@ -14300,9 +14434,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -14300,9 +14434,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("Setting Line No in Detail record---"+adpElement.getLineNo()); //System.out.println("Setting Line No in Detail record---"+adpElement.getLineNo());
//detADPElement.setSaleOrder(adpElement.getSaleOrder()); //detADPElement.setSaleOrder(adpElement.getSaleOrder());
//detADPElement.setLineNo(adpElement.getLineNo()); //detADPElement.setLineNo(adpElement.getLineNo());
System.out.println("detADPElement.getPendingPO()----"+detADPElement.getPendingPO()); //System.out.println("detADPElement.getPendingPO()----"+detADPElement.getPendingPO());
System.out.println("tranId#tranSer----"+tranId+"#"+tranSer); //System.out.println("tranId#tranSer----"+tranId+"#"+tranSer);
detMap.put(tranId+"#"+tranSer, detADPElement); detMap.put(tranId+"#"+tranSer, detADPElement);
...@@ -14477,7 +14611,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -14477,7 +14611,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Added by Pavan R 27-apr-18 to check duplicate item in adpelement //Added by Pavan R 27-apr-18 to check duplicate item in adpelement
if("TPBP0822".equalsIgnoreCase(adpE1.getItemCode().trim())) if("TPBP0822".equalsIgnoreCase(adpE1.getItemCode().trim()))
{ {
System.out.println("[4]---childItems()..."); //System.out.println("[4]---childItems()...");
} }
al1.add(adpE1); al1.add(adpE1);
//adpE.setDetList(null); //adpE.setDetList(null);
...@@ -14548,7 +14682,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -14548,7 +14682,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
System.out.println("sqlFileName---"+sqlFileName); //System.out.println("sqlFileName---"+sqlFileName);
// end 14-02-2007 manoharan // end 14-02-2007 manoharan
if ((CommonConstants.DB_NAME).equalsIgnoreCase("db2")) if ((CommonConstants.DB_NAME).equalsIgnoreCase("db2"))
...@@ -14918,6 +15052,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -14918,6 +15052,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
while (rs.next()) { while (rs.next()) {
msgType = checkNull(rs.getString("MSG_TYPE")); msgType = checkNull(rs.getString("MSG_TYPE"));
} }
rs.close();rs = null;
pstmt.close(); pstmt = null;
} catch (Exception ex) { } catch (Exception ex) {
ex.printStackTrace(); ex.printStackTrace();
} finally { } finally {
...@@ -15231,10 +15367,17 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -15231,10 +15367,17 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode"); String loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
UserInfoBean userInfo = dbAccess.createUserInfo(loginCode); UserInfoBean userInfo = dbAccess.createUserInfo(loginCode);
//mailRetStr=email.sendMail(commInfo.toString(), "ITM"); //mailRetStr=email.sendMail(commInfo.toString(), "ITM");
//Pavan R 25dec18[not to bypass ecxeption if mail details not config in ibase.xml]
try{
mailRetStr=email.sendMail(commInfo.toString(), "ITM", userInfo); mailRetStr=email.sendMail(commInfo.toString(), "ITM", userInfo);
//Pavan R on 03dec18 end //Pavan R on 03dec18 end
System.out.println("@V@ Mail return String :- ["+mailRetStr+"]"); System.out.println("@V@ Mail return String :- ["+mailRetStr+"]");
}
catch(Exception e)
{
e.getMessage();
}
if(mailRetStr.contains("S")) if(mailRetStr.contains("S"))
{ {
System.out.println("@V@ Cust code :- [" + empCode + "] Email Addres :- [" + emailAddr + "]"); System.out.println("@V@ Cust code :- [" + empCode + "] Email Addres :- [" + emailAddr + "]");
......
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