Commit 18042065 authored by cpatil's avatar cpatil

modify at urse supreme


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97854 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 302ac646
......@@ -29,6 +29,7 @@ import org.w3c.dom.NodeList;
@Stateless
public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,WoIssPartialPrcRemote
{
String batchQuantityStr="";
public String process() throws RemoteException,ITMException
{
......@@ -40,6 +41,8 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
Document headerDom = null;
GenericUtility genericUtility = GenericUtility.getInstance();
String retStr = "";
try
{
System.out.println("xmlString[process]::::::::::;;;"+xmlString);
......@@ -78,7 +81,8 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
{
System.out.println("WoIssPartialPrc process called........");
String errString = null,sql="";
String batchQuantityStr="",deptCode="",operationStr="";
//String batchQuantityStr="";
String deptCode="",operationStr="";
String worder = "";
Connection conn = null;
ConnDriver connDriver = null;
......@@ -95,7 +99,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
int cnt = 0,operation=0;
double batchQuantity=0.0,quantity=0.0;
GenericUtility genericUtility = null;
//batchQuantityStr="";
try
{
connDriver = null;
......@@ -352,7 +356,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
CommonConstants commonConstants = new CommonConstants();
String itemCodeInv=""; double quantityInv=0,issueQtyInv=0; // added by cpatil
double noArt = 0,netWeight = 0, grossWeight=0, stkQty=0; // added by cpatil on 02/04/15 urse
try
{
......@@ -451,7 +455,8 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
pstmt.setString(4,worder);
pstmt.setInt(5,operation);
pstmt.setString(6,siteCode);
pstmt.setString(7,"issue generated partially for work order "+worder);
// pstmt.setString(7,"issue generated partially for work order "+worder);
pstmt.setString(7,"issue generated partially for WO "+worder+" for Qty " +batchQuantityStr);
pstmt.setTimestamp(8,currDate1);
pstmt.setString(9,chgUser);
pstmt.setString(10,termId);
......@@ -582,6 +587,35 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
+" and lot_no in ('" +lotNoIss+ "')"
+" and ( a.quantity - a.alloc_qty ) > 0 ";
*/
noArt = 0;
netWeight = 0;
grossWeight= 0 ;
stkQty = 0;
stockSql ="select a.NO_ART , a.NET_WEIGHT , a.GROSS_WEIGHT, a.quantity " //added on 02/04/15 by cpatil
+" from stock a, invstat b, item c "
+" Where a.inv_stat = b.inv_stat and a.item_code = c.item_code "
+" and a.item_code = '" + itemCodeInv + "' "
+" and a.site_code = '"+siteCode+"' "
+" and b.stat_type <> 'S' and b.available = 'Y' "
+" and a.loc_code ='"+locCode+"' "
+" and a.lot_no = ('" +lotNoInv+ "') "
+" and a.quantity > 0 ";
pstmt1 = conn.prepareStatement(stockSql);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
noArt = rs1.getDouble(1); // added by cpatil on 02/04/15
netWeight = rs1.getDouble(2); // added by cpatil on 02/04/15
grossWeight= rs1.getDouble(3); // added by cpatil on 02/04/15
stkQty= rs1.getDouble(4); // added by cpatil on 02/04/15
}
rs1.close();rs1=null;
pstmt1.close();pstmt1=null;
stockSql ="select a.lot_no, a.loc_code, a.lot_sl, a.rate, a.gross_rate,a.supp_code__mfg "
+" ,(a.quantity-a.alloc_qty) as stockBalQty "
+" from stock a, invstat b, item c "
......@@ -636,10 +670,48 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
// end
// NO_ART , NET_WEIGHT , GROSS_WEIGHT added urse
System.out.println("@@@@@@@@@ before calculation : netWeight["+netWeight+"]grossWeight["+grossWeight+"]noArt["+noArt+"]stkQty["+stkQty+"]propReqQty["+propReqQty+"]");
netWeight = ( netWeight * propReqQty ) / stkQty ;
grossWeight = ( grossWeight * propReqQty ) / stkQty ;
noArt = new Double( Math.ceil( ( noArt * propReqQty ) / stkQty )) ;
System.out.println("@@@@@@@@@ after calculation : netWeight["+netWeight+"]grossWeight["+grossWeight+"]noArt["+noArt+"]");
System.out.println("@@@@@@@@@ locGroup work order["+locGroup+"]locCode["+locCode+"]");
String locGroupLoc = "";
String locSql =" select loc_group from location where loc_code = ? ";
pstmt1 = conn.prepareStatement(locSql);
pstmt1.setString(1,locCode);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
locGroupLoc = checkNull(rs1.getString(1));
}
rs1.close();rs1=null;
pstmt1.close();pstmt1=null;
System.out.println("@@@@@@@@@ locGroup work order["+locGroup+"]locGroupLoc["+locGroupLoc+"]");
if(! (checkNull(locGroup).equalsIgnoreCase(locGroupLoc)) )
{
retString = "VMLOCGRPIN";
System.out.println("@@@@@@@@@ locGroup miss match in work order["+locGroup+"]location["+locGroupLoc+"]");
return retString ;
}
insertDetail ="insert into workorder_issdet (tran_id,line_no,exp_lev,item_code,loc_code,lot_no," +
" lot_sl,quantity,unit,rate,gross_rate,calc_potency, potency_adj," +
" match_potency,min_potency_perc,adj_potency,work_order)" +
" values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
" match_potency,min_potency_perc,adj_potency,work_order" +
" , NO_ART , NET_WEIGHT , GROSS_WEIGHT )" +
" values ( ?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? " +
" ,? ,? ,? )";
pstmt1 = conn.prepareStatement(insertDetail);
pstmt1.setString(1,tranId);
pstmt1.setInt(2,lineNo);
......@@ -658,13 +730,19 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
pstmt1.setDouble(15,minPotencyPerc);
pstmt1.setString(16,adjPotency);
pstmt1.setString(17,worder);
pstmt1.setDouble(18,noArt); // added by cpatil on 02/04/15
pstmt1.setDouble(19,netWeight); // added by cpatil on 02/04/15
pstmt1.setDouble(20,grossWeight); // added by cpatil on 02/04/15
updDet = updDet + pstmt1.executeUpdate();
pstmt1.close();pstmt1=null;
sql = " update inv_alloc_det set issue_qty = (CASE WHEN issue_qty IS NULL THEN 0 ELSE issue_qty END) + ? ,"//Add case condition for removing null value
+ " dealloc_qty = (CASE WHEN dealloc_qty IS NULL THEN 0 ELSE dealloc_qty END) + ?"
+ " where tran_id in (select tran_id from inv_allocate where work_order = ? )"+
" and item_code = ? and lot_sl= ? and lot_no = ? and site_code= ? and loc_code = ? ";
+ " where tran_id in (select tran_id from inv_allocate where work_order = ? )"
+ " and item_code = ? and lot_sl= ? and lot_no = ? and site_code= ? and loc_code = ? "
+ " and exp_lev = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setDouble(1,propReqQty);
pstmt1.setDouble(2,propReqQty);
......@@ -674,6 +752,7 @@ public class WoIssPartialPrc extends ProcessEJB implements WoIssPartialPrcLocal,
pstmt1.setString(6,lotNoInv);
pstmt1.setString(7,siteCode);
pstmt1.setString(8,locCode);
pstmt1.setString(9,expLev);
int cnt=pstmt1.executeUpdate();
System.out.println("Count after PSTM is:- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%["+cnt+"]");
pstmt1.close();pstmt1=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