| | |
| | | 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; |
| | | } |
| | | |
| | | /** |
| | | * 获取库区下监控信息 |
| | | * |
| | |
| | | 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; |
| | | } |
| | | /** |
| | | * 大屏首页-抓拍跟踪信息 |
| | | * |