From 4da2c35574f8100e93d18fa4fa5d6e5f3b9f994b Mon Sep 17 00:00:00 2001 From: Renpc-kilig <308442850@qq.com> Date: Tue, 30 Nov 2021 16:26:02 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=BB=9F=E8=AE=A1=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20=E6=96=B0=E5=A2=9Epom=E5=BC=95=E5=85=A5=E5=8C=85?= =?UTF-8?q?=EF=BC=88mongo,redis=E7=AD=89=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 33 + .../api/statistics/StatisticsController.java | 65 ++ .../dao/statistics/IStatisticsDao.java | 64 ++ .../pojo/dtos/statistics/StatisticsDTO.java | 37 ++ .../statistics/IStatisticsService.java | 70 ++ .../impl/StatisticsServiceImpl.java | 111 ++++ src/main/resources/application-prod.yml | 2 +- src/main/resources/application-test.yml | 44 +- .../mapper/statistics/statistics-mapper.xml | 92 +++ .../templates/buildinghouse/update.html | 2 +- .../resources/templates/default-home.html | 629 ++++++++++++++++++ 11 files changed, 1145 insertions(+), 4 deletions(-) create mode 100644 src/main/java/cn/com/tenlion/systemhouse/controller/api/statistics/StatisticsController.java create mode 100644 src/main/java/cn/com/tenlion/systemhouse/dao/statistics/IStatisticsDao.java create mode 100644 src/main/java/cn/com/tenlion/systemhouse/pojo/dtos/statistics/StatisticsDTO.java create mode 100644 src/main/java/cn/com/tenlion/systemhouse/service/statistics/IStatisticsService.java create mode 100644 src/main/java/cn/com/tenlion/systemhouse/service/statistics/impl/StatisticsServiceImpl.java create mode 100644 src/main/resources/mybatis/mapper/statistics/statistics-mapper.xml create mode 100644 src/main/resources/templates/default-home.html diff --git a/pom.xml b/pom.xml index 0c65577..9d005f5 100644 --- a/pom.xml +++ b/pom.xml @@ -109,6 +109,39 @@ login-oauth2-client 1.0-SNAPSHOT + + + ink.wgink + redis-cache + 1.0-SNAPSHOT + + + + ink.wgink + mongo-module-dictionary + 1.0-SNAPSHOT + + + + + org.springframework.boot + spring-boot-starter-data-mongodb + + + + + + org.springframework.boot + spring-boot-starter-data-redis + + + + + + org.springframework.session + spring-session-data-redis + + diff --git a/src/main/java/cn/com/tenlion/systemhouse/controller/api/statistics/StatisticsController.java b/src/main/java/cn/com/tenlion/systemhouse/controller/api/statistics/StatisticsController.java new file mode 100644 index 0000000..504ccac --- /dev/null +++ b/src/main/java/cn/com/tenlion/systemhouse/controller/api/statistics/StatisticsController.java @@ -0,0 +1,65 @@ +package cn.com.tenlion.systemhouse.controller.api.statistics; + +import cn.com.tenlion.systemhouse.pojo.dtos.houseusersub.HouseUserSubDTO; +import cn.com.tenlion.systemhouse.pojo.dtos.statistics.StatisticsDTO; +import cn.com.tenlion.systemhouse.service.houseusersub.IHouseUserSubService; +import cn.com.tenlion.systemhouse.service.statistics.IStatisticsService; +import ink.wgink.common.base.DefaultBaseController; +import ink.wgink.interfaces.consts.ISystemConstant; +import ink.wgink.pojo.result.ErrorResult; +import io.swagger.annotations.*; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: StatisticsController + * @Description: 统计 + * @Author: CodeFactory + * @Date: 2021-09-24 17:03:54 + * @Version: 3.0 + **/ +@Api(tags = ISystemConstant.API_TAGS_SYSTEM_PREFIX + "统计接口") +@RestController +@RequestMapping(ISystemConstant.API_PREFIX + "/statistics") +public class StatisticsController extends DefaultBaseController { + + @Autowired + private IStatisticsService statisticsService; + + @ApiOperation(value = "房屋系统总体数据", notes = "房屋系统总体数据接口") + @ApiImplicitParams({}) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("house_sys_info") + public List houseSysInfo() { + Map params = requestParams(); + return statisticsService.houseSysInfo(params); + } + + @ApiOperation(value = "小区类型", notes = "小区类型接口") + @ApiImplicitParams({}) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("estate_info") + public List estateInfo() { + return statisticsService.estateInfo(); + } + + @ApiOperation(value = "楼宇类型", notes = "楼宇类型接口") + @ApiImplicitParams({}) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("building_info") + public List buildingInfo() { + return statisticsService.buildingInfo(); + } + + @ApiOperation(value = "房屋类型", notes = "房屋类型接口") + @ApiImplicitParams({}) + @ApiResponses({@ApiResponse(code = 400, message = "请求失败", response = ErrorResult.class)}) + @GetMapping("house_info") + public List houseInfo() { + return statisticsService.houseInfo(); + } + +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemhouse/dao/statistics/IStatisticsDao.java b/src/main/java/cn/com/tenlion/systemhouse/dao/statistics/IStatisticsDao.java new file mode 100644 index 0000000..d4a195e --- /dev/null +++ b/src/main/java/cn/com/tenlion/systemhouse/dao/statistics/IStatisticsDao.java @@ -0,0 +1,64 @@ +package cn.com.tenlion.systemhouse.dao.statistics; + +import cn.com.tenlion.systemhouse.pojo.dtos.statistics.StatisticsDTO; +import ink.wgink.exceptions.SearchException; +import org.springframework.stereotype.Repository; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IStatisticsDao + * @Description: 统计 + * @Author: CodeFactory + * @Date: 2021-11-22 15:31:23 + * @Version: 3.0 + **/ +@Repository +public interface IStatisticsDao { + + /** + * 小区数量 + * @return + */ + Integer residentialCount(Map params) throws SearchException; + + /** + * 楼宇数量 + * @return + */ + Integer buildingCount(Map params) throws SearchException; + + /** + * 房屋数量 + * @return + */ + Integer houseCount(Map params) throws SearchException; + + /** + * 社区数量 + * @return + */ + Integer communityCount(Map params) throws SearchException; + + /** + * 小区类型 + * @param params + * @return + */ + List estateInfo(Map params); + + /** + * 楼宇类型 + * @param params + * @return + */ + List buildingInfo(Map params); + + /** + * 房屋类型 + * @param params + * @return + */ + List houseInfo(Map params); +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemhouse/pojo/dtos/statistics/StatisticsDTO.java b/src/main/java/cn/com/tenlion/systemhouse/pojo/dtos/statistics/StatisticsDTO.java new file mode 100644 index 0000000..1251fb3 --- /dev/null +++ b/src/main/java/cn/com/tenlion/systemhouse/pojo/dtos/statistics/StatisticsDTO.java @@ -0,0 +1,37 @@ +package cn.com.tenlion.systemhouse.pojo.dtos.statistics; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +/** + * + * @ClassName: StatisticsDTO + * @Description: 统计专用 + * @Author: CodeFactory + * @Date: 2021-09-17 14:43:53 + * @Version: 3.0 + **/ +@ApiModel +public class StatisticsDTO { + + @ApiModelProperty(name = "dataType", value = "数据类型") + private String dataType; + @ApiModelProperty(name = "count", value = "数量") + private String count; + + public String getDataType() { + return dataType; + } + + public void setDataType(String dataType) { + this.dataType = dataType; + } + + public String getCount() { + return count; + } + + public void setCount(String count) { + this.count = count; + } +} diff --git a/src/main/java/cn/com/tenlion/systemhouse/service/statistics/IStatisticsService.java b/src/main/java/cn/com/tenlion/systemhouse/service/statistics/IStatisticsService.java new file mode 100644 index 0000000..e8a1a38 --- /dev/null +++ b/src/main/java/cn/com/tenlion/systemhouse/service/statistics/IStatisticsService.java @@ -0,0 +1,70 @@ +package cn.com.tenlion.systemhouse.service.statistics; + +import cn.com.tenlion.systemhouse.pojo.dtos.statistics.StatisticsDTO; + +import java.util.List; +import java.util.Map; + +/** + * @ClassName: IResidentialIntroductionService + * @Description: 小区简介 + * @Author: CodeFactory + * @Date: 2021-11-22 15:31:23 + * @Version: 3.0 + **/ +public interface IStatisticsService { + + /** + * 房屋系统总体数据 + * @return + */ + List houseSysInfo(Map params); + + /** + * 小区数量 + * @return + */ + Integer residentialCount(Map params); + + /** + * 楼宇数量 + * @return + */ + Integer buildingCount(Map params); + + /** + * 房屋数量 + * @return + */ + Integer houseCount(Map params); + + /** + * 出租房数量 + * @return + */ + Integer rentalHousingCount(Map params); + + /** + * 社区数量 + * @return + */ + Integer communityCount(Map params); + + /** + * 小区类型 + * @return + */ + List estateInfo(); + + /** + * 楼宇类型 + * @return + */ + List buildingInfo(); + + /** + * 房屋类型 + * @return + */ + List houseInfo(); +} \ No newline at end of file diff --git a/src/main/java/cn/com/tenlion/systemhouse/service/statistics/impl/StatisticsServiceImpl.java b/src/main/java/cn/com/tenlion/systemhouse/service/statistics/impl/StatisticsServiceImpl.java new file mode 100644 index 0000000..3a8fdee --- /dev/null +++ b/src/main/java/cn/com/tenlion/systemhouse/service/statistics/impl/StatisticsServiceImpl.java @@ -0,0 +1,111 @@ +package cn.com.tenlion.systemhouse.service.statistics.impl; + + +import cn.com.tenlion.systemhouse.dao.statistics.IStatisticsDao; +import cn.com.tenlion.systemhouse.pojo.dtos.statistics.StatisticsDTO; +import cn.com.tenlion.systemhouse.service.statistics.IStatisticsService; +import ink.wgink.common.base.DefaultBaseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @ClassName: ResidentialIntroductionServiceImpl + * @Description: 小区简介 + * @Author: CodeFactory + * @Date: 2021-11-22 15:31:23 + * @Version: 3.0 + **/ +@Service +public class StatisticsServiceImpl extends DefaultBaseService implements IStatisticsService { + + @Autowired + private IStatisticsDao statisticsDao; + + @Override + public List houseSysInfo(Map params) { + List statisticsDTOList = new ArrayList<>(); + + Integer residentialCount = residentialCount(params); + StatisticsDTO statisticsDTO = new StatisticsDTO(); + statisticsDTO.setDataType("小区"); + statisticsDTO.setCount(residentialCount.toString()); + statisticsDTOList.add(statisticsDTO); + + Integer buildingCount = buildingCount(params); + statisticsDTO = new StatisticsDTO(); + statisticsDTO.setDataType("楼宇"); + statisticsDTO.setCount(buildingCount.toString()); + statisticsDTOList.add(statisticsDTO); + + Integer houseCount = houseCount(params); + statisticsDTO = new StatisticsDTO(); + statisticsDTO.setDataType("房屋"); + statisticsDTO.setCount(houseCount.toString()); + statisticsDTOList.add(statisticsDTO); + + params.put("houseStatus", "出租"); + Integer rentalHousingCount = rentalHousingCount(params); + statisticsDTO = new StatisticsDTO(); + statisticsDTO.setDataType("出租房"); + statisticsDTO.setCount(rentalHousingCount.toString()); + statisticsDTOList.add(statisticsDTO); + + Integer communityCount = communityCount(params); + statisticsDTO = new StatisticsDTO(); + statisticsDTO.setDataType("社区"); + statisticsDTO.setCount(communityCount.toString()); + statisticsDTOList.add(statisticsDTO); + return statisticsDTOList; + } + + @Override + public Integer residentialCount(Map params) { + return statisticsDao.residentialCount(params); + } + + @Override + public Integer buildingCount(Map params) { + return statisticsDao.buildingCount(params); + } + + @Override + public Integer houseCount(Map params) { + return statisticsDao.houseCount(params); + } + + @Override + public Integer rentalHousingCount(Map params) { + return statisticsDao.houseCount(params); + } + + @Override + public Integer communityCount(Map params) { + return statisticsDao.communityCount(params); + } + + @Override + public List estateInfo() { + Map params = new HashMap<>(2); + List statisticsDTOList = statisticsDao.estateInfo(params); + return statisticsDTOList; + } + + @Override + public List buildingInfo() { + Map params = new HashMap<>(2); + List statisticsDTOList = statisticsDao.buildingInfo(params); + return statisticsDTOList; + } + + @Override + public List houseInfo() { + Map params = new HashMap<>(2); + List statisticsDTOList = statisticsDao.houseInfo(params); + return statisticsDTOList; + } +} \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 4b12928..7a45587 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -1,6 +1,6 @@ server: port: 8081 - url: http://192.168.0.111:8081/systemhousehttp://192.168.0.111:8081/systemhousehttp://192.168.0.111:8081/systemhouse + url: http://192.168.0.111:8081/systemhouse system-title: 房屋管理系统 system-sub-title: 房屋管理系统 servlet: diff --git a/src/main/resources/application-test.yml b/src/main/resources/application-test.yml index dc74e88..f7499f0 100644 --- a/src/main/resources/application-test.yml +++ b/src/main/resources/application-test.yml @@ -1,8 +1,9 @@ server: - port: 8081 - url: http://192.168.0.111:8081/systemhouse + port: 8083 + url: http://192.168.0.111:8083/systemhouse system-title: 房屋管理系统 system-sub-title: 房屋管理系统 + nav-page: http://192.168.0.155:7011/usercenter servlet: context-path: /systemhouse @@ -57,11 +58,50 @@ spring: connection-properties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000 # 合并多个DruidDataSource的监控数据 use-global-data-source-stat: true + data: + mongodb: + uri: mongodb://smartcity:smartcity@192.168.0.156:27017/smartcity + redis: + database: 6 + host: 192.168.0.156 + port: 6379 + password: 666 + timeout: 3000ms + jedis: + pool: + max-active: 8 + max-wait: 1ms + max-idle: 8 + min-idle: 0 mybatis: config-location: classpath:mybatis/mybatis-config.xml mapper-locations: classpath*:mybatis/mapper/**/*.xml +api-path: + # user-center: http://49.233.36.36:58091/usercenter + user-center: http://192.168.0.155:7011/usercenter + +# 安全 +security: + oauth2: + # oauth-server: http://49.233.36.36:58091/usercenter + oauth-server: http://192.168.0.155:7011/usercenter + oauth-logout: ${security.oauth2.oauth-server}/logout?redirect_uri=${server.url} + client: + client-id: caed885903874d0391ad16832887e4e0 + client-secret: cENSUjMxWFNHY1R1NjJsK3E2SmltTTg0TjNyQmVsdjA2dGtXcGFQY2d2N2xIdG9KZmEyTjJIRnI0dG1McEdEVA== + user-authorization-uri: ${security.oauth2.oauth-server}/oauth2_client/authorize + access-token-uri: ${security.oauth2.oauth-server}/oauth2_client/token + grant-type: authorization_code + resource: + jwt: + key-uri: ${security.oauth2.oauth-server}/oauth2_client/token_key + token-info-uri: ${security.oauth2.oauth-server}/oauth2_client/check_token + user-info-uri: ${security.oauth2.oauth-server}/user + authorization: + check-token-access: ${security.oauth2.oauth-server}/oauth2_client/token_key + logging: level: root: error diff --git a/src/main/resources/mybatis/mapper/statistics/statistics-mapper.xml b/src/main/resources/mybatis/mapper/statistics/statistics-mapper.xml new file mode 100644 index 0000000..c5dd869 --- /dev/null +++ b/src/main/resources/mybatis/mapper/statistics/statistics-mapper.xml @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/resources/templates/buildinghouse/update.html b/src/main/resources/templates/buildinghouse/update.html index a741486..acde4e8 100644 --- a/src/main/resources/templates/buildinghouse/update.html +++ b/src/main/resources/templates/buildinghouse/update.html @@ -91,7 +91,7 @@ // 初始化备注富文本 function initRemakeRichText(value) { var editor = new wangEditor('#remake'); - editor.customConfig.zIndex = 1000; + editor.customConfig.zIndex = 0; editor.customConfig.uploadImgMaxSize = 5 * 1024 * 1024; editor.customConfig.uploadImgMaxLength = 1; editor.customConfig.uploadFileName = 'image'; diff --git a/src/main/resources/templates/default-home.html b/src/main/resources/templates/default-home.html new file mode 100644 index 0000000..00cd765 --- /dev/null +++ b/src/main/resources/templates/default-home.html @@ -0,0 +1,629 @@ + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
    +
  • + 小区 +
  • +
  • + +
  • +
+
+
+
    +
  • + 楼宇 +
  • +
  • + +
  • +
+ +
+
+
    +
  • + 房屋 +
  • +
  • + +
  • +
+ +
+
+
    +
  • + 出租房 +
  • +
  • + +
  • +
+ +
+
+
    +
  • + 社区 +
  • +
  • + +
  • +
+ +
+
+
+
+
+
+
+
+
+
+
+
+ + + + + + \ No newline at end of file