From 5e4d1521e463a92c3217f8094deec380b5a42a24 Mon Sep 17 00:00:00 2001 From: zhousq Date: Mon, 20 Nov 2023 10:12:34 +0800 Subject: [PATCH] =?UTF-8?q?2023-11-20=20=E9=A1=B9=E7=9B=AE=E5=88=9D?= =?UTF-8?q?=E5=A7=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcBusiDataScreenMainController.java | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java b/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java index 7a659d4..e63516a 100644 --- a/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java +++ b/lzbi-module/src/main/java/com/lzbi/bi/controller/DcBusiDataScreenMainController.java @@ -151,33 +151,31 @@ public class DcBusiDataScreenMainController extends BaseController{ List real = dcBusiDataScreenMainService.selectSquareRealDetail(qdate); List self = dcBusiDataScreenMainService.selectSquareSelfDetail(qdate); List group = dcBusiDataScreenMainService.selectSquareGroup(qdate); - JSONArray product=new JSONArray(); - JSONArray realcost=new JSONArray(); - product.add("real_name"); - realcost.add("real_value"); - AtomicReference 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); } /**