|
@@ -383,39 +383,33 @@ public class ChannelAnalyseServiceImpl implements ChannelAnalyseService {
|
|
});
|
|
});
|
|
|
|
|
|
List<StoreWd> storeWds = storeWdDao.perCapitaConsumpAnalyse(queryWrapper);
|
|
List<StoreWd> storeWds = storeWdDao.perCapitaConsumpAnalyse(queryWrapper);
|
|
- HashMap<String, Integer> hashMap = new HashMap<>();
|
|
|
|
- hashMap.put("0~20",0);
|
|
|
|
- hashMap.put("20~50",0);
|
|
|
|
- hashMap.put("50~100",0);
|
|
|
|
- hashMap.put("100~200",0);
|
|
|
|
- hashMap.put("200以上",0);
|
|
|
|
|
|
+ LinkedHashMap<String, Integer> linkedHashMap = new LinkedHashMap<>();
|
|
|
|
+ linkedHashMap.put("0~20",0);
|
|
|
|
+ linkedHashMap.put("20~50",0);
|
|
|
|
+ linkedHashMap.put("50~100",0);
|
|
|
|
+ linkedHashMap.put("100~200",0);
|
|
|
|
+ linkedHashMap.put("200以上",0);
|
|
for (StoreWd storeWd : storeWds) {
|
|
for (StoreWd storeWd : storeWds) {
|
|
if (storeWd.getPerCapitaConsumption() != null){
|
|
if (storeWd.getPerCapitaConsumption() != null){
|
|
if (storeWd.getPerCapitaConsumption() >= 0 && storeWd.getPerCapitaConsumption()<20){
|
|
if (storeWd.getPerCapitaConsumption() >= 0 && storeWd.getPerCapitaConsumption()<20){
|
|
- hashMap.put("0~20",hashMap.get("0~20")+1);
|
|
|
|
|
|
+ linkedHashMap.put("0~20",linkedHashMap.get("0~20")+1);
|
|
}else if(storeWd.getPerCapitaConsumption() >= 20 && storeWd.getPerCapitaConsumption()<50){
|
|
}else if(storeWd.getPerCapitaConsumption() >= 20 && storeWd.getPerCapitaConsumption()<50){
|
|
- hashMap.put("20~50",hashMap.get("20~50")+1);
|
|
|
|
|
|
+ linkedHashMap.put("20~50",linkedHashMap.get("20~50")+1);
|
|
}else if(storeWd.getPerCapitaConsumption() >= 50 && storeWd.getPerCapitaConsumption()< 100){
|
|
}else if(storeWd.getPerCapitaConsumption() >= 50 && storeWd.getPerCapitaConsumption()< 100){
|
|
- hashMap.put("50~100",hashMap.get("50~100")+1);
|
|
|
|
|
|
+ linkedHashMap.put("50~100",linkedHashMap.get("50~100")+1);
|
|
}else if(storeWd.getPerCapitaConsumption() >= 100 && storeWd.getPerCapitaConsumption()< 200){
|
|
}else if(storeWd.getPerCapitaConsumption() >= 100 && storeWd.getPerCapitaConsumption()< 200){
|
|
- hashMap.put("100~200",hashMap.get("100~200")+1);
|
|
|
|
|
|
+ linkedHashMap.put("100~200",linkedHashMap.get("100~200")+1);
|
|
}else {
|
|
}else {
|
|
- hashMap.put("200以上",hashMap.get("200以上")+1);
|
|
|
|
|
|
+ linkedHashMap.put("200以上",linkedHashMap.get("200以上")+1);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
ArrayList<Histogram> list = new ArrayList<>();
|
|
ArrayList<Histogram> list = new ArrayList<>();
|
|
- Histogram histogram1 = new Histogram("0~20",hashMap.get("0~20"));
|
|
|
|
- Histogram histogram2 = new Histogram("20~50",hashMap.get("20~50"));
|
|
|
|
- Histogram histogram3 = new Histogram("50~100",hashMap.get("50~100"));
|
|
|
|
- Histogram histogram4 = new Histogram("100~200",hashMap.get("100~200"));
|
|
|
|
- Histogram histogram5 = new Histogram("200以上",hashMap.get("200以上"));
|
|
|
|
- list.add(histogram1);
|
|
|
|
- list.add(histogram2);
|
|
|
|
- list.add(histogram3);
|
|
|
|
- list.add(histogram4);
|
|
|
|
- list.add(histogram5);
|
|
|
|
|
|
+ for (String s : linkedHashMap.keySet()) {
|
|
|
|
+ Histogram histogram1 = new Histogram(s,linkedHashMap.get(s));
|
|
|
|
+ list.add(histogram1);
|
|
|
|
+ }
|
|
return list;
|
|
return list;
|
|
}
|
|
}
|
|
|
|
|