Commit f7acb0f9 authored by prane's avatar prane

commented unwanted resources like log writing and unnecessary sql writing as per sm sir

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@196870 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 9db7095d
...@@ -43,7 +43,7 @@ import java.io.File; ...@@ -43,7 +43,7 @@ import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.FileWriter; //import java.io.FileWriter;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.io.OutputStreamWriter; import java.io.OutputStreamWriter;
...@@ -186,9 +186,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -186,9 +186,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
CyclicItem cyclicItem = new CyclicItem();// Added by JIten 07/11/06 CyclicItem cyclicItem = new CyclicItem();// Added by JIten 07/11/06
FileWriter fw = null; /*FileWriter fw = null; // as per said by SM sir
FileWriter fw1 = null; FileWriter fw1 = null;
FileWriter fwInvalidBom = null; FileWriter fwInvalidBom = null;*/
String validBomItemCode = null; String validBomItemCode = null;
boolean invaldBomExists = false; boolean invaldBomExists = false;
...@@ -587,20 +587,20 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -587,20 +587,20 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// Added by Jiten 07/11/06 // Added by Jiten 07/11/06
// this.fw = new // this.fw = new
// FileWriter(CommonConstants.JBOSSHOME+"\\log\\RepeatBom.log"); // FileWriter(CommonConstants.JBOSSHOME+"\\log\\RepeatBom.log");
this.fw = new FileWriter(CommonConstants.JBOSSHOME + File.separator + "log" + File.separator + "RepeatBom.log"); //this.fw = new FileWriter(CommonConstants.JBOSSHOME + File.separator + "log" + File.separator + "RepeatBom.log");
this.fw.write("Site Code Bom Code Item Code CyclicItemCode" + "\r\n"); //this.fw.write("Site Code Bom Code Item Code CyclicItemCode" + "\r\n");
// End // End
// Added by jiten 10/11/06 // Added by jiten 10/11/06
// this.fw1 = new // this.fw1 = new
// FileWriter(CommonConstants.JBOSSHOME+"\\log\\SkipItem.log"); // FileWriter(CommonConstants.JBOSSHOME+"\\log\\SkipItem.log");
this.fw1 = new FileWriter(CommonConstants.JBOSSHOME + File.separator + "log" + File.separator + "SkipItem.log"); //this.fw1 = new FileWriter(CommonConstants.JBOSSHOME + File.separator + "log" + File.separator + "SkipItem.log");
this.fw1.write("Site Code Product Code ItemCode Skipped" + "\r\n"); //this.fw1.write("Site Code Product Code ItemCode Skipped" + "\r\n");
// End // End
// 19-01-2007 manohar // 19-01-2007 manohar
this.fwInvalidBom = new FileWriter(CommonConstants.JBOSSHOME + File.separator + "log" + File.separator + "InValidBom.log"); //this.fwInvalidBom = new FileWriter(CommonConstants.JBOSSHOME + File.separator + "log" + File.separator + "InValidBom.log");
this.fwInvalidBom.write("Site Code Item Code Bom Code Message\r\n"); //this.fwInvalidBom.write("Site Code Item Code Bom Code Message\r\n");
this.fwInvalidBom.write("========= ========== ========== ========\r\n"); //this.fwInvalidBom.write("========= ========== ========== ========\r\n");
// End 19-01-2007 manohar // End 19-01-2007 manohar
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "userId"); userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "userId");
...@@ -1233,12 +1233,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -1233,12 +1233,12 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
conn.close(); conn.close();
conn = null; conn = null;
} }
this.fw.flush();// Added by Jiten 07/11/06 //this.fw.flush();// Added by Jiten 07/11/06
this.fw.close();// Added by Jiten 07/11/06 //this.fw.close();// Added by Jiten 07/11/06
this.fw1.flush();// Added by JIten 10/11/06 //this.fw1.flush();// Added by JIten 10/11/06
this.fw1.close();// Added by JIten 10/11/06 //this.fw1.close();// Added by JIten 10/11/06
this.fwInvalidBom.flush(); // 19-01-2007 manohar //this.fwInvalidBom.flush(); // 19-01-2007 manohar
this.fwInvalidBom.close(); // 19-01-2007 manohar //this.fwInvalidBom.close(); // 19-01-2007 manohar
cleanup(); cleanup();
} catch (Exception e) } catch (Exception e)
{ {
...@@ -2647,7 +2647,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2647,7 +2647,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
} }
invaldBomExists = true; invaldBomExists = true;
this.fwInvalidBom.write(logMsg + "\r\n"); //this.fwInvalidBom.write(logMsg + "\r\n");
} }
sqlInner1 = "SELECT COUNT(1) FROM ITEM WHERE ITEM_CODE = ?"; sqlInner1 = "SELECT COUNT(1) FROM ITEM WHERE ITEM_CODE = ?";
pstmtInner1 = conn.prepareStatement(sqlInner1); pstmtInner1 = conn.prepareStatement(sqlInner1);
...@@ -2920,7 +2920,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -2920,7 +2920,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//System.out.println("BASE>>>>>verifier is:"+verifier); //System.out.println("BASE>>>>>verifier is:"+verifier);
if (verifier != null && verifier.equalsIgnoreCase("Y")) if (verifier != null && verifier.equalsIgnoreCase("Y"))
{ {
this.fw.write(cyclicItem.siteCode + " " + cyclicItem.bomCode + " " + cyclicItem.itemCode + " " + rs.getString(1) + "\r\n"); //this.fw.write(cyclicItem.siteCode + " " + cyclicItem.bomCode + " " + cyclicItem.itemCode + " " + rs.getString(1) + "\r\n");
BaseLogger.log("3", null, null, "Cyclic Item Code is : " + itemCode); BaseLogger.log("3", null, null, "Cyclic Item Code is : " + itemCode);
} else } else
{ {
...@@ -3224,7 +3224,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -3224,7 +3224,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
pstmtAltItem.close(); pstmtAltItem.close();
pstmtAltItem = null; pstmtAltItem = null;
} }
this.fw.flush();// Added by Jiten 07/11/06 //this.fw.flush();// Added by Jiten 07/11/06
} catch (Exception e) } catch (Exception e)
{ {
//System.out.println(e); //System.out.println(e);
...@@ -5241,14 +5241,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -5241,14 +5241,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// end 01-10-2007 manoharan // end 01-10-2007 manoharan
// System.out.println("Replaced Values.in SQL....."); // System.out.println("Replaced Values.in SQL.....");
} }
/* commented on 08feb19 [commented unwanted resources]
FileOutputStream fout = null; FileOutputStream fout = null;
BufferedWriter bw = null; BufferedWriter bw = null;
fout = new FileOutputStream("demandsupply.sql"); fout = new FileOutputStream("demandsupply.sql");
bw = new BufferedWriter(new OutputStreamWriter(fout)); bw = new BufferedWriter(new OutputStreamWriter(fout));
bw.write(adpQuery); bw.write(adpQuery);
bw.close(); bw.close();
fout.close(); fout.close();*/
// stmt = conn.createStatement(); // stmt = conn.createStatement();
// System.out.println("Executing Query After Replacement....."); // System.out.println("Executing Query After Replacement.....");
// rs = stmt.executeQuery(adpQuery); // rs = stmt.executeQuery(adpQuery);
...@@ -5474,7 +5474,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -5474,7 +5474,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} else if (ctr == -1) } else if (ctr == -1)
{// Else if condition added by jiten 10/11/06 as per Tarun {// Else if condition added by jiten 10/11/06 as per Tarun
// Bhai to write for skipped item // Bhai to write for skipped item
this.fw1.write(siteCode + " " + itemCode + " " + rsItemCode + "\r\n"); //this.fw1.write(siteCode + " " + itemCode + " " + rsItemCode + "\r\n");
} }
} }
// End addding // End addding
...@@ -5559,13 +5559,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -5559,13 +5559,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpDetQuery = adpDetQuery.replaceAll("@madetostock@", madeToStock); adpDetQuery = adpDetQuery.replaceAll("@madetostock@", madeToStock);
adpDetQuery = adpDetQuery.replaceAll("@rundate@", dbRunDate); adpDetQuery = adpDetQuery.replaceAll("@rundate@", dbRunDate);
} }
/* commented on 08feb19 [commented unwanted resources]
FileOutputStream fout1 = null; FileOutputStream fout1 = null;
BufferedWriter bw1 = null; BufferedWriter bw1 = null;
fout1 = new FileOutputStream("demandsupplyDetail.sql"); fout1 = new FileOutputStream("demandsupplyDetail.sql");
bw1 = new BufferedWriter(new OutputStreamWriter(fout1)); bw1 = new BufferedWriter(new OutputStreamWriter(fout1));
bw1.write(adpDetQuery); bw1.write(adpDetQuery);
bw1.close(); bw1.close();
fout1.close(); fout1.close();*/
if (pstmt != null) if (pstmt != null)
{ {
...@@ -5824,7 +5825,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -5824,7 +5825,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
rs = null; rs = null;
} }
this.fw1.flush();// Added by jiten 10/11/06 //this.fw1.flush();// Added by jiten 10/11/06
// System.out.println("populateDemandSupply() finally block......"); // System.out.println("populateDemandSupply() finally block......");
// return adpElement; // return adpElement;
} }
...@@ -6316,7 +6317,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6316,7 +6317,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
rs = null; rs = null;
} }
this.fw1.flush();// Added by jiten 10/11/06 //this.fw1.flush();// Added by jiten 10/11/06
} }
} }
...@@ -6453,13 +6454,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6453,13 +6454,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// System.out.println("Replaced Values.in SQL....."); // System.out.println("Replaced Values.in SQL.....");
} }
/* commented on 08feb19 [commented unwanted resources]
FileOutputStream fout = null; FileOutputStream fout = null;
BufferedWriter bw = null; BufferedWriter bw = null;
fout = new FileOutputStream("demandsupply.sql"); fout = new FileOutputStream("demandsupply.sql");
bw = new BufferedWriter(new OutputStreamWriter(fout)); bw = new BufferedWriter(new OutputStreamWriter(fout));
bw.write(adpQuery); bw.write(adpQuery);
bw.close(); bw.close();
fout.close(); fout.close();*/
pstmt = conn.prepareStatement(adpQuery); pstmt = conn.prepareStatement(adpQuery);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -6796,13 +6798,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -6796,13 +6798,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpDetQuery = adpDetQuery.replaceAll("@rundate@", dbRunDate); adpDetQuery = adpDetQuery.replaceAll("@rundate@", dbRunDate);
} }
/* commented on 08feb19 [commented unwanted resources]
FileOutputStream fout1 = null; FileOutputStream fout1 = null;
BufferedWriter bw1 = null; BufferedWriter bw1 = null;
fout1 = new FileOutputStream("demandsupply.sql"); fout1 = new FileOutputStream("demandsupply.sql");
bw1 = new BufferedWriter(new OutputStreamWriter(fout1)); bw1 = new BufferedWriter(new OutputStreamWriter(fout1));
bw1.write(adpDetQuery); bw1.write(adpDetQuery);
bw1.close(); bw1.close();
fout1.close(); fout1.close();*/
if (pstmt != null) if (pstmt != null)
{ {
...@@ -7059,7 +7062,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -7059,7 +7062,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{ {
rs = null; rs = null;
} }
this.fw1.flush();// Added by jiten 10/11/06 //this.fw1.flush();// Added by jiten 10/11/06
// System.out.println("populateDemandSupply() finally block......"); // System.out.println("populateDemandSupply() finally block......");
// return adpElement; // return adpElement;
} }
...@@ -15142,6 +15145,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -15142,6 +15145,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpGenQuery1=adpQuery; adpGenQuery1=adpQuery;
if(!isDetailReq) if(!isDetailReq)
{ {
/* commented on 08feb19 [commented unwanted resources]
FileOutputStream fout = null; FileOutputStream fout = null;
BufferedWriter bw = null; BufferedWriter bw = null;
fout = new FileOutputStream("demandsupply.sql"); fout = new FileOutputStream("demandsupply.sql");
...@@ -15150,7 +15154,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -15150,7 +15154,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
bw.close(); bw.close();
fout.close(); fout.close();
fout = null; fout = null;
bw = null; bw = null;*/
} }
...@@ -15365,6 +15369,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -15365,6 +15369,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
} }
if(!isDetailReq) if(!isDetailReq)
{ {
/* commented on 08feb19 [commented unwanted resources]
FileOutputStream fout = null; FileOutputStream fout = null;
BufferedWriter bw = null; BufferedWriter bw = null;
fout = new FileOutputStream("demandsupply.sql"); fout = new FileOutputStream("demandsupply.sql");
...@@ -15373,7 +15378,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe ...@@ -15373,7 +15378,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
bw.close(); bw.close();
fout.close(); fout.close();
fout = null; fout = null;
bw = null; bw = null;*/
} }
......
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