Commit 522f9396 authored by pshinde's avatar pshinde

process of Customer Item Update


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97688 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 6e4b308a
...@@ -71,9 +71,9 @@ public String process(Document headerDom, Document detailDom, String windowName, ...@@ -71,9 +71,9 @@ public String process(Document headerDom, Document detailDom, String windowName,
String custCodeFrom="",custCodeTo=""; String custCodeFrom="",custCodeTo="";
String itemCodeFrom="",itemCodeTo=""; String itemCodeFrom="",itemCodeTo="";
String integralQty=""; String integralQty="";
double intQty=0,minQty=0,intQtyExst=0; double intQty=0,minQty=0,intQtyExst=0,temp=0;
String custCode="",itemCode=""; String custCode="",itemCode="",preItemCode="";
ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB(); ITMDBAccessEJB itmDBAccessEJB = new ITMDBAccessEJB();
String userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId"); String userId = genericUtility.getValueFromXTRA_PARAMS(xtraParams,"userId");
...@@ -107,6 +107,7 @@ public String process(Document headerDom, Document detailDom, String windowName, ...@@ -107,6 +107,7 @@ public String process(Document headerDom, Document detailDom, String windowName,
System.out.println("intQty========="+intQty); System.out.println("intQty========="+intQty);
sql="select (case when integral_qty is null then 0 else integral_qty end) as integral_qty,cust_code,item_code from customeritem where item_code >= ? and item_code <= ? and cust_code >= ? and cust_code <= ? order by item_code"; sql="select (case when integral_qty is null then 0 else integral_qty end) as integral_qty,cust_code,item_code from customeritem where item_code >= ? and item_code <= ? and cust_code >= ? and cust_code <= ? order by item_code";
pstmt=conn.prepareStatement(sql); pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemCodeFrom); pstmt.setString(1,itemCodeFrom);
...@@ -140,6 +141,19 @@ public String process(Document headerDom, Document detailDom, String windowName, ...@@ -140,6 +141,19 @@ public String process(Document headerDom, Document detailDom, String windowName,
rs1 = null; rs1 = null;
System.out.println("Getting mininum existing integral quantity======"+minQty); System.out.println("Getting mininum existing integral quantity======"+minQty);
if(!preItemCode.equalsIgnoreCase(itemCode))
{
System.out.println("In if itemcode does not match. ***********");
temp=minQty;
preItemCode=itemCode;
}
else
{
System.out.println("In else item code match *****************");
minQty=temp;
}
if(intQtyExst <= minQty) if(intQtyExst <= minQty)
{ {
System.out.println("intQtyExst before if======"+intQtyExst); System.out.println("intQtyExst before if======"+intQtyExst);
...@@ -177,6 +191,21 @@ public String process(Document headerDom, Document detailDom, String windowName, ...@@ -177,6 +191,21 @@ public String process(Document headerDom, Document detailDom, String windowName,
pstmt1.close(); pstmt1.close();
pstmt1 = null; pstmt1 = null;
sql="select min(case when integral_qty is null then 0 else integral_qty end) as min_qty from customeritem where item_code = ?";
pstmt1=conn.prepareStatement(sql);
pstmt1.setString(1,itemCode);
rs1=pstmt1.executeQuery();
if(rs1.next())
{
minQty=rs1.getDouble("min_qty");
}
pstmt1.close();
rs1.close();
pstmt1 = null;
rs1 = null;
System.out.println("After update======"+minQty);
} }
pstmt.close(); pstmt.close();
rs.close(); rs.close();
...@@ -189,7 +218,7 @@ public String process(Document headerDom, Document detailDom, String windowName, ...@@ -189,7 +218,7 @@ public String process(Document headerDom, Document detailDom, String windowName,
try { try {
conn.rollback(); conn.rollback();
} catch (SQLException e1) { } catch (SQLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace(); e1.printStackTrace();
} }
isError = true; isError = true;
......
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