Commit 9cdf85ad authored by smane's avatar smane

Changes done in sql add condition (deallocated is null then 'N' else deallocated end = 'N')


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97942 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e7428100
......@@ -1139,6 +1139,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
double potencyPerc=0,grossWeight=0,tareWeight=0,netWeight=0;
DecimalFormat df = new DecimalFormat("0.000");
boolean campflag1 = false;
boolean connStatus=false;
String invstat1 = "";
DistStkUpdLocal distStkUpd = null;
HashMap hashMap = null;
......@@ -1356,10 +1357,17 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
if(campNo != null && campNo.trim().length() > 0)
{
int ddlg = 0;
// //comment added by sagar on 28/04/15.
/*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= ? ";*/
//sql changed by sagar on 28/04/15.
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= ? ";
" and loc_code in(select loc_code from location where inv_stat = ? ) and site_code = ? and item_code= ? and case when deallocated is null then 'N' else deallocated end = 'N' ";
pstmt = connOne.prepareStatement(sql);
pstmt.setString(1,campNo);
......@@ -1369,6 +1377,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
rs = pstmt.executeQuery();
while(rs.next())
{
System.out.println(">>>>>>In inv_alloc_det:");
ddlg ++;
hashMap=new HashMap();
hashMap.put("tran_date", new java.sql.Date(System.currentTimeMillis()));
......@@ -1435,7 +1444,7 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
System.out.println("--retString finished--");
if (retString.indexOf("Success") > -1)
{
connOne.commit();
//connOne.commit(); //comment added by sagar on 28/04/2015
System.out.println("@@@@@@3: retString @ "+retString);
String[] arrayForTranId = retString.split("<TranID>");
int endIndex = arrayForTranId[1].indexOf("</TranID>");
......@@ -1443,7 +1452,9 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
System.out.println("-tranIdForIssue-"+tranIdForIssue);
StockTransferConf stconf = new StockTransferConf();
retString = stconf.confirm(tranIdForIssue,xtraParams,"");
//retString = stconf.confirm(tranIdForIssue,xtraParams,""); //comment added by sagar on 28/04/15
System.out.println(">>>>>>>connStatus:"+connStatus);
retString = stconf.confirm(tranIdForIssue,xtraParams,"",connOne,connStatus);//connOne and connStatus added by sagar on 28/04/15
System.out.println("retString from StockTransferConf :: @:: "+retString);//CONFSUCC
if(retString.indexOf("CONFSUCC") > -1)
{
......@@ -3458,14 +3469,32 @@ public class WoTransferPrc extends ProcessEJB implements WoTransferPrcLocal,WoTr
} catch (SQLException e)
{
System.out.println("SQLException :allocDeAlloc :SQLException :==>\n"+e.getMessage());
//code added by sagar on 28/04/15
try
{
conn.rollback();
System.out.println(">>>>>Transaction rollbacked successfully in SQLException:");
}
catch(Exception ee2)
{}
errString = e.getMessage();
System.out.println(">>>>>After rollbacked successfully in SQLException errString:"+errString);
e.printStackTrace();
throw new ITMException(e);
}
catch (Exception e)
{
System.out.println("Exception :allocDeAlloc : :Exception :==>\n"+e.getMessage());
//code added by sagar on 28/04/15
try
{
conn.rollback();
System.out.println(">>>>>Transaction rollbacked successfully in Exception:");
}
catch(Exception ee2)
{}
errString = e.getMessage();
System.out.println(">>>>>After rollbacked successfully in Exception errString:"+errString);
e.printStackTrace();
throw new ITMException(e);
}
......
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