Commit b5929df7 authored by ssarkar's avatar ssarkar

changed by sumit on 23/03/13 source given by KUNAL


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92866 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1ac41f79
...@@ -97,9 +97,9 @@ public class PhysicalCountSchedule implements Schedule ...@@ -97,9 +97,9 @@ public class PhysicalCountSchedule implements Schedule
{ {
Connection conn = null; Connection conn = null;
PreparedStatement pstmt = null; PreparedStatement pstmt = null,pstmt1 = null;
PreparedStatement pstmtInsert = null; PreparedStatement pstmtInsert = null;
ResultSet rs = null; ResultSet rs = null,rs1 = null;
Statement stmt = null; Statement stmt = null;
java.util.Date todayDate=null; java.util.Date todayDate=null;
...@@ -115,7 +115,7 @@ public class PhysicalCountSchedule implements Schedule ...@@ -115,7 +115,7 @@ public class PhysicalCountSchedule implements Schedule
String itemCode=""; String itemCode="";
String analysisClass=""; String analysisClass="";
String siteCode=""; String siteCode="";
String sql = "";
String locCode=""; String locCode="";
String chgUser=""; String chgUser="";
String chgTerm=""; String chgTerm="";
...@@ -761,6 +761,18 @@ public class PhysicalCountSchedule implements Schedule ...@@ -761,6 +761,18 @@ public class PhysicalCountSchedule implements Schedule
if(!locationMap.contains((String)rs.getString("LOC_CODE").trim())) if(!locationMap.contains((String)rs.getString("LOC_CODE").trim()))
{ {
System.out.println("Kunal Test");
sql = " select stock.loc_code,stock.item_code,stock.lot_no,stock.lot_sl , item.analysis_class,item.cycle_criteria,"
+" item.unit from stock ,item where stock.item_code = item.item_code and stock.site_code = ? and stock.loc_code = ? and stock.quantity > 0 ";
pstmt1 = conn.prepareStatement(sql);
pstmt1.setString(1, loginSiteCode);
pstmt1.setString(2, rs.getString("LOC_CODE").trim());
rs1 = pstmt1.executeQuery();
if(rs1 == null)
{
System.out.println("insert from query ");
insertItemProcess="insert into PHYSCANDET (TRAN_ID,LINE_NO,SITE_CODE,ITEM_CODE," + insertItemProcess="insert into PHYSCANDET (TRAN_ID,LINE_NO,SITE_CODE,ITEM_CODE," +
"LOC_CODE,LOT_NO,LOT_SL,QUANTITY," + "LOC_CODE,LOT_NO,LOT_SL,QUANTITY," +
"ANALYSIS_CLASS,PRIORITY_SEQ,CYCLE_CRITERIA,EMP_CODE__USER,UNIT,TRAN_TYPE) " + "ANALYSIS_CLASS,PRIORITY_SEQ,CYCLE_CRITERIA,EMP_CODE__USER,UNIT,TRAN_TYPE) " +
...@@ -783,6 +795,43 @@ public class PhysicalCountSchedule implements Schedule ...@@ -783,6 +795,43 @@ public class PhysicalCountSchedule implements Schedule
pstmtInsert.executeUpdate(); pstmtInsert.executeUpdate();
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
{ {
......
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