Commit cab7e1ca authored by cpatil's avatar cpatil

update msg


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@91795 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 215f51af
......@@ -145,6 +145,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
}
else
{
/*
sql = "select count(1) from inv_hold_det where tran_id ='" + tranIdFrom + "'";
pstmt = conn.prepareStatement(sql);
rs1 = pstmt.executeQuery();
......@@ -161,6 +162,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
errString = itmDBAccessEJB.getErrorString("","TRIDFRINV","","",conn);
return errString;
}
*/
}
if ( tranIdTo == null || tranIdTo.trim().length() == 0 )
......@@ -171,6 +173,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
}
else
{
/*
sql = "select count(1) from inv_hold_det where tran_id ='" + tranIdTo + "'";
pstmt = conn.prepareStatement(sql);
rs1 = pstmt.executeQuery();
......@@ -187,6 +190,7 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
errString = itmDBAccessEJB.getErrorString("","TRIDTOINV","","",conn);
return errString;
}
*/
}
if ( schRelDateFrom == null )
......@@ -294,16 +298,24 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
}
*/
System.out.println("refIdFrom["+refIdFrom+"]:::::::refIdTo["+refIdTo+"]");
getDataSql= " select ihd.tran_id,ihd.line_no,ihd.line_no_sl," +
" case when ihd.hold_status is null then 'H' else ihd.hold_status end as hold_status ," +
" ihd.item_code,ihd.loc_code,ihd.site_code,ihd.status_date,ihd.reas_code,ihd.sch_rel_date," +
" ih.ref_id,ih.confirmed from inv_hold_det ihd,inv_hold ih where ( ihd.tran_id = ih.tran_id )" +
" and ( ihd.tran_id >= ? and ihd.tran_id <= ? ) and ( ihd.sch_rel_date between ? and ? )";
" and ( ihd.tran_id >= ? and ihd.tran_id <= ? ) and ( ihd.sch_rel_date between ? and ? )" +
" and ihd.hold_status <> 'R' ";
if(refIdFrom != null )
{
getDataSql = getDataSql + " and (ih.ref_id >= ? ) ";
}
if(refIdFrom != null && refIdTo != null)
if(refIdTo != null )
{
getDataSql = getDataSql + " and (ih.ref_id >= ? and ih.ref_id <= ? ) ";
getDataSql = getDataSql + " and ih.ref_id <= ? ) ";
}
System.out.println("Sql Fired :::::"+getDataSql.trim().length());
if (getDataSql.trim().length()>0)
{
......@@ -314,9 +326,13 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
pstmt.setTimestamp(3,schRelDateFrom);
pstmt.setTimestamp(4,schRelDateTo);
if(refIdFrom != null && refIdTo != null)
if(refIdFrom != null )
{
pstmt.setString(5,refIdFrom);
}
if( refIdTo != null)
{
pstmt.setString(6,refIdTo);
}
......@@ -325,7 +341,6 @@ public class InvHoldRelGen extends ProcessEJB implements InvHoldRelGenLocal, Inv
System.out.println("QUERY PROCESS FINISED.......");
while(rs1.next())
{
//tran_id
retTabSepStrBuff.append((rs1.getString(1)==null?" ":rs1.getString(1))).append("\t");
//line_no
......@@ -524,6 +539,10 @@ public String process(String xmlString, String xmlString2, String windowName, St
tranId = genericUtility.getColumnValue("tran_id",detailDom);
autoConfirmed = genericUtility.getColumnValue("auto_confirmed",headerDom);
if(autoConfirmed == null || autoConfirmed.trim().length() == 0 )
{
autoConfirmed = "Y";
}
System.out.println("tranId:["+tranId+"]:::::autoConfirmed:["+autoConfirmed+"]");
//System.out.println("INV_HOLD_REL sql ");
invHoldRelSql = "INSERT INTO INV_HOLD_REL(TRAN_ID, TRAN_DATE, SITE_CODE, REMARKS, CONFIRMED, EMP_CODE__APRV,CHG_USER ,CHG_DATE, CHG_TERM) VALUES(?,?,?,?,?,?,?,?,?)";
......@@ -616,13 +635,16 @@ public String process(String xmlString, String xmlString2, String windowName, St
if("Y".equalsIgnoreCase(autoConfirmed))
{
sql = "update inv_hold set confirmed = 'Y', conf_date = ? where tran_id = ?";
//sql = " update inv_hold set confirmed = 'Y', conf_date = ? where tran_id = ?";
sql = "update inv_hold_det set hold_status = 'R', status_date = ? where tran_id = ?";
pstmt = conn.prepareStatement(sql);
pstmt.setTimestamp(1,currDate);
pstmt.setString(2,tranId);
int rowcnt = pstmt.executeUpdate();
pstmt.close();
pstmt = null;
conn.commit();
if(rowcnt == 0)
{
errString = itmDBAccessLocal.getErrorString("","VTMCONF9","");
......@@ -630,11 +652,13 @@ public String process(String xmlString, String xmlString2, String windowName, St
}
else
{
System.out.println("inv_hold transaction confirm succesfully........");
System.out.println("inv_hold_det transaction hold_status release succesfully........");
errString = itmDBAccessLocal.getErrorString("","VTMCONF2","");
return errString;
}
}
conn.commit();
}
if(pRelHdr != 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