Commit a9fa37a3 authored by ssalve's avatar ssalve

Sarita: Done changes on 17MARCH2018

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@182221 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 930a0254
......@@ -104,48 +104,13 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
{
String serialDate = checkNullAndTrim(genericUtility.getColumnValue("serial_date",dom)).trim();
System.out.println("Date is :::["+serialDate+"]");
/*if(serialDate == null || serialDate.trim().length() == 0)
if(serialDate == null || serialDate.trim().length() == 0)
{
errCode = "DSSRDATE";
errList.add(errCode);
errFields.add("serial_date");
}*/
}
if("no_art".equalsIgnoreCase(childNodeName))
{
noArt = checkNullAndTrim(genericUtility.getColumnValue("no_art",dom)).trim();
lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl",dom)).trim();
System.out.println("[No. of Articles ["+noArt+"]] \t [lotSl ["+lotSl+"]]");
if(noArt == null || noArt.length() == 0)
{
errCode = "VMNOARTNUL";
errList.add(errCode);
errFields.add("no_art");
}
else if(noArt != null && noArt.length() > 0)
{
try
{
int noArtValue = Integer.parseInt(noArt);
if(noArtValue == 0 || noArtValue < 0)
{
errCode = "VMNOART";
errList.add(errCode);
errFields.add("no_art");
}
}
catch(NumberFormatException ex)
{
System.out.println("Getting NumberFormatException in [SRLContainerIC] ::"+ex);
errCode = "SRWIZQTY1";
errList.add(errCode);
errFields.add("no_art");
}
}
}//End of Validation for no_art
else if("item_code".equalsIgnoreCase(childNodeName))
{
itemCode = checkNullAndTrim(genericUtility.getColumnValue("item_code",dom)).trim();
......@@ -154,7 +119,7 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
//if("0".equalsIgnoreCase(inventoryType))
//{
if(itemCode == null || itemCode.length() == 0)
if(itemCode == null || itemCode.trim().length() == 0)
{
errCode = "VTITEMBLK";
errList.add(errCode);
......@@ -198,7 +163,7 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
System.out.println("[Lot Number ["+lotNo+"]]");
//if("2".equalsIgnoreCase(inventoryType))
//{
if(lotNo == null || lotNo.length() == 0)
if(lotNo == null || lotNo.trim().length() == 0)
{
errCode = "VMLOTNONUL";
errList.add(errCode);
......@@ -239,7 +204,7 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl",dom)).trim();
System.out.println("[Lot SL ["+lotSl+"]]");
if(lotSl == null || lotSl.trim().length() == 0)
if(lotSl == null || lotSl.trim().trim().length() == 0)
{
errCode = "VTLTSLBLNK";
errList.add(errCode);
......@@ -311,6 +276,7 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
contentType = checkNullAndTrim(genericUtility.getColumnValue("content_type", dom));
itemCode = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom1));
itemCodeDtl = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom));
System.out.println("Inventory Type ====> ["+inverntoryType+"] \t Item Code Header=====> ["+itemCode+"]\t Content Type ======>["+contentType+"]\t Item Code Detail ["+itemCodeDtl+"] ");
//if("0".equalsIgnoreCase(contentType) && "0".equalsIgnoreCase(contentType))
......@@ -350,7 +316,7 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
}
}
//}
else if("0".equalsIgnoreCase(inverntoryType))
if("0".equalsIgnoreCase(inverntoryType))
{
int detlCnt1 = getNumOfNonDelDetail(dom2,2); System.out.println("Detal Count in Itemchange ::::["+detlCnt1+"]");
if(detlCnt1 >= 1)
......@@ -615,20 +581,24 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
StringBuffer valueXmlString = new StringBuffer();
Connection conn = null;
PreparedStatement pstmt = null;
PreparedStatement pstmt1 = null;
ResultSet rs = null ;
ResultSet rs1 = null ;
int currentFormNo=0,ctr = 0;
String loginSite = "" , childNodeName = "" , sql = "",item_descr="";
String loginSite = "" , childNodeName = "" , sql = "",item_descr="", site_descr="";
NodeList parentNodeList = null;
Node parentNode = null;
Node childNode = null;
NodeList childNodeList = null;
int childNodeListLength = 0 , cnt = 0;
SimpleDateFormat sdf;
double qty = 0;
String serialNo = "", serialDate = "", description = "", numOfArticle="", inverntoryType="", contentLevel="",itemCode="",lotNo="",lotSl="",createSource="",srlNoSource="";
try
{
conn = getConnection();
sdf = new SimpleDateFormat(genericUtility.getApplDateFormat());
loginSite = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode");System.out.println(" loginSite::"+loginSite);
if(objContext != null && objContext.trim().length()>0)
{
currentFormNo = Integer.parseInt(objContext);
......@@ -653,23 +623,22 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
if("itm_default".equalsIgnoreCase(currentColumn.trim()))
{
valueXmlString.append("<serial_date>").append("<![CDATA[" + sdf.format(new Date())+ "]]>").append("</serial_date>");
}
itemCode = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom1));
lotNo = checkNullAndTrim(genericUtility.getColumnValue("lot_no",dom1)).trim();
lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl",dom1)).trim();
else if("itm_defaultedit".equalsIgnoreCase(currentColumn.trim()))
{
serialDate = checkNullAndTrim(genericUtility.getColumnValue("serial_date", dom));
valueXmlString.append("<serial_date>").append("<![CDATA[" + serialDate + "]]>").append("</serial_date>");
valueXmlString.append("<serial_date>").append("<![CDATA[" + sdf.format(new Date())+ "]]>").append("</serial_date>");
valueXmlString.append("<site_code>").append("<![CDATA[" +loginSite+ "]]>").append("</site_code>");
valueXmlString.append("<no_art protect = \"1\">").append("<![CDATA[]]>").append("</no_art>");
itemCode = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom));
sql = "select descr from item where item_code=?";
sql = "select descr from site where site_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
pstmt.setString(1,loginSite);
rs = pstmt.executeQuery();
if(rs.next())
{
item_descr = rs.getString("descr");
System.out.println("Item Description is [Header]===========>"+item_descr);
site_descr = rs.getString("descr");
System.out.println("Item Description is ===========>"+site_descr);
}
if(pstmt != null)
{
......@@ -681,7 +650,13 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
rs.close();
rs = null;
}
valueXmlString.append("<item_descr><![CDATA[" ).append(item_descr).append( "]]></item_descr>\r\n" );
valueXmlString.append("<site_descr><![CDATA[" ).append(site_descr).append( "]]></site_descr>\r\n" );
}
else if("itm_defaultedit".equalsIgnoreCase(currentColumn.trim()))
{
serialDate = checkNullAndTrim(genericUtility.getColumnValue("serial_date", dom));
valueXmlString.append("<serial_date>").append("<![CDATA[" + serialDate + "]]>").append("</serial_date>");
}
else if("item_code".equalsIgnoreCase(currentColumn.trim()))
{
......@@ -709,6 +684,45 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
}
valueXmlString.append("<item_descr><![CDATA[" ).append(item_descr).append( "]]></item_descr>\r\n" );
}
else if("lot_sl".equalsIgnoreCase(currentColumn.trim()))
{
itemCode = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom)).trim();
lotNo = checkNullAndTrim(genericUtility.getColumnValue("lot_no",dom)).trim();
lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl",dom)).trim();
System.out.println("itemCode ["+itemCode+"] , lotNo ["+lotNo+"] , lotSl["+lotSl+"]");
if(lotSl != null && lotSl.trim().length() > 0)
{
if(lotNo != null && lotNo.trim().length() >0)
{
if(itemCode != null && itemCode.trim().length() > 0)
{
sql = "select quantity from stock where item_code=? and lot_no=? and lot_sl=? and quantity > 0";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, itemCode);
pstmt1.setString(2, lotNo);
pstmt1.setString(3, lotSl);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
qty = rs1.getDouble("quantity");
System.out.println("Quantity of Stock for item_code , lotNo and lotSL is ["+qty+"]");
}
if(pstmt1 != null)
{
pstmt1.close();
pstmt1 = null;
}
if(rs1 != null)
{
rs1.close();
rs1 = null;
}
valueXmlString.append("<no_art protect = \"1\">").append("<![CDATA[" + qty + "]]>").append("</no_art>");
}
}
}
}
}
valueXmlString.append("</Detail1>\r\n");
break;
......@@ -751,32 +765,18 @@ public class SRLContainerIC extends ValidatorEJB implements SRLContainerICRemote
}
valueXmlString.append("<item_descr><![CDATA[" ).append(item_descr).append( "]]></item_descr>\r\n" );
}
if("itm_defaultedit".equalsIgnoreCase(currentColumn.trim()))
{
itemCode = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom)); System.out.println("Item Code is Detail=== ["+itemCode+"]");
sql = "select descr from item where item_code=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,itemCode);
rs = pstmt.executeQuery();
if(rs.next())
{
item_descr = rs.getString("descr");
System.out.println("Item Description is [Detail2]===========>"+item_descr);
}
if(pstmt != null)
{
pstmt.close();
pstmt = null;
}
if(rs != null)
inverntoryType = checkNullAndTrim(genericUtility.getColumnValue("inventory_type", dom1));
System.out.println("Inventory Type in Header is ["+inverntoryType+"]");//1 is for multiple item
if(!("1".equalsIgnoreCase(inverntoryType)))
{
rs.close();
rs = null;
itemCode = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom1)).trim();
lotNo = checkNullAndTrim(genericUtility.getColumnValue("lot_no",dom1)).trim();
//lotSl = checkNullAndTrim(genericUtility.getColumnValue("lot_sl",dom1)).trim();
valueXmlString.append("<lot_no protect = \"1\"><![CDATA[" ).append(lotNo).append( "]]></lot_no>\r\n" );
valueXmlString.append("<item_code protect = \"1\"><![CDATA[" ).append(itemCode).append( "]]></item_code>\r\n" );
}
valueXmlString.append("<item_descr><![CDATA[" ).append(item_descr).append( "]]></item_descr>\r\n" );
}
else if("item_code".equalsIgnoreCase(currentColumn.trim()))
{
itemCode = checkNullAndTrim(genericUtility.getColumnValue("item_code", dom));
......
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