From ba372c23865872b627e1cf258b9b23f5927de06a Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Mon, 23 May 2022 18:28:02 +0800 Subject: [PATCH] ... --- .../common/controller/CensusController.java | 11 ++++ .../modules/resource/dao/ResourceDao.java | 6 ++ .../resource/service/ResourceService.java | 2 + .../service/impl/ResourceServiceImpl.java | 43 +++++++++++++ .../src/main/resources/application-prod.yml | 2 +- .../src/main/resources/application.yml | 2 + .../resources/mapper/resource/ResourceDao.xml | 63 +++++++++++++++++++ 7 files changed, 128 insertions(+), 1 deletion(-) diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index 883c7446..717dad48 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -167,4 +167,15 @@ public class CensusController { resultMap.put("browseDayList", resourceBrowseService.selectDayList(startDate, endDate)); return new Result().ok(resultMap); } + + @GetMapping("/sourceDepartmentStatistics") + @ApiOperation("来源部门统计") + @LogOperation("来源部门统计") + public Result sourceDepartmentStatistics() { + return new Result().ok(resourceService.selectSourceDepartmentStatistics()); + } + + + + } diff --git a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java index 00bdb6dc..d19a4e5a 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/dao/ResourceDao.java @@ -62,4 +62,10 @@ public interface ResourceDao extends BaseDao { Integer selectTypeCountByDist(@Param(("districtName")) String districtName, @Param("resourceType") String resourceType); Long countAllVisits(); + + Integer selectDeptCount(); + + List selectDeptTypeCount(); + + List selectDeptTotalCount(); } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java index 86063460..9bb4a453 100644 --- a/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java +++ b/renren-admin/src/main/java/io/renren/modules/resource/service/ResourceService.java @@ -49,4 +49,6 @@ public interface ResourceService extends CrudService resultMap = new HashMap<>(); + resultMap.put("deptCount", resourceDao.selectDeptCount()); + HashMap map = new HashMap() { + { + put("省级", "0"); + put("市级", "0"); + put("区级", "0"); + put("企业", "0"); + put("其他", "0"); + } + }; + List deptTypeCount = resourceDao.selectDeptTypeCount(); + map.entrySet().forEach(item -> { + deptTypeCount.forEach(index -> { + if (index.get("type").equals(item.getKey())) { + item.setValue(index.get("count")); + } + }); + }); + resultMap.put("deptTypeCount", map); + List deptTotalCount = resourceDao.selectDeptTotalCount(); + HashMap map1 = new HashMap() { + { + put("0", 0); + put("5", 0); + put("10", 0); + put("15", 0); + put("20", 0); + } + }; + map1.entrySet().forEach(item -> { + deptTotalCount.forEach(index -> { + if (index.get("type").equals(item.getKey())) { + item.setValue(index.get("total")); + } + }); + }); + resultMap.put("deptTotalCount", map1); + return resultMap; + } } \ No newline at end of file diff --git a/renren-admin/src/main/resources/application-prod.yml b/renren-admin/src/main/resources/application-prod.yml index bbf13ad6..949faba0 100644 --- a/renren-admin/src/main/resources/application-prod.yml +++ b/renren-admin/src/main/resources/application-prod.yml @@ -36,7 +36,7 @@ spring: multi-statement-allow: true #上传的静态资源配置 resource: - root_url: 15.2.21.238 + root_url: 15.72.183.90 path: /data/services/nengli/files/ devModelFilePath: /data/services/nengli/files/devModelFile # 大数据部门相关配置 diff --git a/renren-admin/src/main/resources/application.yml b/renren-admin/src/main/resources/application.yml index e0e83289..38b75291 100644 --- a/renren-admin/src/main/resources/application.yml +++ b/renren-admin/src/main/resources/application.yml @@ -80,5 +80,7 @@ mybatis-plus: call-setters-on-nulls: true jdbc-type-for-null: 'null' # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl + +#系统上线日期,用于统计能力浏览记录 system: startDay: 2022-01-01 \ No newline at end of file diff --git a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml index 5b943444..9701565a 100644 --- a/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml +++ b/renren-admin/src/main/resources/mapper/resource/ResourceDao.xml @@ -464,4 +464,67 @@ tb_data_resource + + + + + + \ No newline at end of file