Commit 545522c2 authored by ssalve's avatar ssalve

Sarita : Done changes on 05 NOV 2018

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@192697 ce508802-f39f-4f6c-b175-0d175dae99d5
parent bd2e1ed6
...@@ -9,6 +9,7 @@ import java.util.ArrayList; ...@@ -9,6 +9,7 @@ import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet; import java.util.HashSet;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Set; import java.util.Set;
...@@ -76,13 +77,16 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote ...@@ -76,13 +77,16 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null ; ResultSet rs = null ;
int currentFormNo = 0 , cnt = 0 , detlCnt = 0; int currentFormNo = 0 , cnt = 0 , detlCnt = 0, stkCnt = 0;
String updateFlag = "", detItemCode="", contentType = "", itemCodeDtl = "", quantity = "",lotSlExist=""; String updateFlag = "", detItemCode="", contentType = "", itemCodeDtl = "", quantity = "",lotSlExist="";
List<String> DetItemCodeList = new ArrayList<String>(); List<String> DetItemCodeList = new ArrayList<String>();
//Added by sarita on 18MARCH2018 //Added by sarita on 18MARCH2018
String invSrnoReqd = ""; String invSrnoReqd = "";
HashMap<Integer,String> lotSlVal = null; HashMap<Integer,String> lotSlVal = null;
String avalibleFrLocCode = "";//Added by sarita on 29 OCT 2018 String avalibleFrLocCode = "";//Added by sarita on 29 OCT 2018
//Added by sarita on 02 NOV 2018 [START]
ArrayList stockDataList = new ArrayList();
//Added by sarita on 02 NOV 2018 [END]
try try
{ {
conn = getConnection(); conn = getConnection();
...@@ -266,8 +270,8 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote ...@@ -266,8 +270,8 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
{ {
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
}*/ }*/
sql = "select count(*) as cnt , a.available " sql = "select a.available "
+ "from invstat a , Location b , Stock c " + "from invstat a , Location b , Stock c "
+ "where a.inv_stat = b.inv_stat " + "where a.inv_stat = b.inv_stat "
+ "AND b.loc_code = c.loc_code " + "AND b.loc_code = c.loc_code "
...@@ -275,7 +279,7 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote ...@@ -275,7 +279,7 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
+ "AND c.LOT_NO = ? " + "AND c.LOT_NO = ? "
+ "AND c.LOT_SL = ? " + "AND c.LOT_SL = ? "
+ "AND c.quantity > 0 " + "AND c.quantity > 0 "
+ "group by a.available"; + "group by a.available ,c.loc_code,c.item_code,c.lot_no,c.lot_sl,c.quantity";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, itemCode); pstmt.setString(1, itemCode);
pstmt.setString(2, lotNo); pstmt.setString(2, lotNo);
...@@ -283,10 +287,13 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote ...@@ -283,10 +287,13 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
while(rs.next()) while(rs.next())
{ {
cnt = rs.getInt("cnt"); stkCnt++;
avalibleFrLocCode = rs.getString("available"); avalibleFrLocCode = rs.getString("available");
} //Added by sarita to store data into ArrayList on 02 NOV 2018 [START]
System.out.println("[SRLContainerIC] Count is ["+cnt+"] && Available in invstat is ["+avalibleFrLocCode+"]"); stockDataList.add(stkCnt);
stockDataList.add(avalibleFrLocCode);
//Added by sarita to store data into ArrayList on 02 NOV 2018 [END]
}
if(rs != null) if(rs != null)
{ {
rs.close(); rs.close();
...@@ -297,7 +304,33 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote ...@@ -297,7 +304,33 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
if(cnt == 0) System.out.println("stockDataList ["+stockDataList+"] \t ["+stockDataList.size()+"]");
//Commented and Added by sarita on 02 NOV 2018 [START]
if(stockDataList.isEmpty() == true)
{
errCode = "VTNOSTK";//No records of stock for item_code,lot_no and lot_sl
errList.add(errCode);
errFields.add("lot_sl");
}
else if(stockDataList.size() > 2)
{
errCode = "INVRCDSTOC";//Multiple Records Found in stock for item_code,lot_no and lot_sl
errList.add(errCode);
errFields.add("lot_sl");
}
else
{
stkCnt = (Integer)stockDataList.get(0);
avalibleFrLocCode = (String)stockDataList.get(1);
System.out.println("avalibleFrLocCode ["+avalibleFrLocCode+"]");
if((stkCnt == 1) && ("N".equalsIgnoreCase(avalibleFrLocCode)))
{
errCode = "VTINVGIT";//Please check the GIT Location Code, it does not exists or not for internal use.
errList.add(errCode);
errFields.add("lot_sl");
}
}
/* if(cnt == 0)
{ {
errCode = "VTNOSTK";//No records of stock for item_code,lot_no and lot_sl errCode = "VTNOSTK";//No records of stock for item_code,lot_no and lot_sl
errList.add(errCode); errList.add(errCode);
...@@ -315,7 +348,8 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote ...@@ -315,7 +348,8 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
errCode = "VTINVGIT";//Please check the GIT Location Code, it does not exists or not for internal use. errCode = "VTINVGIT";//Please check the GIT Location Code, it does not exists or not for internal use.
errList.add(errCode); errList.add(errCode);
errFields.add("lot_sl"); errFields.add("lot_sl");
} }*/
//Commented and Added by sarita on 02 NOV 2018 [END]
} }
} }
} }
......
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