Commit 26117ac8 authored by dsawant's avatar dsawant

added validation for location


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95893 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 74f4a08d
...@@ -103,7 +103,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -103,7 +103,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
String userId = ""; String userId = "";
PreparedStatement pstmt = null ; PreparedStatement pstmt = null ;
ResultSet rs = null; ResultSet rs = null;
String sql = ""; String sql = "",locCode ="";
String workOrder = "",squantity="",wotatus="",itemCode=""; String workOrder = "",squantity="",wotatus="",itemCode="";
...@@ -315,6 +315,40 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -315,6 +315,40 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
} }
} }
else if(childNodeName.equalsIgnoreCase("loc_code"))
{
locCode = genericUtility.getColumnValue("loc_code",dom2);
if (locCode == null || locCode.trim().length() == 0)
{
errCode = "WORDWLCNU";
errString = getErrorString("loc_code",errCode,userId);
break;
}
else
{
sql = "select count(1) from location where loc_code = ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,locCode);
rs = pstmt.executeQuery();
if(rs.next())
{
cnt = rs.getInt(1);
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
if(cnt == 0)
{
errCode = "WORDWLCNE";
errString = getErrorString("loc_code",errCode,userId);
break;
}
}
}
/*else if(childNodeName.equalsIgnoreCase("no_art")) /*else if(childNodeName.equalsIgnoreCase("no_art"))
{ {
...@@ -660,7 +694,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -660,7 +694,7 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
System.out.println(">>>>>>>>>>>SXD"+workOrder); System.out.println(">>>>>>>>>>>SXD"+workOrder);
sql = "select a.tran_id,a.tran_date,a.site_code,a.work_order,a.date__start," sql = "select a.tran_id,a.tran_date,a.site_code,a.work_order,a.date__start,"
+ "a.item_code,b.descr,a.loc_code,a.lot_sl,a.quantity,a.no_art,a.unit,a.lot_no " + "a.item_code,b.descr,a.loc_code,a.lot_sl,a.quantity,a.no_art,a.unit,a.lot_no,a.gross_weight,a.net_weight "
+ "FROM workorder_receipt a,item b WHERE a.item_code = b.item_code and CASE WHEN confirmed IS NULL THEN 'N' ELSE CONFIRMED END = 'N' and work_order = ?"; + "FROM workorder_receipt a,item b WHERE a.item_code = b.item_code and CASE WHEN confirmed IS NULL THEN 'N' ELSE CONFIRMED END = 'N' and work_order = ?";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,workOrder); pstmt.setString(1,workOrder);
...@@ -681,24 +715,10 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W ...@@ -681,24 +715,10 @@ public class WorkOrdRcpDet extends ValidatorEJB implements WorkOrdRcpDetLocal, W
noOfArt = rs.getDouble(11); noOfArt = rs.getDouble(11);
unit = rs.getString(12) == null ? "":rs.getString(12); unit = rs.getString(12) == null ? "":rs.getString(12);
lotNo = rs.getString(13) == null ? "":rs.getString(13); lotNo = rs.getString(13) == null ? "":rs.getString(13);
grossWeight = rs.getDouble(14);
netWeight = rs.getDouble(15);
sql = "select gross_weight,net_weight from item where item_code = ?";
pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1,itemCode);
rs1 = pstmt1.executeQuery();
if(rs1.next())
{
grossWeight = rs1.getDouble(1);
netWeight = rs1.getDouble(2);
}
pstmt1.close();
rs1.close();
pstmt1 = null;
rs1 = null;
tareWeight = grossWeight - netWeight; tareWeight = grossWeight - netWeight;
simpleDateFormat=new SimpleDateFormat(genutility.getApplDateFormat()); simpleDateFormat=new SimpleDateFormat(genutility.getApplDateFormat());
......
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