From 74a25082f68c00a797a7eca8672cde8edb0dc95f Mon Sep 17 00:00:00 2001
From: sgj <1442489573@qq.com>
Date: 星期二, 17 三月 2026 15:16:32 +0800
Subject: [PATCH] 修改,gis建模监管页,数据不一致问题

---
 fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java |  102 +++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 102 insertions(+), 0 deletions(-)

diff --git a/fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java b/fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java
index b974889..7860820 100644
--- a/fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java
+++ b/fzzy-igdss-web/src/main/java/com/fzzy/group/manager/GroupManager.java
@@ -303,6 +303,44 @@
         return list;
     }
 
+
+    /**
+     * 鑾峰彇搴撳尯灏佽淇℃伅
+     *
+     * @param companyId
+     * @return
+     */
+    public List<GroupDepotData> getDepotData(String companyId) {
+
+        List<GroupDepotData> list = new ArrayList<>();
+        GroupDepotData depotData;
+        List<Dept> deptList = deptService.getDeptByUserType(null);
+        if (null != deptList && !deptList.isEmpty()) {
+            List<Depot> depotList;
+            for (Dept dept : deptList) {
+                //缁熻浠撳簱鏁�
+                depotList = depotService.getCacheDepotList(dept.getCompanyId(), dept.getId());
+                if (null != depotList && !depotList.isEmpty()) {
+                    for (Depot depot : depotList) {
+                        depotData = new GroupDepotData();
+                        depotData.setDeptId(dept.getId());
+                        depotData.setDeptName(dept.getKqmc());
+                        depotData.setCode(dept.getXzqhdm());
+                        depotData.setCounty(dept.getXzqhmc());
+                        depotData.setDepotId(depot.getId());
+                        depotData.setDepotName(depot.getName());
+                        if (null == depot.getStorageReal()) {
+                            depot.setStorageReal(0.0);
+                        }
+                        depotData.setStorageNum(depot.getStorageReal() / 1000);
+                        list.add(depotData);
+                    }
+                }
+            }
+        }
+        return list;
+    }
+
     /**
      * 鑾峰彇搴撳尯涓嬬洃鎺т俊鎭�
      *
@@ -549,6 +587,70 @@
         return groupGisData;
     }
 
+
+
+    public GroupGisData getGisDataByCompanyId() {
+
+        GroupGisData groupGisData = new GroupGisData();
+
+        //鏌ヨ浼婄妬涓嬪睘鍖哄幙
+        //鍖哄幙
+        List<DicArea> dicAreaList = dicAreaService.listData("654000", null, null);
+
+        //缁熻鍖哄幙涓嬪簱鍖烘暟
+        LinkedHashMap<String, Integer> valuePieChart = new LinkedHashMap<>();
+        LinkedHashMap<String, String> namePieChart = new LinkedHashMap<>();
+        if (null != dicAreaList && !dicAreaList.isEmpty()) {
+            for (DicArea dicArea : dicAreaList) {
+                valuePieChart.put(dicArea.getCode(), 0);
+                namePieChart.put(dicArea.getCode(), dicArea.getName());
+            }
+        }
+        List<Dept> deptList = deptService.getDeptByUserType(null);
+        if (null != deptList && !deptList.isEmpty()) {
+            //搴撳尯鎬绘暟
+            groupGisData.setDeptNum(deptList.size());
+            for (Dept dept : deptList) {
+                if (StringUtils.isBlank(dept.getXzqhdm()) || null == valuePieChart.get(dept.getXzqhdm())) {
+                    if (null == valuePieChart.get("999999")) {
+                        valuePieChart.put("999999", 0);
+                        namePieChart.put("999999", "鍏朵粬鍖哄幙");
+                    }
+                    dept.setXzqhdm("999999");
+                }
+                valuePieChart.put(dept.getXzqhdm(), valuePieChart.get(dept.getXzqhdm()) + 1);
+            }
+        }
+
+        if (groupGisData.getDeptNum() > 0) {
+            for (String mapKey : valuePieChart.keySet()) {
+                groupGisData.getDeptList().add(new ChartPie(valuePieChart.get(mapKey) + "", namePieChart.get(mapKey), new DecimalFormat("0.0").format((double) valuePieChart.get(mapKey) / groupGisData.getDeptNum() * 100)));
+            }
+        }
+
+        //缁熻閲嶉噺
+        List<Depot> depotList = depotService.getCacheDepotList(ContextUtil.getCompanyId());
+        if (null != depotList && !depotList.isEmpty()) {
+            for (Depot depot : depotList) {
+                if (null == depot.getStorageReal()) {
+                    depot.setStorageReal(0.0);
+                }
+                groupGisData.setSum(groupGisData.getSum() + depot.getStorageReal());
+                if (StringUtils.isNotBlank(depot.getPledgeBank())) {
+                    groupGisData.setBankSum(groupGisData.getBankSum() + depot.getStorageReal());
+                } else {
+                    groupGisData.setNormalSum(groupGisData.getNormalSum() + depot.getStorageReal());
+                }
+            }
+        }
+        if (groupGisData.getSum() > 0) {
+            groupGisData.setSumPer(new DecimalFormat("0.00").format(groupGisData.getSum() / groupGisData.getSum() * 100L));
+            groupGisData.setBankSumPer(new DecimalFormat("0.00").format(groupGisData.getBankSum() / groupGisData.getSum() * 100L));
+            groupGisData.setNormalSumPer(new DecimalFormat("0.00").format(groupGisData.getNormalSum() / groupGisData.getSum() * 100L));
+        }
+
+        return groupGisData;
+    }
     /**
      * 澶у睆棣栭〉-鎶撴媿璺熻釜淇℃伅
      *

--
Gitblit v1.9.3