Commit 2b24308f authored by pshinde's avatar pshinde

update chg date,chg user,chg terminal customeritem update process.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97969 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 83e62cec
......@@ -14,6 +14,7 @@ import java.sql.*;
import org.w3c.dom.*;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.HashMap;
import javax.ejb.Stateless; // added for ejb3
......@@ -72,14 +73,17 @@ public String process(Document headerDom, Document detailDom, String windowName,
ResultSet rs2 = null;
String sql = "",sql1="";
int updCnt=0;
GenericUtility genericUtility = GenericUtility.getInstance();
String custCodeFrom="",custCodeTo="",preCustCode="";
String siteCodeFr="",siteCodeTo="";
String itemCodeFrom="",itemCodeTo="";
String integralQty="";
double intQty=0,minQty=0,intQtyExst=0,temp=0;
String chguser = null;
String chgterm = null;
String custCode="",itemCode="",preItemCode="",custCode1="",siteCode="";
String sysDate ="";
Timestamp sysDate1 = null;
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
String userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId");
loginSiteCode = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"loginSiteCode");
......@@ -92,7 +96,14 @@ public String process(Document headerDom, Document detailDom, String windowName,
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
conn.setAutoCommit(false);
java.util.Date today=new java.util.Date();
Calendar c = Calendar.getInstance();
today = c.getTime();
SimpleDateFormat sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
sysDate=sdf.format(today);
System.out.println("sysDate****=========="+sysDate);
sysDate1= Timestamp.valueOf(genericUtility.getValidDateString(sysDate, genericUtility.getApplDateFormat(),genericUtility.getDBDateFormat()) + " 00:00:00.0");
//custCodeFrom = checkNull(genericUtility.getColumnValue("cust_code__from",headerDom ));
//custCodeTo= checkNull(genericUtility.getColumnValue("cust_code__to",headerDom ));
siteCodeFr = checkNull(genericUtility.getColumnValue("site_code__fr",headerDom ));
......@@ -101,6 +112,15 @@ public String process(Document headerDom, Document detailDom, String windowName,
itemCodeTo = checkNull(genericUtility.getColumnValue("item_code__to",headerDom ));
integralQty = checkNull(genericUtility.getColumnValue("integral_qty",headerDom ));
chguser = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "loginCode");
chgterm = genericUtility.getValueFromXTRA_PARAMS(xtraParams, "termId");
System.out.println("Change User================"+chguser);
System.out.println("Change Term================"+chgterm);
System.out.println("Change date================"+sysDate);
System.out.println("Change date=TimeStamp==============="+sysDate1);
if(integralQty!=null && integralQty.trim().length()>0)
{
intQty=Double.parseDouble(integralQty);
......@@ -229,12 +249,15 @@ public String process(Document headerDom, Document detailDom, String windowName,
System.out.println("Getting new integral Quantity====="+intQtyExst);
sql1="update customeritem set integral_qty= ? where item_code= ? and cust_code= ? ";
sql1="update customeritem set integral_qty= ?,CHG_DATE= ?,CHG_USER= ?, CHG_TERM= ? where item_code= ? and cust_code= ? ";
System.out.println("sql :" + sql1);
pstmt2 = conn.prepareStatement(sql1);
pstmt2.setDouble(1,intQtyExst);
pstmt2.setString(2,itemCode);
pstmt2.setString(3,custCode);
pstmt2.setTimestamp(2,sysDate1);
pstmt2.setString(3,chguser);
pstmt2.setString(4,chgterm);
pstmt2.setString(5,itemCode);
pstmt2.setString(6,custCode);
updCnt = pstmt2.executeUpdate();
System.out.println(updCnt + " Records Updated");
......
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