Commit 6bff5252 authored by ssalve's avatar ssalve

Sarita : Done changes to check avalable from invstat table for location and...

Sarita : Done changes to check avalable from invstat table for location and provide validation for GIT Location on 30 OCT 2018

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@192467 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 92fe6c12
......@@ -82,6 +82,7 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
//Added by sarita on 18MARCH2018
String invSrnoReqd = "";
HashMap<Integer,String> lotSlVal = null;
String avalibleFrLocCode = "";//Added by sarita on 29 OCT 2018
try
{
conn = getConnection();
......@@ -240,10 +241,11 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
else if(lotSl != null && lotSl.length() > 0)
{
if(lotNo != null && lotNo.trim().length() >0)
{
if(itemCode != null && itemCode.trim().length() > 0)
{
sql = "select count(*) as cnt from stock where item_code=? and lot_no=? and lot_sl=? and quantity > 0";
{
if(itemCode != null && itemCode.trim().length() > 0)
{
//Commented & Added by sarita to perform validation on location as location should not be GIT Location on 29 OCT 2018 [START]
/*sql = "select count(*) as cnt from stock where item_code=? and lot_no=? and lot_sl=? and quantity > 0";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, lotNo);
......@@ -254,7 +256,7 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
cnt = rs.getInt("cnt");
System.out.println("Count of Stock for item_code , lotNo and lotSL is ["+cnt+"]");
}
if(rs != null)
{
rs.close();
......@@ -264,22 +266,60 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
{
pstmt.close();
pstmt = null;
}
}
}
}
if(cnt == 0)
{
errCode = "VTNOSTK";//No records of stock for item_code,lot_no and lot_sl
errList.add(errCode);
errFields.add("lot_sl");
}
else if(cnt > 1)
{
errCode = "INVRCDSTOC";//Multiple Records Found in stock for item_code,lot_no and lot_sl
errList.add(errCode);
errFields.add("lot_sl");
}
}*/
sql = "select count(*) as cnt , a.available "
+ "from invstat a , Location b , Stock c "
+ "where a.inv_stat = b.inv_stat "
+ "AND b.loc_code = c.loc_code "
+ "AND c.ITEM_CODE = ? "
+ "AND c.LOT_NO = ? "
+ "AND c.LOT_SL = ? "
+ "AND c.quantity > 0 "
+ "group by a.available";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode);
pstmt.setString(2, lotNo);
pstmt.setString(3, lotSl);
rs = pstmt.executeQuery();
while(rs.next())
{
cnt = rs.getInt("cnt");
avalibleFrLocCode = rs.getString("available");
}
System.out.println("[SRLContainerIC] Count is ["+cnt+"] && Available in invstat is ["+avalibleFrLocCode+"]");
if(rs != null)
{
rs.close();
rs = null;
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0)
{
errCode = "VTNOSTK";//No records of stock for item_code,lot_no and lot_sl
errList.add(errCode);
errFields.add("lot_sl");
}
else if(cnt > 1)
{
errCode = "INVRCDSTOC";//Multiple Records Found in stock for item_code,lot_no and lot_sl
errList.add(errCode);
errFields.add("lot_sl");
}
else if("N".equalsIgnoreCase(avalibleFrLocCode))
{
System.out.println("COUNT if available is N ["+cnt+"]");
errCode = "VTINVGIT";//Please check the GIT Location Code, it does not exists or not for internal use.
errList.add(errCode);
errFields.add("lot_sl");
}
}
}
}
//Commented and Added by sarita to perform validation on location as location should not be GIT Location on 29 OCT 2018 [END]
/* else
{
String serialNo = checkNullAndTrim(genericUtility.getColumnValue("serial_no",dom)).trim();
......
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