|
|
|
@@ -354,12 +354,6 @@ public class WxChartServiceImpl implements WxChartDataService { |
|
|
|
return new ResultData(new HashMap<>()); |
|
|
|
} |
|
|
|
|
|
|
|
public static void main(String[] args) { |
|
|
|
double a = 8; |
|
|
|
double b = 9; |
|
|
|
System.out.println(a/b); |
|
|
|
} |
|
|
|
|
|
|
|
public Map<String,Long> getMap(List<String> days){ |
|
|
|
Map<String,Long> map = new LinkedMap(); |
|
|
|
for (String d:days) { |
|
|
|
@@ -2360,6 +2354,7 @@ public class WxChartServiceImpl implements WxChartDataService { |
|
|
|
double rentTotalShopRate = new Double(rentTotalShop)/ new Double(totalShop)*100; |
|
|
|
datamap.put("rentTotalShopRate",formatDouble(rentTotalShopRate)); |
|
|
|
double rentTotalPointRate = new Double(rentTotalPoint)/ new Double(totalPoint)*100; |
|
|
|
logger.info("chartimpl rentTotalPoint:{},totalPoint:{}",rentTotalPoint,totalPoint); |
|
|
|
datamap.put("rentTotalPointRate",formatDouble(rentTotalPointRate)); |
|
|
|
|
|
|
|
return new ResultData(datamap); |
|
|
|
@@ -2527,9 +2522,14 @@ public class WxChartServiceImpl implements WxChartDataService { |
|
|
|
return new ResultData(datamap); |
|
|
|
} |
|
|
|
|
|
|
|
public static double formatDouble(Double d){ |
|
|
|
public double formatDouble(Double d){ |
|
|
|
String s = d+""; |
|
|
|
String lt = s.substring(s.indexOf("."),s.length()); |
|
|
|
int index = s.indexOf("."); |
|
|
|
if(index == -1){ |
|
|
|
logger.info("formatDouble is -1 d:"+d); |
|
|
|
return d; |
|
|
|
} |
|
|
|
String lt = s.substring(index,s.length()); |
|
|
|
if(lt.length() >3){ |
|
|
|
s = s.substring(0,s.indexOf(".")+3); |
|
|
|
} |
|
|
|
|