Commit f04b8333 authored by msharma's avatar msharma

Sorting issue resolved and unit,unit__std columns are set


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@93220 ce508802-f39f-4f6c-b175-0d175dae99d5
parent e70c0135
...@@ -144,9 +144,17 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -144,9 +144,17 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
double pendQty = 0; double pendQty = 0;
double allocQty = 0; double allocQty = 0;
boolean bappend = false ; boolean bappend = false ;
SimpleDateFormat sdf=null;
retTabSepStrBuff = new StringBuffer("<?xml version = \"1.0\"?>");
retTabSepStrBuff.append("<DocumentRoot>");
retTabSepStrBuff.append("<description>").append("Datawindow Root").append("</description>");
retTabSepStrBuff.append("<group0>");
retTabSepStrBuff.append("<description>").append("Group0 description").append("</description>");
retTabSepStrBuff.append("<Header0>");
try try
{ {
sdf=new SimpleDateFormat(genericUtility.getApplDateFormat());
ConnDriver connDriver = new ConnDriver(); ConnDriver connDriver = new ConnDriver();
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat()); SimpleDateFormat simpleDateFormat = new SimpleDateFormat(genericUtility.getDBDateFormat());
conn = connDriver.getConnectDB("DriverITM"); conn = connDriver.getConnectDB("DriverITM");
...@@ -278,6 +286,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -278,6 +286,7 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
+"SORDER.SITE_CODE__SHIP,SORDITEM.EXP_LEV , " +"SORDER.SITE_CODE__SHIP,SORDITEM.EXP_LEV , "
+"CASE WHEN SORDDET.HOLD_FLAG IS NULL THEN 'N' ELSE SORDDET.HOLD_FLAG END, "// ADDED BY AKHILESH FOR NEW COLUNM +"CASE WHEN SORDDET.HOLD_FLAG IS NULL THEN 'N' ELSE SORDDET.HOLD_FLAG END, "// ADDED BY AKHILESH FOR NEW COLUNM
+" ITEM.GTIN_CASE,ITEM.GTIN_UNIT " //added by Kunal on 22/10/12 +" ITEM.GTIN_CASE,ITEM.GTIN_UNIT " //added by Kunal on 22/10/12
+",SORDDET.UNIT,SORDDET.UNIT__STD,SORDDET.CONV__QTY_STDUOM,SORDDET.QUANTITY__STDUOM "
+"FROM SORDDET,SORDER,SORDITEM,CUSTOMER,ITEM " +"FROM SORDDET,SORDER,SORDITEM,CUSTOMER,ITEM "
+"WHERE ( SORDER.SALE_ORDER = SORDDET.SALE_ORDER ) AND " +"WHERE ( SORDER.SALE_ORDER = SORDDET.SALE_ORDER ) AND "
+"( SORDITEM.SALE_ORDER = SORDER.SALE_ORDER ) AND " +"( SORDITEM.SALE_ORDER = SORDER.SALE_ORDER ) AND "
...@@ -370,41 +379,64 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -370,41 +379,64 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
if(itemCodeMap.containsKey(rs.getString(6))) if(itemCodeMap.containsKey(rs.getString(6)))
{ {
retTabSepStrBuff.append("<Detail2>");
//CUST_CODE //CUST_CODE
retTabSepStrBuff.append(rs.getString(1)).append("\t"); //retTabSepStrBuff.append(rs.getString(1)).append("\t");
retTabSepStrBuff.append("<cust_code>").append("<![CDATA[" + rs.getString(1) +"]]>").append("</cust_code>");
//CUST_NAME //CUST_NAME
retTabSepStrBuff.append(rs.getString(2)).append("\t"); //retTabSepStrBuff.append(rs.getString(2)).append("\t");
retTabSepStrBuff.append("<cust_name>").append("<![CDATA[" + rs.getString(2) +"]]>").append("</cust_name>");
//LINE_NO //LINE_NO
retTabSepStrBuff.append(rs.getString(3)).append("\t"); //retTabSepStrBuff.append(rs.getString(3)).append("\t");
retTabSepStrBuff.append("<line_no>").append("<![CDATA[" + rs.getString(3) +"]]>").append("</line_no>");
//SALE_ORDER //SALE_ORDER
retTabSepStrBuff.append(rs.getString(4)).append("\t"); //retTabSepStrBuff.append(rs.getString(4)).append("\t");
retTabSepStrBuff.append("<sale_order>").append("<![CDATA[" + rs.getString(4) +"]]>").append("</sale_order>");
//DUE_DATE //DUE_DATE
retTabSepStrBuff.append(rs.getTimestamp(5)).append("\t"); //retTabSepStrBuff.append(rs.getTimestamp(5)).append("\t");
retTabSepStrBuff.append("<due_date>").append("<![CDATA[" + sdf.format(rs.getTimestamp(5)) +"]]>").append("</due_date>");
dueDate = rs.getTimestamp(5); dueDate = rs.getTimestamp(5);
//ITEM_CODE //ITEM_CODE
retTabSepStrBuff.append(rs.getString(6)).append("\t"); //retTabSepStrBuff.append(rs.getString(6)).append("\t");
//DESCR retTabSepStrBuff.append("<item_code>").append("<![CDATA[" + rs.getString(6) +"]]>").append("</item_code>");
retTabSepStrBuff.append(rs.getString(7)).append("\t");
//QUANTITY //QUANTITY
retTabSepStrBuff.append(rs.getDouble(8)).append("\t"); //retTabSepStrBuff.append(rs.getDouble(8)).append("\t");
retTabSepStrBuff.append("<quantity>").append("<![CDATA[" + rs.getDouble(8) +"]]>").append("</quantity>");
//UNIT
retTabSepStrBuff.append("<unit>").append("<![CDATA[" + rs.getString("UNIT") +"]]>").append("</unit>");
//UNIT__STD
retTabSepStrBuff.append("<unit__std>").append("<![CDATA[" + rs.getString("UNIT__STD") +"]]>").append("</unit__std>");
//UNIT__STD
retTabSepStrBuff.append("<conv__qty_stduom>").append("<![CDATA[" + rs.getString("CONV__QTY_STDUOM") +"]]>").append("</conv__qty_stduom>");
//UNIT__STD
retTabSepStrBuff.append("<quantity__stduom>").append("<![CDATA[" + rs.getString("QUANTITY__STDUOM") +"]]>").append("</quantity__stduom>");
//PENDING_QUANTITY //PENDING_QUANTITY
retTabSepStrBuff.append(rs.getDouble(9)).append("\t"); //retTabSepStrBuff.append(rs.getDouble(9)).append("\t");
//STOCK_QUANTITY retTabSepStrBuff.append("<pending_quantity>").append("<![CDATA[" + rs.getDouble(9) +"]]>").append("</pending_quantity>");
pendQty = rs.getDouble(9);
//***** check itemhashmap wheather current item_code already exists
// if not add to itemhashmap and get the stock as follows and set in
// tabdelimited string else nothing is to be done just consider the stock as 0
if (bappend == true) if (bappend == true)
{ {
retTabSepStrBuff.append(balStockQty).append("\t"); //retTabSepStrBuff.append(balStockQty).append("\t");
retTabSepStrBuff.append("<stock_quantity>").append("<![CDATA[" + balStockQty +"]]>").append("</stock_quantity>");
} }
else else
{ {
retTabSepStrBuff.append("0").append("\t"); //retTabSepStrBuff.append("0").append("\t");
retTabSepStrBuff.append("<stock_quantity>").append("<![CDATA[" + 0 +"]]>").append("</stock_quantity>");
} }
//qty allocated
//retTabSepStrBuff.append(rs.getDouble(10)).append("\t");// ADDED BY AKHILESH
retTabSepStrBuff.append("<qty_allocated>").append("<![CDATA[" + rs.getDouble(10) +"]]>").append("</qty_allocated>");
//STOCK_QUANTITY
pendQty = rs.getDouble(9);
//***** check itemhashmap wheather current item_code already exists
// if not add to itemhashmap and get the stock as follows and set in
// tabdelimited string else nothing is to be done just consider the stock as 0
/////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////
// alloc_qty to be set based on stock availability // alloc_qty to be set based on stock availability
...@@ -425,40 +457,59 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc ...@@ -425,40 +457,59 @@ public class StockAllocationPrc extends ProcessEJB implements StockAllocationPrc
} }
if(DefaultQtyFlag.equals("Y")) if(DefaultQtyFlag.equals("Y"))
{ {
retTabSepStrBuff.append(allocQty).append("\t"); //retTabSepStrBuff.append(allocQty).append("\t");
retTabSepStrBuff.append("<qty_alloc>").append("<![CDATA[" + allocQty +"]]>").append("</qty_alloc>");
} }
else else
{ {
retTabSepStrBuff.append("0").append("\t"); //retTabSepStrBuff.append("0").append("\t");
retTabSepStrBuff.append("<qty_alloc>").append("<![CDATA[" + 0 +"]]>").append("</qty_alloc>");
} }
//Hold Qty
//retTabSepStrBuff.append(holdQty).append("\t");// added by Kunal on 22/10/12
retTabSepStrBuff.append("<hold_qty>").append("<![CDATA[" + holdQty +"]]>").append("</hold_qty>");
//Gtin Case
//retTabSepStrBuff.append(rs.getString(15)== null?" ":rs.getString(15)).append("\t");// added by Kunal on 22/10/12
retTabSepStrBuff.append("<gtin_case>").append("<![CDATA[" + (rs.getString(15) == null? " ":rs.getString(15)) +"]]>").append("</gtin_case>");
//Gtin Unit
//retTabSepStrBuff.append(rs.getString(16) == null?" ":rs.getString(16)).append("\t");// added by Kunal on 25/10/12
retTabSepStrBuff.append("<gtin_unit>").append("<![CDATA[" + (rs.getString(16) == null? " ":rs.getString(16)) +"]]>").append("</gtin_unit>");
//DESCR
//retTabSepStrBuff.append(rs.getString(7)).append("\t");
retTabSepStrBuff.append("<item_descr>").append("<![CDATA[" + rs.getString(7) +"]]>").append("</item_descr>");
//Hold Flag
//retTabSepStrBuff.append(rs.getString(14) == null?"N":rs.getString(14)).append("\t");// ADDED BY AKHILESH
retTabSepStrBuff.append("<hold_flag>").append("<![CDATA[" + (rs.getString(14) == null? " ":rs.getString(14)) +"]]>").append("</hold_flag>");
// this line has to be commented later // this line has to be commented later
// as this will be a input from the user // as this will be a input from the user
itemCodeMap.put(rs.getString(6), new Double(balStockQty)); itemCodeMap.put(rs.getString(6), new Double(balStockQty));
//PACK_INSTR //PACK_INSTR
retTabSepStrBuff.append(rs.getString(11) == null? " ":rs.getString(11)).append("\t"); //retTabSepStrBuff.append(rs.getString(11) == null? " ":rs.getString(11)).append("\t");
retTabSepStrBuff.append("<pack_instr>").append("<![CDATA[" + (rs.getString(11) == null? " ":rs.getString(11)) +"]]>").append("</pack_instr>");
//SITE_CODE //SITE_CODE
retTabSepStrBuff.append(rs.getString(12) == null?" ":rs.getString(12)).append("\t"); //retTabSepStrBuff.append(rs.getString(12) == null?" ":rs.getString(12)).append("\t");
retTabSepStrBuff.append("<site_code>").append("<![CDATA[" + (rs.getString(12) == null? " ":rs.getString(12)) +"]]>").append("</site_code>");
//EXP_LEV //EXP_LEV
retTabSepStrBuff.append(rs.getString(13) == null?" " :rs.getString(13) ).append("\t"); //retTabSepStrBuff.append(rs.getString(13) == null?" " :rs.getString(13) ).append("\t");
retTabSepStrBuff.append("<exp_lev>").append("<![CDATA[" + (rs.getString(13) == null? " ":rs.getString(13)) +"]]>").append("</exp_lev>");
//Hold Flag
retTabSepStrBuff.append(rs.getString(14) == null?"N":rs.getString(14)).append("\t");// ADDED BY AKHILESH
//qty allocated
retTabSepStrBuff.append(rs.getDouble(10)).append("\t");// ADDED BY AKHILESH
//Hold Qty
retTabSepStrBuff.append(holdQty).append("\t");// added by Kunal on 22/10/12
//Gtin Case
retTabSepStrBuff.append(rs.getString(15)== null?" ":rs.getString(15)).append("\t");// added by Kunal on 22/10/12
//Gtin Unit
retTabSepStrBuff.append(rs.getString(16) == null?" ":rs.getString(16)).append("\t");// added by Kunal on 25/10/12
retTabSepStrBuff.append("\n");
retTabSepStrBuff.append("</Detail2>");
//retTabSepStrBuff.append("\n");
} }
}while(rs.next());
}while(rs.next());
retTabSepStrBuff.append("</Header0>");
retTabSepStrBuff.append("</group0>");
retTabSepStrBuff.append("</DocumentRoot>");
resultString = retTabSepStrBuff.toString(); resultString = retTabSepStrBuff.toString();
System.out.println("ResultString....." + resultString); System.out.println("ResultString....." + resultString);
pstmt.clearParameters(); pstmt.clearParameters();
......
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