Commit 2c18e873 authored by manohar's avatar manohar

MF90BHU005 in case of made-to-order sales order reference to be stored in workorder


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91405 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 97e301c9
......@@ -68,10 +68,18 @@ class ADPElement
private String mfgLeadBasis = "F";
private double batchSizeLead = 0;
// end 22/06/10 manoharan
//sabyasachi 17-03-2011
private String saleOrder;
private String lineNo;
//end sabyasachi 17-03-2011
public ADPElement()
{
//System.out.println("New ADPElement Created");
this.timeMRPArr = new ArrayList();
this.saleOrder = " ";
this.lineNo = " ";
}
public void setItemCode(String itemCode)
......@@ -142,7 +150,7 @@ class ADPElement
{
return this.empCodePur;
}
public void setSuppCodePref(String code)
public void setSuppCodePref(String code)
{
this.suppCodePref = code;
}
......@@ -198,11 +206,17 @@ class ADPElement
{
return this.purcRate;
}
public void setDemand(java.sql.Timestamp dueDate, double demand)
//changed method arguments by sabyasachi 29-03-2011
public void setDemand(java.sql.Timestamp dueDate, double demand, String saleOrder, String lineNo)
//public void setDemand(java.sql.Timestamp dueDate, double demand)
{
this.demand += demand;
this.saleOrder = saleOrder;
this.lineNo = lineNo;
//updateTimeMrp(dueDate, demand, 0, 0, 0,saleOrder,lineNo);
updateTimeMrp(dueDate, demand, 0, 0, 0);
}
//changed method arguments by sabyasachi 29-03-2011 end
public double getDemand()
{
return this.demand;
......@@ -210,6 +224,7 @@ class ADPElement
public void setSupply(java.sql.Timestamp dueDate, double supply)
{
this.supply += supply;
//updateTimeMrp(dueDate, 0, supply, 0, 0," "," ");
updateTimeMrp(dueDate, 0, supply, 0, 0);
}
public double getSupply()
......@@ -220,6 +235,7 @@ class ADPElement
public void setStockQty(java.sql.Timestamp dueDate, double stockQty)
{
this.stockQty += stockQty;
//updateTimeMrp(dueDate, 0,0, stockQty,0," "," ");
updateTimeMrp(dueDate, 0,0, stockQty,0);
}
public double getStockQty()
......@@ -229,6 +245,7 @@ class ADPElement
public void setOthSupply(java.sql.Timestamp dueDate, double othSupply)
{
this.othSupply += othSupply;
//updateTimeMrp(dueDate, 0,0, 0, othSupply," "," ");
updateTimeMrp(dueDate, 0,0, 0, othSupply);
}
public double getOthSupply()
......@@ -236,16 +253,19 @@ class ADPElement
return this.othSupply;
}
// end 12/04/10 manoharan MF90BHU001
public void setPlanSupply(java.sql.Timestamp dueDate, double supply)
{
this.planSupply += supply;
//updateTimeMrp(dueDate, 0, supply, 0, 0," "," ");
updateTimeMrp(dueDate, 0, supply, 0, 0);
}
public double getPlanSupply()
{
return this.planSupply;
}
//added by dharmendra on 28th-dec
//added by dharmendra on 28th-dec
public void setSuppSour(String suppSour)
{
this.suppSour = suppSour;
......@@ -467,8 +487,27 @@ class ADPElement
return this.batchSizeLead;
}
// end 22/06/10 manoharan
//added by sabyasachi 17-03-11
public void setSaleOrder(String saleOrder)
{
this.saleOrder = saleOrder;
}
public void setLineNo(String lineNo)
{
this.lineNo = lineNo;
}
public String getSaleOrder()
{
return this.saleOrder;
}
public String getLineNo()
{
return this.lineNo;
}
//end added by sabyasachi 17-03-11
//private void updateTimeMrp(java.sql.Timestamp dueDate, double demand, double supply, double stockQty, double othSupply, String saleOrder, String lineNo)
private void updateTimeMrp(java.sql.Timestamp dueDate, double demand, double supply, double stockQty, double othSupply)
{
String errString = "";
......@@ -477,6 +516,7 @@ class ADPElement
int timeEle = -1, ctr;
SimpleDateFormat sdt=new SimpleDateFormat("yyyy-MM-dd");
dueDate = java.sql.Timestamp.valueOf(sdt.format(dueDate) + " 00:00:00.000");
try
{
if (timeMRPArr.size() > 0)
......@@ -484,6 +524,7 @@ class ADPElement
for (ctr = 0; ctr < timeMRPArr.size(); ctr++)
{
timeMRP = (TimeMRP)timeMRPArr.get(ctr);
//if (timeMRP.getDueDate() != null && timeMRP.getSaleOrder().equals(saleOrder) && timeMRP.getLineNo().equals(lineNo))
if (timeMRP.getDueDate() != null)
{
if (timeMRP.getDueDate().equals(dueDate))
......@@ -491,33 +532,41 @@ class ADPElement
timeEle = ctr;
break;
}
}
}
}
}
if (timeEle == -1)
{
timeMRP = new TimeMRP();
timeMRP.setDueDate(dueDate);
//added by sabyasachi 29.03.2011
//timeMRP.setDemand(demand,saleOrder,lineNo);
timeMRP.setDemand(demand);
//end added by sabyasachi 29.03.2011
timeMRP.setSupply(supply);
// 12/04/10 manoharan MF90BHU001
timeMRP.setStockQty(stockQty);
timeMRP.setOthSupply(othSupply);
// end 12/04/10 manoharan MF90BHU001
timeMRP.setOthSupply(othSupply);
// end 12/04/10 manoharan MF90BHU001
this.timeMRPArr.add(timeMRP);
}
else
{
timeMRP = (TimeMRP)this.timeMRPArr.get(timeEle);
//added by sabyasachi 29.03.2011
//timeMRP.setDemand(demand,saleOrder,lineNo);
timeMRP.setDemand(demand);
//end added by sabyasachi 29.03.2011
timeMRP.setSupply(supply);
// 12/04/10 manoharan MF90BHU001
timeMRP.setStockQty(stockQty);
timeMRP.setOthSupply(othSupply);
// end 12/04/10 manoharan MF90BHU001
// end 12/04/10 manoharan MF90BHU001
//timeMRP.setSaleOrder(saleOrder);
//timeMRP.setLineNo(lineNo);
this.timeMRPArr.set(timeEle,timeMRP);
}
updateRunningDemandSupply(dueDate);
updateRunningDemandSupply(dueDate);
}
catch(Exception e)
{
......@@ -541,16 +590,16 @@ class ADPElement
for (int ctr = 0; ctr < timeMRPArr.size(); ctr++)
{
timeMRP = (TimeMRP)timeMRPArr.get(ctr);
if (timeMRP.getDueDate().equals(dueDate))
{
index = ctr;
break;
}
runningDemand = runningDemand + timeMRP.getDemand();
runningSupply = runningSupply + timeMRP.getSupply();
// 10-04-2006 manoharan
runningPlanSupply = runningPlanSupply + timeMRP.getPlanSupply();
// end 10-04-2006 manoharan
if (timeMRP.getDueDate().equals(dueDate))
{
index = ctr;
break;
}
runningDemand = runningDemand + timeMRP.getDemand();
runningSupply = runningSupply + timeMRP.getSupply();
// 10-04-2006 manoharan
runningPlanSupply = runningPlanSupply + timeMRP.getPlanSupply();
// end 10-04-2006 manoharan
}
for (int ctr = index; ctr < timeMRPArr.size(); ctr++)
......@@ -625,4 +674,5 @@ class ADPElement
}
}
}
\ No newline at end of file
......@@ -90,7 +90,7 @@ public class ExplodeBom
// public String explodeBom(String xmlString, Connection conn)//Commented by Jiten as per Kandarp Sir 13/11/06 - Connenction to be opened and to be closed here
public String explodeBom(String xmlString)//Added by Jiten 13/11/06 -
public String explodeBom(String xmlString) throws Exception //Added by Jiten 13/11/06 -
{
utilMethods = new UtilMethods(); // 10/12/07 manoharan
genericUtility = GenericUtility.getInstance();
......@@ -105,7 +105,7 @@ public class ExplodeBom
ConnDriver connDriver = new ConnDriver();//Added by Jiten 13/11/06 -
int iLeadTime = 0;
int iiLeadTime = 0;
String sqlLead = null;
String sqlLead = null, tempXML = null;
String mfgLeadBasis = "F";
double batchSizeLead = 0;
......@@ -471,6 +471,8 @@ public class ExplodeBom
else
{
pstmtLead.close();
rsLead.close();
mfgLeadBasis = "F";
batchSizeLead = 0;
......@@ -490,6 +492,11 @@ public class ExplodeBom
pstmtLead.close();
rsLead.close();
}
else
{
pstmtLead.close();
rsLead.close();
}
}
if ( "P".equals(suppSourInner) )
{
......@@ -587,6 +594,14 @@ public class ExplodeBom
System.out.println("SQLException : ExplodeBom :explodeBom()" +se.getMessage());
se.printStackTrace();
errString = se.getMessage();
try {
tempXML = valueXmlString.toString();
tempXML = tempXML.replaceAll("<Root>","");
tempXML = tempXML.replaceAll("</Root>","");
valueXmlString = new StringBuffer("<Root>" + tempXML + "</Detail></Root>");
}
catch (Exception x) {}
throw (se);
}
catch(Exception e)
{
......@@ -594,6 +609,14 @@ public class ExplodeBom
this.errString = genericUtility.createErrorString(e);
e.printStackTrace();
errString = e.getMessage();
try {
tempXML = valueXmlString.toString();
tempXML = tempXML.replaceAll("<Root>","");
tempXML = tempXML.replaceAll("</Root>","");
valueXmlString = new StringBuffer("<Root>" + tempXML + "</Detail></Root>");
}
catch (Exception x) {}
throw (e);
}
finally
{
......@@ -602,15 +625,38 @@ public class ExplodeBom
rs.close();
rs = null;
}
if(conn != null){//Added by Jiten 13/11/06 -
if (rsLead != null)
{
rsLead.close();
rsLead = null;
}
if (rsInner != null)
{
rsInner.close();
rsInner = null;
}
if (pstmt != null)
{
pstmt.close();
pstmt = null;
}
if (pstmtInner != null)
{
pstmtInner.close();
pstmtInner = null;
}
if (pstmtLead != null)
{
pstmtLead.close();
pstmtLead = null;
}
if(conn != null)
{//Added by Jiten 13/11/06 -
conn.close();
conn = null;
}
if (pstmt != null) { pstmt = null; }
if (pstmtInner != null) { pstmtInner = null; }
if (pstmtInner != null) { pstmtInner = null; }
if (rs != null) { rs = null; }
if (rsInner != null) { rsInner = null; }
}catch(Exception e){}
/*if( (errString != null) && (errString.length() > 0) )
return errString;
......
package ibase.webitm.ejb.mfg;
//import java.sql.Timestamp;
public class MPSOrder
{
public String tranId = "";
public String ordType = "";
public String itemCode = "";
public String siteCode = "";
public String mrpRunId = "";
public String addnOrder = "";
public String status = "";
public String routeCode = "";
public String bomCode = "";
public String projCode = "";
public String chgUser = "";
public String chgTerm = "";
public String unit = "";
public String acctCodeWp = "";
public String cctrCodeWp = "";
public double quantity = 0;
public double yieldPerc = 0 ;
public double curBatchQty = 0;
public java.sql.Timestamp ordDate = null;
public java.sql.Timestamp planDueDate = null;
public java.sql.Timestamp dueDate = null;
public java.sql.Timestamp statusDate = null;
public java.sql.Timestamp chgDate = new java.sql.Timestamp(System.currentTimeMillis());
public MPSOrder()
{
//System.out.println("MPSOrder Instantiated.......");
}
public void Test()
{
System.out.println("Inside Test().......");
}
package ibase.webitm.ejb.mfg;
//import java.sql.Timestamp;
public class MPSOrder
{
public String tranId = "";
public String ordType = "";
public String itemCode = "";
public String siteCode = "";
public String mrpRunId = "";
public String addnOrder = "";
public String status = "";
public String routeCode = "";
public String bomCode = "";
public String projCode = "";
public String chgUser = "";
public String chgTerm = "";
public String unit = "";
public String acctCodeWp = "";
public String cctrCodeWp = "";
//ADDED BY SABYASACHI 30-03-11
public String saleOrder = "";
public String lineNo = "";
public String mfgType = "";
//ADDED BY SABYASACHI ENDS 30-03-11
public double quantity = 0;
public double yieldPerc = 0 ;
public double curBatchQty = 0;
public java.sql.Timestamp ordDate = null;
public java.sql.Timestamp planDueDate = null;
public java.sql.Timestamp dueDate = null;
public java.sql.Timestamp statusDate = null;
public java.sql.Timestamp chgDate = new java.sql.Timestamp(System.currentTimeMillis());
public MPSOrder()
{
//System.out.println("MPSOrder Instantiated.......");
}
public void Test()
{
System.out.println("Inside Test().......");
}
}
\ No newline at end of file
......@@ -19,11 +19,19 @@ public class TimeMRP
private double stockQty = 0;
private double othSupply = 0;
// end 12/04/10 manoharan MF90BHU001
//added by sabyasachi 17.03.2011
//private String saleOrder = "";
//private String lineNo = "";
//end added by sabyasachi 17.03.2011
boolean createDemand = false;
public TimeMRP()
{
// System.out.println("New TimeMRP Created");
//this.saleOrder = " ";
//this.lineNo = " ";
}
public void setDueDate(java.sql.Timestamp dueDate)
......@@ -37,10 +45,16 @@ public class TimeMRP
return this.dueDate;
}
//changed method arguments by sabyasachi 29-03-2011
//public void setDemand(double demand,String saleOrder, String lineNo)
public void setDemand(double demand)
{
this.demand += demand;
//this.saleOrder = saleOrder;
//this.lineNo = lineNo;
}
//changed method definition by sabyasachi 29-03-2011 end
public double getDemand()
{
return this.demand;
......@@ -113,4 +127,22 @@ public class TimeMRP
{
return this.independentDemand;
}
//added by sabyasachi 17.03.2011
//public void setSaleOrder(String saleOrder)
//{
// this.saleOrder = saleOrder;
//}
//public String getSaleOrder()
//{
// return this.saleOrder;
//}
//public void setLineNo(String lineNo)
//{
// this.lineNo = lineNo;
//}
//public String getLineNo()
//{
// return this.lineNo;
//}
//end added by sabyasachi 17.03.2011
}
\ No newline at end of file
......@@ -576,7 +576,7 @@ public String actionHandler(String actionType, String xmlString,String xmlString
+" BOMDET.PEND_STK, BOMDET.POTENCY_INPUT, BOMDET.ISS_VAR_VALTYPE, "
+" BOMDET.SPEC_METADATA, BOMDET.SPEC_DIMENSION , BOMDET.MFG_REF , BOMDET.ITEM_CATEGORY, BOMDET.DISP_CONTAINER_SIZE, "
+" BOMDET.OPERATION_USED "
+" FROM BOMDET ,ITEM WHERE ( BOMDET.ITEM_CODE = ITEM.ITEM_CODE (+)) AND "
+" FROM BOMDET ,ITEM WHERE ( BOMDET.ITEM_CODE = ITEM.ITEM_CODE ) AND "
+" ( ( BOMDET.BOM_CODE = ? ) ) " ;
pstmt = conn.prepareStatement(sql1);
......
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