Commit d170e3a0 authored by ssarkar's avatar ssarkar

Update by sumit on 01/04/13 source given by kunal


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92915 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 60204f0e
...@@ -756,8 +756,8 @@ public class PhysicalCountSchedule implements Schedule ...@@ -756,8 +756,8 @@ public class PhysicalCountSchedule implements Schedule
while(rs.next()) while(rs.next())
{ {
rec++; rec++;
//change done by kunal on 1/04/13 for previous day empty
boolean fromStock = false;
if(!locationMap.contains((String)rs.getString("LOC_CODE").trim())) if(!locationMap.contains((String)rs.getString("LOC_CODE").trim()))
{ {
...@@ -769,7 +769,40 @@ public class PhysicalCountSchedule implements Schedule ...@@ -769,7 +769,40 @@ public class PhysicalCountSchedule implements Schedule
pstmt1.setString(1, loginSiteCode); pstmt1.setString(1, loginSiteCode);
pstmt1.setString(2, rs.getString("LOC_CODE").trim()); pstmt1.setString(2, rs.getString("LOC_CODE").trim());
rs1 = pstmt1.executeQuery(); rs1 = pstmt1.executeQuery();
if(rs1 == null) while(rs1.next())
{
System.out.println("insert from stock ");
fromStock = true ;
insertItemProcess="insert into PHYSCANDET (TRAN_ID,LINE_NO,SITE_CODE,ITEM_CODE," +
"LOC_CODE,LOT_NO,LOT_SL,QUANTITY," +
"ANALYSIS_CLASS,PRIORITY_SEQ,CYCLE_CRITERIA,EMP_CODE__USER,UNIT,TRAN_TYPE) " +
"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmtInsert = conn.prepareStatement(insertItemProcess);
pstmtInsert.setString(1,tranId);
pstmtInsert.setInt(2,rec);
pstmtInsert.setString(3,loginSiteCode);
pstmtInsert.setString(4,rs1.getString("ITEM_CODE"));
pstmtInsert.setString(5,rs1.getString("LOC_CODE"));
pstmtInsert.setString(6,rs1.getString("LOT_NO"));
pstmtInsert.setString(7,rs1.getString("LOT_SL"));
pstmtInsert.setDouble(8,0);
pstmtInsert.setString(9,rs1.getString("ANALYSIS_CLASS"));
pstmtInsert.setInt(10,0);
pstmtInsert.setString(11,rs1.getString("CYCLE_CRITERIA"));
pstmtInsert.setString(12,empCode);
pstmtInsert.setString(13,rs1.getString("UNIT"));
pstmtInsert.setString(14,"A");
pstmtInsert.executeUpdate();
pstmtInsert.close();
pstmtInsert=null;
rec++;
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1 =null;
System.out.println("From Stock="+fromStock);
if(!fromStock)
{ {
System.out.println("insert from query "); System.out.println("insert from query ");
...@@ -796,41 +829,6 @@ public class PhysicalCountSchedule implements Schedule ...@@ -796,41 +829,6 @@ public class PhysicalCountSchedule implements Schedule
pstmtInsert.close(); pstmtInsert.close();
pstmtInsert=null; pstmtInsert=null;
} }
else
{
while(rs1.next())
{
System.out.println("insert from stock ");
insertItemProcess="insert into PHYSCANDET (TRAN_ID,LINE_NO,SITE_CODE,ITEM_CODE," +
"LOC_CODE,LOT_NO,LOT_SL,QUANTITY," +
"ANALYSIS_CLASS,PRIORITY_SEQ,CYCLE_CRITERIA,EMP_CODE__USER,UNIT,TRAN_TYPE) " +
"values(?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
pstmtInsert = conn.prepareStatement(insertItemProcess);
pstmtInsert.setString(1,tranId);
pstmtInsert.setInt(2,rec);
pstmtInsert.setString(3,loginSiteCode);
pstmtInsert.setString(4,rs1.getString("ITEM_CODE"));
pstmtInsert.setString(5,rs1.getString("LOC_CODE"));
pstmtInsert.setString(6,rs1.getString("LOT_NO"));
pstmtInsert.setString(7,rs1.getString("LOT_SL"));
pstmtInsert.setDouble(8,0);
pstmtInsert.setString(9,rs1.getString("ANALYSIS_CLASS"));
pstmtInsert.setInt(10,0);
pstmtInsert.setString(11,rs1.getString("CYCLE_CRITERIA"));
pstmtInsert.setString(12,empCode);
pstmtInsert.setString(13,rs1.getString("UNIT"));
pstmtInsert.setString(14,"A");
pstmtInsert.executeUpdate();
pstmtInsert.close();
pstmtInsert=null;
rec++;
}
rs1.close();
rs1=null;
pstmt1.close();
pstmt1 =null;
}
} }
else else
...@@ -840,8 +838,6 @@ public class PhysicalCountSchedule implements Schedule ...@@ -840,8 +838,6 @@ public class PhysicalCountSchedule implements Schedule
} }
locationMap.add(rs.getString("LOC_CODE")==null?" ":rs.getString("LOC_CODE").trim()); locationMap.add(rs.getString("LOC_CODE")==null?" ":rs.getString("LOC_CODE").trim());
} }
rs.close(); rs.close();
rs=null; 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