Commit d218a3d3 authored by sbade's avatar sbade

updated aql for dashboard data as per given bye client


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97780 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 85c104c8
......@@ -21,7 +21,7 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote
GenericUtility genericUtility = GenericUtility.getInstance();
//1.This is the main method to show the parent graph
@SuppressWarnings("unchecked")
public JSONObject getSalesInventoryDivWise(String dataSourceName, String month, String from_mns, String to_mns ) throws RemoteException, ITMException
public JSONObject getSalesInventoryDivWise(String dataSourceName, String month, String nomns) throws RemoteException, ITMException
{
JSONObject rawDataJson = new JSONObject();
......@@ -40,7 +40,7 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote
int count=0;
if(month!=null && month.trim().length()>0)
{
System.out.println("month inside EJB SalesInventory.getSalesInventoryDivWise(String dataSourceName, String month) ==="+month);
System.out.println("month inside EJB SalesInventory.getSalesInventoryDivWise(String dataSourceName, String month) ==="+month+"and Nomns==="+nomns);
String selectedmonth = month.substring(4, 6);
if(selectedmonth.trim().equalsIgnoreCase("01") ||selectedmonth.trim().equalsIgnoreCase("02") ||selectedmonth.trim().equalsIgnoreCase("03"))
{
......@@ -79,7 +79,8 @@ public class SalesInventory extends ValidatorEJB implements SalesInventoryRemote
" GROUP BY item_code UNION ALL SELECT item_code, SUM(cl_stk_qty) AS cl_stk FROM sun.inventory_spl WHERE inv_date= LAST_DAY(TO_DATE('"+month+"','yyyymm')) AND loc_code " +
" IN ( SELECT loc_code FROM LOC_SALABLE) GROUP BY item_code ) GROUP BY item_code ) CLSTK WHERE Sl.item_code= i.item_code AND ('"+month+"' = '"+month+"') AND i.item_sub_group NOT " +
" IN ('CU','BJ') AND sl.item_code=clstk.item_code(+) GROUP BY sl.item_ser, trim(i.item_sub_group_descr) HAVING SUM(sl.ytdsl)>0 ) GROUP BY item_ser,brand,ytdsl,ytdach,cl_stk,nomn HAVING " +
" ( ROUND(cl_stk/(ytdsl/nomn),1) >= '"+from_mns+"' and ROUND(cl_stk/(ytdsl/nomn),1) <= '"+to_mns+"' ) ) A , ITEMSER WHERE a.item_ser=ITEMSER.item_ser AND a.brand NOT LIKE 'DUMMY%'";
" ( ROUND(cl_stk/(ytdsl/nomn),1) "+nomns +") ) A , ITEMSER WHERE a.item_ser=ITEMSER.item_ser AND a.brand NOT LIKE 'DUMMY%'";
//" ( ROUND(cl_stk/(ytdsl/nomn),1) >= '"+from_mns+"' and ROUND(cl_stk/(ytdsl/nomn),1) <= '"+to_mns+"' ) ) A , ITEMSER WHERE a.item_ser=ITEMSER.item_ser AND a.brand NOT LIKE 'DUMMY%'";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
......
......@@ -8,7 +8,7 @@ import org.json.simple.JSONObject;
@Local
public interface SalesInventoryLocal extends ValidatorLocal
{
public JSONObject getSalesInventoryDivWise(String dataSourceName,String month,String from_mns, String to_mns) throws RemoteException, ITMException;
public JSONObject getSalesInventoryDivWise(String dataSourceName,String month,String nomns) throws RemoteException, ITMException;
public JSONObject getSalesInventoryBrandWise(String dataSourceName,String month,String brandName) throws RemoteException, ITMException;
}
......@@ -10,7 +10,7 @@ import org.json.simple.JSONObject;
@Remote
public interface SalesInventoryRemote extends ValidatorRemote
{
public JSONObject getSalesInventoryDivWise(String dataSourceName,String month,String from_mns, String to_mns) throws RemoteException, ITMException;
public JSONObject getSalesInventoryDivWise(String dataSourceName,String month,String nomns) throws RemoteException, ITMException;
public JSONObject getSalesInventoryBrandWise(String dataSourceName,String month,String brandName) throws RemoteException, ITMException;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
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