Commit 95cfe804 authored by dsawant's avatar dsawant

updated post save for loc code and lot sl


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@95881 ce508802-f39f-4f6c-b175-0d175dae99d5
parent fa70dabc
...@@ -47,41 +47,55 @@ public class WorkOrdRcpDetPostSave extends ValidatorEJB implements WorkOrdRcpDet ...@@ -47,41 +47,55 @@ public class WorkOrdRcpDetPostSave extends ValidatorEJB implements WorkOrdRcpDet
public String postSave(Document dom,String tranId,String editflag,String xtraParams,Connection conn) public String postSave(Document dom,String tranId,String editflag,String xtraParams,Connection conn)
{ {
System.out.println("post save dom data1 ---------------:"+dom); System.out.println("post save dom data1 ---------------:"+dom);
String sql = "", error = "", quantity = "", grossWeight = "", tareWeight = "", netWeight = "", noArt = ""; String sql = "", error = "";
int quantity = 0, grossWeight = 0, tareWeight = 0, netWeight = 0, noArt = 0;
int cnt1 = 0; int cnt1 = 0;
String lotSl="",locCode="";
PreparedStatement pstmt = null; PreparedStatement pstmt = null;
ResultSet rs=null; ResultSet rs=null;
try try
{ {
sql = "select sum(coalesce(quantity,0)), sum(coalesce(gross_weight,0)), sum(coalesce(tare_weight,0)), " + sql = "select sum(coalesce(quantity,0)), sum(coalesce(gross_weight,0)), sum(coalesce(tare_weight,0)), " +
" sum(coalesce(net_weight,0)), sum(coalesce(no_art,0)) from workorder_rcp_det where tran_id = ? "; " sum(coalesce(net_weight,0)), sum(coalesce(no_art,0)), lot_sl from workorder_rcp_det where tran_id = ? group by lot_sl";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, tranId); pstmt.setString(1, tranId);
rs = pstmt.executeQuery(); rs = pstmt.executeQuery();
if(rs.next()){ if(rs.next()){
quantity = rs.getString(1); quantity = rs.getInt(1);
grossWeight = rs.getString(2); grossWeight = rs.getInt(2);
tareWeight = rs.getString(3); tareWeight = rs.getInt(3);
netWeight = rs.getString(4); netWeight = rs.getInt(4);
noArt = rs.getString(5); noArt = rs.getInt(5);
lotSl = rs.getString(6) == null ? "":rs.getString(6);
} }
pstmt.close(); pstmt.close();
pstmt = null; pstmt = null;
rs.close(); rs.close();
rs = null; rs = null;
sql = "update workorder_receipt set quantity = ?, gross_weight = ?, tare_weight = ?, net_weight = ?, no_art = ? where tran_id = ?"; if ((lotSl != null && lotSl.trim().length() > 0) || (lotSl == null || lotSl.trim().length() == 0))
{
System.out.println("ENTER FOR SETTING >>>");
locCode = " ";
lotSl = " ";
}
sql = "update workorder_receipt set quantity = ?, gross_weight = ?, tare_weight = ?, net_weight = ?, no_art = ?, lot_sl = ?, loc_code = ? where tran_id = ?";
pstmt = conn.prepareStatement(sql); pstmt = conn.prepareStatement(sql);
pstmt.setString(1, quantity); pstmt.setInt(1, quantity);
pstmt.setString(2, grossWeight); pstmt.setInt(2, grossWeight);
pstmt.setString(3, tareWeight); pstmt.setInt(3, tareWeight);
pstmt.setString(4, netWeight); pstmt.setInt(4, netWeight);
pstmt.setString(5, noArt); pstmt.setInt(5, noArt);
pstmt.setString(6, tranId); pstmt.setString(6, lotSl);
pstmt.setString(7, locCode);
pstmt.setString(8, tranId);
cnt1 = pstmt.executeUpdate(); cnt1 = pstmt.executeUpdate();
System.out.println(">>>>>>>successfully updated record bom post save cnt1:" + cnt1); System.out.println(">>>>>>>successfully updated record bom post save cnt1:" + cnt1);
conn.commit(); conn.commit();
......
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