Commit aebf9c10 authored by dkasliwal's avatar dkasliwal

update ejb


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@97959 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 1a2e3a75
...@@ -3773,6 +3773,99 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -3773,6 +3773,99 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
} }
/*** end of method getMnthSalesDivWiseGraphData() **/ /*** end of method getMnthSalesDivWiseGraphData() **/
/* Start Code for Globle child grid on 14/04/2015 -Dhanendra*/
@Override
public JSONObject getGlobleChildGridDet(String dataSourceName,String month, String parameters, String linkMetadate) throws RemoteException,ITMException
{
JSONObject rawDataGlobleChildGridJson = new JSONObject();
JSONObject rowData = null;
String sql = "";
ResultSet rs = null;
PreparedStatement pstmt = null;
Connection conn = null;
ConnDriver connDriver = new ConnDriver();
String brandName="";
try
{
System.out.println("linkMetadate------>"+linkMetadate);
if(month!=null && month.trim().length()>0 && parameters!=null)
{
conn = connDriver.getConnectDB(dataSourceName);
connDriver = null;
if(linkMetadate.equals("topbrandgridchild"))
{
String[] splitArr = parameters.trim().split("\\s+");
System.out.println(" month======" + month);
System.out.println(" brandName======" + splitArr[0]);
brandName = splitArr[0];
sql ="SELECT cust_name||' ('||cust_code||')' AS party, ROUND(cmth_val/100000,1) AS cy_mth," +
"ROUND(lmth_val/100000,1) AS ly_mth, ( CASE WHEN lmth_val=0 THEN 0 WHEN " +
"ROUND( (cmth_val-lmth_val)/ lmth_val *100,1) >200 THEN 200 WHEN " +
"ROUND( (cmth_val-lmth_val)/ lmth_val *100,1) <-200 THEN -200 ELSE " +
"ROUND( (cmth_val-lmth_val)/ lmth_val *100,1) END ) AS mth_gr, " +
"ROUND(cytd_val/100000,1) AS cy_ytd, ROUND(lytd_val/100000,1) AS ly_ytd," +
" ( CASE WHEN lytd_val=0 THEN 0 WHEN ROUND( (cytd_val-lytd_val)/ lytd_val *100,1) >200 " +
"THEN 200 WHEN ROUND( (cytd_val-lytd_val)/ lytd_val *100,1) <-200 THEN -200 " +
"ELSE ROUND( (cytd_val-lytd_val)/ lytd_val *100,1) END ) AS ytd_gr, " +
"ROUND(lfull_val/100000,1) AS ly_fullyr FROM brand_cus WHERE prd_code='"+month+"'" +
" AND trim(brand)='"+brandName+"' ORDER BY cytd_val DESC ";
//sql = "select 1 as PARTY, 2 as CY_MTH, 2 as LY_MTH, 2 as MTH_GR,2 as CY_YTD,2 as LY_YTD,2 as YTD_GR,2 as LY_FULLYR from dual";
pstmt = conn.prepareStatement(sql);
rs = pstmt.executeQuery();
int count = 0;
while (rs.next())
{
rowData = new JSONObject();
rowData.put("party", checkNull(rs.getString("PARTY")));
rowData.put("cy_mth", rs.getString("CY_MTH"));
rowData.put("ly_mth", rs.getString("LY_MTH"));
rowData.put("mth_gr", rs.getString("MTH_GR"));
rowData.put("cy_ytd", rs.getString("CY_YTD"));
rowData.put("ly_ytd", rs.getString("LY_YTD"));
rowData.put("ytd_gr", rs.getString("YTD_GR"));
rowData.put("ly_fullyr", rs.getString("LY_FULLYR"));
rawDataGlobleChildGridJson.put(count, rowData);
count++;
}
}
}
System.out.println("fetch Data for Mnth Sales Div Wise Graph rawjson====" + rawDataGlobleChildGridJson.toString());
}
catch (Exception e)
{
e.printStackTrace();
throw new ITMException(e);
} finally
{
try
{
if (conn != null)
{
if (rs != null)
rs.close();
rs = null;
if (pstmt != null)
pstmt.close();
pstmt = null;
conn.close();
conn = null;
}
conn = null;
} catch (Exception d)
{
d.printStackTrace();
System.out.println("Exception in :SalesPersonSales:getMnthSalesDivWiseGraphData:" + d.getMessage());
throw new ITMException(d);
}
}
return rawDataGlobleChildGridJson;
}
/* End Code for Globle child grid on 14/04/2015 -Dhanendra*/
private String checkNull(String str) private String checkNull(String str)
...@@ -3787,5 +3880,4 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe ...@@ -3787,5 +3880,4 @@ public class SalesPerformance extends ValidatorEJB implements SalesPerformanceRe
} }
} }
} }
...@@ -24,4 +24,5 @@ public interface SalesPerformanceLocal extends ValidatorLocal ...@@ -24,4 +24,5 @@ public interface SalesPerformanceLocal extends ValidatorLocal
public JSONObject getBrandWiseZoneDetail(String dataSourceName,String month,String brandName) throws RemoteException, ITMException; public JSONObject getBrandWiseZoneDetail(String dataSourceName,String month,String brandName) throws RemoteException, ITMException;
public JSONObject getBrandZoneWiseMetroDetail(String dataSourceName,String month,String brandName,String zoneDescr,String divDescr) throws RemoteException, ITMException; public JSONObject getBrandZoneWiseMetroDetail(String dataSourceName,String month,String brandName,String zoneDescr,String divDescr) throws RemoteException, ITMException;
public JSONObject getTopBrandMTH(String dataSourceName,String month,String divCode) throws RemoteException, ITMException; public JSONObject getTopBrandMTH(String dataSourceName,String month,String divCode) throws RemoteException, ITMException;
public JSONObject getGlobleChildGridDet(String dataSourceName,String month,String parameters, String linkMetadata) throws RemoteException, ITMException;
} }
...@@ -23,4 +23,6 @@ public interface SalesPerformanceRemote extends ValidatorRemote ...@@ -23,4 +23,6 @@ public interface SalesPerformanceRemote extends ValidatorRemote
public JSONObject getTopBrandMTH(String dataSourceName,String month,String divCode) throws RemoteException, ITMException; public JSONObject getTopBrandMTH(String dataSourceName,String month,String divCode) throws RemoteException, ITMException;
public JSONObject getBrandWiseZoneDetail(String dataSourceName,String month,String brandName) throws RemoteException, ITMException; public JSONObject getBrandWiseZoneDetail(String dataSourceName,String month,String brandName) throws RemoteException, ITMException;
public JSONObject getBrandZoneWiseMetroDetail(String dataSourceName,String month,String brandName,String zoneDescr,String divDescr) throws RemoteException, ITMException; public JSONObject getBrandZoneWiseMetroDetail(String dataSourceName,String month,String brandName,String zoneDescr,String divDescr) throws RemoteException, ITMException;
public JSONObject getGlobleChildGridDet(String dataSourceName,String month,String parameters, String linkMetadata) throws RemoteException, ITMException;
} }
This diff is collapsed.
package ibase.dashboard.scm.ejb;
import java.rmi.RemoteException;
import ibase.webitm.ejb.ValidatorLocal;
import ibase.webitm.utility.ITMException;
import javax.ejb.Local;
import org.json.simple.JSONObject;
@Local
public interface StateWiseStockLocal extends ValidatorLocal
{
public JSONObject getIndiaMap(String dataSourceName,String month,String brand,String division,String viewOptionSelectd) throws RemoteException, ITMException;
}
package ibase.dashboard.scm.ejb;
import java.rmi.RemoteException;
import ibase.webitm.ejb.ValidatorRemote;
import ibase.webitm.utility.ITMException;
import javax.ejb.Remote;
import org.json.simple.JSONObject;
@Remote
public interface StateWiseStockRemote extends ValidatorRemote
{
public JSONObject getIndiaMap(String dataSourceName,String month,String brand,String division,String viewOptionSelectd) throws RemoteException, ITMException;
}
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