Commit d6602a3d authored by pshinde's avatar pshinde

process of Customer Item Update


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97615 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 4483ed1f
......@@ -65,7 +65,7 @@ public String process(Document headerDom, Document detailDom, String windowName,
PreparedStatement pstmt = null;
PreparedStatement pstmt1 = null;
ResultSet rs = null;
//ResultSet rs1 = null;
ResultSet rs1 = null;
String sql = "",sql1="";
int updCnt=0;
String custCodeFrom="",custCodeTo="";
......@@ -83,8 +83,6 @@ public String process(Document headerDom, Document detailDom, String windowName,
try
{
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver = null;
......@@ -95,15 +93,11 @@ public String process(Document headerDom, Document detailDom, String windowName,
itemCodeFrom = checkNull(genericUtility.getColumnValue("item_code__from",headerDom ));
itemCodeTo = checkNull(genericUtility.getColumnValue("item_code__to",headerDom ));
integralQty = checkNull(genericUtility.getColumnValue("integral_qty",headerDom ));
if(integralQty==null|| integralQty.trim().length()==0)
{
resultString = itmDBAccessEJB.getErrorString("","PROCFAILED",userId);
return resultString;
}
else
if(integralQty!=null && integralQty.trim().length()>0)
{
intQty=Double.parseDouble(integralQty);
}
intQty=Double.parseDouble(integralQty);
}
System.out.println("custCodeFrom========="+custCodeFrom);
System.out.println("custCodeTo========="+custCodeTo);
......@@ -111,24 +105,9 @@ public String process(Document headerDom, Document detailDom, String windowName,
System.out.println("itemCodeTo========="+itemCodeTo);
System.out.println("integralQty========="+integralQty);
System.out.println("intQty========="+intQty);
sql="select min(integral_qty) as min_qty from customeritem where item_code >= ? and item_code <= ?";
pstmt=conn.prepareStatement(sql);
pstmt.setString(1,itemCodeFrom);
pstmt.setString(2,itemCodeTo);
rs=pstmt.executeQuery();
if(rs.next())
{
minQty=rs.getDouble("min_qty");
}
pstmt.close();
rs.close();
pstmt = null;
rs = null;
System.out.println("Getting mininum existing integral quantity======"+minQty);
sql="select integral_qty,cust_code,item_code from customeritem where item_code >= ? and item_code <= ? and cust_code >= ? and cust_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.setString(1,itemCodeFrom);
pstmt.setString(2,itemCodeTo);
......@@ -141,10 +120,26 @@ public String process(Document headerDom, Document detailDom, String windowName,
custCode=rs.getString("cust_code");
itemCode=rs.getString("item_code");
System.out.println("Intergral Qty existing Minimum========"+minQty);
System.out.println("custCode========"+custCode);
System.out.println("itemCode========"+itemCode);
System.out.println("Intergral Qty existing========"+intQtyExst);
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("Getting mininum existing integral quantity======"+minQty);
if(intQtyExst <= minQty)
{
intQtyExst=intQty;
......@@ -168,8 +163,7 @@ public String process(Document headerDom, Document detailDom, String windowName,
System.out.println(updCnt + " Records Updated");
if(updCnt>0)
{
System.out.println("Process Sucessful");
System.out.println("Process Sucessful");
}
pstmt1.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