Commit 9410e37d authored by sankara.rao's avatar sankara.rao

updated by sankara on 20/09/13 replissconf given by pragyan sir


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93639 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5eb4ecff
...@@ -549,8 +549,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -549,8 +549,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
// reduce the quantity in existing and insert new for the active // reduce the quantity in existing and insert new for the active
//if ("A".equals(orderType) || "E".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType) ) //if ("A".equals(orderType) || "E".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType) )
//if ("E".equals(orderType) || "P".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType)) // all active replenishment //if ("E".equals(orderType) || "P".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType)) // all active replenishment
if ("E".equals(orderType) || "P".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType) || "I".equals(orderType)) // all active replenishment /*if ("E".equals(orderType) || "P".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType) || "I".equals(orderType)) // all active replenishment
{ {*/
//Changed By Pragyan 06/12/2012 To get valid Pick Order.start //Changed By Pragyan 06/12/2012 To get valid Pick Order.start
/*sql = " SELECT * FROM PICK_ORD_DET " /*sql = " SELECT * FROM PICK_ORD_DET "
//+ " WHERE SALE_ORDER = ? AND LINE_NO__SORD = ? " //+ " WHERE SALE_ORDER = ? AND LINE_NO__SORD = ? "
...@@ -592,15 +592,6 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -592,15 +592,6 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
//Changed by sumit on 08/02/13 changed the sql ( Told Manoharan Sir) end //Changed by sumit on 08/02/13 changed the sql ( Told Manoharan Sir) end
pstmtPick = conn.prepareStatement(sql); pstmtPick = conn.prepareStatement(sql);
//pstmtPick.setString(1, saleOrder);
//pstmtPick.setString(2, lineNoSord);
//Changed by sumit on 08/02/13 commented setter parameter the sql start
/*pstmtPick.setString(1, itemCode);
//pstmtPick.setString(2, locCodeTo);
//pstmtPick.setString(2, locCode);
pstmtPick.setString(2, lotNo);
pstmtPick.setString(3, lotSl);*/
//Changed by sumit on 08/02/13 commented setter parameter the sql end
pstmtPick.setString(1, replOrder); pstmtPick.setString(1, replOrder);
pstmtPick.setInt(2, replOrderLineNo); pstmtPick.setInt(2, replOrderLineNo);
//Changed By Pragyan 21/02/13 Logic change as above by manohran sir.start //Changed By Pragyan 21/02/13 Logic change as above by manohran sir.start
...@@ -720,6 +711,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -720,6 +711,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
System.out.println("Finally the Exp level["+expLev+"]"); System.out.println("Finally the Exp level["+expLev+"]");
//Changed by sumit on 25/02/13 checking whether already insertion done in sordalloc if yes then update start //Changed by sumit on 25/02/13 checking whether already insertion done in sordalloc if yes then update start
sql = " SELECT SALE_ORDER, LINE_NO, EXP_LEV, ITEM_CODE, LOT_NO, LOT_SL, LOC_CODE FROM SORDALLOC " + sql = " SELECT SALE_ORDER, LINE_NO, EXP_LEV, ITEM_CODE, LOT_NO, LOT_SL, LOC_CODE FROM SORDALLOC " +
" WHERE SALE_ORDER = ? AND LINE_NO = ? AND EXP_LEV = ? AND ITEM_CODE = ? AND LOT_NO = ? " + " WHERE SALE_ORDER = ? AND LINE_NO = ? AND EXP_LEV = ? AND ITEM_CODE = ? AND LOT_NO = ? " +
" AND LOT_SL = ? AND LOC_CODE = ? "; " AND LOT_SL = ? AND LOC_CODE = ? ";
...@@ -731,8 +723,40 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -731,8 +723,40 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pstmt1.setString(5, lotNo); pstmt1.setString(5, lotNo);
pstmt1.setString(6, lotSlNew); pstmt1.setString(6, lotSlNew);
pstmt1.setString(7, locCodeTo); pstmt1.setString(7, locCodeTo);
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if( rs1.next()) if( rs1.next())
{
updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + ? " //LOC_CODE = ? ,LOT_SL = ? "
+ " WHERE SALE_ORDER = ? AND LINE_NO = ? "
+ " AND EXP_LEV = ? "
+ " AND ITEM_CODE = ? "
+ " AND LOC_CODE = ? "
+ " AND LOT_NO = ? "
+ " AND LOT_SL = ? "
+ " AND QTY_ALLOC > 0";
pstmtUpd = conn.prepareStatement(updateSql);
pstmtUpd.setDouble(1, pickQty);
pstmtUpd.setString(2, saleOrder);
pstmtUpd.setString(3, lineNoSord);
pstmtUpd.setString(4, expLev);
pstmtUpd.setString(5, itemCode); //pickQty
pstmtUpd.setString(6, locCodeTo);
pstmtUpd.setString(7, lotNo);
pstmtUpd.setString(8, lotSlNew);
updCnt = pstmtUpd.executeUpdate();
if( updCnt > 0 )
{
System.out.println( " updated successfullt in sordalloc ");
}
else
{
throw new Exception(" Update fail in sordalloc");
}
pstmtUpd.close(); pstmtUpd = null;
/*if ("E".equals(orderType) || "P".equals(orderType) || "Q".equals(orderType) || "T".equals(orderType) || "I".equals(orderType)) // all active replenishment
{ {
updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + ? " //LOC_CODE = ? ,LOT_SL = ? " updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC + ? " //LOC_CODE = ? ,LOT_SL = ? "
+ " WHERE SALE_ORDER = ? AND LINE_NO = ? " + " WHERE SALE_ORDER = ? AND LINE_NO = ? "
...@@ -761,8 +785,36 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -761,8 +785,36 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
throw new Exception(" Update fail in sordalloc"); throw new Exception(" Update fail in sordalloc");
} }
pstmtUpd.close(); pstmtUpd = null; pstmtUpd.close(); pstmtUpd = null;
}
else
{
System.out.println("manohar 26/10/12 ");
updateSql = "UPDATE SORDALLOC SET LOC_CODE = ? ,LOT_SL = ? "
+ " WHERE "
+" SALE_ORDER = ? AND LINE_NO = ? AND "
+ " ITEM_CODE = ? "
+ " AND LOC_CODE = ? "
+ " AND LOT_NO = ? "
+ " AND LOT_SL = ? "
+ " AND QTY_ALLOC > 0";
pstmtUpd = conn.prepareStatement(updateSql);
pstmtUpd.setString(1, locCodeTo);
pstmtUpd.setString(2, lotSlNew); //added by Kunal on 11/09/12 as per S Manoharan sir intruction
//To Check whether th other saleorder exist with replenishmnet.start
pstmtUpd.setString(3, saleOrder);
pstmtUpd.setString(4, lineNoSord);
//To Check whether th other saleorder exist with replenishmnet.end
pstmtUpd.setString(5, itemCode);
pstmtUpd.setString(6, locCode);
pstmtUpd.setString(7, lotNo);
pstmtUpd.setString(8, lotSl);
updCnt = pstmtUpd.executeUpdate();
pstmtUpd.close();
pstmtUpd = null;
} }
*/ }
else else
{ {
updateSql = "insert into sordalloc( SALE_ORDER, LINE_NO, EXP_LEV, ITEM_CODE__ORD, " updateSql = "insert into sordalloc( SALE_ORDER, LINE_NO, EXP_LEV, ITEM_CODE__ORD, "
...@@ -826,136 +878,9 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -826,136 +878,9 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pstmtPick.close(); pstmtPick.close();
pstmtPick = null; pstmtPick = null;
/*sql = " SELECT EXP_LEV, ITEM_CODE__ORD, "
+ " ITEM_REF, UNIT, DATE_ALLOC, STATUS, ITEM_GRADE, EXP_DATE, ALLOC_MODE, SITE_CODE, "
+ " CONV__QTY_STDUOM, UNIT__STD, MFG_DATE, SITE_CODE__MFG, REAS_CODE,QUANTITY FROM SORDALLOC "
+ " WHERE SALE_ORDER = ? AND LINE_NO = ? "
+ " AND ITEM_CODE = ? "
+ " AND LOC_CODE = ? "
+ " AND LOT_NO = ? "
+ " AND LOT_SL = ? "
+ " AND QTY_ALLOC > 0";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, saleOrder);
pstmt1.setString(2, lineNoSord);
pstmt1.setString(3, itemCode);
pstmt1.setString(4, locCode);
pstmt1.setString(5, lotNo);
pstmt1.setString(6, lotSl);
rs1 = pstmt1.executeQuery();
if( rs1.next())
{
System.out.println("Inside the Query the Exp level["+expLev+"]");
expLev = rs1.getString( "EXP_LEV" );
System.out.println("Inside the Query the Exp level["+expLev+"]");
if (expLev == null || expLev.trim().length() == 0)
{
expLev = dExpLev;
}
if (expLev == null || expLev.trim().length() == 0)
{
expLev = " ";
}
itemCodeOrd = rs1.getString( "ITEM_CODE__ORD" );
itemRef = rs1.getString( "ITEM_REF" );
unit = rs1.getString( "UNIT" );
status = rs1.getString( "STATUS" );
itemGrade = rs1.getString( "ITEM_GRADE" );
allocMode = rs1.getString( "ALLOC_MODE" );
siteCode = rs1.getString( "SITE_CODE" );
siteCodeMfg = rs1.getString( "SITE_CODE__MFG" );
reasCode = rs1.getString( "REAS_CODE" );
unitStd = rs1.getString( "UNIT__STD" );
convQtyStduom = rs1.getDouble( "CONV__QTY_STDUOM" );
dateAlloc = rs1.getTimestamp("DATE_ALLOC");
expDate = rs1.getTimestamp("EXP_DATE");
mfgDate = rs1.getTimestamp("MFG_DATE");
qtyOrd = rs1.getDouble( "QUANTITY" );
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
//updateSql = "UPDATE SORDALLOC SET QUANTITY = quantity - ?, QTY_ALLOC = QTY_ALLOC - ? " //LOC_CODE = ? ,LOT_SL = ? "
updateSql = "UPDATE SORDALLOC SET QTY_ALLOC = QTY_ALLOC - ? " //LOC_CODE = ? ,LOT_SL = ? "
+ " WHERE SALE_ORDER = ? AND LINE_NO = ? "
+ " AND ITEM_CODE = ? "
+ " AND LOC_CODE = ? "
+ " AND LOT_NO = ? "
+ " AND LOT_SL = ? "
+ " AND QTY_ALLOC > 0";
pstmtUpd = conn.prepareStatement(updateSql);
//pstmtUpd.setDouble(1, actualQty); //locCodeTo);
//pstmtUpd.setDouble(1, actualQty); //lotSlNew); //added by Kunal on 11/09/12 as per S Manoharan sir intruction
pstmtUpd.setDouble(1, pickQty); //lotSlNew); //added by Kunal on 11/09/12 as per S Manoharan sir intruction
pstmtUpd.setString(2, saleOrder);
pstmtUpd.setString(3, lineNoSord);
pstmtUpd.setString(4, itemCode);
pstmtUpd.setString(5, locCode);
pstmtUpd.setString(6, lotNo);
pstmtUpd.setString(7, lotSl);
updCnt = pstmtUpd.executeUpdate();
System.out.println("manohar 18/09/12 sordalloc updated updCnt [" + updCnt + "]");
//pstmtUpd.close();
//pstmtUpd = null;
if (expLev == null || expLev.trim().length() == 0)
{
System.out.println("Check1l["+expLev+"]");
expLev = dExpLev;
}
System.out.println("Finally the Exp level["+expLev+"]");
updateSql = "insert into sordalloc( SALE_ORDER, LINE_NO, EXP_LEV, ITEM_CODE__ORD, "
+ " ITEM_CODE, LOT_NO, LOT_SL, LOC_CODE, ITEM_REF, QUANTITY, UNIT, "
+ " QTY_ALLOC, DATE_ALLOC, STATUS, ITEM_GRADE, EXP_DATE, ALLOC_MODE, SITE_CODE, "
+ " CONV__QTY_STDUOM, UNIT__STD, QUANTITY__STDUOM, MFG_DATE, SITE_CODE__MFG, "
+ " REAS_CODE ) VALUES (?, ?, ?, ?, "
+ " ?, ?, ? , ?, ?, ?, ?, "
+ " ?,?, ?, ?, ?, ?, ?, "
+ " ?, ?, ? , ?, ?, ?) ";
pstmtUpd = conn.prepareStatement(updateSql);
pstmtUpd.setString(1, saleOrder);
pstmtUpd.setString(2, lineNoSord);
pstmtUpd.setString(3, expLev);
pstmtUpd.setString(4, itemCodeOrd);
pstmtUpd.setString(5, itemCode);
pstmtUpd.setString(6, lotNo);
pstmtUpd.setString(7, lotSlNew);
pstmtUpd.setString(8, locCodeTo);
pstmtUpd.setString(9, itemRef);
//pstmtUpd.setDouble(10, actualQty);
pstmtUpd.setDouble(10, qtyOrd);
pstmtUpd.setString(11, unit);
//pstmtUpd.setDouble(12, actualQty);
pstmtUpd.setDouble(12, pickQty);
pstmtUpd.setTimestamp(13, dateAlloc);
pstmtUpd.setString(14, status);
pstmtUpd.setString(15, itemGrade);
pstmtUpd.setTimestamp(16, expDate);
pstmtUpd.setString(17, allocMode);
pstmtUpd.setString(18, siteCode);
pstmtUpd.setDouble(19, convQtyStduom );
pstmtUpd.setString(20, unitStd);
pstmtUpd.setDouble(21, actualQty * convQtyStduom);
pstmtUpd.setTimestamp(22, mfgDate );
pstmtUpd.setString(23, siteCodeMfg);
pstmtUpd.setString(24, reasCode);
updCnt = pstmtUpd.executeUpdate();
System.out.println("manohar 18/09/12 sordalloc inserted updCnt [" + updCnt + "]");*/ //}
/*else
}
else
{ {
System.out.println("manohar 26/10/12 "); System.out.println("manohar 26/10/12 ");
...@@ -971,8 +896,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -971,8 +896,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pstmtUpd.setString(1, locCodeTo); pstmtUpd.setString(1, locCodeTo);
pstmtUpd.setString(2, lotSlNew); //added by Kunal on 11/09/12 as per S Manoharan sir intruction pstmtUpd.setString(2, lotSlNew); //added by Kunal on 11/09/12 as per S Manoharan sir intruction
//To Check whether th other saleorder exist with replenishmnet.start //To Check whether th other saleorder exist with replenishmnet.start
/*pstmtUpd.setString(3, saleOrder); pstmtUpd.setString(3, saleOrder);
pstmtUpd.setString(4, lineNoSord); */ pstmtUpd.setString(4, lineNoSord);
//To Check whether th other saleorder exist with replenishmnet.end //To Check whether th other saleorder exist with replenishmnet.end
pstmtUpd.setString(3, itemCode); pstmtUpd.setString(3, itemCode);
pstmtUpd.setString(4, locCode); pstmtUpd.setString(4, locCode);
...@@ -982,7 +907,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -982,7 +907,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
pstmtUpd.close(); pstmtUpd.close();
pstmtUpd = null; pstmtUpd = null;
} }*/
// end 18/09/12 manoharan as the lot_sl also changed and allocation may be for case pick as well as active pick // end 18/09/12 manoharan as the lot_sl also changed and allocation may be for case pick as well as active pick
// end 16/10/11 manoharan update sordalloc // end 16/10/11 manoharan update sordalloc
......
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