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;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
import ibase.utility.BaseLogger;
//import ibase.webitm.utility.ITMException;
//import ibase.webitm.utility.GenericUtility;
import ibase.utility.E12GenericUtility;
......@@ -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)
{
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.saleOrder = saleOrder;//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
public void setDemand(java.sql.Timestamp dueDate, double demand, String saleOrder, String lineNo,boolean isDetailReq)
//public void setDemand(java.sql.Timestamp dueDate, double demand)
{
System.out.println("--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)
{
this.demand+= demand;
......@@ -403,7 +406,8 @@ class ADPElement implements Cloneable
public void setSupply(java.sql.Timestamp dueDate, double 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," "," ");
/*if(this.reorderLevel>0)
{
......@@ -444,11 +448,13 @@ class ADPElement implements Cloneable
public void setPlanSupply(java.sql.Timestamp dueDate, double supply)
{
System.out.println("Before SetPlanSupply itemCode["+itemCode+"] dueDate:["+dueDate+"] supply["+supply+"] planSupply["+planSupply+"]");
//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;
//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()
{
......@@ -843,7 +849,8 @@ class ADPElement implements Cloneable
int timeEle = -1, ctr;
SimpleDateFormat sdt=new SimpleDateFormat("yyyy-MM-dd");
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
{
timeEle = -1;
......@@ -853,7 +860,8 @@ class ADPElement implements Cloneable
{
timeMRP = (TimeMRP)timeMRPArr.get(ctr);
//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().equals(dueDate))
......@@ -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)
{
timeMRP = new TimeMRP();
timeMRP.setDueDate(dueDate);
//added by sabyasachi 29.03.2011
//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);
//end added by sabyasachi 29.03.2011
timeMRP.setSupply(supply);
......@@ -886,18 +896,21 @@ class ADPElement implements Cloneable
timeMRP = (TimeMRP)this.timeMRPArr.get(timeEle);
//added by sabyasachi 29.03.2011
//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
// 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);
// }
//Commented by Pavan R on 05/DEC/17 End
//end added by sabyasachi 29.03.2011
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
timeMRP.setStockQty(stockQty);
timeMRP.setOthSupply(othSupply);
......@@ -906,13 +919,16 @@ class ADPElement implements Cloneable
//timeMRP.setLineNo(lineNo);
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);
System.out.println("after updateRunningDemandSupply()" );
//System.out.println("after updateRunningDemandSupply()" );
BaseLogger.log( "9", null, null, "after updateRunningDemandSupply()");
}
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);
e.printStackTrace();
errString = e.getMessage();
......@@ -928,7 +944,8 @@ class ADPElement implements Cloneable
int timeEle = -1, ctr;
SimpleDateFormat sdt=new SimpleDateFormat("yyyy-MM-dd");
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
{
timeEle = -1;
......@@ -938,7 +955,8 @@ class ADPElement implements Cloneable
{
timeMRP = (TimeMRP)timeMRPArr.get(ctr);
//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().equals(dueDate))
......@@ -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)
{
......@@ -957,16 +976,19 @@ class ADPElement implements Cloneable
timeMRP.setDueDate(dueDate);
//added by sabyasachi 29.03.2011
//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 )
{
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 ) ;
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);
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);
//end added by sabyasachi 29.03.2011
......@@ -982,21 +1004,25 @@ class ADPElement implements Cloneable
timeMRP = (TimeMRP)this.timeMRPArr.get(timeEle);
//added by sabyasachi 29.03.2011
//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 )
{
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 ) ;
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);
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);
//end added by sabyasachi 29.03.2011
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
timeMRP.setStockQty(stockQty);
timeMRP.setOthSupply(othSupply);
......@@ -1005,13 +1031,16 @@ class ADPElement implements Cloneable
//timeMRP.setLineNo(lineNo);
this.timeMRPArr.set(timeEle,timeMRP);
}
System.out.println("before updateRunningDemandSupply()" );
//System.out.println("before updateRunningDemandSupply()" );
BaseLogger.log( "9", null, null, "before updateRunningDemandSupply()" );
updateRunningDemandSupply(dueDate);
System.out.println("after updateRunningDemandSupply()" );
//System.out.println("after updateRunningDemandSupply()" );
BaseLogger.log( "9", null, null, "after updateRunningDemandSupply()");
}
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);
e.printStackTrace();
errString = e.getMessage();
......@@ -1031,7 +1060,8 @@ class ADPElement implements Cloneable
try
{
//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);
//Added By Pavan Rane on 28MAR18[End]
//commented by Pavan R on 27-apr-18 for to check duplicate item in adpelement
......@@ -1064,14 +1094,16 @@ class ADPElement implements Cloneable
planSupply = timeMRP.getPlanSupply();
runningPlanSupply = runningPlanSupply + planSupply;
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
timeMRPArr.set(ctr, timeMRP);
}
}
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);
e.printStackTrace();
errString = e.getMessage();
......@@ -1123,7 +1155,8 @@ class ADPElement implements Cloneable
}
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);
e.printStackTrace();
errString = e.getMessage();
......@@ -1132,7 +1165,8 @@ class ADPElement implements Cloneable
//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)
{
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 = "";
TimeMRP timeMRP = null;
//genericUtility = GenericUtility.getInstance();
......@@ -1179,7 +1213,8 @@ class ADPElement implements Cloneable
}
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);
e.printStackTrace();
errString = e.getMessage();
......
......@@ -144,11 +144,12 @@ public class ExplodeBom
leadTime = mfgLeadTime + qcLeadTime;
iLeadTime = (int)leadTime;
System.out.println("Due Date Before.........."+dueDate) ;
BaseLogger.log( "0", null, null, "Due Date Before..........["+dueDate+"]" );
//System.out.println("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
System.out.println("Due Date After..........."+dueDate) ;
BaseLogger.log( "0", null, null, "Due Date After..........["+dueDate+"]" );
//System.out.println("Due Date After..........."+dueDate) ;
BaseLogger.log( "9", null, null, "Due Date After..........["+dueDate+"]" );
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
sDueDate = simpleDateFormat.format(dueDate);
......@@ -185,160 +186,160 @@ public class ExplodeBom
+ " ORDER BY BOMDET.OPERATION, BOMDET.ITEM_REF, BOMDET.ITEM_CODE ";
// end 11-08-2007 manoharan
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,bomCode);
//pstmt.setString(2,siteCode);
rs = pstmt.executeQuery();
//System.out.println("Exploding " + siteCode + " " + itemCode + " " + bomCode +" for " + sQuantity );
pstmt.setString(1,bomCode);
//pstmt.setString(2,siteCode);
rs = pstmt.executeQuery();
//System.out.println("Exploding " + siteCode + " " + itemCode + " " + bomCode +" for " + sQuantity );
while (rs.next())
{
itemCodeBomDet = rs.getString(1);
itemRef = rs.getString(2);
unit = rs.getString(3);
batchQty = rs.getDouble(4);
perQty = rs.getDouble(5);
reqType = rs.getString(6);
minQty = rs.getDouble(7);
operation = rs.getInt(8);
critItem = rs.getString(9);
round = rs.getString(10).charAt(0);
roundTo = rs.getDouble(11);
//added field by rajendra on 14/06/07
matchPotency = rs.getString(12);
minPotencyPerc = rs.getDouble(13);
adjPotency =( rs.getString(14) ==null ? "" :rs.getString(14) );
usageType = rs.getString(15);
allocateType = rs.getString(16);
locUsageType = rs.getString(17);
considerLotNoIssue = rs.getString(18);
// 11-08-2007 manoharan
itemActive = rs.getString("ACTIVE");
suppCodeMfg = rs.getString("SUPP_CODE__MFG");
useInvStatus = rs.getString("USE_INVSTATUS");
mfgRef = rs.getString("MFG_REF");
dimension = rs.getString("DIMENSION");
minReqQty = rs.getDouble("MIN_REQ_QTY");
itemCategory = rs.getString("ITEM_CATEGORY");
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 + "]");
BaseLogger.log( "9", null, null, "12/06/14 itemActive before[ " +itemActive + "]");
if (itemActive == null || "null".equals(itemActive))
{
itemActive = "Y";
}
//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
+ "FROM ITEM "
+ "WHERE ITEM_CODE = ?";
pstmtInner = conn.prepareStatement(sqlInner);
pstmtInner.setString(1,itemCodeBomDet);
rsInner = pstmtInner.executeQuery();
if (rsInner.next())
{
suppSourItem = rsInner.getString(1);
bomCodeItem = rsInner.getString(2);
unit = rsInner.getString(3);
netWeight = rsInner.getDouble(4);
item_type =rsInner.getString(5);
item_ser =rsInner.getString(6);
//System.out.println("unit.........."+unit) ;
//System.out.println("netWeight.........."+netWeight) ;
}
rsInner.close();
rsInner = null;//Added by JIten 13/11/06 -
pstmtInner.close();
pstmtInner = null;//Added by JIten 13/11/06 -
sqlInner = "SELECT SUPP_SOUR, BOM_CODE, ACTIVE "
+ "FROM SITEITEM "
+ "WHERE SITE_CODE = ? "
+ "AND ITEM_CODE = ? ";
pstmtInner = conn.prepareStatement(sqlInner);
pstmtInner.setString(1,siteCode);
pstmtInner.setString(2,itemCodeBomDet);
rsInner = pstmtInner.executeQuery();
//rsInner = pstmtInner.executeQuery();//Commented by Jiten as this is repeated - 13/11/06
if (rsInner.next())
{
suppSourInner = rsInner.getString(1);
bomCodeInner = rsInner.getString(2);
siteItemActive = rsInner.getString("ACTIVE");
while (rs.next())
if( (suppSourInner == null) || (suppSourInner.trim().length() == 0) )
{
suppSourInner = suppSourItem;
}
if( (bomCodeInner == null) || (bomCodeInner.trim().length() == 0) )
{
bomCodeInner = bomCodeItem;
}
}
suppSourInner= suppSourInner.trim();
rsInner.close();
rsInner = null;//Added by Jiten 13/11/06 -
pstmtInner.close();
pstmtInner = null;//Added by Jiten 13/11/06 -
//System.out.println("12/06/14 siteItemActive [ " +siteItemActive + "]");
if (siteItemActive == null || "null".equals(siteItemActive))
{
siteItemActive = "Y";
}
//System.out.println("12/06/14 siteItemActive after[ " +siteItemActive + "]");
if ("N".equalsIgnoreCase(itemActive) || "N".equalsIgnoreCase(siteItemActive) )
{
continue;
}
// end 11-08-2007 manoharan
//siteItemActive = null;
//added by rajendra 6/04/07
if(pevoper != operation){
ctr =1;
pevoper = operation;
//System.out.println("pevoper........." +pevoper);
}
if(exp_lev == null){
xml_exp_lev = operation +"."+ctr+".";
//System.out.println("xml_exp_lev...when exp_lev is null......" +xml_exp_lev);
}else{
xml_exp_lev = xml_exp_lev +"."+ctr+".";
//System.out.println("xml_exp_lev........." +xml_exp_lev);
}
ctr++;
//end by rajendra
//System.out.println("Item Code : " + itemCodeBomDet + "Item Ref : " + itemRef + " Line Type " + lineType);
if (lineType.equals("B"))
{
if (reqType.equals("S"))
{
quantityUpdate = (quantity / batchQty) * perQty;
}
else if (reqType.equals("P"))
{
quantityUpdate = (perQty / batchQty) * quantity;
}
else if (reqType.equals("F"))
{
quantityUpdate = perQty;
}
//System.out.println("Qty :" + quantity + " Batch Qty :" + batchQty + " Item Ref : " + itemRef + " Qty Per " + perQty + " Req Type " + reqType + " Qty Update :" + quantityUpdate);
itemCodeBomDet = rs.getString(1);
itemRef = rs.getString(2);
unit = rs.getString(3);
batchQty = rs.getDouble(4);
perQty = rs.getDouble(5);
reqType = rs.getString(6);
minQty = rs.getDouble(7);
operation = rs.getInt(8);
critItem = rs.getString(9);
round = rs.getString(10).charAt(0);
roundTo = rs.getDouble(11);
//added field by rajendra on 14/06/07
matchPotency = rs.getString(12);
minPotencyPerc = rs.getDouble(13);
adjPotency =( rs.getString(14) ==null ? "" :rs.getString(14) );
usageType = rs.getString(15);
allocateType = rs.getString(16);
locUsageType = rs.getString(17);
considerLotNoIssue = rs.getString(18);
// 11-08-2007 manoharan
itemActive = rs.getString("ACTIVE");
suppCodeMfg = rs.getString("SUPP_CODE__MFG");
useInvStatus = rs.getString("USE_INVSTATUS");
mfgRef = rs.getString("MFG_REF");
dimension = rs.getString("DIMENSION");
minReqQty = rs.getDouble("MIN_REQ_QTY");
itemCategory = rs.getString("ITEM_CATEGORY");
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 + "]");
if (itemActive == null || "null".equals(itemActive))
{
itemActive = "Y";
}
System.out.println("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
+ "FROM ITEM "
+ "WHERE ITEM_CODE = ?";
pstmtInner = conn.prepareStatement(sqlInner);
pstmtInner.setString(1,itemCodeBomDet);
rsInner = pstmtInner.executeQuery();
if (rsInner.next())
{
suppSourItem = rsInner.getString(1);
bomCodeItem = rsInner.getString(2);
unit = rsInner.getString(3);
netWeight = rsInner.getDouble(4);
item_type =rsInner.getString(5);
item_ser =rsInner.getString(6);
//System.out.println("unit.........."+unit) ;
//System.out.println("netWeight.........."+netWeight) ;
}
rsInner.close();
rsInner = null;//Added by JIten 13/11/06 -
pstmtInner.close();
pstmtInner = null;//Added by JIten 13/11/06 -
sqlInner = "SELECT SUPP_SOUR, BOM_CODE, ACTIVE "
+ "FROM SITEITEM "
+ "WHERE SITE_CODE = ? "
+ "AND ITEM_CODE = ? ";
pstmtInner = conn.prepareStatement(sqlInner);
pstmtInner.setString(1,siteCode);
pstmtInner.setString(2,itemCodeBomDet);
rsInner = pstmtInner.executeQuery();
//rsInner = pstmtInner.executeQuery();//Commented by Jiten as this is repeated - 13/11/06
if (rsInner.next())
{
suppSourInner = rsInner.getString(1);
bomCodeInner = rsInner.getString(2);
siteItemActive = rsInner.getString("ACTIVE");
if( (suppSourInner == null) || (suppSourInner.trim().length() == 0) )
{
suppSourInner = suppSourItem;
}
if( (bomCodeInner == null) || (bomCodeInner.trim().length() == 0) )
{
bomCodeInner = bomCodeItem;
}
}
suppSourInner= suppSourInner.trim();
rsInner.close();
rsInner = null;//Added by Jiten 13/11/06 -
pstmtInner.close();
pstmtInner = null;//Added by Jiten 13/11/06 -
System.out.println("12/06/14 siteItemActive [ " +siteItemActive + "]");
if (siteItemActive == null || "null".equals(siteItemActive))
{
siteItemActive = "Y";
}
System.out.println("12/06/14 siteItemActive after[ " +siteItemActive + "]");
if ("N".equalsIgnoreCase(itemActive) || "N".equalsIgnoreCase(siteItemActive) )
{
continue;
}
// end 11-08-2007 manoharan
//siteItemActive = null;
//added by rajendra 6/04/07
if(pevoper != operation){
ctr =1;
pevoper = operation;
//System.out.println("pevoper........." +pevoper);
}
if(exp_lev == null){
xml_exp_lev = operation +"."+ctr+".";
//System.out.println("xml_exp_lev...when exp_lev is null......" +xml_exp_lev);
}else{
xml_exp_lev = xml_exp_lev +"."+ctr+".";
//System.out.println("xml_exp_lev........." +xml_exp_lev);
}
ctr++;
//end by rajendra
//System.out.println("Item Code : " + itemCodeBomDet + "Item Ref : " + itemRef + " Line Type " + lineType);
if (lineType.equals("B"))
{
if (reqType.equals("S"))
{
quantityUpdate = (quantity / batchQty) * perQty;
}
else if (reqType.equals("P"))
{
quantityUpdate = (perQty / batchQty) * quantity;
}
else if (reqType.equals("F"))
{
quantityUpdate = perQty;
}
//System.out.println("Qty :" + quantity + " Batch Qty :" + batchQty + " Item Ref : " + itemRef + " Qty Per " + perQty + " Req Type " + reqType + " Qty Update :" + quantityUpdate);
quantityUpdate = itmDBAccessEJB.getRndamt(quantityUpdate, round, roundTo);
if (quantityUpdate < minQty)
{
quantityUpdate = minQty;
}
}
else
{
quantityUpdate = quantity;
}
quantityUpdate = itmDBAccessEJB.getRndamt(quantityUpdate, round, roundTo);
if (quantityUpdate < minQty)
{
quantityUpdate = minQty;
}
}
else
{
quantityUpdate = quantity;
}
// check for bom or item if bom explode further
/* 11-08-2007 manoharan commented and taken up as was required to check the active flag
sqlInner = "SELECT SUPP_SOUR, BOM_CODE ,UNIT,NET_WEIGHT,item_type,item_ser " //added unit,NET_WEIGHT by rajendra
......@@ -646,6 +647,11 @@ public class ExplodeBom
}
}
}//loop end
rs.close();//added by Pavan R 21dec18
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("</Root>");
//rs.close(); //Below three lines commented by Jiten 31/10/06
//pstmtInner.close();
......@@ -736,7 +742,7 @@ public class ExplodeBom
fmtStr = fmtStr + "." + "000000000".substring(0, prec);
}
DecimalFormat decFormat = new DecimalFormat(fmtStr);
System.out.println("getRequiredDecimal---["+actVal+"]");
//System.out.println("getRequiredDecimal---["+actVal+"]");
return decFormat.format(actVal);
}
private String decFormat(double num)
......
......@@ -19,6 +19,7 @@ package ibase.webitm.ejb.mfg;
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.utility.BaseLogger;
import ibase.utility.CommonConstants;
import ibase.utility.EMail;
import ibase.utility.UserInfoBean;
......@@ -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
{
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;
Document dom = null, dom1 = null;
String retString = null;
......@@ -307,7 +309,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// -
try
{
System.out.println(">>>>>xmlString:"+xmlString);
//System.out.println(">>>>>xmlString:"+xmlString);
if (xmlString != null && xmlString.trim().length() != 0)
{
// System.out.println("XML String :" + xmlString);
......@@ -320,14 +322,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
retString = getData(dom, dom1, windowName, xtraParams);
endTime = System.currentTimeMillis();
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));
totalHrs = (int) (totSecs / 3600);
totlMts = (int) (((totSecs - (totalHrs * 3600)) / 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 -
} catch (Exception e)
{
......@@ -342,7 +346,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
mrpErrDetList.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;
}
......@@ -404,7 +409,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
try
{
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
if (context != null && context.trim().length() > 0)
{
......@@ -427,10 +433,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
siteList = genericUtility.getColumnValue("site_list", dom); //added by chandrashekar
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
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
//added by sagar on 28/05/2015, Start
......@@ -441,8 +449,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Added by Pavan R on 09/oct/17 start
bomLevelDetStr = bomLevelStr;
//Pavan R on 09/oct/17 end
System.out.println(">>>>>>In getData roundingRequired:"+roundingRequired);
System.out.println(">>>>>>In getData bomLevelStr:"+bomLevelStr);
//System.out.println(">>>>>>In getData roundingRequired:"+roundingRequired);
//System.out.println(">>>>>>In getData bomLevelStr:"+bomLevelStr);
if(bomLevelStr == null || bomLevelStr.trim().length()==0)
{
bomLevelStr="0";
......@@ -452,14 +460,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
roundingRequired="Y";
}
System.out.println(">>>>>>In getData roundingRequired:"+roundingRequired);
System.out.println(">>>>>>In getData bomLevel:"+bomLevel);
//System.out.println(">>>>>>In getData roundingRequired:"+roundingRequired);
//System.out.println(">>>>>>In getData bomLevel:"+bomLevel);
//added by sagar on 28/05/2015, End
if(yield == null || yield.trim().length() == 0)
{
yield = "Y";
}
System.out.println("yield>>>>>["+yield+"]");
//System.out.println("yield>>>>>["+yield+"]");
if( soItemList != null )
{
//System.out.println("BASE@@@@@ soItemList["+soItemList+"]");
......@@ -548,7 +556,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
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
if( dom1 != null )
......@@ -566,7 +575,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
e1.printStackTrace();
}
this.wnName1=windowName1;
System.out.println("wnName1 ==>"+wnName1);
//System.out.println("wnName1 ==>"+wnName1);
}
}
// end
......@@ -605,19 +614,22 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
endTime = System.currentTimeMillis();
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));
totalHrs = (int) (totSecs / 3600);
totlMts = (int) (((totSecs - (totalHrs * 3600)) / 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)
{
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;
}
......@@ -627,14 +639,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
errString = populateCommonParameters();
endTime = System.currentTimeMillis();
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));
totalHrs = (int) (totSecs / 3600);
totlMts = (int) (((totSecs - (totalHrs * 3600)) / 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)
{
......@@ -836,14 +848,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String sourceItem = setDescription("item_code", "bom", "bom_code", bomCode1, conn);
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 + "]");
}
//else
//{
System.out.println("680---"+adpeList.size());
//System.out.println("680---"+adpeList.size());
BaseLogger.log("9", null, null, "680---"+adpeList.size());
errString = populateADPElementList();
endTime = System.currentTimeMillis();
totalTime = endTime - startTime;
......@@ -1986,7 +2000,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// System.out.println(rs.getString(1));
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
} catch (SQLException se)
{
System.out.println("SQLException : RunMRPPrcEJB :populateSiteMap()" + se.getMessage());
......@@ -2157,21 +2174,25 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pstmt1 = null;
boolean isMtoS = 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(madeToStock.equalsIgnoreCase("0") && (!(mfgType1.trim().equalsIgnoreCase("O") || mfgType1.trim().equalsIgnoreCase("D"))))
{
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"))
{
String adpQueryOriginal = readFile(sqlFileName + "Oracle.sql");
adpQuery = adpQueryOriginal;
System.out.println("siteCode:["+siteCode+"]\nitemCode:["+rs.getString(1)+"]\ndbDateFrom:["+dbDateFrom+"]\ndbDateTo["+dbDateTo+"]");
System.out.println("standingOrdTypes:["+standingOrdTypes+"]\nmadeToOrder:["+madeToOrder+"]\nmadeToStock:["+madeToStock+"]\ndbRunDate["+dbRunDate+"]");
System.out.println("3309::Replacing Values.in SQL.....");
//System.out.println("siteCode:["+siteCode+"]\nitemCode:["+rs.getString(1)+"]\ndbDateFrom:["+dbDateFrom+"]\ndbDateTo["+dbDateTo+"]");
//BaseLogger.log( "0", null, null, "siteCode:["+siteCode+"] itemCode:["+rs.getString(1)+"] dbDateFrom:["+dbDateFrom+"] dbDateTo["+dbDateTo+"]");
//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("@itemcode@", rs.getString(1));
adpQuery = adpQuery.replaceAll("@fromdate@", dbDateFrom);
......@@ -2180,14 +2201,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpQuery = adpQuery.replaceAll("@madetoorder@", madeToOrder);
adpQuery = adpQuery.replaceAll("@madetostock@", madeToStock);
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);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
isMtoS = true;
System.out.println("isMtoO=["+isMtoO+"]");
//System.out.println("isMtoO=["+isMtoO+"]");
BaseLogger.log("9", null, null, "isMtoO=["+isMtoO+"]");
}
rs1.close();
rs1 = null;
......@@ -2197,7 +2220,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if(madeToOrder.equalsIgnoreCase("0") && (mfgType1.trim().equalsIgnoreCase("O") || mfgType1.trim().equalsIgnoreCase("D")))
{
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"))
{
String adpQueryOriginal = readFile(sqlFileName + "Oracle.sql");
......@@ -2241,7 +2265,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
}
}
rs.close();
rs = null;
}
pstmt.close();
pstmt = null;
} catch (SQLException se)
{
//System.out.println("SQLException : RunMRPPrcEJB :populateItemMap()" + se.getMessage());
......@@ -2259,15 +2287,25 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
try
{
if (rs != null)
{
rs.close();
rs = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
if (rs != null)
if(pstmt1 != null)
{
rs.close();
rs = null;
pstmt1.close();
pstmt1 = null;
}
} catch (Exception e)
{
......@@ -2413,7 +2451,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
//System.out.println("confirmedBom---"+confirmedBom+"---activeBom---"+activeBom);
rsValidBom.close();
rsValidBom = null;
pstmtValidBom.close();
pstmtValidBom = null;
// 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"))
{
......@@ -2454,7 +2494,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
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 + "'";
// pstmt = conn.prepareStatement(sql);
System.out.println(sql);
//System.out.println(sql);
pstmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);
// pstmt.setString(1,bomCode);
rs = pstmt.executeQuery(sql);
......@@ -2464,7 +2504,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//End added by Pavan R on 22/NOV/17
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));
ctr = 1;
//added by Pavan R on 22/NOV/17
......@@ -2566,7 +2607,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
rmpmMap.put(bomCode, bomList);
//System.out.println("rmpmMAP::["+rmpmMap+"]");
//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;
hmap.put(new Integer(level), levelBom);
//System.out.println(">>>>>>>>>level:"+level);
......@@ -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();
itemCodeDetailMap.put(rs.getString(1), parentBom+"@"+bomCode);
System.out.println();
//System.out.println();
String sourceItem = setDescription("item_code", "bom", "bom_code", bomCode, conn);
parentItemMap.put(rs.getString(1), sourceItem ); //18/06/14
//System.out.println("BASE@@@@ 1589 : sourceItem["+sourceItem+"]bomCode["+bomCode+"]parentItemMap["+parentItemMap+"]");
......@@ -2664,8 +2706,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// + rs.getString(1) + "'");
if (rsCount.next() && rsCount.getInt(1) > 0)
{
rsCount.close();
pstmtInner1.close();
rsCount.close();rsCount = null;
pstmtInner1.close(); pstmtInner1 = null;
// Add ItemCode in ItemCodeMap if it not present earlier
innerSuppSour = getSuppSour(siteCode, rs.getString(1));
innerBomCode = getBomCode(siteCode, rs.getString(1));
......@@ -2693,10 +2735,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("Cyclic Item Code is : " + rs.getString(1));
} 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);
rs.close();
pstmt.close();
rs.close();rs = null;
pstmt.close();pstmt = null;
if("Y".equalsIgnoreCase(verifier)) //for error_report @19/09/16
{
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
if (errString != null && errString.trim().length() > 0)
{
System.out.println("Error While Calling method bomExplode(String, String):..." + errString);
rs.close();
pstmt.close();
//System.out.println("Error While Calling method bomExplode(String, String):..." + errString);
BaseLogger.log("9", null, null, "Error While Calling method bomExplode(String, String):..." + errString);
rs.close(); rs = null;
pstmt.close(); pstmt = null;
return errString;
}
}
......@@ -2853,7 +2897,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
else
{
rsCount.close();
rsCount.close(); rsCount = null;
sqlInner2 = "SELECT COUNT(1) FROM BOM WHERE BOM_CODE = ?";
pstmtInner2 = conn.prepareStatement(sqlInner2);
pstmtInner2.setString(1, rs.getString(1));
......@@ -2863,38 +2907,51 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// + rs.getString(1) + "'");
if (rsCount.next() && rsCount.getInt(1) > 0)
{
rsCount.close();
pstmtInner2.close();
rsCount.close();rsCount = null;
pstmtInner2.close();pstmtInner2 = null;
validBomItemCode = "BOMDET:" + rs.getString(1);
//System.out.println(">>>>Before calling bomExplode at line 2225 in bomExplode():");
errString = bomExplode(siteCode, rs.getString(1));
//System.out.println(">>>>>>errString from bomExplode at line 2225 in bomExplode():"+errString);
if (errString != null && errString.trim().length() > 0)
{
System.out.println("Error While Calling method bomExplode(String, String):..." + errString);
rs.close();
pstmt.close();
//System.out.println("Error While Calling method bomExplode(String, String):..." + errString);
BaseLogger.log("9", null, null,"Error While Calling method bomExplode(String, String):..." + errString);
rs.close();rs = null;
pstmt.close();pstmt = null;
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);
level--;
//System.out.println(">>>>>>After decrease level--:"+level);
rs.close();
rs = null;// Added by Jiten 09/11/06 -Sun
if(rs != null){
rs.close(); rs = null;
}
if(pstmt != null){
pstmt.close(); pstmt = null;
}
// Added by Jiten 09/11/06 -Sun
} 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();
errString = se.getMessage();
throw new ITMException(se);
} 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);
e.printStackTrace();
errString = e.getMessage();
......@@ -2917,11 +2974,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
pstmtInner1.close();
pstmtInner1 = null;
}
if (rsInner1 != null)
{
rsInner1 = null;
}
}
if (pstmtInner2 != null)
{
pstmtInner2.close();
......@@ -2935,7 +2988,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
this.fw.flush();// Added by Jiten 07/11/06
} catch (Exception e)
{
System.out.println(e);
//System.out.println(e);
throw new ITMException(e);
}
}
......@@ -3140,8 +3193,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
bomCode = rs.getString(1);
} else
{
rs.close();
pstmt.close();
rs.close();rs = null;
pstmt.close(); pstmt = null;
sql = "SELECT BOM_CODE FROM ITEM WHERE ITEM_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
......@@ -3203,6 +3256,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if (rs.next() && rs.getInt(1) > 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 ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
......@@ -3211,19 +3266,19 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if (rs.next())
{
bomCode = rs.getString(1);
rs.close();
pstmt.close();
rs.close(); rs = null;
pstmt.close(); pstmt = null;
} else
{
rs.close();
pstmt.close();
rs.close();rs = null;
pstmt.close();pstmt = null;
bomCode = getBomCode(siteCode, itemCode);
}
} else
{
rs.close();
pstmt.close();
rs.close(); rs = null;
pstmt.close(); pstmt = null;
bomCode = getBomCode(siteCode, itemCode);
}
......@@ -3270,8 +3325,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
suppSour = checkNull(rs.getString(1));
} else
{
rs.close();
pstmt.close();
rs.close(); rs = null;
pstmt.close(); pstmt = null;
sql = "SELECT SUPP_SOUR FROM ITEM WHERE ITEM_CODE = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
......@@ -3281,9 +3336,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
suppSour = checkNull(rs.getString(1));
}
}
rs.close();
pstmt.close();
rs.close();rs = null;
pstmt.close();pstmt = null;
} catch (SQLException se)
{
System.out.println("SQLException :RunMRPPrcEJB :getSuppSour(String siteCode, String ItemCode).." + se.getMessage());
......@@ -3346,8 +3400,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
rs.close();
pstmt.close();
rs.close(); rs = null;
pstmt.close(); pstmt = null;
} catch (SQLException se)
{
System.out.println("SQLException :RunMRPPrcEJB :getSuppSour(String siteCode, String ItemCode).." + se.getMessage());
......@@ -3967,9 +4021,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("*** No SiteItem *** " + siteCode + " " + itemCode);
// ***************************** 04-01-2007 manoharan take all
// values from item if no siteitem
rs.close();
pstmt.close();
if(rs != null){ rs.close(); rs = null;}
if(pstmt != null){pstmt.close(); pstmt = null;}
sql = "SELECT CASE WHEN B.SUPP_SOUR IS NULL THEN '' ELSE B.SUPP_SOUR END ,"
// 2
+ "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
// ***************************** end 04-01-2007 manoharan
}
if(rs != null){
rs.close(); rs = null;}
if(pstmt != null){
pstmt.close(); pstmt = null;}
if (adpElement.getSuppSour() == null)
{
adpElement.setSuppSour(this.getSuppSour(siteCode, itemCode));
......@@ -4175,12 +4232,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
acctCodeWp = rs.getString(1);
cctrCodeWp = rs.getString(2);
rs.close();
pstmt1.close();
rs.close(); rs = null;
pstmt1.close(); pstmt1 = null;
} else
{
rs.close();
pstmt1.close();
rs.close(); rs = null;
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 = ' '";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemCode);
......@@ -4189,12 +4246,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
acctCodeWp = rs.getString(1);
cctrCodeWp = rs.getString(2);
rs.close();
pstmt1.close();
rs.close(); rs = null;
pstmt1.close();pstmt1 = null;
} else
{
rs.close();
pstmt1.close();
rs.close(); rs = null;
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 = ' '";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemSer); // itemSer ???
......@@ -4203,12 +4260,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
acctCodeWp = rs.getString(1);
cctrCodeWp = rs.getString(2);
rs.close();
pstmt1.close();
rs.close(); rs = null;
pstmt1.close();pstmt1 = null;
} else
{
rs.close();
pstmt1.close();
rs.close(); rs = null;
pstmt1.close();pstmt1 = null;
sql = "SELECT ACCT_CODE__WP, CCTR_CODE__WP FROM ITEMSER WHERE ITEM_SER = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemSer);
......@@ -4217,8 +4274,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
acctCodeWp = rs.getString(1);
cctrCodeWp = rs.getString(2);
rs.close();
pstmt1.close();
rs.close(); rs = null;
pstmt1.close();pstmt1 = null;
}
}
}
......@@ -4236,7 +4293,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
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"))
{
// adpElement.setReoQty(adpElement.getBatchQty());
......@@ -4262,6 +4320,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
throw new ITMException(e);
} finally
{
if (rs != null)
{
rs.close();
rs = null;
}
if (rsInner != null)
{
rsInner.close();
rsInner = null;
}
if (pstmt != null)
{
pstmt.close();
......@@ -4276,16 +4344,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pstmtInner.close();
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
// normally - jiten -03/11/06
......@@ -4603,7 +4662,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement = populateDemandSupply(adpElement);
adpeList.set(ctr, adpElement);
//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)
{
ArrayList<HashMap<String, ADPElement>> detList=adpElement.getDetList();
......@@ -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
// made to order
// don't process here
System.out.println("BASEpopulateDemandSupply...called....siteCode--["+siteCode+"]itemCode-["+itemCode+"]itemCodeTo-["+itemCodeTo+"]");
System.out.println("madeToOrder---"+madeToOrder+"----adpElement.getMfgType()----"+adpElement.getMfgType());
//System.out.println("BASEpopulateDemandSupply...called....siteCode--["+siteCode+"]itemCode-["+itemCode+"]itemCodeTo-["+itemCodeTo+"]");
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
if ("0".equals(madeToOrder) && "O".equals(adpElement.getMfgType()))
{
......@@ -4929,8 +4991,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("BASE2804--isDetailReq------"+isDetailReq+"----"+rsItemCode+"---"+itemCode);
if (rsItemCode != null && rsItemCode.trim().equalsIgnoreCase(itemCode.trim()))
{
System.out.println("dueDate---demand---supply"+dueDate+"---"+demand+"---"+supply);
System.out.println("madeToOrder>>>>>>>"+madeToOrder+"mfg type>>>>>>"+adpElement.getMfgType());
//System.out.println("dueDate---demand---supply"+dueDate+"---"+demand+"---"+supply);
//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
if(!isRequirement)
{
......@@ -4946,7 +5009,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//if(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"));
}
//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
//if(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"));
}
//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
+ "demandsupplyDet";
}
System.out.println("SQL File Name:::::" + sqlFileName);
System.out.println("SQL Det File Name:::::"
+ sqlFileNameDet);
//System.out.println("SQL File Name:::::" + sqlFileName);
BaseLogger.log( "9", null, null, "SQL File Name:::::" + sqlFileName);
//System.out.println("SQL Det File Name:::::"
//+ sqlFileNameDet);
BaseLogger.log( "9", null, null, "SQL Det File Name:::::"+sqlFileNameDet);
if ((CommonConstants.DB_NAME).equalsIgnoreCase("oracle"))
{
String adpDetQueryOriginal = readFile(sqlFileNameDet+ "Oracle.sql");
......@@ -5312,7 +5377,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}else{
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
demandSupplyList.add(demandSupplyMap);
} else
......@@ -5359,7 +5425,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}else{
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
demandSupplyList.add(demandSupplyMap);
}
......@@ -6224,7 +6291,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//if(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"));
}
//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
}else{
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
demandSupplyList.add(demandSupplyMap);
......@@ -6674,7 +6742,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
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);
adpeList.set(adpeCtr, adpElement);
......@@ -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+"]");
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 ((( supply - demand ) < reorderLevel && reorderLevel>0) || ((demand - supply)>0 && reorderLevel==0) )
{
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
//if(madeToOrder.equalsIgnoreCase("0") && (mfgType1.trim().equalsIgnoreCase("O") || mfgType1.trim().equalsIgnoreCase("D")))
//{
......@@ -6973,8 +7043,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if (mfgLeadBasis == null)
{
mfgLeadBasis = "F";
}
}
if ("B".equals(mfgLeadBasis) && quantity > batchSizeLead)
{
//System.out.println("BASEmanohar mfgLeadTime before [" + mfgLeadTime + "]");
......@@ -7011,6 +7080,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Changed By Priyankac on 21-SEP-2018.
// 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
// by
......@@ -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("25022010 23->Item [ return value --- reqQty [" + reqQty + "] ");
//System.out.println("25022010 23->Item [ return value --- reqQty [" + reqQty + "] ");
return reqQty;
}
......@@ -8065,18 +8135,21 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
index = indexOfADPElement(siteCode, itemCode, saleOrder,lineNo);
}
//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)
{
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
if (index == -1)
{
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 On 13-Oct-17 end
/*if (isBomReplace)
......@@ -8419,7 +8492,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
adpElement = (ADPElement) adpeList.get(ctr);
//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)))
{
retVal = ctr;
......@@ -8858,7 +8931,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
runningPlanSupply = timeMrp.getRunningPlanSupply();
independentDemand = timeMrp.getIndependentDemand();
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)
{
Calendar calen = Calendar.getInstance();
......@@ -9117,7 +9191,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
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") )&&
// matPlan.equals("Y") )
else if (suppSour.equals("M") && mfgPlan.equals("Y"))
......@@ -9518,8 +9593,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
for (int listCtr = mpsList.size() - 1; listCtr >= 0; listCtr--)
{
mpsOrder = (MPSOrder) mpsList.get(listCtr);
System.out.println("dueDate["+dueDate+"]");
System.out.println("horizonDate["+horizonDate+"]");
//System.out.println("dueDate["+dueDate+"]");
//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("BASEmpsOrder.itemCode.trim()["+mpsOrder.itemCode.trim()+"]itemCode.trim()["+itemCode.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
}
}
}
System.out.println("@@@@@findEle2["+findEle+"]");
//System.out.println("@@@@@findEle2["+findEle+"]");
BaseLogger.log( "9", null, null, "@@@@@findEle2["+findEle+"]");
if (findEle >= 0)
{
mpsOrder.quantity += reqQty;
......@@ -11392,7 +11469,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
count++;
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_INDENT_List = new ArrayList();
......@@ -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()+"]");
}*/
//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("BASEitemCodeDetailMap["+itemCodeDetailMap+"]");
//System.out.println("BASEitemBomMap["+itemBomMap+"]");
......@@ -11713,8 +11791,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("BASE@@@@@@@@itemCDDetailMap["+itemCDDetailMap+"]");
//System.out.println("BASE@@@@@@@@itemCodeParent["+itemCodeParent+"]originalOrAltitem["+originalOrAltitem+"]adpElement.getBomCodeParent()["+adpElement.getBomCodeParent()+"]");
ArrayList timeMRParr = adpElement.getTimeMrpList();
System.out.println("timeMRParr>>>>>"+timeMRParr);
System.out.println("Printing timeMRParr.size()---" + timeMRParr.size());
//System.out.println("timeMRParr>>>>>"+timeMRParr);
//System.out.println("Printing timeMRParr.size()---" + timeMRParr.size());
//detailMap=adpElement.getDetMap();//Added by Manoj dtd 02/11/2013
//HashMap<String,ADPElement> detailMap=adpElement.getDetMap();
......@@ -11764,9 +11842,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
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);
System.out.println("Printing timeMrp---" + timeMrp);
//System.out.println("Printing timeMrp---" + timeMrp);
//BaseLogger.log( "0", null, null, "Printing timeMrp---" + timeMrp+"]");
demand = timeMrp.getDemand();
demandSum = demandSum+demand;
......@@ -12194,7 +12274,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
tranSer2="";
*/
System.out.println("@@@@@@itemCode["+itemCode+"]itemCDDetailMap["+itemCDDetailMap+"]");
//System.out.println("@@@@@@itemCode["+itemCode+"]itemCDDetailMap["+itemCDDetailMap+"]");
if ( itemCDDetailMap != null && itemCDDetailMap.containsKey(itemCode))
{
String tempBomItem = itemCDDetailMap.get(itemCode)==null?"":itemCDDetailMap.get(itemCode).toString();
......@@ -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
}
System.out.println("@@@@@@@@@@@@@@@["+itemCode+"] sourceSupplyFlag["+sourceSupplyFlag+"] ");
//System.out.println("@@@@@@@@@@@@@@@["+itemCode+"] sourceSupplyFlag["+sourceSupplyFlag+"] ");
tranSer2="";
......@@ -12509,7 +12589,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// System.out.println("@@@@@@@@@050115 inside Stock---stkKey.length["+stkKey.length+"]stkKey["+stkKey+"]");
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("<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");
......@@ -12616,7 +12696,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
valueXmlString = new StringBuffer();
System.out.println("context["+context+"]");
//System.out.println("context["+context+"]");
//reqValueXmlString = new StringBuffer("<?xml version = \"1.0\"?><Root>\r\n");
reqCount++;
reqValueXmlString.append("<Detail" + context + " domID='" + reqCount + "' >\r\n");
......@@ -12677,11 +12757,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
reqValueXmlString.append("</Root>");
//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 context-------" + context);
//System.out.println("Printing context-------" + context);
// 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
System.out.println("isWizard-------"+isWizard);
//System.out.println("isWizard-------"+isWizard);
if(isWizard)
{
resultString = valueXmlString.toString();
......@@ -12693,18 +12773,22 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
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();
// System.out.println("End of collected datas......");
// resultString = retTabSepStrBuff.toString();
} 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();
throw new ITMException(se);
} 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();
throw new ITMException(e);
} finally
......@@ -12930,6 +13014,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
HSSFCell cellDet = null;
HSSFRow rowDet = null;
HSSFCellStyle cellStyleDet = null;
//Pavan R on 09/oct/17 end
//added by pavan r On 22/NOV/17
HSSFCell cell1 = null;
......@@ -12990,14 +13075,37 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
HSSFRow headerRow = sheet.createRow(1);
headerRow.setHeightInPoints(40);
HSSFCell headerCell;
for (int cellCtr = 0; cellCtr < titles.length; cellCtr++)
{
//headerCell = headerRow.createCell((short) cellCtr);
headerCell = headerRow.createCell((int) 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());
int insertRow = 2;
for (int adpeCount = 0; adpeCount < adpeList.size(); adpeCount++)
......@@ -13030,7 +13138,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
PreparedStatement pstmt = null;
ResultSet rs = null;
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 = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString( 1, itemCode );
......@@ -13075,9 +13184,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
//cell = row.createCell((short) j);
cell = row.createCell((int) j);
}*/
}
HSSFCellStyle styleDateClr = wb.createCellStyle();
HSSFCellStyle styleClr = wb.createCellStyle();
HSSFCellStyle styleClr = wb.createCellStyle();*/
HSSFFont fontClr = wb.createFont();
fontClr.setColor(HSSFColor.RED.index);
styleClr.setFont(fontClr);
......@@ -13141,7 +13250,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
row.getCell(15).setCellValue(runningDemand);
row.getCell(16).setCellValue(runningSupply);
//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() > adpeCount+1)
......@@ -13187,8 +13296,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}else
{
row.getCell(17).setCellValue(runningPlanSupply);
}
//row.getCell(17).setCellValue(runningPlanSupply);
}*/
row.getCell(17).setCellValue(runningPlanSupply);
//Added by Pavan R on 14dec18 end
row.getCell(18).setCellValue(independentDemand);
......@@ -13215,6 +13324,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// flag = false; // 25/02/11 manoharan commented as BTPL
// 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
......@@ -13224,12 +13335,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
final String[] detTitles = { "Item Code", "Due Date", "Demand",
"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);
titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();*/
styleDet.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
......@@ -13291,12 +13402,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
"Pending DR", "Tran Id", "Tran Series",
"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);
titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();*/
styleDet.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
......@@ -13378,12 +13489,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
"Demand", "Supply", "Stock Qty", "Other Supply",
"Pending PO", "Pending DO", "Pending Indent",
"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);
titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();*/
styleDet.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
......@@ -13460,12 +13571,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
"Pending PO", "Pending DO", "Pending Indent",
"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);
titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();*/
styleDet.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
......@@ -13539,12 +13650,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
"Pending PO", "Pending DO", "Pending Indent",
"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);
titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();*/
styleDet.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
......@@ -13620,34 +13731,34 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
final String[] detTitles = { "Bom code", "Component code", "Item code",
"Batch quantity", "Component quantity", "quantity per batch" , "Required type","Demand","Due date" };
HSSFSheet sheetDet = wb.createSheet("MRPRun BOM exploded detail");
HSSFRow titleRowDet = sheetDet.createRow(0);
/*HSSFSheet sheet3 = wb.createSheet("MRPRun BOM exploded detail");
HSSFRow titleRowDet = sheet3.createRow(0);
titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();
styleDet.setBorderTop((short) 6); // double lines border
styleDet.setBorderBottom((short) 1); // single line border
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
HSSFCellStyle style3 = wb.createCellStyle();*/
style3.setBorderTop((short) 6); // double lines border
style3.setBorderBottom((short) 1); // single line border
style3.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
HSSFFont fontDet = wb.createFont();
fontDet.setFontName(HSSFFont.FONT_ARIAL);
fontDet.setFontHeightInPoints((short) 20);
fontDet.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
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.setCellStyle(style);
sheetDet.autoSizeColumn((short) 1);
sheet3.autoSizeColumn((short) 1);
HSSFRow headerRowDet = sheetDet.createRow(1);
headerRowDet.setHeightInPoints(40);
HSSFRow headerRow3 = sheet3.createRow(1);
headerRow3.setHeightInPoints(40);
HSSFCell headerCellDet;
for (int cellCtr = 0; cellCtr < detTitles.length; cellCtr++)
{
headerCellDet = headerRowDet.createCell((int) cellCtr);
headerCellDet = headerRow3.createCell((int) cellCtr);
headerCellDet.setCellValue(detTitles[cellCtr]);
}
int insertRowDet = 1;
......@@ -13656,7 +13767,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
insertRowDet++;
rowDet = sheetDet.createRow(insertRowDet);
rowDet = sheet3.createRow(insertRowDet);
for (int j = 0; j < detTitles.length; j++)
{
cellDet = rowDet.createCell((int) j);
......@@ -13688,36 +13799,37 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
"Manufacturing Plan", "Material Plan", "Generate Indent",
"Made To Stock", "Made To Order", "Balance Intersite" };
HSSFSheet sheetDet = wb.createSheet("MRPRun Input Parameter");
HSSFRow titleRowDet = sheetDet.createRow(0);
titleRowDet.setHeightInPoints(45);
cellStyleDet = wb.createCellStyle();
HSSFCellStyle styleDet = wb.createCellStyle();
styleDet.setBorderTop((short) 6);
styleDet.setBorderBottom((short) 1);
styleDet.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
/*HSSFSheet sheet4 = wb.createSheet("MRPRun Input Parameter");
HSSFRow titleRow4 = sheet4.createRow(0);
titleRow4.setHeightInPoints(45);
//cellStyleDet = wb.createCellStyle();
//HSSFCellStyle style4 = wb.createCellStyle();*/
style4.setBorderTop((short) 6);
style4.setBorderBottom((short) 1);
style4.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
HSSFFont fontDet = wb.createFont();
fontDet.setFontName(HSSFFont.FONT_ARIAL);
fontDet.setFontHeightInPoints((short) 20);
fontDet.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
fontDet.setColor(HSSFColor.BLUE.index);
styleDet.setFont(fontDet);
HSSFCell titleCellDet = titleRowDet.createCell((int) 0);
style4.setFont(fontDet);
HSSFCell titleCellDet = titleRow4.createCell((int) 0);
titleCellDet.setCellValue("MRPRun - Input Parameter");
titleCellDet.setCellStyle(style);
sheetDet.autoSizeColumn((short) 1);
HSSFRow headerRowDet = sheetDet.createRow(1);
headerRowDet.setHeightInPoints(40);
sheet4.autoSizeColumn((short) 1);
HSSFRow headerRow4 = sheet4.createRow(1);
headerRow4.setHeightInPoints(40);
HSSFCell headerCellDet;
for (int cellCtr = 0; cellCtr < inputParam.length; cellCtr++)
{
headerCellDet = headerRowDet.createCell((int) cellCtr);
headerCellDet = headerRow4.createCell((int) cellCtr);
headerCellDet.setCellValue(inputParam[cellCtr]);
}
int insertRowDet = 2;
insertRowDet++;
rowDet = sheetDet.createRow(insertRowDet);
rowDet = sheet4.createRow(insertRowDet);
for (int j = 0; j < inputParam.length; j++)
{
cellDet = rowDet.createCell((int) j);
......@@ -13836,7 +13948,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
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();
throw new ITMException(e);
}
......@@ -13858,29 +13971,35 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
String subDirs[] = mrpOutputLocation.split("\\\\");
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++)
{
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
{
String subDirs[] = mrpOutputLocation.split("/");
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++)
{
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);
System.out.println("File path [" + subDirName + "]");
//System.out.println("File path [" + subDirName + "]");
BaseLogger.log("9", null, null, "File path [" + subDirName + "]");
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();
}
}
......@@ -13902,14 +14021,17 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
loginUser = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
formatCode="MRPRPT";// send mail only for 'To'.
mailMrpReport = mfgCommon.getEnvMfg("999999","MAIL_MRP_REPORT",conn);
System.out.println("MAIL_MRP_REPORT"+mailMrpReport);
System.out.println("@@@@@ mailMrpReport["+mailMrpReport+"]loginUser["+loginUser+"]fileName["+fileName+"]mrpErrDetList["+mrpErrDetList+"]");
//System.out.println("MAIL_MRP_REPORT"+mailMrpReport);
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) )
{
//emailAddr = setDescription("email_id_off", "employee", "emp_code", 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("<MAIL><EMAIL_TYPE>page</EMAIL_TYPE><ENTITY_CODE>BASE</ENTITY_CODE>");
......@@ -13930,21 +14052,31 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
DBAccessEJB dbAccess = new DBAccessEJB();
String loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
UserInfoBean userInfo = dbAccess.createUserInfo(loginCode);
//mailRetStr=email.sendMail(commInfo.toString(), "ITM");
mailRetStr=email.sendMail(commInfo.toString(), "ITM", userInfo);
//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);
//System.out.println("@V@ Mail return String :- ["+mailRetStr+"]");
BaseLogger.log("9", null, null, "@V@ Mail return String :- ["+mailRetStr+"]");
//Pavan R on 03dec18 end
System.out.println("@V@ Mail return String :- ["+mailRetStr+"]");
}catch(Exception e)
{
e.getMessage();
}
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());
}
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());
}
}
}
// 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
resultString = retTabSepStrBuff.toString();
} 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();
throw new ITMException(se);
} 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();
throw new ITMException(e);
} finally
......@@ -14264,7 +14398,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String rsItemCode = "", adpItemcode = "";
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
dueDate = rs.getTimestamp(2);
demand = rs.getDouble(3);
......@@ -14300,9 +14434,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("Setting Line No in Detail record---"+adpElement.getLineNo());
//detADPElement.setSaleOrder(adpElement.getSaleOrder());
//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);
......@@ -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
if("TPBP0822".equalsIgnoreCase(adpE1.getItemCode().trim()))
{
System.out.println("[4]---childItems()...");
//System.out.println("[4]---childItems()...");
}
al1.add(adpE1);
//adpE.setDetList(null);
......@@ -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
if ((CommonConstants.DB_NAME).equalsIgnoreCase("db2"))
......@@ -14918,6 +15052,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
while (rs.next()) {
msgType = checkNull(rs.getString("MSG_TYPE"));
}
rs.close();rs = null;
pstmt.close(); pstmt = null;
} catch (Exception ex) {
ex.printStackTrace();
} finally {
......@@ -15231,12 +15367,19 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String loginCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
UserInfoBean userInfo = dbAccess.createUserInfo(loginCode);
//mailRetStr=email.sendMail(commInfo.toString(), "ITM");
mailRetStr=email.sendMail(commInfo.toString(), "ITM", userInfo);
//Pavan R on 03dec18 end
System.out.println("@V@ Mail return String :- ["+mailRetStr+"]");
//Pavan R 25dec18[not to bypass ecxeption if mail details not config in ibase.xml]
try{
mailRetStr=email.sendMail(commInfo.toString(), "ITM", userInfo);
//Pavan R on 03dec18 end
System.out.println("@V@ Mail return String :- ["+mailRetStr+"]");
}
catch(Exception e)
{
e.getMessage();
}
if(mailRetStr.contains("S"))
{
{
System.out.println("@V@ Cust code :- [" + empCode + "] Email Addres :- [" + emailAddr + "]");
//fos1.write(("\n Email send SUCCESSFULLY for Customer code :- [" + custCode + "]").getBytes());
}
......@@ -15244,7 +15387,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
System.out.println("@V@ Email addr NOT FOUND for Cust code :- [" + empCode + "]");
//fos1.write(("\n Email sending FAIL for Customer code :- [" + custCode + "]").getBytes());
}
}
}
else
{
......
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