Commit 8b78f7ce authored by ssalve's avatar ssalve

Sarita: done changes to add validation for item_code on 14APRIL2018

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@183592 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4a5b80b4
...@@ -80,6 +80,7 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote ...@@ -80,6 +80,7 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
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
invSrnoReqd = "";
HashMap<Integer,String> lotSlVal = null; HashMap<Integer,String> lotSlVal = null;
try try
{ {
...@@ -133,31 +134,46 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote ...@@ -133,31 +134,46 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
} }
else if(itemCode != null && itemCode.trim().length() > 0) else if(itemCode != null && itemCode.trim().length() > 0)
{ {
sql = "select count(*) as cnt from item where item_code=?"; cnt = 0;
//changes by sarita on 14APR2018 [start] - to validate item_code as inv_srno_reqd is 'Y' or 'N'
//sql = "select count(*) as cnt from item where item_code=?";
sql = "select case when inv_srno_reqd is null then 'N' else inv_srno_reqd end as inv_srno_reqd , 1 as cnt from item where item_code = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode); pstmt.setString(1,itemCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
cnt = rs.getInt("cnt"); cnt = rs.getInt("cnt");
System.out.println("Cnt..item_code :"+cnt); //Added by sarita on 14APR2018 to get inv_srno_reqd val [start]
} invSrnoReqd = rs.getString("inv_srno_reqd");
if(pstmt != null) //System.out.println("Cnt..item_code :"+cnt);
{ System.out.println("Cnt..item_code : & inv_srno_reqd.. item code is ("+cnt+" , "+invSrnoReqd+")");
pstmt.close(); //Added by sarita on 14APR2018 to get inv_srno_reqd val [end]
pstmt = null;
} }
if(rs != null) if(rs != null)
{ {
rs.close(); rs.close();
rs = null; rs = null;
} }
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(cnt == 0) if(cnt == 0)
{ {
errCode = "IVITMCDASN"; errCode = "IVITMCDASN";
errList.add(errCode); errList.add(errCode);
errFields.add("item_code"); errFields.add("item_code");
} }
//Added by sarita on 14APR2018[start] - to validate item_code as inv_srno_reqd is 'Y' or 'N'
if("Y".equalsIgnoreCase(invSrnoReqd) == false)
{
errCode = "IVITMSRRQD";
errList.add(errCode);
errFields.add("item_code");
}
//Added by sarita on 14APR2018[end] - to validate item_code as inv_srno_reqd is 'Y' or 'N'
} }
//} //}
}//End of Validation for item_code }//End of Validation for item_code
......
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