Commit cbc30539 authored by smestry's avatar smestry

Updated the file for DispatchIC.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104549 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 79bac79f
...@@ -82,8 +82,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -82,8 +82,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
StringBuffer errStringXml = new StringBuffer( StringBuffer errStringXml = new StringBuffer( "<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
"<?xml version = \"1.0\"?> \r\n <Root> <Errors>");
int currentFormNo = 0; int currentFormNo = 0;
String sordNo="",despId="",despDateStr="",confirmed="",allocFlag="",status="",siteCode="",lrDateStr=""; String sordNo="",despId="",despDateStr="",confirmed="",allocFlag="",status="",siteCode="",lrDateStr="";
...@@ -547,6 +546,15 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -547,6 +546,15 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
rdPermitNo = checkNull(genericUtility.getColumnValue("rd_permit_no", dom)); rdPermitNo = checkNull(genericUtility.getColumnValue("rd_permit_no", dom));
if ( rdPermitNo.trim().length() > 0) if ( rdPermitNo.trim().length() > 0)
{
isExist = isExist("ROADPERMIT", "RD_PERMIT_NO", rdPermitNo, conn);
if(!isExist)
{
errCode = "VMRDPNINV2";
errList.add(errCode);
errFields.add(childNodeName.toLowerCase());
}
else
{ {
custCodeDlv = checkNull(genericUtility.getColumnValue("cust_code__dlv", dom)); custCodeDlv = checkNull(genericUtility.getColumnValue("cust_code__dlv", dom));
siteCode = checkNull(genericUtility.getColumnValue("site_code", dom)); siteCode = checkNull(genericUtility.getColumnValue("site_code", dom));
...@@ -682,6 +690,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -682,6 +690,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
errFields.add(childNodeName.toLowerCase()); errFields.add(childNodeName.toLowerCase());
} // end if } // end if
}//end if }//end if
}
}//end if }//end if
//}//end if //}//end if
}// end wf }// end wf
...@@ -3010,8 +3019,8 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -3010,8 +3019,8 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
} }
private String gbf_comp_sord(String as_sale_order, Document dom, private String gbf_comp_sord(String as_sale_order, Document dom, Connection conn) throws ITMException, SQLException
Connection conn) throws ITMException, SQLException { {
String ls_value="", ls_errcode="", ls_site_code="",ls_trans_mode="",sql=""; String ls_value="", ls_errcode="", ls_site_code="",ls_trans_mode="",sql="";
String ls_cust_code="",ls_cust_code__dlv="",ls_item_ser="",ls_cr_term="",ls_dlv_term="",ls_order_type=""; String ls_cust_code="",ls_cust_code__dlv="",ls_item_ser="",ls_cr_term="",ls_dlv_term="",ls_order_type="";
...@@ -3049,8 +3058,8 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -3049,8 +3058,8 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
} }
private boolean isExist(String table, String field, String value, private boolean isExist(String table, String field, String value, Connection conn) throws SQLException
Connection conn) throws SQLException { {
String sql = ""; String sql = "";
boolean retStr = false; boolean retStr = false;
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
...@@ -3080,10 +3089,8 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -3080,10 +3089,8 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
} }
// method for item change // method for item change
public String itemChanged(String xmlString, String xmlString1, public String itemChanged(String xmlString, String xmlString1, String xmlString2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
String xmlString2, String objContext, String currentColumn, {
String editFlag, String xtraParams) throws RemoteException,
ITMException {
Document dom = null; Document dom = null;
Document dom1 = null; Document dom1 = null;
Document dom2 = null; Document dom2 = null;
...@@ -3114,9 +3121,8 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -3114,9 +3121,8 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
} }
// method for item change // method for item change
public String itemChanged(Document dom, Document dom1, Document dom2, public String itemChanged(Document dom, Document dom1, Document dom2, String objContext, String currentColumn, String editFlag, String xtraParams) throws RemoteException, ITMException
String objContext, String currentColumn, String editFlag, {
String xtraParams) throws RemoteException, ITMException {
String childNodeName = null,childNodeName1=""; String childNodeName = null,childNodeName1="";
String sql = "",columnValue=""; String sql = "",columnValue="";
StringBuffer valueXmlString = new StringBuffer(); StringBuffer valueXmlString = new StringBuffer();
...@@ -3824,7 +3830,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -3824,7 +3830,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
if( ! isnull(rdPermitNo) && lenTrim(rdPermitNo) > 0 ) if( ! isnull(rdPermitNo) && lenTrim(rdPermitNo) > 0 )
{ {
roadpermitDescr = getValue("descr", "roadpermit", "rd_permit_no", rdPermitNo, conn); roadpermitDescr = getValue("descr", "roadpermit", "rd_permit_no", rdPermitNo, conn);
valueXmlString.append("<roadpermit_descr>").append("<![CDATA[" + stationDescr + "]]>").append("</roadpermit_descr>"); valueXmlString.append("<roadpermit_descr>").append("<![CDATA[" + roadpermitDescr + "]]>").append("</roadpermit_descr>");
} }
} }
else if (currentColumn.trim().equalsIgnoreCase("desp_date")) else if (currentColumn.trim().equalsIgnoreCase("desp_date"))
...@@ -5187,6 +5193,8 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -5187,6 +5193,8 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
//ll_no_art = gf_get_no_art(ls_site_code_det,ls_cust_code,itemcode,ls_pack_code,mNum,'B',ac_shipper_qty,ac_int_qty); //ll_no_art = gf_get_no_art(ls_site_code_det,ls_cust_code,itemcode,ls_pack_code,mNum,'B',ac_shipper_qty,ac_int_qty);
//ll_no_art = distCommon.getNoArt(ls_site_code_det, ls_cust_code, itemcode, ls_pack_code, mNum, 'B', ac_shipper_qty, ac_int_qty, conn); //ll_no_art = distCommon.getNoArt(ls_site_code_det, ls_cust_code, itemcode, ls_pack_code, mNum, 'B', ac_shipper_qty, ac_int_qty, conn);
getNoArtList = distCommon.getNoArtAList(ls_site_code_det, ls_cust_code, itemcode, ls_pack_code, mNum, 'B', ac_shipper_qty, ac_int_qty, conn); getNoArtList = distCommon.getNoArtAList(ls_site_code_det, ls_cust_code, itemcode, ls_pack_code, mNum, 'B', ac_shipper_qty, ac_int_qty, conn);
System.out.println("------- getNoArtList.size() -------------"+getNoArtList.size());
if( getNoArtList.size() > 2) if( getNoArtList.size() > 2)
{ {
ll_no_art = Double.parseDouble(checkDoubleNull(getNoArtList.get(0).toString())); ll_no_art = Double.parseDouble(checkDoubleNull(getNoArtList.get(0).toString()));
...@@ -5399,6 +5407,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -5399,6 +5407,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
} }
else if (currentColumn.trim().equalsIgnoreCase("lot_no") || currentColumn.trim().equalsIgnoreCase("lot_sl")) else if (currentColumn.trim().equalsIgnoreCase("lot_no") || currentColumn.trim().equalsIgnoreCase("lot_sl"))
{ {
System.out.println("------ Inside lot_no ----------- ");
ls_item_code = checkNull(genericUtility.getColumnValue("item_code", dom)); ls_item_code = checkNull(genericUtility.getColumnValue("item_code", dom));
ls_site_code = checkNull(genericUtility.getColumnValue("site_code", dom)); ls_site_code = checkNull(genericUtility.getColumnValue("site_code", dom));
ls_loc_code = checkNull(genericUtility.getColumnValue("loc_code", dom)); ls_loc_code = checkNull(genericUtility.getColumnValue("loc_code", dom));
...@@ -5824,6 +5833,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -5824,6 +5833,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
if ("F".equalsIgnoreCase(ls_nature) || "B".equalsIgnoreCase(ls_nature) || "S".equalsIgnoreCase(ls_nature)) if ("F".equalsIgnoreCase(ls_nature) || "B".equalsIgnoreCase(ls_nature) || "S".equalsIgnoreCase(ls_nature))
{ {
valueXmlString.append("<rate__stduom>").append("<![CDATA[0]]>").append("</rate__stduom>"); valueXmlString.append("<rate__stduom>").append("<![CDATA[0]]>").append("</rate__stduom>");
valueXmlString.append("<line_type>").append("<![CDATA["+ls_nature+"]]>").append("</line_type>"); valueXmlString.append("<line_type>").append("<![CDATA["+ls_nature+"]]>").append("</line_type>");
}//end if }//end if
...@@ -5831,11 +5841,13 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -5831,11 +5841,13 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
} //end ic } //end ic
else if (currentColumn.trim().equalsIgnoreCase("loc_code") ) else if (currentColumn.trim().equalsIgnoreCase("loc_code") )
{ {
System.out.println("------ Inside loc_code ----------- ");
//gbf_set_rate_conversion(); //gbf_set_rate_conversion();
valueXmlString = gbf_set_rate_conversion(dom,valueXmlString, conn); valueXmlString = gbf_set_rate_conversion(dom,valueXmlString, conn);
} }
else if (currentColumn.trim().equalsIgnoreCase("no_art") ) else if (currentColumn.trim().equalsIgnoreCase("no_art") )
{ {
System.out.println("------ Inside no_art ----------- ");
lc_qty_stduom = Double.parseDouble(checkDoubleNull(genericUtility.getColumnValue("quantity__stduom", dom))); lc_qty_stduom = Double.parseDouble(checkDoubleNull(genericUtility.getColumnValue("quantity__stduom", dom)));
lc_no_article = Double.parseDouble(checkDoubleNull(genericUtility.getColumnValue("no_art", dom))); lc_no_article = Double.parseDouble(checkDoubleNull(genericUtility.getColumnValue("no_art", dom)));
...@@ -5849,6 +5861,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -5849,6 +5861,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
else if (currentColumn.trim().equalsIgnoreCase("cust_item__ref") ) else if (currentColumn.trim().equalsIgnoreCase("cust_item__ref") )
{ {
System.out.println("------ Inside cust_item__ref ----------- ");
ls_cust_code = checkDoubleNull(genericUtility.getColumnValue("cust_code", dom)); ls_cust_code = checkDoubleNull(genericUtility.getColumnValue("cust_code", dom));
ls_item_cd = checkDoubleNull(genericUtility.getColumnValue("cust_item__ref", dom)); ls_item_cd = checkDoubleNull(genericUtility.getColumnValue("cust_item__ref", dom));
...@@ -6286,8 +6299,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch ...@@ -6286,8 +6299,7 @@ public class DispatchIC extends ValidatorEJB implements DispatchICLocal,Dispatch
return stockCheckMap; return stockCheckMap;
} }
private StringBuffer gbf_set_rate_conversion(Document dom, StringBuffer valueXmlString, private StringBuffer gbf_set_rate_conversion(Document dom, StringBuffer valueXmlString, Connection conn) throws ITMException, SQLException
Connection conn) throws ITMException, SQLException
{ {
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs = null; ResultSet rs = null;
......
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