Commit 982df34f authored by prane's avatar prane

code merge to head

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@177152 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 851531d9
......@@ -26,6 +26,7 @@ import ibase.webitm.ejb.ProcessEJB;
import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.fin.FinCommon;
import ibase.webitm.ejb.mfg.adv.WorkorderPrc;
import ibase.webitm.ejb.mfg.ADPElement;
import ibase.webitm.ejb.mfg.MfgCommon;
//import ibase.webitm.utility.GenericUtility;
import ibase.utility.E12GenericUtility;
......@@ -62,6 +63,7 @@ import java.util.Calendar;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
......@@ -271,6 +273,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String bomLevelDetStr = "";
boolean mfgParam = true;
//Pavan R on 09/oct/17 end
//added by Pavan R on 22/NOV/17
Map<String, ArrayList<String>> rmpmMap = new LinkedHashMap();
//End added by Pavan R on 22/NOV/17
public String getData(String xmlString, String xmlString2, String windowName, String xtraParams) throws RemoteException, ITMException
......@@ -666,6 +671,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("Populating Item Code Map.......");
errString = populateItemMap();
System.out.println("ItemcodeMap:23/NOV/17::["+itemCodeMap+"]");
if (errString != null && errString.trim().length() > 0)
{
......@@ -1988,6 +1995,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
Set setSite = siteCodeMap.entrySet();
Iterator itrSite = setSite.iterator();
String subQuery=" ";
//Added by Pavan R on 23/NOV/17 START
PreparedStatement pstmt1 = null;
ResultSet rs1 = null;
String sql1 = "", sqlFileName = "", adpQuery = "", masterSh = "", mfgType1 = "";
//Added by Pavan R on 23/NOV/17 END
// System.out.println("Database Name:............"+CommonConstants.DB_NAME);
try
{
......@@ -2092,8 +2104,105 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
System.out.println("Item Code already exists : " + rs.getString(1));
} else
{
//Added by Pavan R on 23/NOV/17 START
sql1 = "SELECT (CASE WHEN MASTER_SCH IS NULL THEN ' ' ELSE MASTER_SCH END), (CASE WHEN MFG_TYPE IS NULL THEN ' ' ELSE MFG_TYPE END) FROM SITEITEM WHERE SITE_CODE = ? AND ITEM_CODE = ?";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, siteCode);
pstmt1.setString(2, rs.getString(1));
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
masterSh = checkNull(rs1.getString(1));
mfgType1 = checkNull(rs1.getString(2));
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
boolean isMtoS = false;
boolean isMtoO = false;
System.out.println("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);
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.....");
adpQuery = adpQuery.replaceAll("@sitecode@", siteCode);
adpQuery = adpQuery.replaceAll("@itemcode@", rs.getString(1));
adpQuery = adpQuery.replaceAll("@fromdate@", dbDateFrom);
adpQuery = adpQuery.replaceAll("@todate@", dbDateTo);
adpQuery = adpQuery.replaceAll("@ordtypes@", standingOrdTypes);
adpQuery = adpQuery.replaceAll("@madetoorder@", madeToOrder);
adpQuery = adpQuery.replaceAll("@madetostock@", madeToStock);
adpQuery = adpQuery.replaceAll("@rundate@", dbRunDate);
System.out.println("Replaced Values.in SQL.....");
}
pstmt1 = conn.prepareStatement(adpQuery);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
isMtoS = true;
System.out.println("isMtoO=["+isMtoO+"]");
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
}
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);
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.....");
adpQuery = adpQuery.replaceAll("@sitecode@", siteCode);
adpQuery = adpQuery.replaceAll("@itemcode@", rs.getString(1));
adpQuery = adpQuery.replaceAll("@fromdate@", dbDateFrom);
adpQuery = adpQuery.replaceAll("@todate@", dbDateTo);
adpQuery = adpQuery.replaceAll("@ordtypes@", standingOrdTypes);
adpQuery = adpQuery.replaceAll("@madetoorder@", madeToOrder);
adpQuery = adpQuery.replaceAll("@madetostock@", madeToStock);
adpQuery = adpQuery.replaceAll("@rundate@", dbRunDate);
System.out.println("Replaced Values.in SQL.....");
}
pstmt1 = conn.prepareStatement(adpQuery);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
isMtoO = true;
System.out.println("isMtoO=["+isMtoO+"]");
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
}
System.out.println("isMadeToOrder["+isMtoO+"]isMadeToStock["+isMtoS+"]");
if (isMtoO != false || isMtoS != false)
{
itemCodeMap.put(rs.getString(1), new Integer(itemCodeMap.size() + 1));
System.out.println("Item Code added : "+rs.getString(1));
}
}else{
//Added by Pavan R on 23/NOV/17 END
itemCodeMap.put(rs.getString(1), new Integer(itemCodeMap.size() + 1));
// System.out.println("Item Code added : "+rs.getString(1));
System.out.println("Item Code added : "+rs.getString(1));
}
}
}
}
......@@ -2246,6 +2355,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
PreparedStatement pstmt1=null;
ResultSet rs1=null;
String bomItem="";
//added by Pavan R on 22/NOV/17
ArrayList<String> bomList = null;
//End added by Pavan R on 22/NOV/17
try
{
System.out.println(">>>>>>>>>In bomExplode bomCode:"+bomCode);
......@@ -2310,13 +2423,17 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// pstmt.setString(1,bomCode);
rs = pstmt.executeQuery(sql);
int ctr = 0;
//added by Pavan R on 22/NOV/17
bomList = new ArrayList<String>();
//End added by Pavan R on 22/NOV/17
while (rs.next())
{
System.out.println("rs.getString(1)----" + rs.getString(1));
levelBom.add(rs.getString(1));
ctr = 1;
//added by Pavan R on 22/NOV/17
bomList.add(checkNull(rs.getString(1)));
//End added by Pavan R on 22/NOV/17
//Added by Manoj dtd 30/04/2014 to add Alternate items in list
if(isDetailReq)
{
......@@ -2409,6 +2526,10 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
//Ended by Manoj dtd 30/04/2014 to add Alternate items in list
}
//added by Pavan R on 22/NOV/17
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);
level = level + ctr;
hmap.put(new Integer(level), levelBom);
......@@ -3237,7 +3358,9 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
PreparedStatement pstmt = null;
String sql = "", siteCode = "", itemCode = "", mfgType = "";
ResultSet rs = null;
//added by Pavan R on 22/NOV/17 Start
String sqlFileName = "", adpQuery = "", masterSh = "", mfgType1 = "";
//End added by Pavan R on 22/NOV/17
Set setItem = itemCodeMap.entrySet();
//Added by Manoj dtd 30/04/2014 to add Alternate items in list
//Iterator itrAltItem = null;
......@@ -3258,90 +3381,245 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
Map.Entry itemMapEntry = (Map.Entry) itrItem.next();
System.out.println("@@@@@@@@ isBomReplace["+isBomReplace+"]::::siteMapEntry["+siteMapEntry+"]::::itemMapEntry["+itemMapEntry+"]itemCodeDetailMap["+itemCodeDetailMap+"]");
siteCode = (String) siteMapEntry.getKey();
itemCode = (String) itemMapEntry.getKey();
if( isBomReplace )
//commented on24/NOV/17 Start
//added by Pavan R on 22/NOV/17 Start
/*sql = "SELECT (CASE WHEN MASTER_SCH IS NULL THEN ' ' ELSE MASTER_SCH END), (CASE WHEN MFG_TYPE IS NULL THEN ' ' ELSE MFG_TYPE END) FROM SITEITEM WHERE SITE_CODE = ? AND ITEM_CODE = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, siteCode);
pstmt.setString(2, itemCode);
rs = pstmt.executeQuery();
if (rs.next())
{
//continue;
int ctr = indexOfADPElement(siteCode, itemCode, " ", " ");
System.out.println("@@@@@@2687 ctr["+ctr+"]");
if (ctr > -1)
{
continue;
}
masterSh = checkNull(rs.getString(1));
mfgType1 = checkNull(rs.getString(2));
}
adpElement = new ADPElement();
adpElement.setbomSet( itemCodeDetailMap );
//Manoj dtd 30/04/2014 to set Original/Alternate item flag
adpElement.setOriginalOrAltitem("O");
adpElement.setItemCodeParent(itemCode); //added by cpatil on 03/05/14
// 01/04/11 in case of made to order only made to order item
// will be planned
/*
* if ("Y".equals(madeToOrder)) { sql =
* "SELECT mfg_type FROM SITEITEM WHERE SITE_CODE = ? AND ITEM_CODE = ?"
* ; pstmt = conn.prepareStatement(sql);
* pstmt.setString(1,siteCode); pstmt.setString(2,itemCode);
* rs = pstmt.executeQuery(); if(rs.next()) { mfgType =
* rs.getString(1); } rs.close(); pstmt.close(); if
* (!"O".equals(mfgType)) { continue; } }
*/
// end 01/04/11 in case of made to order only made to order
// item will be planned
adpElement.setSiteCode((String) siteMapEntry.getKey());
adpElement.setItemCode((String) itemMapEntry.getKey());
adpElement = setAdpeValues(adpElement);
if( !(isBomReplace ))
{
if (adpElement.getSuppSour() != null)
rs.close();
rs = null;
pstmt.close();
pstmt = null;
boolean isMtoS = false;
boolean isMtoO = false;
System.out.println("masterSh::["+masterSh+"] MFG_TYPE::["+mfgType1+"]");
if(masterSh.equalsIgnoreCase("Y"))
{
// if("0".equalsIgnoreCase(madeToStock) && (!("O".equalsIgnoreCase(mfgType1) || "D".equalsIgnoreCase(mfgType1))))
if(madeToStock.equalsIgnoreCase("0") && (!(mfgType1.equalsIgnoreCase("O") || mfgType1.equalsIgnoreCase("D"))))
{
sqlFileName = CommonConstants.JBOSSHOME + File.separator + "sql" + File.separator + "demandsupplyMS";
System.out.println("BASEsqlFileName---"+sqlFileName);
if ((CommonConstants.DB_NAME).equalsIgnoreCase("oracle"))
{
String adpQueryOriginal = readFile(sqlFileName + "Oracle.sql");
adpQuery = adpQueryOriginal;
System.out.println("siteCode:["+siteCode+"]\nitemCode:["+itemCode+"]\ndbDateFrom:["+dbDateFrom+"]\ndbDateTo["+dbDateTo+"]");
System.out.println("standingOrdTypes:["+standingOrdTypes+"]\nmadeToOrder:["+madeToOrder+"]\nmadeToStock:["+madeToStock+"]\ndbRunDate["+dbRunDate+"]");
System.out.println("3309::Replacing Values.in SQL.....");
adpQuery = adpQuery.replaceAll("@sitecode@", siteCode);
adpQuery = adpQuery.replaceAll("@itemcode@", itemCode);
adpQuery = adpQuery.replaceAll("@fromdate@", dbDateFrom);
adpQuery = adpQuery.replaceAll("@todate@", dbDateTo);
adpQuery = adpQuery.replaceAll("@ordtypes@", standingOrdTypes);
adpQuery = adpQuery.replaceAll("@madetoorder@", madeToOrder);
adpQuery = adpQuery.replaceAll("@madetostock@", madeToStock);
adpQuery = adpQuery.replaceAll("@rundate@", dbRunDate);
System.out.println("Replaced Values.in SQL.....");
}
pstmt = conn.prepareStatement(adpQuery);
rs = pstmt.executeQuery();
if (rs.next())
{
isMtoS = true;
System.out.println("isMtoO=["+isMtoO+"]");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if(madeToOrder.equalsIgnoreCase("0") && (mfgType1.equalsIgnoreCase("O") || mfgType1.equalsIgnoreCase("D")))
{
if (adpElement.getSuppSour().equals("D") && !disPlan.equals("Y"))
sqlFileName = CommonConstants.JBOSSHOME + File.separator + "sql" + File.separator + "madeToOrderMO";
System.out.println("BASEsqlFileName---"+sqlFileName);
if ((CommonConstants.DB_NAME).equalsIgnoreCase("oracle"))
{
continue;
String adpQueryOriginal = readFile(sqlFileName + "Oracle.sql");
adpQuery = adpQueryOriginal;
System.out.println("siteCode:["+siteCode+"]\nitemCode:["+itemCode+"]\ndbDateFrom:["+dbDateFrom+"]\ndbDateTo["+dbDateTo+"]");
System.out.println("standingOrdTypes:["+standingOrdTypes+"]\nmadeToOrder:["+madeToOrder+"]\nmadeToStock:["+madeToStock+"]\ndbRunDate["+dbRunDate+"]");
System.out.println("3309::Replacing Values.in SQL.....");
adpQuery = adpQuery.replaceAll("@sitecode@", siteCode);
adpQuery = adpQuery.replaceAll("@itemcode@", itemCode);
adpQuery = adpQuery.replaceAll("@fromdate@", dbDateFrom);
adpQuery = adpQuery.replaceAll("@todate@", dbDateTo);
adpQuery = adpQuery.replaceAll("@ordtypes@", standingOrdTypes);
adpQuery = adpQuery.replaceAll("@madetoorder@", madeToOrder);
adpQuery = adpQuery.replaceAll("@madetostock@", madeToStock);
adpQuery = adpQuery.replaceAll("@rundate@", dbRunDate);
System.out.println("Replaced Values.in SQL.....");
}
if (adpElement.getSuppSour().equals("M") && (!mfgPlan.equals("Y") && !matPlan.equals("Y")))
pstmt = conn.prepareStatement(adpQuery);
rs = pstmt.executeQuery();
if (rs.next())
{
continue;
isMtoO = true;
System.out.println("isMtoO=["+isMtoO+"]");
}
if (adpElement.getSuppSour().equals("P") && !matPlan.equals("Y"))
rs.close();
rs = null;
pstmt.close();
pstmt = null;
}
if (isMtoO != false || isMtoS != false)
{
if( isBomReplace )
{
continue;
//continue;
int ctr = indexOfADPElement(siteCode, itemCode, " ", " ");
System.out.println("@@@@@@2687 ctr["+ctr+"]");
if (ctr > -1)
{
continue;
}
}
}
else
{
//cpatil-25/08/14-System.out.println("NULL : SiteCode : [" + siteMapEntry.getKey() + "] ItemCode : [" + itemMapEntry.getKey() + "]");
if("Y".equalsIgnoreCase(verifier)) //for error_report @19/09/16
adpElement = new ADPElement();
adpElement.setbomSet( itemCodeDetailMap );
adpElement.setOriginalOrAltitem("O");
adpElement.setItemCodeParent(itemCode);
adpElement.setSiteCode((String) siteMapEntry.getKey());
adpElement.setItemCode((String) itemMapEntry.getKey());
adpElement = setAdpeValues(adpElement);
if( !(isBomReplace ))
{
msgStr = "Supply source is null....";
mrpErrDetList.add(msgStr);
if (adpElement.getSuppSour() != null)
{
if (adpElement.getSuppSour().equals("D") && !disPlan.equals("Y"))
{
continue;
}
if (adpElement.getSuppSour().equals("M") && (!mfgPlan.equals("Y") && !matPlan.equals("Y")))
{
continue;
}
if (adpElement.getSuppSour().equals("P") && !matPlan.equals("Y"))
{
continue;
}
}
else
{
System.out.println("NULL : SiteCode : [" + siteMapEntry.getKey() + "] ItemCode : [" + itemMapEntry.getKey() + "]");
if("Y".equalsIgnoreCase(verifier))
{
msgStr = "Supply source is null....";
mrpErrDetList.add(msgStr);
}
else
{
errString = "Supply source is null...";
return errString;
}
}
}
if (adpElement != null)
adpeList.add(adpElement);
System.out.println("adpeList@3429=["+adpeList+"]");
}
//errList.add("VTMRPITEME");
//errFields.add("bom_code");
}
else
{
*/ if( isBomReplace )
{
//continue;
int ctr = indexOfADPElement(siteCode, itemCode, " ", " ");
System.out.println("@@@@@@2687 ctr["+ctr+"]");
if (ctr > -1)
{
continue;
}
}
adpElement = new ADPElement();
adpElement.setbomSet( itemCodeDetailMap );
//Manoj dtd 30/04/2014 to set Original/Alternate item flag
adpElement.setOriginalOrAltitem("O");
adpElement.setItemCodeParent(itemCode); //added by cpatil on 03/05/14
// 01/04/11 in case of made to order only made to order item
// will be planned
/*
* if ("Y".equals(madeToOrder)) { sql =
* "SELECT mfg_type FROM SITEITEM WHERE SITE_CODE = ? AND ITEM_CODE = ?"
* ; pstmt = conn.prepareStatement(sql);
* pstmt.setString(1,siteCode); pstmt.setString(2,itemCode);
* rs = pstmt.executeQuery(); if(rs.next()) { mfgType =
* rs.getString(1); } rs.close(); pstmt.close(); if
* (!"O".equals(mfgType)) { continue; } }
*/
// end 01/04/11 in case of made to order only made to order
// item will be planned
adpElement.setSiteCode((String) siteMapEntry.getKey());
adpElement.setItemCode((String) itemMapEntry.getKey());
adpElement = setAdpeValues(adpElement);
if( !(isBomReplace ))
{
if (adpElement.getSuppSour() != null)
{
if (adpElement.getSuppSour().equals("D") && !disPlan.equals("Y"))
{
continue;
}
if (adpElement.getSuppSour().equals("M") && (!mfgPlan.equals("Y") && !matPlan.equals("Y")))
{
continue;
}
if (adpElement.getSuppSour().equals("P") && !matPlan.equals("Y"))
{
continue;
}
}
else
{
errString = "Supply source is null...";
return errString;
//cpatil-25/08/14-System.out.println("NULL : SiteCode : [" + siteMapEntry.getKey() + "] ItemCode : [" + itemMapEntry.getKey() + "]");
if("Y".equalsIgnoreCase(verifier)) //for error_report @19/09/16
{
msgStr = "Supply source is null....";
mrpErrDetList.add(msgStr);
//errList.add("VTMRPITEME");
//errFields.add("bom_code");
}
else
{
errString = "Supply source is null...";
return errString;
}
}
}
}
// Code for adding Demand (i.e. getDemand()) in adpElement
// // adpElement.setDemand(adpElement.getDemand(demand));
// adpElement = populateDemandSupply(adpElement);//Commented
// by Jiten 09/11/06
if (adpElement != null)
adpeList.add(adpElement);
// Code for adding Demand (i.e. getDemand()) in adpElement
// // adpElement.setDemand(adpElement.getDemand(demand));
// adpElement = populateDemandSupply(adpElement);//Commented
// by Jiten 09/11/06
if (adpElement != null)
adpeList.add(adpElement);
System.out.println("adpeList@3514=["+adpeList+"]");
//}
//Else Ended by Pavan R on 22/NOV/17
}
......@@ -3643,6 +3921,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement.setBatchSizeLead(batchSizeLead);
adpElement.setEmpCodePlan(rs.getString("EMP_CODE__PLN"));//Manoj dtd 11/03/2014
adpElement.setReorderLevel(rs.getDouble("REO_LEV"));//Manoj dtd 26/03/2015
System.out.println("adpElement@3818=["+adpElement+"]");
// end 22/06/10 manoharan
rs.close();
} else
......@@ -3828,6 +4107,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// end 22/06/10 manoharan
adpElement.setEmpCodePlan(rs.getString("EMP_CODE__PLN"));//Manoj dtd 11/03/2014
adpElement.setReorderLevel(rs.getDouble("REO_LEV"));//Manoj dtd 26/03/2015
System.out.println("adpElement@4004=["+adpElement+"]");
rs.close();
}
......@@ -3907,6 +4187,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
adpElement.setAcctCodeWp(acctCodeWp);
adpElement.setCctrCodeWp(cctrCodeWp);
System.out.println("adpElement@3818=["+adpElement+"]");
}
// set the batch quantity for later use
sql = "SELECT BATCH_QTY FROM BOM WHERE BOM_CODE = ?";
......@@ -3926,6 +4207,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
System.out.println("item [" + itemCode + " ] roundReqTo ..[" + roundReqTo + "] setting integral to [" + adpElement.getReoQty() + "]");
adpElement.setIntegralQty(adpElement.getReoQty());
System.out.println("adpElement@4104=["+adpElement+"]");
}
} catch (SQLException se)
{
......@@ -3995,6 +4277,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
if (rs.next())
{
mfgType = checkNull(rs.getString("mfg_type")).trim();
System.out.println("mfgType@4174=["+mfgType+"]");
}
rs.close();rs = null;
pstmt.close();pstmt = null;
......@@ -4807,6 +5090,11 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
bw1.close();
fout1.close();
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
int norows = 0;
pstmt = conn.prepareStatement(adpDetQuery);
rs = pstmt.executeQuery();
......@@ -5947,10 +6235,16 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
bw1.close();
fout1.close();
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
pstmt = conn.prepareStatement(adpDetQuery);
rs = pstmt.executeQuery();
while (rs.next()) {
while (rs.next())
{
if (matPlan.equalsIgnoreCase("N") && mfgPlan.equalsIgnoreCase("N"))
{
HashMap demandSupplyMap = new HashMap();
......@@ -6113,6 +6407,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
}
}
//added on 24/10/17
rs.close();
rs = null;
pstmt.close();
......@@ -6498,7 +6793,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// explodeBomObj.explodeBom(xmlString.toString(),
// conn).toString();//Commented by Jiiten as per
// Kandarp Sir 13/11/06 -
System.out.println("xmlString--------"+xmlString);
//System.out.println("xmlString--------"+xmlString);//commented By Pavan R on 26/OCT/17
/*if (isBomReplace)
{
System.out.println("12/06/14 manohar xmlString [" + xmlString + "]");
......@@ -6780,7 +7075,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
// explodeBomObj.explodeBom(xmlString.toString(),
// conn).toString();//Commented by Jiiten as per
// Kandarp Sir 13/11/06 -
System.out.println("xmlString--------"+xmlString);
//System.out.println("xmlString--------"+xmlString);//commented By Pavan R on 26/OCT/17
/*if (isBomReplace)
{
System.out.println("12/06/14 manohar xmlString [" + xmlString + "]");
......@@ -6919,6 +7214,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement.setSiteCodeCust(siteCodeCust);
found = adpeCtr;
adpeList.set(adpeCtr, adpElement);
System.out.println("adpeList@7104=["+adpeList+"]");
break;
}
}
......@@ -6931,6 +7227,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
adpElement.setIndependentDemand(dueDate, quantity);
adpElement.setSiteCodeCust(siteCodeCust);
adpeList.add(adpElement);
System.out.println("adpeList@7117=["+adpeList+"]");
}
} catch (Exception e)
{
......@@ -7449,7 +7746,14 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
{
index = indexOfADPElement(siteCode, itemCode, saleOrder,lineNo);
}
System.out.println("4072----index---"+index);
//Added by Pavan On 13-Oct-17 start
System.out.println("13-oct-17----index---before ["+index +"]");
if (index == -1)
{
index = indexOfADPElement(siteCode, itemCode, " ", " ");
}
System.out.println("oct-oct-17----index---after ["+index +"]");
//Added by Pavan On 13-Oct-17 end
/*if (isBomReplace)
{
System.out.println("12/06/14 index [" + index+ "] itemCode [" + itemCode + "] dueDate [" + dueDate + "] quantity [" + quantity + "] saleOrder [" + saleOrder + "] lineNo [" + lineNo +"]");
......@@ -7881,6 +8185,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
disList.clear();
//Added by Pavan R on 09/oct/17 start
demandSupplyList.clear();
rmpmMap.clear();
//Pavan R on 09/oct/17 end
}
......@@ -11443,7 +11748,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
}
System.out.println("Printing valueXmlString----" + valueXmlString);
//System.out.println("Printing valueXmlString----" + valueXmlString); //commented By Pavan R on 26/OCT/17
// ended by akhilesh
if (flag)
......@@ -11910,8 +12215,8 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
valueXmlString.append("</Root>");
reqValueXmlString.append("</Root>");
System.out.println("Printing reqValueXmlString----" + reqValueXmlString);
System.out.println("Printing valueXmlString----2---" + valueXmlString);
//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);
// 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
......@@ -12157,6 +12462,17 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
HSSFRow rowDet = null;
HSSFCellStyle cellStyleDet = null;
//Pavan R on 09/oct/17 end
//added by pavan r On 22/NOV/17
HSSFCell cell1 = null;
HSSFRow row1 = null;
HSSFCellStyle cellStyle1 = null;
String sql1 = "";
PreparedStatement pstmt1 = null;
ResultSet rs1 = null;
Double qty = 0.0;
String itmqty = "";
//added by pavan r On 22/NOV/17
ADPElement adpElement = null;
java.sql.Timestamp dueDate;
......@@ -12809,7 +13125,77 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
rowDet.getCell(19).setCellValue(balIntersite);
//Pavan R on 09/oct/17 end
//Added By Pavan R on 22/NOV/17 Start
final String[] inputList = { "BOM Code", "RMPM Item", "Standard Quantity" };
HSSFSheet sheet1 = wb.createSheet("MRPRun BOM Code and RMPM List");
HSSFRow titleRow1 = sheet1.createRow(0);
titleRow1.setHeightInPoints(45);
cellStyle1 = wb.createCellStyle();
HSSFCellStyle style1 = wb.createCellStyle();
style1.setBorderTop((short) 6);
style1.setBorderBottom((short) 1);
style1.setFillBackgroundColor(HSSFColor.GREY_25_PERCENT.index);
HSSFFont font1 = wb.createFont();
font1.setFontName(HSSFFont.FONT_ARIAL);
font1.setFontHeightInPoints((short) 20);
font1.setBoldweight(HSSFFont.BOLDWEIGHT_BOLD);
font1.setColor(HSSFColor.BLUE.index);
style1.setFont(font1);
HSSFCell titleCell1 = titleRow1.createCell((int) 0);
titleCell1.setCellValue("MRPRun - BOM Code and RMPM List");
titleCell1.setCellStyle(style1);
sheet1.autoSizeColumn((short) 1);
HSSFRow headerRow1 = sheet1.createRow(1);
headerRow1.setHeightInPoints(40);
HSSFCell headerCell1;
for (int cellCtr = 0; cellCtr < inputList.length; cellCtr++)
{
headerCell1 = headerRow1.createCell((int) cellCtr);
headerCell1.setCellValue(inputList[cellCtr]);
}
int insertRow1 = 2;
System.out.println("rmpmMAP in Write2XSL ["+rmpmMap+"]");
for (String rmpmKey : rmpmMap.keySet())
{
System.out.println("first loop");
ArrayList<String> rmpmVal = rmpmMap.get(rmpmKey);
System.out.println("rmpmVal::["+rmpmVal+"]");
for (String rmpmStr : rmpmVal)
{
System.out.println("rmpmStr::["+rmpmStr+"]");
System.out.println("2nd loop");
insertRow1++;
row1 = sheet1.createRow(insertRow1);
for (int j = 0; j < inputList.length; j++)
{
cell1 = row1.createCell((int) j);
}
sql1 = "SELECT QTY_PER FROM BOMDET WHERE BOM_CODE = ? AND ITEM_CODE = ?";
System.out.println("Sql1:["+sql1+"]");
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, rmpmKey);
pstmt1.setString(2, rmpmStr);
rs1 = pstmt1.executeQuery();
if (rs1.next())
{
qty = rs1.getDouble(1);
itmqty = String.valueOf(qty);
System.out.println(">>>>qty ["+qty+"] itmqty ["+itmqty+"]");
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
row1.getCell(0).setCellValue(checkNull(rmpmKey));
row1.getCell(1).setCellValue(checkNull(rmpmStr));
row1.getCell(2).setCellValue(checkNull(itmqty));
}
}
//End added by Pavan R on 22/NOV/17
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document dom = db.parse("/IBASEHOME/ibase.xml");
......@@ -13975,7 +14361,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
xmlBuff.append("</DocumentRoot>");
xmlString = xmlBuff.toString();
System.out.println("@V@ xmlString for sendReport:-["+xmlString+"]");
//System.out.println("@V@ xmlString for sendReport:-["+xmlString+"]");//commented By Pavan R on 26/OCT/17
retString= this.sendReport(chgUser,key,xmlString, reportName, reportArgs, reportType, formatCode, xtraParams, conn);
System.out.println("@@@@@@1211 retString["+retString+"]");
......@@ -14041,7 +14427,7 @@ public class RunMRPPrc extends ProcessEJB implements RunMRPPrcLocal, RunMRPPrcRe
String mailRetStr="",siteCode="";
try
{
System.out.println("@V@ xmlString :-"+xmlString);
//System.out.println("@V@ xmlString :-"+xmlString); //commented By Pavan R on 26/OCT/17
System.out.println("@V@ reportName :-["+reportName +"]");
System.out.println("@V@ reportArgs :-["+reportArgs +"]");
System.out.println("@V@ reportType :-["+reportType +"]");
......
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