Commit 80aa9e1b authored by ajadhav's avatar ajadhav

changes in itm_defaultedit remove else logic for stkopt

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@183508 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 29fa6fd8
...@@ -1333,12 +1333,12 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj ...@@ -1333,12 +1333,12 @@ public class AdjReceiptIC extends ValidatorEJB implements AdjReceiptICRemote,Adj
valueXmlString.append("<lot_sl protect=\"1\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n"); valueXmlString.append("<lot_sl protect=\"1\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
} }
else /*else
{ {
valueXmlString.append("<lot_no protect=\"0\"><![CDATA[").append(" ").append("]]></lot_no>\r\n"); valueXmlString.append("<lot_no protect=\"0\"><![CDATA[").append(" ").append("]]></lot_no>\r\n");
valueXmlString.append("<lot_sl protect=\"0\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n"); valueXmlString.append("<lot_sl protect=\"0\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
} }*/
} }
////Add by Ajay on 10/04/2018/:END ////Add by Ajay on 10/04/2018/:END
else if (currentColumn.trim().equalsIgnoreCase("item_code")) else if (currentColumn.trim().equalsIgnoreCase("item_code"))
......
...@@ -26,6 +26,7 @@ import java.util.Date; ...@@ -26,6 +26,7 @@ import java.util.Date;
import javax.ejb.Stateless; import javax.ejb.Stateless;
//import javax.jcr.Value; //import javax.jcr.Value;
import org.w3c.dom.CDATASection;
//import org.apache.log4j.spi.ErrorCode; //import org.apache.log4j.spi.ErrorCode;
import org.w3c.dom.Document; import org.w3c.dom.Document;
import org.w3c.dom.Node; import org.w3c.dom.Node;
...@@ -6135,11 +6136,11 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -6135,11 +6136,11 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
valueXmlString.append("<lot_sl protect=\"1\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n"); valueXmlString.append("<lot_sl protect=\"1\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
} }
else /*else
{ {
valueXmlString.append("<lot_no protect=\"0\"><![CDATA[").append(" ").append("]]></lot_no>\r\n"); valueXmlString.append("<lot_no protect=\"0\"><![CDATA[").append(" ").append("]]></lot_no>\r\n");
valueXmlString.append("<lot_sl protect=\"0\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n"); valueXmlString.append("<lot_sl protect=\"0\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
} }*/
//Add by Ajay on 10/04/18:END //Add by Ajay on 10/04/18:END
sql="select case when po_rate_option is null then 'N' else po_rate_option end" + sql="select case when po_rate_option is null then 'N' else po_rate_option end" +
...@@ -6224,6 +6225,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -6224,6 +6225,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
mPordLine = checkNull(genericUtility.getColumnValue("line_no__ord", dom)); mPordLine = checkNull(genericUtility.getColumnValue("line_no__ord", dom));
lspurcorder= checkNull(genericUtility.getColumnValue("purc_order", dom)); lspurcorder= checkNull(genericUtility.getColumnValue("purc_order", dom));
lsporcpline =checkNull( genericUtility.getColumnValue("line_no", dom)); lsporcpline =checkNull( genericUtility.getColumnValue("line_no", dom));
lsitemcode=checkNull(genericUtility.getColumnValue( "item_code", dom ));
System.out.println("LINE NUMBER IN DOM"+mPordLine); System.out.println("LINE NUMBER IN DOM"+mPordLine);
mPordLine = " " + mPordLine; mPordLine = " " + mPordLine;
mPordLine = mPordLine.substring(mPordLine.length() - 3,mPordLine.length()); mPordLine = mPordLine.substring(mPordLine.length() - 3,mPordLine.length());
...@@ -6312,6 +6314,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -6312,6 +6314,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
valueXmlString.append("<analysis_descr >").append("<![CDATA[" + mdescr + "]]>").append("</analysis_descr>"); valueXmlString.append("<analysis_descr >").append("<![CDATA[" + mdescr + "]]>").append("</analysis_descr>");
} }
valueXmlString.append("<item_code >").append("<![CDATA[" + lsitemcode + "]]>").append("</item_code>"); valueXmlString.append("<item_code >").append("<![CDATA[" + lsitemcode + "]]>").append("</item_code>");
setNodeValue(dom,"item_code" , lsitemcode);
String lsautogeneratelotno="",lsNull="",lsLotNoManualSite="",lssitestring="" ,lsexit="",lsgenlotauto=""; String lsautogeneratelotno="",lsNull="",lsLotNoManualSite="",lssitestring="" ,lsexit="",lsgenlotauto="";
lssite = checkNull(genericUtility.getColumnValue("site_code", dom1)); lssite = checkNull(genericUtility.getColumnValue("site_code", dom1));
...@@ -7053,6 +7056,9 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -7053,6 +7056,9 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lssitecode=checkNull(genericUtility.getColumnValue( "site_code", dom )); lssitecode=checkNull(genericUtility.getColumnValue( "site_code", dom ));
lsstkopt=gfChkStkOpt(lsitemcode,lssitecode,conn); lsstkopt=gfChkStkOpt(lsitemcode,lssitecode,conn);
System.out.println("StkOpt is"+lsstkopt); System.out.println("StkOpt is"+lsstkopt);
if("0".equalsIgnoreCase(lsstkopt)) if("0".equalsIgnoreCase(lsstkopt))
{ {
valueXmlString.append("<effect_stock >").append("N").append("</effect_stock>"); valueXmlString.append("<effect_stock >").append("N").append("</effect_stock>");
...@@ -7111,8 +7117,10 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -7111,8 +7117,10 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
lcbudgetamt = lsbudgetamtanal -lsconsumedamtanal; lcbudgetamt = lsbudgetamtanal -lsconsumedamtanal;
System.out.println("TOtal AMount is"+lcbudgetamt); System.out.println("TOtal AMount is"+lcbudgetamt);
valueXmlString.append("<budget_amt >").append("<![CDATA[" + lcbudgetamt + "]]>").append("</budget_amt>"); valueXmlString.append("<budget_amt >").append("<![CDATA[" + lcbudgetamt + "]]>").append("</budget_amt>");
//Add by Ajay on 10/04/18:START //Add by Ajay on 10/04/18:START
sql = "select (case when stk_opt is null then '0' else stk_opt end) as stk_opt, item_ser from item where item_code = ? "; lsitemcode=checkNull(genericUtility.getColumnValue( "item_code", dom ));
System.out.println("item_code:"+lsitemcode);
sql = "select (case when stk_opt is null then '0' else stk_opt end) as stk_opt, item_ser from item where item_code = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, lsitemcode); pstmt.setString(1, lsitemcode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
...@@ -7139,10 +7147,12 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -7139,10 +7147,12 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
valueXmlString.append("<lot_sl protect=\"0\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n"); valueXmlString.append("<lot_sl protect=\"0\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
} }
//Add by Ajay on 10/04/18:END //Add by Ajay on 10/04/18:END
} }
else if(currentColumn.trim().equalsIgnoreCase("item_code")) else if(currentColumn.trim().equalsIgnoreCase("item_code"))
{ {
System.out.println(" inside ItemCode : " );
String mpordno="",maccr="",lsunitrate="",lcqty1="",invAcct="",lssuppcd="",lsitemserhdr="",mpordline="",lsshelflifetype=""; String mpordno="",maccr="",lsunitrate="",lcqty1="",invAcct="",lssuppcd="",lsitemserhdr="",mpordline="",lsshelflifetype="";
String acctDetrType="",lssuppcode=""; String acctDetrType="",lssuppcode="";
String acctcodedr="",cctrcodedr="",acctcodecr="",cctrcodecr=""; String acctcodedr="",cctrcodedr="",acctcodecr="",cctrcodecr="";
...@@ -7152,6 +7162,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -7152,6 +7162,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
double inputQty=0; double inputQty=0;
mcode = checkNull(genericUtility.getColumnValue( "item_code", dom )); mcode = checkNull(genericUtility.getColumnValue( "item_code", dom ));
System.out.println("ItemCode : " +mcode);
mpordno = checkNull(genericUtility.getColumnValue( "purc_order", dom )); mpordno = checkNull(genericUtility.getColumnValue( "purc_order", dom ));
...@@ -7186,37 +7197,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec ...@@ -7186,37 +7197,7 @@ public class PoReceiptIc extends ValidatorEJB implements PoReceiptIcLocal,PoRec
rs = null; rs = null;
pstmt = null; pstmt = null;
//Changes Add by Ajay Jadhav on 03/04/2018:START
sql = "select (case when stk_opt is null then '0' else stk_opt end) as stk_opt, item_ser from item where item_code = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, mcode);
rs = pstmt.executeQuery();
System.out.println("executesql:"+mcode);
if (rs.next())
{
stkOpt = checkNull(rs.getString("stk_opt")).trim();
lsitemser = rs.getString("item_ser");
System.out.println("STKOPT["+stkOpt+"]");
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if("1".equalsIgnoreCase(stkOpt))
{
valueXmlString.append("<lot_no protect=\"1\"><![CDATA[").append(" ").append("]]></lot_no>\r\n");
valueXmlString.append("<lot_sl protect=\"1\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
}
else
{
valueXmlString.append("<lot_no protect=\"0\"><![CDATA[").append(" ").append("]]></lot_no>\r\n");
valueXmlString.append("<lot_sl protect=\"0\" ><![CDATA[").append(" ").append("]]></lot_sl>\r\n");
}
//Changes Add by Ajay Jadhav on 03/04/2018:END
if(mpordno == null && mpordno.trim().length() >0) if(mpordno == null && mpordno.trim().length() >0)
{ {
valueXmlString.append("<item_descr >").append("<![CDATA[" + mdescr + "]]>").append("</item_descr>"); valueXmlString.append("<item_descr >").append("<![CDATA[" + mdescr + "]]>").append("</item_descr>");
...@@ -10442,5 +10423,24 @@ return errCode; ...@@ -10442,5 +10423,24 @@ return errCode;
System.out.println("retStr :"+retStr); System.out.println("retStr :"+retStr);
return retStr; return retStr;
} }
//Add by Ajay Jadhav on 12/04/2018:START
private static void setNodeValue( Document dom, String nodeName, String nodeVal ) throws Exception
{
Node tempNode = dom.getElementsByTagName( nodeName ).item(0);
if( tempNode != null )
{
if( tempNode.getFirstChild() == null )
{
CDATASection cDataSection = dom.createCDATASection( nodeVal );
tempNode.appendChild( cDataSection );
}
else
{
tempNode.getFirstChild().setNodeValue(nodeVal);
}
}
tempNode = null;
}
//Add by Ajay Jadhav on 12/04/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