Commit d0f0cb92 authored by dkasliwal's avatar dkasliwal

Add code for stacksmrt group for FGWarehouse dashboard. and create method for...

Add code for stacksmrt group for FGWarehouse dashboard. and create method for FGWarehouse stack chart.


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@104632 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 41d6a87f
...@@ -398,7 +398,7 @@ public class GraphComponent extends Composite ...@@ -398,7 +398,7 @@ public class GraphComponent extends Composite
this.createInnerDiv(uniqueId+cnt,groupNameList.get(0)+uniqueId); this.createInnerDiv(uniqueId+cnt,groupNameList.get(0)+uniqueId);
RootPanel.get("chart"+uniqueId+cnt).setStyleName(groupCssTypeNameList.get(0)); RootPanel.get("chart"+uniqueId+cnt).setStyleName(groupCssTypeNameList.get(0));
graphJson = ChartCreator.buildChartData(graphDtlList, dataJsn, key,parameterList,filterList,""); graphJson = ChartCreator.buildChartData(graphDtlList, dataJsn, key,parameterList,filterList,"",null);
CommonUtils.printOnConsole("dataJsn for Stack key graphJson :"+graphJson); CommonUtils.printOnConsole("dataJsn for Stack key graphJson :"+graphJson);
if(graphJson.size()==0 ) if(graphJson.size()==0 )
...@@ -416,6 +416,143 @@ public class GraphComponent extends Composite ...@@ -416,6 +416,143 @@ public class GraphComponent extends Composite
this.focusOnDiv(groupNameList.get(0)+uniqueId+"Div"); this.focusOnDiv(groupNameList.get(0)+uniqueId+"Div");
} }
} }
}else if("stacksmrt".equalsIgnoreCase(groupNameList.get(0)))
{
CommonUtils.printOnConsole("*************** In stacksmrt************* ");
CommonUtils.printOnConsole("datajsn :"+dataJsn);
JSONObject dataJsonObject = getReceivableDataJson(dataJsn);
String currentID = "Graph"+uniqueId+componentId+"Div";
CommonUtils.printOnConsole("dataJsn for dataJsonObject :"+dataJsonObject);
graphJson = ChartCreator.buildChartData(graphDtlList, dataJsonObject, dtSrouce,parameterList,filterList,currentID,null);
CommonUtils.printOnConsole("dataJsn for graphJson :"+graphJson);
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
pageOpenContainer.putIdListInMap(currentID, childID);
exportDynamicMethod();
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
// start- added empty json chartdata to display no data found message by swati on 7jan2015
if(graphJson.size()==0)
{
graphJson.put("chart", new JSONString(""));
}
// end- added empty json chartdata to display no data found message by swati on 7jan2015
if (graphJson != null && graphJson.size() > 0)
{
/*Added code for Dynamic Div and New CSS By Dhanendra 01-07-15*/
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
//this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0), "chartContainer");
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
if(childID.equalsIgnoreCase(""))
{
CommonUtils.printOnConsole("In if(childID.equalsIgnoreCase())");
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0), "chartContainer");
}
else
{
CommonUtils.printOnConsole("In else childID = "+childID);
this.createOuterDiv("Graph"+uniqueId+componentId,type,groupCssTypeNameList.get(0),childID+"Outer");
}
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
idList.add("Graph"+uniqueId+componentId+"Div");
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
/*added code to append x-axis value in child grpah in title by dhanendra on Date: 07-Dec-2015*/
Label componantTtl=null;
if(empCodeEpa.length()>0)
{
componantTtl = new Label(componantTitlNameList.get(0)+" : "+empCodeEpa);
}
else
{
componantTtl = new Label(componantTitlNameList.get(0));
}
/*added code to append x-axis value in child grpah in title by dhanendra on Date: 07-Dec-2015*/
if(!childID.equalsIgnoreCase(""))
{
componantTtl = new Label(componantTitlNameList.get(0)+ " : " +parameterList.get(parameterList.size()-2));
}
Image componantTtlImg = new Image("FusionChart/images/"+componentIconName);
Image refreshImg = new Image("FusionChart/images/refresh.png");
SimpleDateFormat dispDateTimeFormat = new SimpleDateFormat("dd-MMM-yyyy HH:mm:ss");
Date date = new Date();
String strDate = dispDateTimeFormat.format(date);
String dateformat = getTimeSince(strDate);
Label refreshDateTime = new Label(dateformat);
HorizontalPanel componantTtlPanel = new HorizontalPanel();
HorizontalPanel dateHPanel = new HorizontalPanel();
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
final Label closeButton = new Label("x");
closeButton.setStyleName("closeButtonStyle");
closeButton.getElement().setId("Graph"+uniqueId+componentId+"Div");
closeButton.addClickHandler(new ClickHandler()
{
@Override
public void onClick(ClickEvent event)
{
pageOpenContainer.closeLinkedMetadataDiv(closeButton);
}
});
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
componantTtlImg.setStyleName("componantTtlImg");
componantTtl.setStyleName("componantTtl");
componantTtlPanel.add(componantTtlImg);
componantTtlPanel.add(componantTtl);
refreshDateTime.setStyleName("refreshDateTime");
dateHPanel.setStyleName("refreshDatePanel");
dateHPanel.add(refreshImg);
dateHPanel.add(refreshDateTime);
HorizontalPanel mainPanel = new HorizontalPanel();
mainPanel.add(componantTtlPanel);
mainPanel.add(dateHPanel);
mainPanel.setStyleName("mainPanel");
mainPanel.setCellHorizontalAlignment(dateHPanel, HasHorizontalAlignment.ALIGN_RIGHT);
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
if(!childID.equalsIgnoreCase(""))
{
mainPanel.add(closeButton);
mainPanel.setCellHorizontalAlignment(closeButton, HasHorizontalAlignment.ALIGN_RIGHT);
mainPanel.setCellWidth( closeButton, "2%" );
}
/*End Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
RootPanel.get("Graph"+uniqueId+componentId+"head").add(mainPanel);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
/* added code to add html tag to ssgrid by swati on 08-sep-2015*/
if(htmlString.length()>0)
{
htmlPnl = new HTMLPanel(htmlString);
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
RootPanel.get("Graph"+uniqueId+componentId).add(htmlPnl);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
}
/* ended code to add html tag to ssgrid by swati on 08-sep-2015 */
/*Add uniqueId to Graph by Dhanendra on date 10-11-2015*/
this.createInnerDiv(uniqueId+componentId,"Graph"+uniqueId+componentId);
/*Ended code for Dyanamic Div and New CSS By Dhanendra 01-07-15*/
this.createChart(graphJson.toString().replace('@', '='), uniqueId+componentId, "chartContainer" + uniqueId+componentId, width, height, imageName,userMail,reportCaption);
/*End uniqueId to Graph by Dhanendra on date 10-11-2015*/
if(!childID.equalsIgnoreCase(""))
{
this.focusOnDiv("Graph"+uniqueId+componentId+"Div");
}
}
} }
else else
{ {
...@@ -465,7 +602,7 @@ public class GraphComponent extends Composite ...@@ -465,7 +602,7 @@ public class GraphComponent extends Composite
idList.add("Graph"+uniqueId+componentId+"Div"); idList.add("Graph"+uniqueId+componentId+"Div");
/*Add append uniqueId in createInnerDiv method by Dhanendra on Date 14-03-2016*/ /*Add append uniqueId in createInnerDiv method by Dhanendra on Date 14-03-2016*/
this.createInnerDiv(uniqueId+componentId,"Graph"+uniqueId+componentId); this.createInnerDiv(uniqueId+componentId,"Graph"+uniqueId+componentId);
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,""); graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,"",null);
this.createChart(graphJson.toString().replace('@', '='), uniqueId+componentId, "chartContainer" +uniqueId+ componentId, width, height, imageName,userMail,reportCaption); this.createChart(graphJson.toString().replace('@', '='), uniqueId+componentId, "chartContainer" +uniqueId+ componentId, width, height, imageName,userMail,reportCaption);
/*End uniqueId to Graph,chartContainer by Dhanendra on Date 10-11-2015*/ /*End uniqueId to Graph,chartContainer by Dhanendra on Date 10-11-2015*/
...@@ -477,7 +614,7 @@ public class GraphComponent extends Composite ...@@ -477,7 +614,7 @@ public class GraphComponent extends Composite
String currentID = "Graph"+uniqueId+componentId+"Div"; String currentID = "Graph"+uniqueId+componentId+"Div";
CommonUtils.printOnConsole("dataJsn for jsonObjFrGraph :"+jsonObjFrGraph); CommonUtils.printOnConsole("dataJsn for jsonObjFrGraph :"+jsonObjFrGraph);
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,currentID); graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,currentID,null);
CommonUtils.printOnConsole("dataJsn for graphJson :"+graphJson); CommonUtils.printOnConsole("dataJsn for graphJson :"+graphJson);
/*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/ /*Add Code for Drill-down metadataxml by Dhanendra on date 16-09-2016*/
pageOpenContainer.putIdListInMap(currentID, childID); pageOpenContainer.putIdListInMap(currentID, childID);
...@@ -1255,6 +1392,7 @@ public class GraphComponent extends Composite ...@@ -1255,6 +1392,7 @@ public class GraphComponent extends Composite
String bubbleComponantCssName = ""; String bubbleComponantCssName = "";
String bgColor = ""; String bgColor = "";
String iconImage = ""; String iconImage = "";
ArrayList<String> dataListValue = new ArrayList<String>();
for (int i = 0; i < graphDtlList.size(); i++) for (int i = 0; i < graphDtlList.size(); i++)
{ {
if (i == 0) if (i == 0)
...@@ -1285,7 +1423,32 @@ public class GraphComponent extends Composite ...@@ -1285,7 +1423,32 @@ public class GraphComponent extends Composite
{ {
iconImage = (String) graphDtlList.get(i); iconImage = (String) graphDtlList.get(i);
} }
if (i == 9)
{
dataListValue = (ArrayList<String>) graphDtlList.get(i);
}
} }
CommonUtils.printOnConsole("dataListValue :"+dataListValue);
CommonUtils.printOnConsole("dataListValue.size() :"+dataListValue.size());
String xAxisLbl = "";
String yAxisLbl = "";
String zAxisLbl = "";
for (int i = 0; i < dataListValue.size(); i++)
{
if(i==0)
{
xAxisLbl = dataListValue.get(i);
}
if(i==1)
{
yAxisLbl = dataListValue.get(i);
}
if(i==2)
{
zAxisLbl = dataListValue.get(i);
}
}
String currentID = "Bubble"+uniqueId+componentId+"Div"; String currentID = "Bubble"+uniqueId+componentId+"Div";
pageOpenContainer.putIdListInMap(currentID, childID); pageOpenContainer.putIdListInMap(currentID, childID);
...@@ -1329,7 +1492,7 @@ public class GraphComponent extends Composite ...@@ -1329,7 +1492,7 @@ public class GraphComponent extends Composite
graphJson = ChartCreator.getBubbleChart(graphDtlList, jsonObjFrGraph, dtSrouce); graphJson = ChartCreator.getBubbleChart(graphDtlList, jsonObjFrGraph, dtSrouce);
idList.add("Bubble"+uniqueId+componentId+"Div"); idList.add("Bubble"+uniqueId+componentId+"Div");
RootPanel.get("Bubble"+uniqueId+componentId+"head").add(gridTtlPanel); RootPanel.get("Bubble"+uniqueId+componentId+"head").add(gridTtlPanel);
this.createBubbleChart(graphJson.toString(), "Bubble"+uniqueId+componentId); this.createBubbleChart(graphJson.toString(), "Bubble"+uniqueId+componentId,xAxisLbl,yAxisLbl,zAxisLbl);
/*CommonUtils.printOnConsole("In BUBBLE GraphComponent File"); /*CommonUtils.printOnConsole("In BUBBLE GraphComponent File");
this.createOuterDiv("Bubble"+uniqueId+componentId, type, gridCssName, "chartContainer"); this.createOuterDiv("Bubble"+uniqueId+componentId, type, gridCssName, "chartContainer");
...@@ -1612,10 +1775,10 @@ public class GraphComponent extends Composite ...@@ -1612,10 +1775,10 @@ public class GraphComponent extends Composite
} }
}-*/; }-*/;
private native void createBubbleChart(String chartData, String chartContainer) private native void createBubbleChart(String chartData, String chartContainer, String xAxisLbl,String yAxisLbl,String zAxisLbl)
/*-{ /*-{
try { try {
$wnd.bubbleChart(chartData, chartContainer); $wnd.bubbleChart(chartData, chartContainer,xAxisLbl,yAxisLbl,zAxisLbl);
} catch (e) { } catch (e) {
alert("Excpeiton :: GraphComponent : createBubbleChart [" + e.message + "]"); alert("Excpeiton :: GraphComponent : createBubbleChart [" + e.message + "]");
} }
...@@ -1626,7 +1789,7 @@ public class GraphComponent extends Composite ...@@ -1626,7 +1789,7 @@ public class GraphComponent extends Composite
/*added new method for smart filter by sachin 12 may 2015*/ /*added new method for smart filter by sachin 12 may 2015*/
/*Add IdList Parameter to buildchart method by dhanendra on date 23-11-2015*/ /*Add IdList Parameter to buildchart method by dhanendra on date 23-11-2015*/
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
public void buildChart(final LinkedHashMap<String, JSONObject> dataMap ,HashMap<String, HashMap> gridNGraphMeataDataMap,ArrayList<FilterInfo> filterList,ArrayList<String> containerIdList,String childID) public void buildChart(final LinkedHashMap<String, JSONObject> dataMap ,HashMap<String, HashMap> gridNGraphMeataDataMap,ArrayList<FilterInfo> filterList,ArrayList<String> containerIdList,String childID,HashMap<String, ArrayList<String>> selectedDataMap)
{ {
//Window.alert("in Smart Filter buildChart :"+childID); //Window.alert("in Smart Filter buildChart :"+childID);
/*Start Add uniqueId for random Id by Dhanendra on 19-11-2015*/ /*Start Add uniqueId for random Id by Dhanendra on 19-11-2015*/
...@@ -1832,43 +1995,59 @@ public class GraphComponent extends Composite ...@@ -1832,43 +1995,59 @@ public class GraphComponent extends Composite
if(groupNameList.size()>0) // loop for compliance if(groupNameList.size()>0) // loop for compliance
{ {
refreshComponantIdList =(ArrayList<String>)graphDtlList.get(20); CommonUtils.printOnConsole("*************** jsonObjFrGraph : "+jsonObjFrGraph);
refCompIdMap.put(groupNameList.get(0), refreshComponantIdList.get(0));
rawDataMapJsonOuter = new JSONObject();
fltrDataJson = new JSONObject(); fltrDataJson = new JSONObject();
if(jsonObjFrGraph != null) if(jsonObjFrGraph != null)
{ {
dataJsn = (JSONObject) jsonObjFrGraph.get(dtSrouce); dataJsn = (JSONObject) jsonObjFrGraph.get(dtSrouce);
mainDataJsn = new JSONObject(); if("stacksmrt".equalsIgnoreCase(groupNameList.get(0)))
mainDataJsn.put("1", dataJsn);
if(componentId.equals("1"))
{ {
rawDataMapJsonOuter = getDataMapJson(dataJsn, groupNameList.get(0),graphDtlList); CommonUtils.printOnConsole("*************** In stacksmrt ************* ");
grpNameList.add(groupNameList.get(0));
}else{ CommonUtils.printOnConsole("containerIdList.get(countForSmartFilter) :"+containerIdList.get(countForSmartFilter));
if(jsonAftrFltr.size() == 0)
JSONObject dataJsonObject = getReceivableDataJson(dataJsn);
graphJson = ChartCreator.buildChartData(graphDtlList, dataJsonObject, dtSrouce,parameterList,filterList,containerIdList.get(countForSmartFilter),selectedDataMap);
String containerId = containerIdList.get(countForSmartFilter).replace("Graph", "").replace("Div", "").trim();
CommonUtils.printOnConsole("containerId :"+containerId);
RootPanel.get("chartContainer" + containerId).clear();
this.createChart(graphJson.toString().replace('@', '='), containerId, "chartContainer" + containerId, width, height, imageName,userMail,reportCaption);
}else
{
refreshComponantIdList =(ArrayList<String>)graphDtlList.get(20);
refCompIdMap.put(groupNameList.get(0), refreshComponantIdList.get(0));
rawDataMapJsonOuter = new JSONObject();
mainDataJsn = new JSONObject();
mainDataJsn.put("1", dataJsn);
if(componentId.equals("1"))
{ {
fltrDataJson = getFltrDataJson(dataJsn, grpNameList.get(0),null); rawDataMapJsonOuter = getDataMapJson(dataJsn, groupNameList.get(0),graphDtlList);
grpNameList.add(groupNameList.get(0));
}else{ }else{
fltrDataJson = getFltrDataJson(jsonAftrFltr, grpNameList.get(0),null); if(jsonAftrFltr.size() == 0)
{
fltrDataJson = getFltrDataJson(dataJsn, grpNameList.get(0),null);
}else{
fltrDataJson = getFltrDataJson(jsonAftrFltr, grpNameList.get(0),null);
}
rawDataMapJsonOuter = getDataMapJson(fltrDataJson, groupNameList.get(0),graphDtlList);
grpNameList = new ArrayList<String>();
grpNameList.add(groupNameList.get(0));
jsonAftrFltr = fltrDataJson;
}
if(rawDataMapJsonOuter.size() > 0)
{
getDisplayData(rawDataMapJsonOuter, graphDtlList, groupCssTypeNameList.get(0), width, height, imageName,refCompIdMap,mainDataJsn,groupNameList.get(0),filterList, firstNameforTitle,"",cellVal);
} }
rawDataMapJsonOuter = getDataMapJson(fltrDataJson, groupNameList.get(0),graphDtlList);
grpNameList = new ArrayList<String>();
grpNameList.add(groupNameList.get(0));
jsonAftrFltr = fltrDataJson;
}
if(rawDataMapJsonOuter.size() > 0)
{
getDisplayData(rawDataMapJsonOuter, graphDtlList, groupCssTypeNameList.get(0), width, height, imageName,refCompIdMap,mainDataJsn,groupNameList.get(0),filterList, firstNameforTitle,"",cellVal);
} }
} }
}/*end Code for display Dashboard one by one in one page by Dhanendra*/ }/*end Code for display Dashboard one by one in one page by Dhanendra*/
else // loop for simple graph else // loop for simple graph
{ {
graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,""); graphJson = ChartCreator.buildChartData(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,"",null);
// start- added empty json chartdata to display no data found message by swati on 7jan2015 // start- added empty json chartdata to display no data found message by swati on 7jan2015
if(graphJson.size()==0 ) if(graphJson.size()==0 )
{ {
...@@ -2922,7 +3101,7 @@ public class GraphComponent extends Composite ...@@ -2922,7 +3101,7 @@ public class GraphComponent extends Composite
} }
dataCnt++; dataCnt++;
graphJson = ChartCreator.buildChartData(graphDtlList, mainDataJson, multGrph,parameterList,filterList,""); graphJson = ChartCreator.buildChartData(graphDtlList, mainDataJson, multGrph,parameterList,filterList,"",null);
if(graphJson.size()==0 ) if(graphJson.size()==0 )
{ {
graphJson.put("chart", new JSONString("")); graphJson.put("chart", new JSONString(""));
...@@ -3199,7 +3378,7 @@ public class GraphComponent extends Composite ...@@ -3199,7 +3378,7 @@ public class GraphComponent extends Composite
SimplePanel panel = new CardBuilder().buildCard(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,currentID, type); SimplePanel panel = new CardBuilder().buildCard(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,currentID, type);
CommonUtils.printOnConsole("Indicator 111 "); CommonUtils.printOnConsole("Indicator 111 ");
pageOpenContainer.putIdListInMap(currentID, childID); pageOpenContainer.putIdListInMap(currentID, childID);
exportDynamicMethod(); //exportDynamicMethod();
componantTitlNameList = new ArrayList<String>(); componantTitlNameList = new ArrayList<String>();
groupCssTypeNameList = new ArrayList<String>(); groupCssTypeNameList = new ArrayList<String>();
componantTitlNameList = (ArrayList<String>) graphDtlList.get(1); componantTitlNameList = (ArrayList<String>) graphDtlList.get(1);
...@@ -3271,7 +3450,7 @@ public class GraphComponent extends Composite ...@@ -3271,7 +3450,7 @@ public class GraphComponent extends Composite
SimplePanel panel = new CardBuilder().buildCard(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,currentID, type); SimplePanel panel = new CardBuilder().buildCard(graphDtlList, jsonObjFrGraph, dtSrouce,parameterList,filterList,currentID, type);
CommonUtils.printOnConsole("Icon 111 ["+pageOpenContainer+"]"); CommonUtils.printOnConsole("Icon 111 ["+pageOpenContainer+"]");
pageOpenContainer.putIdListInMap(currentID, childID); pageOpenContainer.putIdListInMap(currentID, childID);
exportDynamicMethod(); //exportDynamicMethod();
CommonUtils.printOnConsole("Icon 222 ["+gridIconName+"]"); CommonUtils.printOnConsole("Icon 222 ["+gridIconName+"]");
componantTitlNameList = new ArrayList<String>(); componantTitlNameList = new ArrayList<String>();
groupCssTypeNameList = new ArrayList<String>(); groupCssTypeNameList = new ArrayList<String>();
...@@ -3721,4 +3900,157 @@ public class GraphComponent extends Composite ...@@ -3721,4 +3900,157 @@ public class GraphComponent extends Composite
} }
e12LoadImg.setLoading(false); e12LoadImg.setLoading(false);
} }
public JSONObject getReceivableDataJson(JSONObject dataJSN)
{
JSONObject fetchRowWiseValJsn = null;
long overdue_over_3days = 0;
long overdue_over_2days = 0;
long overdue_yesterday = 0;
long overdue_today = 0;
long overdue_tomorrow = 0;
long overdue_day_after= 0;
long overdue_rest_of_week = 0;
long overdue_next_week = 0;
long overdue_next_month = 0;
/*String cust_name = "";
String cust_code = "";
String cust_codeStr = "";
Set<String> custCodeList = new HashSet<String>();*/
for (int jsnCnt = 0; jsnCnt < dataJSN.size(); jsnCnt++)
{
fetchRowWiseValJsn = (JSONObject) dataJSN.get(String.valueOf(jsnCnt));
//CommonUtils.printOnConsole("fetchRowWiseValJsn :"+fetchRowWiseValJsn);
overdue_over_3days = overdue_over_3days + Long.parseLong(fetchRowWiseValJsn.get("overdue_over_3days").toString().replace("\"", "").trim());
overdue_over_2days = overdue_over_2days + Long.parseLong(fetchRowWiseValJsn.get("overdue_over_2days").toString().replace("\"", "").trim());
overdue_yesterday = overdue_yesterday + Long.parseLong(fetchRowWiseValJsn.get("overdue_yesterday").toString().replace("\"", "").trim());
overdue_today = overdue_today + Long.parseLong(fetchRowWiseValJsn.get("overdue_today").toString().replace("\"", "").trim());
overdue_tomorrow = overdue_tomorrow + Long.parseLong(fetchRowWiseValJsn.get("overdue_tomorrow").toString().replace("\"", "").trim());
overdue_day_after = overdue_day_after + Long.parseLong(fetchRowWiseValJsn.get("overdue_day_after").toString().replace("\"", "").trim());
overdue_rest_of_week = overdue_rest_of_week + Long.parseLong(fetchRowWiseValJsn.get("overdue_rest_of_week").toString().replace("\"", "").trim());
overdue_next_week = overdue_next_week + Long.parseLong(fetchRowWiseValJsn.get("overdue_next_week").toString().replace("\"", "").trim());
overdue_next_month = overdue_next_month + Long.parseLong(fetchRowWiseValJsn.get("overdue_next_month").toString().replace("\"", "").trim());
/*cust_code = fetchRowWiseValJsn.get("cust_code").toString().replace("\"", "").trim();
CommonUtils.printOnConsole("cust_code :"+cust_code);
custCodeList.add(cust_code);
if(!cust_codeStr.contains(cust_code))
{
if("".equals(cust_codeStr))
{
cust_codeStr = cust_code;
}else{
cust_codeStr = cust_codeStr+"-"+cust_code;
}
}*/
}
JSONObject rawDataOrderStatusSummStackJson = new JSONObject();
JSONObject rawJson = null;
LinkedHashMap<String, String> catValues = null;
int count = 0;
rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_over_3days);
rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue over 3days"));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
//JSONObject servletJsnObj = (JSONObject) JSONParser.parseStrict(catValues.toString());
//rawJson.put("category_value",servletJsnObj);
rawDataOrderStatusSummStackJson.put(""+count, rawJson);
count++;
rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_over_2days);
rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue over 2days"));
//rawJson.put("category_value",new JSONString(""+catValues));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
rawDataOrderStatusSummStackJson.put(""+count, rawJson);
count++;
rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_yesterday);
rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue yesterday"));
//rawJson.put("category_value",new JSONString(""+catValues));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
rawDataOrderStatusSummStackJson.put(""+count, rawJson);
count++;
rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_today);
rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue today"));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
//rawJson.put("category_value",new JSONString(""+catValues));
rawDataOrderStatusSummStackJson.put(""+count, rawJson);
count++;
rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_tomorrow);
rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue tomorrow"));
//rawJson.put("category_value",new JSONString(""+catValues));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
rawDataOrderStatusSummStackJson.put(""+count, rawJson);
count++;
rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_day_after);
rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue day after"));
//rawJson.put("category_value",new JSONString(""+catValues));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
rawDataOrderStatusSummStackJson.put(""+count, rawJson);
count++;
rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_rest_of_week);
rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue rest of week"));
//rawJson.put("category_value",new JSONString(""+catValues));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
rawDataOrderStatusSummStackJson.put(""+count, rawJson);
count++;
rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_next_week);
rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue next week"));
//rawJson.put("category_value",new JSONString(""+catValues));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
rawDataOrderStatusSummStackJson.put(""+count, rawJson);
count++;
rawJson = new JSONObject();
catValues = new LinkedHashMap<String, String>();
catValues.put("All", ""+overdue_next_month);
rawJson.put("date", new JSONString(""+count));
rawJson.put("status",new JSONString("Overdue next month"));
//rawJson.put("category_value",new JSONString(""+catValues));
rawJson.put("category_value",new JSONString(catValues.toString().replace("=", ":")));
rawDataOrderStatusSummStackJson.put(""+count, rawJson);
count++;
JSONObject jsonObject = new JSONObject();
jsonObject.put("1", rawDataOrderStatusSummStackJson);
CommonUtils.printOnConsole("jsonObject :"+jsonObject);
return jsonObject;
}
} }
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