|
|
@ -151,33 +151,31 @@ public class DcBusiDataScreenMainController extends BaseController{ |
|
|
|
List<DcBusiDataScreenVo> real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate); |
|
|
|
List<DcBusiDataScreenVo> self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate); |
|
|
|
List<DcBusiDataScreenVo> group = dcBusiDataScreenMainService.selectSquareGroup(qdate); |
|
|
|
JSONArray product=new JSONArray(); |
|
|
|
JSONArray realcost=new JSONArray(); |
|
|
|
product.add("real_name"); |
|
|
|
realcost.add("real_value"); |
|
|
|
AtomicReference<String> unit = new AtomicReference<>(); |
|
|
|
JSONObject all=new JSONObject(); |
|
|
|
group.forEach(item->{ |
|
|
|
all.put(item.getCoallost(),item.getMonthAll()); |
|
|
|
all.put("unit",item.getTargetUnit()); |
|
|
|
}); |
|
|
|
JSONArray out=new JSONArray(); |
|
|
|
real.forEach(item->{ |
|
|
|
product.add(item.getCompanyName()); |
|
|
|
realcost.add(StringUtils.getfomatDouble(item.getMonthAll())); |
|
|
|
unit.set(item.getTargetUnit()); |
|
|
|
JSONObject tmp=new JSONObject(); |
|
|
|
tmp.put("name",item.getCompanyName()); |
|
|
|
tmp.put("value",item.getMonthAll()); |
|
|
|
tmp.put("unit",item.getTargetUnit()); |
|
|
|
out.add(tmp); |
|
|
|
}); |
|
|
|
JSONArray product_2=new JSONArray(); |
|
|
|
JSONArray realcost_2=new JSONArray(); |
|
|
|
product_2.add("self_name"); |
|
|
|
realcost_2.add("self_value"); |
|
|
|
JSONArray in=new JSONArray(); |
|
|
|
self.forEach(item->{ |
|
|
|
product_2.add(item.getCompanyName()); |
|
|
|
realcost_2.add(StringUtils.getfomatDouble(item.getMonthAll())); |
|
|
|
//unit.set(item.getTargetUnit());
|
|
|
|
JSONObject tmp=new JSONObject(); |
|
|
|
tmp.put("name",item.getCompanyName()); |
|
|
|
tmp.put("value",item.getMonthAll()); |
|
|
|
tmp.put("unit",item.getTargetUnit()); |
|
|
|
in.add(tmp); |
|
|
|
}); |
|
|
|
JSONArray list=new JSONArray(); |
|
|
|
list.add(product); |
|
|
|
list.add(realcost); |
|
|
|
list.add(product_2); |
|
|
|
list.add(realcost_2); |
|
|
|
JSONObject ret=new JSONObject(); |
|
|
|
ret.put("source",list); |
|
|
|
ret.put("unit",unit.get()); |
|
|
|
ret.put("all",all); |
|
|
|
ret.put("outCircle",out); |
|
|
|
ret.put("inCircle",in); |
|
|
|
return AjaxResult.success(ret); |
|
|
|
} |
|
|
|
/** |
|
|
|