Commit 82bf70a5 authored by ppatro's avatar ppatro

Repl con and Pick conf change for spliting and error generation


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92303 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6da10942
......@@ -66,7 +66,7 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
String locCodeTo = "";
String pickOrder = "";
String ptcn = "";
String dExpLev = "";
String sql = "";
String updateSql = "";
......@@ -141,6 +141,12 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
double shipperSize = 0, itemGrossWeight = 0, caseGrossWeight = 0, itemNetWeight = 0, caseNetWeight = 0;
// end 10/10/12 manoharan
// 18/09/12 manoharan
String expLev = "", itemCodeOrd = "", itemRef = "", status = "", itemGrade = "", allocMode = "";
String reasCode = "",unitStd = "";
java.sql.Timestamp dateAlloc = null;
double pickQty = 0, sordAllocQty = 0,qtyOrd = 0.0;
//double convQtyStduom = 0;
try
{
......@@ -250,7 +256,7 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
sql = "SELECT R.LINE_NO LINE_NO, R.ITEM_CODE ITEM_CODE, R.SITE_CODE SITE_CODE, R.LOC_CODE LOC_CODE, "
+ " R.LOT_NO LOT_NO, R.LOT_SL LOT_SL, R.QUANTITY QUANTITY, R.NO_ART NO_ART, "
+ " R.LOC_CODE__TO LOC_CODE__TO, O.SALE_ORDER SALE_ORDER, O.LINE_NO__SORD LINE_NO__SORD, O.PICK_ORDER,H.PICK_TYPE,R.LINE_NO__ORD "
+ " R.LOC_CODE__TO LOC_CODE__TO, O.SALE_ORDER SALE_ORDER, O.LINE_NO__SORD LINE_NO__SORD, O.PICK_ORDER,H.PICK_TYPE,R.LINE_NO__ORD,O.EXP_LEV EXP_LEV "
+ " FROM PICK_ISS_DET R, PICK_ORD_DET O ,PICK_ORD_HDR H"//CHANGES DONE BY CHITRANJAN PICK_ORD_HDR H TO GET PICK TYPE
+ " WHERE R.TRAN_ID = ? "
+ " AND R.PICK_ORDER = O.PICK_ORDER "
......@@ -279,7 +285,8 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
pickType = rs.getString( "PICK_TYPE" );
lineNoOrd = rs.getInt( "LINE_NO__ORD" );
System.out.println("pick type from hdr->> ["+pickType+"]");
dExpLev = checkNullAndTrim(rs.getString( "EXP_LEV" ));
System.out.println("dExpLev->> ["+dExpLev+"]");
// 10/10/12 manoharan weight to be set properly
itmVolumeMap.clear();
itmVolumeMap = getItemVoumeMap(itemCode,lotNo,conn);
......@@ -452,9 +459,170 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
}
//}
//Changed By 07/12/12 Pragyan To check the sordalloc allocated quantity > quantity then insert new record deducte quantity from old location.start
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,QTY_ALLOC 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" );
sordAllocQty = rs1.getDouble( "QTY_ALLOC" );
}
else
{
retString = itmDBAccess.getErrorString("","RECNOTSORA","");
return retString;
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
if(sordAllocQty > quantity)
{
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, quantity);
pstmtUpd.setString(2, saleOrder);
pstmtUpd.setString(3, lineNoSord);
pstmtUpd.setString(4, itemCode);
pstmtUpd.setString(5, locCode);
pstmtUpd.setString(6, lotNo);
pstmtUpd.setString(7, lotSl);
strAllocate = null;
updCnt = pstmtUpd.executeUpdate();
System.out.println("manohar 18/09/12 sordalloc updated updCnt [" + updCnt + "]");
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, lotSl);
//pstmtUpd.setString(8, locCodeTo);
if(("A".equalsIgnoreCase(pickType)) || ("M".equalsIgnoreCase(pickType)))
{
pstmtUpd.setString(8, stagingLoc);
}
else
{
pstmtUpd.setString(8, locCodeTo);
}
pstmtUpd.setString(9, itemRef);
pstmtUpd.setDouble(10, qtyOrd);
pstmtUpd.setString(11, unit);
pstmtUpd.setDouble(12, quantity);
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, quantity * 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
{
updateSql = "UPDATE SORDALLOC SET LOC_CODE = ? "
+ " 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);
if(("A".equalsIgnoreCase(pickType)) || ("M".equalsIgnoreCase(pickType)))
{
pstmtUpd.setString(1, stagingLoc);
}
else
{
pstmtUpd.setString(1, locCodeTo);
}
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 Update updCnt [" + updCnt + "]");
}
/* strAllocate = null;
// end 16/10/11 manoharan allocation stock for new location
// 16/10/11 manoharan update sordalloc
updateSql = "UPDATE SORDALLOC SET LOC_CODE = ? "
......@@ -482,7 +650,7 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
updCnt = pstmtUpd.executeUpdate();
// end 16/10/11 manoharan update sordalloc
*/ //Changed on 07/12/12 By Pragyan To check the sordalloc allocated quantity > quantity then insert new record deducte quantity from old location.end
String updatePickOrdSql = "UPDATE PICK_ORD_DET SET STATUS = ? "
+ " WHERE PICK_ORDER = ? AND LINE_NO = ? ";
......@@ -913,5 +1081,16 @@ public class PickIssConf extends ActionHandlerEJB implements PickIssConfLocal, P
return dataVolumeMap;
}
private String checkNullAndTrim( String inputVal )
{
if ( inputVal == null )
{
inputVal = "";
}
else
{
inputVal = inputVal.trim();
}
return inputVal;
}
}
......@@ -708,6 +708,11 @@ public class ReplIssConf extends ActionHandlerEJB implements ReplIssConfRemote,
mfgDate = rs1.getTimestamp("MFG_DATE");
qtyOrd = rs1.getDouble( "QUANTITY" );
}
else
{
retString = itmDBAccess.getErrorString("","RECNOTSORA","");
return retString;
}
rs1.close();
rs1 = null;
pstmt1.close();
......
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