Commit fa3c4b0c authored by prahate's avatar prahate

EJB updated for Request Id [D14JSUN004].


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98121 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b52ef4b2
...@@ -74,18 +74,15 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -74,18 +74,15 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
String userId = ""; String userId = "";
String sql = "",sql1=""; String sql = "",sql1="";
String siteCode = ""; String siteCode = "";
String tranDate = ""; String updateStatus="";
String lotNo = "",updateStatus=""; String tranCode="",remarks="";
String lotSl=""; String discrIdDate="",discrResDate="";
String locCode = "",tranCode=""; String keyFlag="",fldValue="";
String quantity = "",lrDateStr=""; String tranIdRcp="",tranId="",reasCode="",status="";
String keyFlag="",confirmed="",fldValue="";
String tranIdRcp="",tranId="",qtyactual="",reasCode="",status="";
String tranIdRcpHdr = "",lineNoRcp="",remarks2=""; String tranIdRcpHdr = "",lineNoRcp="",remarks2="";
int ctr=0; int ctr=0;
int cnt = 0; int cnt = 0;
int cnt1 = 0;
double qtyRcp=0.0,qtyActual=0.0; double qtyRcp=0.0,qtyActual=0.0;
int currentFormNo = 0; int currentFormNo = 0;
int childNodeListLength; int childNodeListLength;
...@@ -95,7 +92,7 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -95,7 +92,7 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null,pstmt1=null; PreparedStatement pstmt = null,pstmt1=null;
ResultSet rs = null,rs1=null; ResultSet rs = null,rs1=null;
String siteCodeShip=""; //String siteCodeShip="";
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>"); StringBuffer errStringXml = new StringBuffer("<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
...@@ -252,9 +249,6 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -252,9 +249,6 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
pstmt = null; pstmt = null;
} }
} }
} }
break; break;
...@@ -321,8 +315,7 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -321,8 +315,7 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
errCode = "VTLINEBLK"; errCode = "VTLINEBLK";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
}else }else{
{
sql = "select count(1) from distord_rcpdet where tran_id = ? and line_no = ? "; sql = "select count(1) from distord_rcpdet where tran_id = ? and line_no = ? ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranIdRcp); pstmt.setString(1,tranIdRcp);
...@@ -339,7 +332,7 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -339,7 +332,7 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
if( cnt == 0 ) if( cnt == 0 )
{ {
errCode = "VTRCPTLN2"; errCode = "VTVOULN1";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
...@@ -388,7 +381,6 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -388,7 +381,6 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
reasCode = genericUtility.getColumnValue("reas_code", dom); reasCode = genericUtility.getColumnValue("reas_code", dom);
qtyRcp=Double.valueOf(genericUtility.getColumnValue("qty_rcp", dom)==null?"0":genericUtility.getColumnValue("qty_rcp", dom)); qtyRcp=Double.valueOf(genericUtility.getColumnValue("qty_rcp", dom)==null?"0":genericUtility.getColumnValue("qty_rcp", dom));
qtyActual = Double.valueOf(genericUtility.getColumnValue("qty_actual", dom)==null?"0":genericUtility.getColumnValue("qty_actual", dom)); qtyActual = Double.valueOf(genericUtility.getColumnValue("qty_actual", dom)==null?"0":genericUtility.getColumnValue("qty_actual", dom));
System.out.println("Reason code :"+reasCode); System.out.println("Reason code :"+reasCode);
if(((qtyRcp-qtyActual) > 0 || (qtyRcp-qtyActual) < 0) && (reasCode == null || reasCode.trim().length() == 0)) if(((qtyRcp-qtyActual) > 0 || (qtyRcp-qtyActual) < 0) && (reasCode == null || reasCode.trim().length() == 0))
{ {
...@@ -400,7 +392,6 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -400,7 +392,6 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
{ {
sql = " select fld_value from gencodes where fld_name='REAS_CODE' and mod_name='W_DISTRCP_EXSH' "; sql = " select fld_value from gencodes where fld_name='REAS_CODE' and mod_name='W_DISTRCP_EXSH' ";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
//pstmt.setString(1,siteCode);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -408,21 +399,17 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -408,21 +399,17 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
System.out.println("FIELD VALUE"+fldValue); System.out.println("FIELD VALUE"+fldValue);
if(!fldValue.equalsIgnoreCase(reasCode)) if(!fldValue.equalsIgnoreCase(reasCode))
{ {
System.out.println("Inside if of field val>>>>>>>>>>>>>");
errCode = "VTREA01"; errCode = "VTREA01";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} }
} }
rs.close(); rs.close();
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
} }
} }
else if(childNodeName.equalsIgnoreCase("remarks2")) else if(childNodeName.equalsIgnoreCase("remarks2"))
{ {
remarks2=genericUtility.getColumnValue("remarks2", dom); remarks2=genericUtility.getColumnValue("remarks2", dom);
...@@ -432,20 +419,36 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -432,20 +419,36 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
System.out.println("Status@@@@@@@@@@@@@ :"+status); System.out.println("Status@@@@@@@@@@@@@ :"+status);
if(( (qtyRcp-qtyActual) > 0) && (!(status.equalsIgnoreCase("O"))) && ((remarks2==null || remarks2.trim().length()<=0))) if(( (qtyRcp-qtyActual) > 0) && (!(status.equalsIgnoreCase("O"))) && ((remarks2==null || remarks2.trim().length()<=0)))
{ {
System.out.println("Inside if of REMARKS2@@@@@@@");
errCode = "VMREMARK"; errCode = "VMREMARK";
errList.add(errCode); errList.add(errCode);
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
System.out.println("Completed of REMARKS2@@@@@@@");
} }
else }
else if(childNodeName.equalsIgnoreCase("discr_id_date"))
{
remarks=genericUtility.getColumnValue("remarks", dom);
discrIdDate=genericUtility.getColumnValue("discr_id_date", dom);
if((remarks!=null && remarks.trim().length() > 0) && (discrIdDate==null || discrIdDate.trim().length() < 0))
{ {
System.out.println("Status is : "+status); errCode = "VTDISDATE";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
}
else if(childNodeName.equalsIgnoreCase("discr_res_date"))
{
remarks2=genericUtility.getColumnValue("remarks2", dom);
discrResDate=genericUtility.getColumnValue("discr_res_date", dom);
System.out.println("Remarks@@@@@@@@@@@@@ :"+remarks2);
System.out.println("Discrepancy Res Date@@@@@@@@@@@@@ :"+discrResDate);
if((remarks2!=null && remarks2.trim().length() > 0) && (discrResDate==null || discrResDate.trim().length() < 0))
{
errCode = "VTDISRDATE";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
} }
} }
} }
}//end switch }//end switch
int errListSize = errList.size(); int errListSize = errList.size();
cnt = 0; cnt = 0;
...@@ -552,34 +555,32 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -552,34 +555,32 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
Node childNode = null; Node childNode = null;
SimpleDateFormat sdf =null; SimpleDateFormat sdf =null;
Timestamp timestamp = null,expDate=null,mfgDate=null; Timestamp timestamp = null,expDate=null,mfgDate=null;
Timestamp lrDate=null,tranDate=null,gpDate=null; Timestamp lrDate=null,tranDate=null,gpDate=null,tranDate2=null;
String currDate=""; String currDate="";
String childNodeName = null; String childNodeName = null;
String siteCode = ""; String siteCode = "";
String itemCode = ""; String itemCode = "";
String itemDescr = ""; String itemDescr = "";
String lineNoRcp = ""; //String lineNoRcp = "";
String chgUser = ""; String chgUser = "";
String chgTerm = ""; String chgTerm = "";
String sql = ""; String sql = "",sql1="";
String siteDescr = "",remarks2=""; String siteDescr = "",remarks2="",status="";
String locCode = "",lrDateStr="",tranDatedStr="",gpDateStr=""; String locCode = "",lrDateStr="",gpDateStr="";
String locDescr = ""; String locDescr = "",locType="",descr1="";
String siteCodeMfg="",suppCodeMfg=""; String siteCodeMfg="",suppCodeMfg="";
String tranIdRcp="",distOrder="",tranId="",tranCode="",lrNo="",transMode="",grossWeight=""; String tranIdRcp="",distOrder="",tranId="",tranCode="",lrNo="",transMode="",grossWeight="";
String tareWeight="",netWeight="",noArt="",gpNo="",tranName="",tranIdIss="",tranDate1="",rate=""; String tareWeight="",netWeight="",noArt="",gpNo="",tranName="",tranIdIss="";
String lotNo = "",lotSl=""; String lotNo = "",lotSl="";
double quantity=0.0; double quantity=0.0,qtyActual=0.0,qtyRcp=0.0,rate=0.0,shortVal=0.0;
String lineNo = ""; String lineNo = "";
int ctr = 0; int ctr = 0;
int currentFormNo = 0; int currentFormNo = 0;
String siteCodeShip="",siteCodeShipDescr="",unit="",columnValue=""; String siteCodeShip="",siteCodeShipDescr="",unit="",columnValue="";
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null,pstmt1=null;
ResultSet rs = null ; ResultSet rs = null,rs1=null ;
GenericUtility genericUtility = GenericUtility.getInstance(); GenericUtility genericUtility = GenericUtility.getInstance();
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
...@@ -631,28 +632,16 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -631,28 +632,16 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
if(currentColumn.trim().equalsIgnoreCase("itm_default")) if(currentColumn.trim().equalsIgnoreCase("itm_default"))
{ {
System.out.println("@@@@@@ itm_default itemchange called"); System.out.println("@@@@@@ itm_default itemchange called");
System.out.println("@@@@@@ 2 siteCode["+siteCode+"]"); System.out.println("@@@@@@ siteCode["+siteCode+"]");
siteCode =(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode")); //25/3/15 start siteCode =(genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginSiteCode")); //25/3/15 start
siteDescr = findValue(conn, "descr" ,"site", "site_code", siteCode); siteDescr = findValue(conn, "descr" ,"site", "site_code", siteCode);
System.out.println("@@@@@@ 1 siteCode["+siteCode+"]::::::siteDescr["+siteDescr+"]"); System.out.println("@@@@@@ 1 siteCode["+siteCode+"]::::::siteDescr["+siteDescr+"]");
valueXmlString.append("<site_code>").append("<![CDATA[" + siteCode + "]]>").append("</site_code>"); valueXmlString.append("<site_code>").append("<![CDATA[" + siteCode + "]]>").append("</site_code>");
valueXmlString.append("<descr>").append("<![CDATA[" + siteDescr + "]]>").append("</descr>"); // 25/3/15end valueXmlString.append("<descr>").append("<![CDATA[" + siteDescr + "]]>").append("</descr>"); // 25/3/15end
System.out.println("Receipt Date@@@@@@@@@@@@@@@@@:"+currDate);
//valueXmlString.append("<tran_date>").append("<![CDATA[" + tranDate + "]]>").append("</tran_date>");
valueXmlString.append("<tran_date>").append("<![CDATA[" + currDate + "]]>").append("</tran_date>"); valueXmlString.append("<tran_date>").append("<![CDATA[" + currDate + "]]>").append("</tran_date>");
valueXmlString.append("<add_date>").append("<![CDATA[" + currDate + "]]>").append("</add_date>"); valueXmlString.append("<add_date>").append("<![CDATA[" + currDate + "]]>").append("</add_date>");
valueXmlString.append("<add_user>").append("<![CDATA[" + chgUser + "]]>").append("</add_user>"); valueXmlString.append("<add_user>").append("<![CDATA[" + chgUser + "]]>").append("</add_user>");
valueXmlString.append("<add_term>").append("<![CDATA[" + chgTerm + "]]>").append("</add_term>"); valueXmlString.append("<add_term>").append("<![CDATA[" + chgTerm + "]]>").append("</add_term>");
System.out.println("Effective Date@@@@@@@@@@@@@@@@@:"+currDate);
}//end of if }//end of if
if(currentColumn.trim().equalsIgnoreCase("itm_defaultedit")) if(currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{ {
...@@ -708,48 +697,39 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -708,48 +697,39 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
rs = null; rs = null;
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
if(lrDate != null) if(lrDate != null)
{ {
System.out.println("In side iff>>>>>>>");
lrDateStr=sdf.format(lrDate).toString(); lrDateStr=sdf.format(lrDate).toString();
System.out.println("lrDateStr@@@@@@@"+lrDateStr); System.out.println("lrDateStr@@@@@@@"+lrDateStr);
} }
else else
{ {
String s1=""; // String s1="";
System.out.println("inside else@@@@?????????"); lrDateStr="";
lrDateStr=s1;
System.out.println("lrDateStr@@@@@@@"+lrDateStr); System.out.println("lrDateStr@@@@@@@"+lrDateStr);
} }
valueXmlString.append("<lr_date>").append("<![CDATA[" + lrDateStr + "]]>").append("</lr_date>"); valueXmlString.append("<lr_date>").append("<![CDATA[" + lrDateStr + "]]>").append("</lr_date>");
if(gpDate != null) if(gpDate != null)
{ {
System.out.println("In side iff>>>>>>>");
gpDateStr=sdf.format(gpDate).toString(); gpDateStr=sdf.format(gpDate).toString();
System.out.println("gpDateStr@@@@@@@"+gpDateStr);
} }
else else
{ {
String s1=""; String s1="";
System.out.println("inside else@@@@?????????");
gpDateStr=s1; gpDateStr=s1;
System.out.println("gpDateStr@@@@@@@"+gpDateStr); System.out.println("gpDateStr@@@@@@@"+gpDateStr);
} }
valueXmlString.append("<gp_date>").append("<![CDATA[" + gpDateStr + "]]>").append("</gp_date>"); valueXmlString.append("<gp_date>").append("<![CDATA[" + gpDateStr + "]]>").append("</gp_date>");
if(tranDate == null) if(tranDate == null)
{ {
valueXmlString.append("<tran_date1>").append("<![CDATA[" + currDate + "]]>").append("</tran_date1>"); valueXmlString.append("<tran_date_1>").append("<![CDATA[" + currDate + "]]>").append("</tran_date_1>");
} }
else else
{ {
valueXmlString.append("<tran_date1>").append("<![CDATA[" + sdf.format(tranDate) + "]]>").append("</tran_date1>"); valueXmlString.append("<tran_date_1>").append("<![CDATA[" + sdf.format(tranDate) + "]]>").append("</tran_date_1>");
} }
valueXmlString.append("<lr_no>").append("<![CDATA[" + lrNo + "]]>").append("</lr_no>"); valueXmlString.append("<lr_no>").append("<![CDATA[" + lrNo + "]]>").append("</lr_no>");
valueXmlString.append("<gp_no>").append("<![CDATA[" + gpNo + "]]>").append("</gp_no>"); valueXmlString.append("<gp_no>").append("<![CDATA[" + gpNo + "]]>").append("</gp_no>");
valueXmlString.append("<trans_mode>").append("<![CDATA[" + transMode + "]]>").append("</trans_mode>"); valueXmlString.append("<trans_mode>").append("<![CDATA[" + transMode + "]]>").append("</trans_mode>");
...@@ -762,32 +742,42 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -762,32 +742,42 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
// valueXmlString.append("<tran_id__iss>").append("<![CDATA[" + tranIdIss + "]]>").append("</tran_id__iss>"); // valueXmlString.append("<tran_id__iss>").append("<![CDATA[" + tranIdIss + "]]>").append("</tran_id__iss>");
valueXmlString.append("<issue_ref>").append("<![CDATA[" + tranIdIss + "]]>").append("</issue_ref>"); valueXmlString.append("<issue_ref>").append("<![CDATA[" + tranIdIss + "]]>").append("</issue_ref>");
sql1="Select tran_date from distord_iss where tran_id= ? ";
pstmt1 = conn.prepareStatement(sql1);
pstmt1.setString(1, tranIdIss);
rs1=pstmt1.executeQuery();
if(rs1.next())
{
tranDate2=rs1.getTimestamp("tran_date");
}
rs1.close();
rs1 = null;
pstmt1.close();
pstmt1 = null;
if(tranDate2 == null)
{
valueXmlString.append("<tran_date_2>").append("<![CDATA[" + currDate + "]]>").append("</tran_date_2>");
}
else
{
valueXmlString.append("<tran_date_2>").append("<![CDATA[" + sdf.format(tranDate2) + "]]>").append("</tran_date_2>");
}
} }
else if(currentColumn.trim().equalsIgnoreCase("site_code")) else if(currentColumn.trim().equalsIgnoreCase("site_code"))
{ {
System.out.println("@@@@@@ site_code itemchange called");
siteCode = genericUtility.getColumnValue("site_code", dom); siteCode = genericUtility.getColumnValue("site_code", dom);
siteDescr = findValue(conn, "descr" ,"site", "site_code", siteCode); siteDescr = findValue(conn, "descr" ,"site", "site_code", siteCode);
System.out.println("@@@@@ siteCode["+siteCode+"]siteDescr["+siteDescr+"]"); System.out.println("@@@@@ siteCode["+siteCode+"]siteDescr["+siteDescr+"]");
valueXmlString.append("<descr>").append("<![CDATA[" + siteDescr + "]]>").append("</descr>"); valueXmlString.append("<descr>").append("<![CDATA[" + siteDescr + "]]>").append("</descr>");
} }
else if(currentColumn.trim().equalsIgnoreCase("tran_code")) else if(currentColumn.trim().equalsIgnoreCase("tran_code"))
{ {
System.out.println("@@@@@@ tran_code itemchange called");
tranCode = genericUtility.getColumnValue("tran_code", dom); tranCode = genericUtility.getColumnValue("tran_code", dom);
tranName = findValue(conn, "tran_name", "transporter", "tran_code", tranCode); tranName = findValue(conn, "tran_name", "transporter", "tran_code", tranCode);
System.out.println("@@@@@ Tran Code["+tranCode+"]Tran Name["+tranName+"]"); System.out.println("@@@@@ Tran Code["+tranCode+"]Tran Name["+tranName+"]");
valueXmlString.append("<tran_name>").append("<![CDATA[" + tranName+ "]]>").append("</tran_name>"); valueXmlString.append("<tran_name>").append("<![CDATA[" + tranName+ "]]>").append("</tran_name>");
System.out.println("Completed");
} }
valueXmlString.append("</Detail1>"); valueXmlString.append("</Detail1>");
break; break;
...@@ -818,12 +808,10 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -818,12 +808,10 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
if(currentColumn.trim().equalsIgnoreCase("itm_default")) if(currentColumn.trim().equalsIgnoreCase("itm_default"))
{ {
String status = genericUtility.getColumnValue("status", dom); status = genericUtility.getColumnValue("status", dom);
valueXmlString.append("<remarks2 protect = \"1\">").append("<![CDATA[" + remarks2 + "]]>").append("</remarks2>"); valueXmlString.append("<remarks2 protect = \"1\">").append("<![CDATA[" + remarks2 + "]]>").append("</remarks2>");
tranIdRcp = genericUtility.getColumnValue("tran_id__rcp", dom1, "1"); tranIdRcp = genericUtility.getColumnValue("tran_id__rcp", dom1, "1");
//valueXmlString.append("<tran_id__rcp>").append("<![CDATA[" + tranIdRcp + "]]>").append("</tran_id__rcp>");
valueXmlString.append("<tran_id__rcp protect = \"1\">").append("<![CDATA[" + tranIdRcp + "]]>").append("</tran_id__rcp>"); valueXmlString.append("<tran_id__rcp protect = \"1\">").append("<![CDATA[" + tranIdRcp + "]]>").append("</tran_id__rcp>");
}//end of if }//end of if
else if(currentColumn.trim().equalsIgnoreCase("itm_defaultedit")) else if(currentColumn.trim().equalsIgnoreCase("itm_defaultedit"))
{ {
...@@ -831,19 +819,16 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -831,19 +819,16 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
} }
else if(currentColumn.trim().equalsIgnoreCase("line_no__rcp")) else if(currentColumn.trim().equalsIgnoreCase("line_no__rcp"))
{ {
System.out.println("");
tranIdRcp = checkNull(genericUtility.getColumnValue("tran_id__rcp", dom)); tranIdRcp = checkNull(genericUtility.getColumnValue("tran_id__rcp", dom));
lineNo = checkNull(genericUtility.getColumnValue("line_no__rcp", dom)); lineNo = checkNull(genericUtility.getColumnValue("line_no__rcp", dom));
System.out.println("Line NO.>>>>>>>>>"+lineNo); System.out.println("Line NO.>>>>>>>>>"+lineNo);
if (lineNo!=null || lineNo.trim().length() > 0 ) if (lineNo!=null && lineNo.trim().length() > 0 )
{ {
System.out.println("In IF>>>>>>>>>>>>>>");
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,rate from distord_rcpdet where tran_id= ? and line_no= ? ";//pankaj 6/5/15 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,rate from distord_rcpdet where tran_id= ? and line_no= ? ";//pankaj 6/5/15
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1,tranIdRcp); pstmt.setString(1,tranIdRcp);
pstmt.setString(2,lineNo); pstmt.setString(2,lineNo);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()) if(rs.next())
{ {
...@@ -862,10 +847,9 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -862,10 +847,9 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
suppCodeMfg= rs.getString("supp_code__mfg"); suppCodeMfg= rs.getString("supp_code__mfg");
itemCode=rs.getString("item_code"); itemCode=rs.getString("item_code");
locCode=rs.getString("loc_code"); locCode=rs.getString("loc_code");
rate=rs.getString("rate"); rate=rs.getDouble("rate");
itemDescr = findValue(conn, "descr" ,"item", "item_code", itemCode); itemDescr = findValue(conn, "descr" ,"item", "item_code", itemCode);
locDescr=findValue(conn, "descr", "location", "loc_code", locCode); locDescr=findValue(conn, "descr", "location", "loc_code", locCode);
} }
rs.close(); rs.close();
rs = null; rs = null;
...@@ -877,7 +861,6 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -877,7 +861,6 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
valueXmlString.append("<loc_code>").append("<![CDATA[" + locCode + "]]>").append("</loc_code>"); valueXmlString.append("<loc_code>").append("<![CDATA[" + locCode + "]]>").append("</loc_code>");
valueXmlString.append("<descr>").append("<![CDATA[" + locDescr + "]]>").append("</descr>"); valueXmlString.append("<descr>").append("<![CDATA[" + locDescr + "]]>").append("</descr>");
valueXmlString.append("<unit>").append("<![CDATA[" + unit + "]]>").append("</unit>"); 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_rcp>").append("<![CDATA[" + quantity + "]]>").append("</qty_rcp>");
valueXmlString.append("<qty_actual>").append("<![CDATA[" + quantity + "]]>").append("</qty_actual>"); valueXmlString.append("<qty_actual>").append("<![CDATA[" + quantity + "]]>").append("</qty_actual>");
valueXmlString.append("<lot_no>").append("<![CDATA[" + lotNo + "]]>").append("</lot_no>"); valueXmlString.append("<lot_no>").append("<![CDATA[" + lotNo + "]]>").append("</lot_no>");
...@@ -906,12 +889,35 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -906,12 +889,35 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
valueXmlString.append("<trans_mode>").append("<![CDATA[" + transMode + "]]>").append("</trans_mode>"); valueXmlString.append("<trans_mode>").append("<![CDATA[" + transMode + "]]>").append("</trans_mode>");
valueXmlString.append("<supp_code__mfg>").append("<![CDATA[" + suppCodeMfg + "]]>").append("</supp_code__mfg>"); valueXmlString.append("<supp_code__mfg>").append("<![CDATA[" + suppCodeMfg + "]]>").append("</supp_code__mfg>");
valueXmlString.append("<rate>").append("<![CDATA[" + rate + "]]>").append("</rate>"); valueXmlString.append("<rate>").append("<![CDATA[" + rate + "]]>").append("</rate>");
shortVal=((qtyRcp - qtyActual) * rate);
valueXmlString.append("<short_val>").append("<![CDATA[" + shortVal + "]]>").append("</short_val>");
locType = findValue(conn, "loc_type" ,"item", "item_code", itemCode);
System.out.println(">>>>>>Loc Type"+locType);
sql = "select descr from gencodes where fld_value=? ";// and fld_name= ?
pstmt = conn.prepareStatement(sql);
// pstmt.setString(1,"LOC_TYPE");
pstmt.setString(1,locType);
rs = pstmt.executeQuery();
if(rs.next())
{
descr1=rs.getString("descr");
System.out.println("Description>>>>"+descr1);
}
rs.close();
rs = null;
pstmt.close();
pstmt = null;
valueXmlString.append("<loc_type>").append("<![CDATA[" + locType + "]]>").append("</loc_type>");
valueXmlString.append("<gencodes_descr>").append("<![CDATA[" + descr1 + "]]>").append("</gencodes_descr>");
} }
} }
else if(currentColumn.trim().equalsIgnoreCase("status")) else if(currentColumn.trim().equalsIgnoreCase("status"))
{ {
System.out.println("@@@@@@ status itemchange called"); System.out.println("@@@@@@ status itemchange called");
String status = genericUtility.getColumnValue("status", dom); status = genericUtility.getColumnValue("status", dom);
System.out.println("Status is : "+status); System.out.println("Status is : "+status);
remarks2=""; remarks2="";
if(status != null && status.equalsIgnoreCase("O")) if(status != null && status.equalsIgnoreCase("O"))
...@@ -919,14 +925,22 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -919,14 +925,22 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
System.out.println("inside open"); System.out.println("inside open");
valueXmlString.append("<remarks2 protect = \"1\">").append("<![CDATA[" + remarks2 + "]]>").append("</remarks2>"); valueXmlString.append("<remarks2 protect = \"1\">").append("<![CDATA[" + remarks2 + "]]>").append("</remarks2>");
} }
if(status != null && status.equalsIgnoreCase("C")) if(status != null && status.equalsIgnoreCase("C"))
{ {
System.out.println("inside close"); System.out.println("inside close");
valueXmlString.append("<remarks2 protect = \"0\">").append("<![CDATA[" + remarks2 + "]]>").append("</remarks2>"); valueXmlString.append("<remarks2 protect = \"0\">").append("<![CDATA[" + remarks2 + "]]>").append("</remarks2>");
} }
} }
else if(currentColumn.trim().equalsIgnoreCase("qty_actual"))
{
qtyRcp=Double.valueOf(genericUtility.getColumnValue("qty_rcp", dom)==null?"0":genericUtility.getColumnValue("qty_rcp", dom));
qtyActual = Double.valueOf(genericUtility.getColumnValue("qty_actual", dom)==null?"0":genericUtility.getColumnValue("qty_actual", dom));
rate = Double.valueOf(genericUtility.getColumnValue("rate", dom)==null?"0":genericUtility.getColumnValue("rate", dom));;
System.out.println("Quantity RCp["+qtyRcp+"]Quantity Actual["+qtyActual+"]Rate["+rate+"]");
shortVal=((qtyRcp - qtyActual) * rate);
System.out.println("Short Value>>>>>>>>>"+shortVal);
valueXmlString.append("<short_val>").append("<![CDATA[" + shortVal + "]]>").append("</short_val>");
}
valueXmlString.append("</Detail2>"); valueXmlString.append("</Detail2>");
break; break;
}//end of switch-case }//end of switch-case
...@@ -1048,24 +1062,23 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D ...@@ -1048,24 +1062,23 @@ public class DistRcpExShIC extends ValidatorEJB implements DistRcpExShICLocal, D
} }
return input; return input;
}//end of checkNull }//end of checkNull
private String getCurrentUpdateFlag(Node currDetail) 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++)
{ {
NodeList currDetailList = null; nodeName = currDetailList.item(i).getNodeName();
String updateStatus = "",nodeName = ""; if (nodeName.equalsIgnoreCase("Attribute"))
int currDetailListLength = 0;
currDetailList = currDetail.getChildNodes();
currDetailListLength = currDetailList.getLength();
for (int i=0;i< currDetailListLength;i++)
{ {
nodeName = currDetailList.item(i).getNodeName(); updateStatus =currDetailList.item(i).getAttributes().getNamedItem("updateFlag").getNodeValue();
if (nodeName.equalsIgnoreCase("Attribute")) break;
{
updateStatus =currDetailList.item(i).getAttributes().getNamedItem("updateFlag").getNodeValue();
break;
}
} }
return updateStatus;
} }
return updateStatus;
}
}//class ends }//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