Commit b5e265d0 authored by rtiwari's avatar rtiwari

updated


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95243 ce508802-f39f-4f6c-b175-0d175dae99d5
parent edeb6e60
...@@ -38,6 +38,7 @@ import org.w3c.dom.Node; ...@@ -38,6 +38,7 @@ import org.w3c.dom.Node;
import org.w3c.dom.NodeList; import org.w3c.dom.NodeList;
import ibase.webitm.ejb.dis.DistCommon; import ibase.webitm.ejb.dis.DistCommon;
import ibase.webitm.ejb.dis.DistStkUpdLocal;
import ibase.webitm.ejb.dis.InvAllocTraceBean; import ibase.webitm.ejb.dis.InvAllocTraceBean;
import ibase.webitm.ejb.dis.StockUpdate; import ibase.webitm.ejb.dis.StockUpdate;
//import ibase.webitm.ejb.dis.InvAllocTrace; //import ibase.webitm.ejb.dis.InvAllocTrace;
...@@ -1072,10 +1073,17 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1072,10 +1073,17 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
double potencyPerc=0,grossWeight=0,tareWeight=0,netWeight=0; double potencyPerc=0,grossWeight=0,tareWeight=0,netWeight=0;
DecimalFormat df = new DecimalFormat("0.000"); DecimalFormat df = new DecimalFormat("0.000");
boolean campflag1 = false; boolean campflag1 = false;
String invstat1 = "";
DistStkUpdLocal distStkUpd = null;
HashMap hashMap = new HashMap();
double aldAllocQty = 0d;
String line = " " + lineno;
MfgCommon mfgComm = new MfgCommon();
try try
{ {
invstat1 = mfgComm.getEnvMfg("999999","MAIN_ST_INVSTAT", connOne);
System.out.println("@@@@@@@ wostock trans. function called::"); System.out.println("@@@@@@@ wostock trans. function called::");
xmlBuff = new StringBuffer(); xmlBuff = new StringBuffer();
genericUtility = GenericUtility.getInstance(); genericUtility = GenericUtility.getInstance();
...@@ -1273,6 +1281,78 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -1273,6 +1281,78 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
xmlString = xmlBuff.toString(); xmlString = xmlBuff.toString();
System.out.println("@@@@@2: xmlString :::: "+xmlBuff.toString()); System.out.println("@@@@@2: xmlString :::: "+xmlBuff.toString());
/* DEALLOCATING STOCK*/
aldAllocQty = -1 * (actualQty);
distStkUpd = getComponent("DistStkUpd");
if(campNo != null && campNo.trim().length() > 0)
{
int ddlg = 0;
sql = "select tran_id,line_no,item_code,lot_no,lot_sl,loc_code, quantity "+
" from inv_alloc_det where tran_id IN (SELECT TRAN_ID FROM INV_ALLOCATE "+
" WHERE WORK_ORDER IN (SELECT WORK_ORDER FROM WORKORDER WHERE CAMPGN_NO = ? AND STATUS = 'R')) "+
" and loc_code in(select loc_code from location where inv_stat = ? ) and site_code = ? and item_code= ? ";
pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,campNo);
pstmt.setString(2,invstat1);
pstmt.setString(3,siteCode);
pstmt.setString(4,itemCode);
rs = pstmt.executeQuery();
while(rs.next())
{
ddlg ++;
hashMap.put("tran_date", new java.sql.Date(System.currentTimeMillis()));
hashMap.put("ref_ser","XFRX");
hashMap.put("ref_id", rs.getString("tran_id"));
hashMap.put("ref_line", rs.getString("line_no"));
hashMap.put("item_code", rs.getString("item_code"));
hashMap.put("site_code", siteCode);
hashMap.put("loc_code",rs.getString("loc_code"));
hashMap.put("lot_no",rs.getString("lot_no"));
hashMap.put("lot_sl",rs.getString("lot_sl"));
hashMap.put("alloc_qty", -1 * rs.getDouble("quantity"));
hashMap.put("chg_win","W_STOCK_TRANSFER_MULTI");
hashMap.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
hashMap.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "termId"));
System.out.println("Calling DistStkUpdEJB....."+ddlg);
if (distStkUpd.updAllocTrace(hashMap, connOne) > 0)
{
System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!");
}
// hashMap.clear();
}
if(rs != null)
rs.close();
rs = null;
if(pstmt != null)
pstmt.close();
pstmt = null;
}
if(worder != null && worder.trim().length() > 0)
{
hashMap.put("tran_date", new java.sql.Date(System.currentTimeMillis()));
hashMap.put("ref_ser","XFRX");
hashMap.put("ref_id", tranId);
hashMap.put("ref_line", line.substring(line.length()-3));
hashMap.put("item_code", itemCode);
hashMap.put("site_code", siteCode);
hashMap.put("loc_code",locCodeFr);
hashMap.put("lot_no",lotno);
hashMap.put("lot_sl",lotsl);
hashMap.put("alloc_qty", aldAllocQty);
hashMap.put("chg_win","W_STOCK_TRANSFER_MULTI");
hashMap.put("chg_user", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "loginCode"));
hashMap.put("chg_term", GenericUtility.getInstance().getValueFromXTRA_PARAMS(xtraParams, "termId"));
//Calling DistStkUpdEJB
System.out.println("Calling DistStkUpdEJB.....");
if (distStkUpd.updAllocTrace(hashMap, connOne) > 0)
{
System.out.println("distStkUpd.UpdAllocTrace(HashMap, Connection) : Sucessuful!");
}
}
System.out.println("...............just before savdata() "); System.out.println("...............just before savdata() ");
siteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode"); siteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");
System.out.println("== site code == @"+siteCode); System.out.println("== site code == @"+siteCode);
...@@ -6256,4 +6336,23 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr ...@@ -6256,4 +6336,23 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
} }
return s; return s;
} }
private DistStkUpdLocal getComponent(String componentName)throws Exception
{
DistStkUpdLocal comp = null;
try
{
System.out.println("Looking For Component.... :: " + componentName);
AppConnectParm appConnect = new AppConnectParm();
java.util.Properties p = appConnect.getProperty();
InitialContext ctx = new InitialContext(p);
comp = (DistStkUpdLocal)ctx.lookup("ibase/DistStkUpd/local"); // for ejb3
//comp = distStkUpdHome.create();
System.out.println(componentName+" Found.....");
}
catch(Exception e)
{
throw e;
}
return comp;
}
} }
\ No newline at end of file
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