Commit 623537e8 authored by cpatil's avatar cpatil

adding change term,change date,change user


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@92841 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 38fac91b
......@@ -35,6 +35,7 @@ public class StockUpdate
Timestamp creaDateStr=null,date=null,mfgDate=null,expDate = null,currDate=null,retestDateDate=null;
Timestamp lastPhycDate=null,tranDate= null,retestDate =null;
String suppCode=""; // added by cpatil
String chgTerm="",chgUser=""; // added by cpatil
//
String considerAllocate = "Y", partialUsed = "";
//
......@@ -77,6 +78,10 @@ public class StockUpdate
tempTestDate = Timestamp.valueOf("1900-01-01 00:00:00");
userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
termId = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId");
chgTerm = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "chgTerm" );
chgUser = genericUtility.getValueFromXTRA_PARAMS( xtraParams, "chgUser" );
if (userId == null || userId.trim().length() == 0)
{
userId = "SYSTEM";
......@@ -2462,22 +2467,22 @@ public class StockUpdate
// added by cpatil on 16/11/12 start adding stock update function
private HashMap updateLotInfo(HashMap updateStockMap ,Connection conn) throws ITMException, Exception
{
String sql="",errCode="";
ResultSet rs=null;
PreparedStatement pstmt=null;
String sql="",errCode="",sql2="";
ResultSet rs=null, rs2=null;
PreparedStatement pstmt=null, pstmt2=null;
String shelfLifeType="",lotNo="",itemCode="",grade="",stkOpt="";
int cnt=0,cnt1=0;
Timestamp expDate=null , mfgDate=null, retestDate=null;
Timestamp expDate=null , mfgDate=null, retestDate=null ,retestDate_upd3=null;
//Date today=null;
double grossrate=0;
String packCode="",siteCodeMfg="",acctCodeInv="",cctrCodeInv="",batchNo="",suppCodeMfg="",suppCode="";
double potencyPerc=0 , grossRate=0 , rate=0 , batchSize=0;
java.util.Date retestDate3=null,expDate3=null,mfgDate3=null;
java.util.Date retestDate3=null,expDate3=null,mfgDate3=null,retestDate_upd2=null;
Calendar currentDate = Calendar.getInstance();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
Timestamp today = Timestamp.valueOf(simpleDateFormat.format(simpleDateFormat.parse(simpleDateFormat.format(currentDate.getTime()))).toString() + " 00:00:00.0");
System.out.println("Now the date is :=> " + today);
String available="";
// today = new java.sql.Date(System.currentTimeMillis());
System.out.println("today:::["+today+"]");
......@@ -2823,10 +2828,52 @@ public class StockUpdate
updateStockMap.put("exp_date", expDate);
}
//if isnull(s_updatestock.retest_date) then s_updatestock.retest_date = mretest_date
System.out.println("@@@@ updateStockMap.get(retest_date) ["+updateStockMap.get("retest_date").toString()+"]"); // added by cpatil on 05-03-13
if( updateStockMap.get("retest_date")!= null && updateStockMap.get("retest_date").toString() != "01/01/1990" )
{
sql2 = " select available from invstat where inv_stat = ( select inv_stat from location where loc_code = ? ) ";
pstmt2 = conn.prepareStatement(sql2);
pstmt2.setString(1,this.locationCode);
rs2 = pstmt2.executeQuery();
if(rs2.next())
{
available = rs2.getString("available");
}
rs2.close();
rs2 = null;
pstmt2.close();
pstmt2 = null;
System.out.println("@@@@ this.tranSer ["+this.tranSer+"]::::available ["+available+"]");
if ( "QC-ORD".equalsIgnoreCase(this.tranSer) && "Y".equalsIgnoreCase( available ) )
{
sql2 = " update item_lot_info set retest_date = ? where item_code = ? and lot_no = ? " ;
pstmt2=conn.prepareStatement(sql2);
String retestDate_upd = updateStockMap.get("retest_date")==null?null:updateStockMap.get("retest_date").toString();
if( retestDate_upd != null )
{
SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat(genericUtility.getDBDateFormat());
retestDate_upd2 = simpleDateFormat1.parse(retestDate_upd);
System.out.println("@@@@@@@@@retestDate_upd2["+retestDate_upd2+"]");
retestDate_upd3 = new Timestamp(retestDate_upd2.getTime());
System.out.println("@@@@@@@@@retestDate_upd3["+retestDate_upd3+"]");
}
pstmt2.setTimestamp(1,retestDate_upd3);
//pstmt2.setDate(1,retestDate_upd2 == null?null:new java.sql.Date(retestDate_upd2.getTime()));
pstmt2.setString(2,updateStockMap.get("item_code")==null?null:updateStockMap.get("item_code").toString());
pstmt2.setString(3,updateStockMap.get("lot_no")==null?null:updateStockMap.get("lot_no").toString());
cnt1 = pstmt2.executeUpdate();
pstmt2.close();
pstmt2 = null;
System.out.println("@@@@ cnt1:::"+cnt1);
}
} // end by cpatil
else
{
if(updateStockMap.get("retest_date")== null)
{
updateStockMap.put("retest_date", retestDate);
}
}
//if isnull(s_updatestock.lotno) then s_updatestock.lotno = ls_lot_no
if(updateStockMap.get("lotno")== null)
{
......@@ -3027,8 +3074,8 @@ public class StockUpdate
sql = " insert into item_lot_info (item_code,lot_no,grade,crea_date,exp_date,mfg_date,retest_date,pack_code," +
" potency_perc,site_code__mfg,rate,gross_rate,acct_code__inv," +
" cctr_code__inv,batch_no,batch_size,supp_code__mfg,shelf_life_type,supp_code) " +
" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) ";
" cctr_code__inv,batch_no,batch_size,supp_code__mfg,shelf_life_type,supp_code,chg_date,chg_term,chg_user) " +
" values (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) "; // added by cpatil on 07-03-13 start for change term,date,user
pstmt=conn.prepareStatement(sql);
......@@ -3076,6 +3123,10 @@ public class StockUpdate
pstmt.setString(17,updateStockMap.get("supp_code_mfg")==null?null:updateStockMap.get("supp_code__mfg").toString());
pstmt.setString(18,shelfLifeType);
pstmt.setString(19,updateStockMap.get("supp_code")==null?null:updateStockMap.get("supp_code").toString());
pstmt.setTimestamp(20,today);
//pstmt.setDate(20,today);
pstmt.setString(21,chgTerm);
pstmt.setString(22,chgUser);
cnt1 = pstmt.executeUpdate();
pstmt.close();
......
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