Commit 3bb6d93a authored by prahate's avatar prahate

EJB updated for distrcp_exsh.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97694 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 5f1d0f07
......@@ -77,7 +77,7 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
String sql = "",sql1="";
String siteCode = "";
String tranDate = "";
String lotNo = "";
String lotNo = "",updateStatus="";
String lotSl="";
String locCode = "";
String quantity = "",lrDateStr="";
......@@ -200,7 +200,7 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
pstmt.setString(1,tranIdRcp);
rs = pstmt.executeQuery();
if(rs.next())
{
{
cnt = rs.getInt(1);
if(cnt == 0)
{
......@@ -309,11 +309,60 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
else if(childNodeName.equalsIgnoreCase("line_no__rcp"))
{
lineNoRcp = genericUtility.getColumnValue("line_no__rcp", dom);
tranIdRcp = genericUtility.getColumnValue("tran_id__rcp", dom);
if(lineNoRcp == null || lineNoRcp.trim().length() == 0)
{
errCode = "VTPRCPD1";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}else
{
sql = "select count(1) from distord_rcpdet where tran_id = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranIdRcp);
pstmt.setString(2,lineNoRcp);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
if( cnt == 0 )
{
errCode = "VTRCPTLN2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{
java.util.HashSet<String> rcpData=new java.util.HashSet<String>();
for(int i =0; i< dom2.getElementsByTagName("Detail2").getLength();i++)
{
updateStatus = checkNull(getCurrentUpdateFlag(dom2.getElementsByTagName("Detail2").item(i)));
System.out.println("lineno ="+genericUtility.getColumnValueFromNode("line_no",dom2.getElementsByTagName("Detail2").item(i)));
tranIdRcp = checkNull(genericUtility.getColumnValueFromNode("tran_id__rcp",dom2.getElementsByTagName("Detail2").item(i)));
lineNoRcp = checkNull(genericUtility.getColumnValueFromNode("line_no__rcp",dom2.getElementsByTagName("Detail2").item(i)));
System.out.println("tranIdRcp = ["+tranIdRcp+"]"+"Update Status =[ "+updateStatus+"]"+"lineNoRcp["+lineNoRcp+"]");
if(!updateStatus.equalsIgnoreCase("D"))
{
if ( ! rcpData.contains(tranIdRcp.trim()+"@"+lineNoRcp.trim()))
{
rcpData.add(tranIdRcp.trim()+"@"+lineNoRcp.trim());
}
else
{ errCode = "VTDUPRCPLN";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
System.out.println("rcpData LIST["+rcpData+"]");
}
}
}
}
}
else if(childNodeName.equalsIgnoreCase("qty_actual"))
......@@ -761,19 +810,7 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
if (lineNo!=null || lineNo.trim().length() > 0 )
{
System.out.println("In IF>>>>>>>>>>>>>>");
//currentColumn.trim().equalsIgnoreCase("tran_id__rcp") || pankaj
// if(lineNo.trim().length() > 0)
//{
/*itemCode=findValue(conn, "item_code", "distord_rcpdet", "tran_id", tranIdRcp);
itemDescr = findValue(conn, "descr" ,"item", "item_code", itemCode);
locCode=findValue(conn, "loc_code", "distord_rcpdet", "tran_id", tranIdRcp);
locDescr=findValue(conn, "descr", "location", "loc_code", locCode);*/
sql = "select unit,quantity,lot_no,lot_sl,no_art,site_code__mfg,mfg_date,exp_date,gross_weight,tare_weight,net_weight,trans_mode,supp_code__mfg from distord_rcpdet where tran_id= ? and line_no= ? ";
sql = "select unit,quantity,lot_no,lot_sl,no_art,site_code__mfg,mfg_date,exp_date,gross_weight,tare_weight,net_weight,trans_mode,supp_code__mfg,item_code,loc_code from distord_rcpdet where tran_id= ? and line_no= ? ";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranIdRcp);
pstmt.setString(2,lineNo);
......@@ -793,45 +830,14 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
tareWeight= rs.getString("tare_weight");
netWeight= rs.getString("net_weight");
transMode= rs.getString("trans_mode");
suppCodeMfg= rs.getString("supp_code__mfg");
suppCodeMfg= rs.getString("supp_code__mfg");
itemCode=rs.getString("item_code");
locCode=rs.getString("loc_code");
itemCode=findValue(conn, "item_code", "distord_rcpdet", "tran_id", tranIdRcp);
itemDescr = findValue(conn, "descr" ,"item", "item_code", itemCode);
locCode=findValue(conn, "loc_code", "distord_rcpdet", "tran_id", tranIdRcp);
locDescr=findValue(conn, "descr", "location", "loc_code", locCode);
//System.out.println("mfgDate@@@@"+sdf.format(mfgDate));
//System.out.println("expDate@@@@"+sdf.format(expDate));
/*valueXmlString.append("<unit>").append("<![CDATA[" + unit + "]]>").append("</unit>");
//valueXmlString.append("<quantity>").append("<![CDATA[" + quantity + "]]>").append("</quantity>");
valueXmlString.append("<qty_rcp>").append("<![CDATA[" + quantity + "]]>").append("</qty_rcp>");
valueXmlString.append("<qty_actual>").append("<![CDATA[" + quantity + "]]>").append("</qty_actual>");
valueXmlString.append("<lot_no>").append("<![CDATA[" + lotNo + "]]>").append("</lot_no>");
valueXmlString.append("<lot_sl>").append("<![CDATA[" + lotSl + "]]>").append("</lot_sl>");
valueXmlString.append("<no_art>").append("<![CDATA[" + noArt + "]]>").append("</no_art>");
valueXmlString.append("<site_code__mfg>").append("<![CDATA[" + siteCodeMfg + "]]>").append("</site_code__mfg>");
if(mfgDate == null)
{
valueXmlString.append("<mfg_date>").append("<![CDATA[ ]]>").append("</mfg_date>");
}
else
{
valueXmlString.append("<mfg_date>").append("<![CDATA[" + sdf.format(mfgDate) + "]]>").append("</mfg_date>");
}
if(expDate == null)
{
valueXmlString.append("<exp_date>").append("<![CDATA[ ]]>").append("</exp_date>");
}
else
{
valueXmlString.append("<exp_date>").append("<![CDATA[" + sdf.format(expDate) + "]]>").append("</exp_date>");
}
valueXmlString.append("<gross_weight>").append("<![CDATA[" + grossWeight + "]]>").append("</gross_weight>");
valueXmlString.append("<tare_weight>").append("<![CDATA[" + tareWeight + "]]>").append("</tare_weight>");
valueXmlString.append("<net_weight>").append("<![CDATA[" + netWeight + "]]>").append("</net_weight>");
valueXmlString.append("<trans_mode>").append("<![CDATA[" + transMode + "]]>").append("</trans_mode>");
valueXmlString.append("<supp_code__mfg>").append("<![CDATA[" + suppCodeMfg + "]]>").append("</supp_code__mfg>");
*/
}
rs.close();
rs = null;
......@@ -878,12 +884,7 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
}/*else if(currentColumn.trim().equalsIgnoreCase("qty_actual"))
{
itemCode="TEST";
valueXmlString.append("<item_code>").append("<![CDATA[" + itemCode + "]]>").append("</item_code>");
}*/
}
valueXmlString.append("</Detail2>");
break;
}//end of switch-case
......@@ -1005,5 +1006,24 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
}
return input;
}//end of checkNull
private String getCurrentUpdateFlag(Node currDetail)
{
NodeList currDetailList = null;
String updateStatus = "",nodeName = "";
int currDetailListLength = 0;
currDetailList = currDetail.getChildNodes();
currDetailListLength = currDetailList.getLength();
for (int i=0;i< currDetailListLength;i++)
{
nodeName = currDetailList.item(i).getNodeName();
if (nodeName.equalsIgnoreCase("Attribute"))
{
updateStatus =currDetailList.item(i).getAttributes().getNamedItem("updateFlag").getNodeValue();
break;
}
}
return updateStatus;
}
}//class ends
\ No newline at end of file
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