Commit 51c111be authored by jshinde's avatar jshinde

Request ID:W15GSUN001 Create transaction screen Pallet Request .


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@98798 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 07d9c221
...@@ -112,7 +112,7 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle ...@@ -112,7 +112,7 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
double stockhold=0; double stockhold=0;
ResultSet rs= null; ResultSet rs= null;
String loginSite = ""; String loginSite = "";
ArrayList locList = new ArrayList(); ArrayList<String> palletList = new ArrayList();
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
int palletCount = 0; int palletCount = 0;
Connection conn = null; Connection conn = null;
...@@ -233,66 +233,90 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle ...@@ -233,66 +233,90 @@ public class PalletReqIC extends ValidatorEJB implements PalletReqICLocal, Palle
System.out.println("DOM2----->>["+genericUtility.serializeDom(dom2).toString()+"]"); System.out.println("DOM2----->>["+genericUtility.serializeDom(dom2).toString()+"]");
parentNodeList = dom2.getElementsByTagName("Detail2"); parentNodeList = dom2.getElementsByTagName("Detail2");
parentNode = parentNodeList.item(0); for(int intPrnt = 0;intPrnt < parentNodeList.getLength();intPrnt++)
childNodeList = parentNode.getChildNodes();
childNodeListLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeListLength; ctr++)
{ {
childNode = childNodeList.item(ctr); parentNode = parentNodeList.item(intPrnt);
childNodeName = childNode.getNodeName(); childNodeList = parentNode.getChildNodes();
String palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom)); childNodeListLength = childNodeList.getLength();
for (ctr = 0; ctr < childNodeListLength; ctr++)
if("pallet_no".equalsIgnoreCase(childNodeName))
{ {
if( "E".equalsIgnoreCase(editFlag) || "A".equalsIgnoreCase(editFlag)) childNode = childNodeList.item(ctr);
{ childNodeName = childNode.getNodeName();
if(palletNo.length() == 0 || palletNo.equalsIgnoreCase(""))
{
errCode = "VMPALLENUL";//pallet no cannot be blank
errList.add( errCode );
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
errFields.add( childNodeName.toLowerCase() ); String palletNo = checkNullAndTrim(genericUtility.getColumnValue("pallet_no",dom));
String tranId = checkNullAndTrim(genericUtility.getColumnValue("tran_id",dom2));
System.out.println("TRAN ID" +tranId);
System.out.println("PALLET" +palletNo);
if("pallet_no".equalsIgnoreCase(childNodeName))
{
if(childNode.getFirstChild()!=null)
{
palletNo = childNode.getFirstChild().getNodeValue();
} }
else if( "E".equalsIgnoreCase(editFlag) || "A".equalsIgnoreCase(editFlag))
{ {
String sql = "SELECT COUNT(1) FROM LOCATION WHERE INV_STAT =? AND LOC_CODE=?"; if(palletNo.length() == 0 || palletNo.equalsIgnoreCase(""))
{
errCode = "VMPALLENUL";//pallet no cannot be blank
errList.add( errCode );
childNode = childNodeList.item(ctr);
childNodeName = childNode.getNodeName();
errFields.add( childNodeName.toLowerCase() );
}
else
{
String sql = "SELECT COUNT(1) FROM LOCATION WHERE INV_STAT =? AND LOC_CODE=?";
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "AWMS");
pstmt.setString(2, palletNo);
rs = pstmt.executeQuery();
if(rs.next())
{
System.out.println("count PALLETNO>>>>>>>" +rs.getInt(1));
if(rs.getInt(1)==0)
{
errCode = "VMPALLEEXT";//pallet no should be in LOCATION MASTER
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
else
{
System.out.println("AFTER ELSE" +palletList);
for(int i=0;i<palletList.size();i++)
{
System.out.println("palletarray"+palletList.get(i));
}
if(palletList.contains(palletNo))
{
System.out.println("PALLETNO>>>>>>>" +palletNo);
errCode = "VMPALLETSM";//pallet no same
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
else
{
palletList.add(palletNo);
System.out.println("ADD PALLET" +palletNo);
}
}
pstmt = conn.prepareStatement(sql);
pstmt.setString(1, "AWMS");
pstmt.setString(2, palletNo);
rs = pstmt.executeQuery();
if(rs.next())
{
System.out.println("count PALLETNO>>>>>>>" +rs.getInt(1));
if(rs.getInt(1)==0)
{
errCode = "VMPALLEEXT";//pallet no should be in LOCATION MASTER
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
} }
rs.close();
pstmt.close();
} }
rs.close();
pstmt.close();
} }
} }
} }
else if("loc_code".equalsIgnoreCase(childNodeName)) }
{
String locCodeHeader = checkNullAndTrim(genericUtility.getColumnValue("loc_code",dom1));
String locCodeDetail = checkNullAndTrim(genericUtility.getColumnValue("loc_code",dom2));
System.out.println("LOC CODE>locCodeDetail>>>>>>" +locCodeDetail);
System.out.println("LOC CODE>locCodeHeader>>>>>>" +locCodeHeader);
if(!(locCodeHeader.equals(locCodeDetail)))
{
errCode = "VMLOCATSAM";//Entered Location Code in detail form should be same as header form
errList.add( errCode );
errFields.add( childNodeName.toLowerCase() );
}
}
}//FOR LOOP end
break; break;
} //switch end } //switch 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