Commit b25f3cb3 authored by pborate's avatar pborate

Updated changes for cg crm dashboard

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@211730 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 54b97a94
...@@ -66,13 +66,15 @@ public class ConsumerGoodsCRM extends ValidatorEJB implements ConsumerGoodsCRMLo ...@@ -66,13 +66,15 @@ public class ConsumerGoodsCRM extends ValidatorEJB implements ConsumerGoodsCRMLo
sql = " Select " + sql = " Select " +
"SalesPerson_Code , To_Calls," + "SalesPerson_Code , To_Calls," +
" SalesPerson_Name , nvl(SUM(Tot_Calls),0) as Tot_Calls , nvl(SUM(Tot_PC),0) as Tot_PC , " + " SalesPerson_Name , nvl(SUM(Tot_Calls),0) as Tot_Calls , nvl(SUM(Tot_PC),0) as Tot_PC , nvl(SUM(ECO),0) as ECO , " +
" nvl(SUM(To_Calls - Tot_Dist_Calls),0) as Call_Bal , nvl(SUM(TLSD),0) as TLSD , " + " nvl(SUM(To_Calls - Tot_Dist_Calls),0) as Call_Bal , nvl(SUM(TLSD),0) as TLSD , " +
" nvl(SUM(Ord_Val),0) as Ord_Val , nvl(SUM(ord_qty), 0) AS ord_qty, nvl(SUM(Display),0) as Display " + " nvl(SUM(Ord_Val),0) as Ord_Val , nvl(SUM(ord_qty), 0) AS ord_qty, nvl(SUM(Display),0) as Display " +
" From ( Select SM.Sales_Pers as SalesPerson_Code , " + " From ( Select SM.Sales_Pers as SalesPerson_Code , " +
" SP.SP_Name as SalesPerson_Name ,nvl(count(strg_code),0) as Tot_Calls , nvl(count(Distinct strg_code),0) as Tot_Dist_Calls ," + " SP.SP_Name as SalesPerson_Name ,nvl(count(strg_code),0) as Tot_Calls , nvl(count(Distinct strg_code),0) as Tot_Dist_Calls ," +
" nvl((select count(distinct strg_code) from STRG_MEET_ORDER SMO " + " nvl((select count(SMO.strg_code) from STRG_MEET_ORDER SMO " +
" where SMO.dcr_id=SM.dcr_id and SMO.Quantity > 0),0) as Tot_PC ," + " where SMO.dcr_id=SM.dcr_id and SMO.Quantity > 0),0) as Tot_PC ," +
" nvl((select count(DISTINCT SMO.strg_code) from STRG_MEET_ORDER SMO " +
" where SMO.dcr_id=SM.dcr_id and SMO.Quantity > 0),0) as ECO ," +
" NVL((Select count(sc_code) From Strg_Series Where Sales_Pers = SM.Sales_Pers " + " NVL((Select count(sc_code) From Strg_Series Where Sales_Pers = SM.Sales_Pers " +
" And Sc_Code in (Select sC_cODE From STRG_CUSTOMER_RETAIL " + " And Sc_Code in (Select sC_cODE From STRG_CUSTOMER_RETAIL " +
" Where Locality_Code In (Select locality_Code From sPRS_TRAVEL " + " Where Locality_Code In (Select locality_Code From sPRS_TRAVEL " +
...@@ -112,9 +114,11 @@ public class ConsumerGoodsCRM extends ValidatorEJB implements ConsumerGoodsCRMLo ...@@ -112,9 +114,11 @@ public class ConsumerGoodsCRM extends ValidatorEJB implements ConsumerGoodsCRMLo
String totalCalls = checkNull(rs.getString("TOT_CALLS")); String totalCalls = checkNull(rs.getString("TOT_CALLS"));
String prodCalls = checkNull(rs.getString("TOT_PC")); String prodCalls = checkNull(rs.getString("TOT_PC"));
String ordQty = checkNull(rs.getString("ORD_QTY")); String ordQty = checkNull(rs.getString("ORD_QTY"));
String ordVal = checkNull(rs.getString("Ord_Val"));
String display = rs.getString("DISPLAY"); String display = rs.getString("DISPLAY");
String tlsd = rs.getString("TLSD"); String tlsd = rs.getString("TLSD");
String callBal = rs.getString("CALL_BAL"); String callBal = rs.getString("CALL_BAL");
String eco = rs.getString("ECO");
totalCallBal = totalCallBal + Integer.parseInt(callBal); totalCallBal = totalCallBal + Integer.parseInt(callBal);
...@@ -140,7 +144,7 @@ public class ConsumerGoodsCRM extends ValidatorEJB implements ConsumerGoodsCRMLo ...@@ -140,7 +144,7 @@ public class ConsumerGoodsCRM extends ValidatorEJB implements ConsumerGoodsCRMLo
workDetails.add(workDetail); workDetails.add(workDetail);
workDetail = new JSONObject(); workDetail = new JSONObject();
workDetail.put("count", ordQty); workDetail.put("count", ordVal);
workDetail.put("value", "Orders"); workDetail.put("value", "Orders");
workDetail.put("color", "#c0b9f6"); workDetail.put("color", "#c0b9f6");
workDetails.add(workDetail); workDetails.add(workDetail);
...@@ -160,7 +164,7 @@ public class ConsumerGoodsCRM extends ValidatorEJB implements ConsumerGoodsCRMLo ...@@ -160,7 +164,7 @@ public class ConsumerGoodsCRM extends ValidatorEJB implements ConsumerGoodsCRMLo
if( toDate != null ) if( toDate != null )
{ {
workDetail = new JSONObject(); workDetail = new JSONObject();
workDetail.put("count", checkNull(callBal)); workDetail.put("count", checkNull(eco));
workDetail.put("value", "Eco"); workDetail.put("value", "Eco");
workDetail.put("color", "#ffca3b"); workDetail.put("color", "#ffca3b");
workDetails.add(workDetail); workDetails.add(workDetail);
...@@ -386,15 +390,15 @@ public class ConsumerGoodsCRM extends ValidatorEJB implements ConsumerGoodsCRMLo ...@@ -386,15 +390,15 @@ public class ConsumerGoodsCRM extends ValidatorEJB implements ConsumerGoodsCRMLo
detail.put("keyName", "Orders"); detail.put("keyName", "Orders");
detail.put("image", "order.svg"); detail.put("image", "order.svg");
String ordQty=checkNull(rs.getString("ORD_QTY")); String ordQty=checkNull(rs.getString("Ord_Val"));
System.out.println(" ORD_QTY "+checkNull(rs.getString("ORD_QTY"))); System.out.println(" Ord_Val "+checkNull(rs.getString("Ord_Val")));
if(ordQty.equalsIgnoreCase("0")) { if(ordQty.equalsIgnoreCase("0")) {
detail.put("summary", "No Orders"); detail.put("summary", "No Orders");
detail.put("keyValue", " "); detail.put("keyValue", " ");
} }
else { else {
detail.put("summary", "order(s)"); detail.put("summary", " ");
detail.put("keyValue", checkNull(rs.getString("ORD_QTY"))); detail.put("keyValue", checkNull(rs.getString("Ord_Val")));
} }
......
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