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