Commit 8123a36d authored by ppatro's avatar ppatro

missing sqls and replenishment pos and confirm


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92099 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6034de51
...@@ -116,8 +116,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -116,8 +116,8 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
// Connection connectionObject = null; // Connection connectionObject = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
PreparedStatement pstmtStock = null; PreparedStatement pstmtStock = null;
PreparedStatement pstmtUpd = null, pstmt1 = null; PreparedStatement pstmtUpd = null, pstmt1 = null,pstmtPick = null;
ResultSet rsStock = null; ResultSet rsStock = null,rsPick = null;
ResultSet rs = null, rs1 = null; ResultSet rs = null, rs1 = null;
boolean isError = false; boolean isError = false;
...@@ -622,7 +622,169 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -622,7 +622,169 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
if ("A".equals(orderType) || "E".equals(orderType) || "Q".equals(orderType)) if ("A".equals(orderType) || "E".equals(orderType) || "Q".equals(orderType))
{ {
sql = " SELECT EXP_LEV, ITEM_CODE__ORD, " sql = " SELECT * FROM PICK_ORD_DET "
//+ " WHERE SALE_ORDER = ? AND LINE_NO__SORD = ? "
+ " WHERE ITEM_CODE = ? "
+ " AND LOC_CODE = ? "
+ " AND LOT_NO = ? "
+ " AND LOT_SL = ? "
+ " AND REPL_ORDER = ? "
+ " AND LINE_NO__REPL = ? ";
pstmtPick = conn.prepareStatement(sql);
//pstmtPick.setString(1, saleOrder);
//pstmtPick.setString(2, lineNoSord);
pstmtPick.setString(1, itemCode);
pstmtPick.setString(2, locCodeTo);
pstmtPick.setString(3, lotNo);
pstmtPick.setString(4, lotSl);
pstmtPick.setString(5, replOrder);
pstmtPick.setInt(6, replOrderLineNo);
rsPick = pstmtPick.executeQuery();
while(rsPick.next())
{
pickQty = rsPick.getDouble("QUANTITY");
saleOrder = rsPick.getString("SALE_ORDER");
lineNoSord = rsPick.getString("LINE_NO__SORD");
lineNoSord = " " + lineNoSord;
lineNoSord = lineNoSord.substring(lineNoSord.length()-3);
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 + "]");
}
rsPick.close();
rsPick = null;
pstmtPick.close();
pstmtPick = null;
/*sql = " SELECT EXP_LEV, ITEM_CODE__ORD, "
+ " ITEM_REF, UNIT, DATE_ALLOC, STATUS, ITEM_GRADE, EXP_DATE, ALLOC_MODE, SITE_CODE, " + " 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 " + " CONV__QTY_STDUOM, UNIT__STD, MFG_DATE, SITE_CODE__MFG, REAS_CODE,QUANTITY FROM SORDALLOC "
+ " WHERE SALE_ORDER = ? AND LINE_NO = ? " + " WHERE SALE_ORDER = ? AND LINE_NO = ? "
...@@ -675,34 +837,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -675,34 +837,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
pstmt1 = null; pstmt1 = null;
sql = " SELECT SUM(QUANTITY) PICKQTY FROM PICK_ORD_DET "
+ " WHERE SALE_ORDER = ? AND LINE_NO__SORD = ? "
+ " AND ITEM_CODE = ? "
+ " AND LOC_CODE = ? "
+ " AND LOT_NO = ? "
+ " AND LOT_SL = ? "
+ " AND REPL_ORDER = ? "
+ " AND LINE_NO__REPL = ? ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, saleOrder);
pstmt1.setString(2, lineNoSord);
pstmt1.setString(3, itemCode);
pstmt1.setString(4, locCodeTo);
pstmt1.setString(5, lotNo);
pstmt1.setString(6, lotSl);
pstmt1.setString(7, replOrder);
pstmt1.setInt(8, replOrderLineNo);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
pickQty = rs1.getDouble(1);
}
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 QUANTITY = quantity - ?, QTY_ALLOC = QTY_ALLOC - ? " //LOC_CODE = ? ,LOT_SL = ? "
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 = ? "
...@@ -775,7 +910,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote, ...@@ -775,7 +910,7 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
updCnt = pstmtUpd.executeUpdate(); updCnt = pstmtUpd.executeUpdate();
System.out.println("manohar 18/09/12 sordalloc inserted updCnt [" + updCnt + "]"); System.out.println("manohar 18/09/12 sordalloc inserted updCnt [" + updCnt + "]");*/
} }
else else
......
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