diff --git a/ruoyi-ui/src/api/data/uvClosingCase.js b/ruoyi-ui/src/api/data/uvClosingCase.js
new file mode 100644
index 000000000..666d399a4
--- /dev/null
+++ b/ruoyi-ui/src/api/data/uvClosingCase.js
@@ -0,0 +1,50 @@
+import request from '@/utils/request'
+
+// 调用es查询案例
+// 1. 模糊搜索地址
+// 2. 模糊搜索小区
+
+
+
+// 查询最终住宅租赁基价列表
+export function list(query) {
+ return request({
+ url: '/basic/cases/closing/list',
+ method: 'get',
+ params: query
+ })
+}
+
+// // 查询最终住宅租赁基价详细
+export function findByText(text) {
+ return request({
+ url: '/basic/cases/closing/query?text=' + text,
+ method: 'get'
+ })
+}
+
+// // 修改最终住宅租赁基价
+// export function update(data) {
+// return request({
+// url: '/data/rent-price/residence/ultimate',
+// method: 'put',
+// data: data
+// })
+// }
+
+// // 导出最终住宅租赁基价
+// export function export2File(query) {
+// return request({
+// url: '/data/rent-price/residence/ultimate/export',
+// method: 'get',
+// params: query
+// })
+// }
+
+// // 查询人工住宅租赁 年月 列表
+// export function getYearMonthList() {
+// return request({
+// url: '/data/rent-price/residence/ultimate/yearmonth',
+// method: 'get'
+// })
+// }
diff --git a/ruoyi-ui/src/views/data/cases/UVClosingCase.vue b/ruoyi-ui/src/views/data/cases/UVClosingCase.vue
new file mode 100644
index 000000000..37796b02d
--- /dev/null
+++ b/ruoyi-ui/src/views/data/cases/UVClosingCase.vue
@@ -0,0 +1,178 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 搜索
+ 重置
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ruoyi/pom.xml b/ruoyi/pom.xml
index df2e45009..7868dcea4 100644
--- a/ruoyi/pom.xml
+++ b/ruoyi/pom.xml
@@ -278,6 +278,39 @@
+
+ org.elasticsearch
+ elasticsearch
+ 6.6.2
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-client
+ 6.6.2
+
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-high-level-client
+ 6.6.2
+
+
+ org.elasticsearch.client
+ elasticsearch-rest-client
+
+
+ org.elasticsearch
+ elasticsearch
+
+
+
+
+
+ cn.hutool
+ hutool-all
+ 5.0.0
+
+
diff --git a/ruoyi/src/main/java/com/ruoyi/common/exception/ElasticsearchException.java b/ruoyi/src/main/java/com/ruoyi/common/exception/ElasticsearchException.java
new file mode 100644
index 000000000..2b461e7d8
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/common/exception/ElasticsearchException.java
@@ -0,0 +1,34 @@
+package com.ruoyi.common.exception;
+
+
+/**
+ * es异常
+ *
+ * @author lihe
+ */
+public class ElasticsearchException extends RuntimeException {
+
+ private String errmsg;
+
+ public String getErrmsg() {
+ return errmsg;
+ }
+
+ public ElasticsearchException(String message) {
+ super(message);
+ }
+
+ public ElasticsearchException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ public ElasticsearchException(Throwable cause) {
+ super(cause);
+ }
+
+ public ElasticsearchException(String message, Throwable cause, boolean enableSuppression,
+ boolean writableStackTrace) {
+ super(message, cause, enableSuppression, writableStackTrace);
+ }
+
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/config/ElasticsearchAutoConfiguration.java b/ruoyi/src/main/java/com/ruoyi/framework/config/ElasticsearchAutoConfiguration.java
new file mode 100644
index 000000000..76c8d2593
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/framework/config/ElasticsearchAutoConfiguration.java
@@ -0,0 +1,99 @@
+package com.ruoyi.framework.config;
+
+import com.ruoyi.common.utils.StringUtils;
+import org.apache.http.HttpHost;
+import org.apache.http.auth.AuthScope;
+import org.apache.http.auth.UsernamePasswordCredentials;
+import org.apache.http.client.CredentialsProvider;
+import org.apache.http.impl.client.BasicCredentialsProvider;
+import org.elasticsearch.client.RestClient;
+import org.elasticsearch.client.RestClientBuilder;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.util.Assert;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * ElasticsearchAutoConfiguration
+ *
+ * @author fxbin
+ * @version v1.0
+ * @since 2019/9/15 22:59
+ */
+@Configuration
+@EnableConfigurationProperties(ElasticsearchProperties.class)
+public class ElasticsearchAutoConfiguration {
+
+ private final ElasticsearchProperties elasticsearchProperties;
+
+ public ElasticsearchAutoConfiguration(ElasticsearchProperties elasticsearchProperties) {
+ this.elasticsearchProperties = elasticsearchProperties;
+ }
+
+ private List httpHosts = new ArrayList<>();
+
+ @Bean
+ @ConditionalOnMissingBean
+ public RestHighLevelClient restHighLevelClient() {
+
+ List clusterNodes = elasticsearchProperties.getClusterNodes();
+ clusterNodes.forEach(node -> {
+ try {
+ String[] parts = StringUtils.split(node, ":");
+ Assert.notNull(parts, "Must defined");
+ Assert.state(parts.length == 2, "Must be defined as 'host:port'");
+ httpHosts.add(new HttpHost(parts[0], Integer.parseInt(parts[1]), elasticsearchProperties.getSchema()));
+ } catch (Exception e) {
+ throw new IllegalStateException("Invalid ES nodes " + "property '" + node + "'", e);
+ }
+ });
+ RestClientBuilder builder = RestClient.builder(httpHosts.toArray(new HttpHost[0]));
+
+ return getRestHighLevelClient(builder, elasticsearchProperties);
+ }
+
+
+ /**
+ * get restHistLevelClient
+ *
+ * @param builder RestClientBuilder
+ * @param elasticsearchProperties elasticsearch default properties
+ * @return {@link org.elasticsearch.client.RestHighLevelClient}
+ * @author fxbin
+ */
+ private static RestHighLevelClient getRestHighLevelClient(RestClientBuilder builder,
+ ElasticsearchProperties elasticsearchProperties) {
+
+ // Callback used the default {@link RequestConfig} being set to the {@link CloseableHttpClient}
+ builder.setRequestConfigCallback(requestConfigBuilder -> {
+ requestConfigBuilder.setConnectTimeout(elasticsearchProperties.getConnectTimeout());
+ requestConfigBuilder.setSocketTimeout(elasticsearchProperties.getSocketTimeout());
+ requestConfigBuilder.setConnectionRequestTimeout(elasticsearchProperties.getConnectionRequestTimeout());
+ return requestConfigBuilder;
+ });
+
+ // Callback used to customize the {@link CloseableHttpClient} instance used by a {@link RestClient} instance.
+ builder.setHttpClientConfigCallback(httpClientBuilder -> {
+ httpClientBuilder.setMaxConnTotal(elasticsearchProperties.getMaxConnectTotal());
+ httpClientBuilder.setMaxConnPerRoute(elasticsearchProperties.getMaxConnectPerRoute());
+ return httpClientBuilder;
+ });
+
+ // Callback used the basic credential auth
+ ElasticsearchProperties.Account account = elasticsearchProperties.getAccount();
+ if (!StringUtils.isEmpty(account.getUsername()) && !StringUtils.isEmpty(account.getUsername())) {
+ final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
+
+ credentialsProvider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(account.getUsername(),
+ account.getPassword()));
+ }
+ return new RestHighLevelClient(builder);
+ }
+
+}
\ No newline at end of file
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/config/ElasticsearchProperties.java b/ruoyi/src/main/java/com/ruoyi/framework/config/ElasticsearchProperties.java
new file mode 100644
index 000000000..e94089d47
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/framework/config/ElasticsearchProperties.java
@@ -0,0 +1,212 @@
+package com.ruoyi.framework.config;
+
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+import javax.validation.constraints.NotNull;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 自定义es配置
+ *
+ * @author lihe
+ */
+@ConfigurationProperties(prefix = "ruoyi.data.elasticsearch")
+public class ElasticsearchProperties {
+
+ /**
+ * 请求协议
+ */
+ private String schema = "http";
+
+ /**
+ * 集群名称
+ */
+ private String clusterName = "elasticsearch";
+
+ /**
+ * 集群节点
+ */
+ @NotNull(message = "集群节点不允许为空")
+ private List clusterNodes = new ArrayList<>();
+
+ /**
+ * 连接超时时间(毫秒)
+ */
+ private Integer connectTimeout = 1000;
+
+ /**
+ * socket 超时时间
+ */
+ private Integer socketTimeout = 30000;
+
+ /**
+ * 连接请求超时时间
+ */
+ private Integer connectionRequestTimeout = 500;
+
+ /**
+ * 每个路由的最大连接数量
+ */
+ private Integer maxConnectPerRoute = 10;
+
+ /**
+ * 最大连接总数量
+ */
+ private Integer maxConnectTotal = 30;
+
+ /**
+ * 索引配置信息
+ */
+ private Index index = new Index();
+
+ /**
+ * 认证账户
+ */
+ private Account account = new Account();
+
+ public String getSchema() {
+ return schema;
+ }
+
+ public void setSchema(String schema) {
+ this.schema = schema;
+ }
+
+ public String getClusterName() {
+ return clusterName;
+ }
+
+ public void setClusterName(String clusterName) {
+ this.clusterName = clusterName;
+ }
+
+ public List getClusterNodes() {
+ return clusterNodes;
+ }
+
+ public void setClusterNodes(List clusterNodes) {
+ this.clusterNodes = clusterNodes;
+ }
+
+ public Integer getConnectTimeout() {
+ return connectTimeout;
+ }
+
+ public void setConnectTimeout(Integer connectTimeout) {
+ this.connectTimeout = connectTimeout;
+ }
+
+ public Integer getSocketTimeout() {
+ return socketTimeout;
+ }
+
+ public void setSocketTimeout(Integer socketTimeout) {
+ this.socketTimeout = socketTimeout;
+ }
+
+ public Integer getConnectionRequestTimeout() {
+ return connectionRequestTimeout;
+ }
+
+ public void setConnectionRequestTimeout(Integer connectionRequestTimeout) {
+ this.connectionRequestTimeout = connectionRequestTimeout;
+ }
+
+ public Integer getMaxConnectPerRoute() {
+ return maxConnectPerRoute;
+ }
+
+ public void setMaxConnectPerRoute(Integer maxConnectPerRoute) {
+ this.maxConnectPerRoute = maxConnectPerRoute;
+ }
+
+ public Integer getMaxConnectTotal() {
+ return maxConnectTotal;
+ }
+
+ public void setMaxConnectTotal(Integer maxConnectTotal) {
+ this.maxConnectTotal = maxConnectTotal;
+ }
+
+ public Index getIndex() {
+ return index;
+ }
+
+ public void setIndex(Index index) {
+ this.index = index;
+ }
+
+ public Account getAccount() {
+ return account;
+ }
+
+ public void setAccount(Account account) {
+ this.account = account;
+ }
+
+ /**
+ * 索引配置信息
+ */
+ public static class Index {
+
+ /**
+ * 分片数量
+ */
+ private Integer numberOfShards = 3;
+
+ /**
+ * 副本数量
+ */
+ private Integer numberOfReplicas = 2;
+
+ public Integer getNumberOfShards() {
+ return numberOfShards;
+ }
+
+ public void setNumberOfShards(Integer numberOfShards) {
+ this.numberOfShards = numberOfShards;
+ }
+
+ public Integer getNumberOfReplicas() {
+ return numberOfReplicas;
+ }
+
+ public void setNumberOfReplicas(Integer numberOfReplicas) {
+ this.numberOfReplicas = numberOfReplicas;
+ }
+ }
+
+ /**
+ * 认证账户
+ */
+ public static class Account {
+
+ /**
+ * 认证用户
+ */
+ private String username;
+
+ /**
+ * 认证密码
+ */
+ private String password;
+
+ public String getUsername() {
+ return username;
+ }
+
+ public void setUsername(String username) {
+ this.username = username;
+ }
+
+ public String getPassword() {
+ return password;
+ }
+
+ public void setPassword(String password) {
+ this.password = password;
+ }
+ }
+
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java b/ruoyi/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java
index 24beda057..e058e0fc0 100644
--- a/ruoyi/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java
+++ b/ruoyi/src/main/java/com/ruoyi/framework/web/domain/BaseEntity.java
@@ -16,6 +16,9 @@ public class BaseEntity implements Serializable
{
private static final long serialVersionUID = 1L;
+ private Integer offset;
+ private Integer limit;
+
/** 搜索值 */
private String searchValue;
@@ -153,4 +156,21 @@ public class BaseEntity implements Serializable
{
this.params = params;
}
+
+
+ public Integer getOffset() {
+ return offset;
+ }
+
+ public void setOffset(Integer offset) {
+ this.offset = offset;
+ }
+
+ public Integer getLimit() {
+ return limit;
+ }
+
+ public void setLimit(Integer limit) {
+ this.limit = limit;
+ }
}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java b/ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java
index 4b66a26bf..cd9d9217b 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/common/CommonController.java
@@ -2,6 +2,7 @@ package com.ruoyi.project.common;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@@ -19,12 +20,11 @@ import com.ruoyi.framework.web.domain.AjaxResult;
/**
* 通用请求处理
- *
+ *
* @author ruoyi
*/
@RestController
-public class CommonController
-{
+public class CommonController {
private static final Logger log = LoggerFactory.getLogger(CommonController.class);
@Autowired
@@ -32,34 +32,30 @@ public class CommonController
/**
* 通用下载请求
- *
+ *
* @param fileName 文件名称
- * @param delete 是否删除
+ * @param delete 是否删除
*/
@GetMapping("common/download")
- public void fileDownload(String fileName, Boolean delete, HttpServletResponse response, HttpServletRequest request)
- {
- try
- {
- if (!FileUtils.isValidFilename(fileName))
- {
+ public void fileDownload(String fileName, Boolean delete, HttpServletResponse response,
+ HttpServletRequest request) {
+ try {
+ if (!FileUtils.isValidFilename(fileName)) {
throw new Exception(StringUtils.format("文件名称({})非法,不允许下载。 ", fileName));
}
- String realFileName = System.currentTimeMillis() + fileName.substring(fileName.indexOf("_") + 1);
+ String realFileName =
+ fileName.substring(0, fileName.indexOf("_")) + fileName.substring(fileName.lastIndexOf("."));
String filePath = RuoYiConfig.getDownloadPath() + fileName;
response.setCharacterEncoding("utf-8");
response.setContentType("multipart/form-data");
response.setHeader("Content-Disposition",
- "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, fileName));
+ "attachment;fileName=" + FileUtils.setFileDownloadHeader(request, realFileName));
FileUtils.writeBytes(filePath, response.getOutputStream());
- if (delete)
- {
+ if (delete) {
FileUtils.deleteFile(filePath);
}
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
log.error("下载文件失败", e);
}
}
@@ -68,10 +64,8 @@ public class CommonController
* 通用上传请求
*/
@PostMapping("/common/upload")
- public AjaxResult uploadFile(MultipartFile file) throws Exception
- {
- try
- {
+ public AjaxResult uploadFile(MultipartFile file) throws Exception {
+ try {
// 上传文件路径
String filePath = RuoYiConfig.getUploadPath();
// 上传并返回新文件名称
@@ -81,9 +75,7 @@ public class CommonController
ajax.put("fileName", fileName);
ajax.put("url", url);
return ajax;
- }
- catch (Exception e)
- {
+ } catch (Exception e) {
return AjaxResult.error(e.getMessage());
}
}
@@ -92,8 +84,7 @@ public class CommonController
* 本地资源通用下载
*/
@GetMapping("/common/download/resource")
- public void resourceDownload(String name, HttpServletRequest request, HttpServletResponse response) throws Exception
- {
+ public void resourceDownload(String name, HttpServletRequest request, HttpServletResponse response) throws Exception {
// 本地资源路径
String localPath = RuoYiConfig.getProfile();
// 数据库资源地址
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/controller/UvCaseController.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/controller/UvCaseController.java
new file mode 100644
index 000000000..7e4747ac4
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/controller/UvCaseController.java
@@ -0,0 +1,69 @@
+package com.ruoyi.project.data.basis.controller;
+
+import com.ruoyi.common.utils.ServletUtils;
+import com.ruoyi.framework.aspectj.lang.annotation.Log;
+import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
+import com.ruoyi.framework.web.controller.BaseController;
+import com.ruoyi.framework.web.domain.AjaxResult;
+import com.ruoyi.framework.web.page.TableDataInfo;
+import com.ruoyi.framework.web.page.TableSupport;
+import com.ruoyi.project.data.basis.domain.LianJiaCommunityDict;
+import com.ruoyi.project.data.basis.domain.UvClosingCase;
+import com.ruoyi.project.data.basis.domain.UvTradingCase;
+import com.ruoyi.project.data.basis.service.ILianJiaCommunityDictService;
+import com.ruoyi.project.data.basis.service.IUvClosingCaseService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 联城案例Controller
+ *
+ * @author lihe
+ */
+@RestController
+@RequestMapping("/basic/cases")
+public class UvCaseController extends BaseController {
+
+ @Autowired
+ private IUvClosingCaseService uvClosingCaseService;
+
+
+ @Autowired
+ private ILianJiaCommunityDictService lianJiaCommunityDictService;
+
+ /**
+ * 列表页面
+ *
+ * @param closingCase
+ * @return
+ */
+ @PreAuthorize("@ss.hasPermi('cases:uvClosingCase:list')")
+ @GetMapping("/closing/list")
+ public TableDataInfo closingCaseList(UvClosingCase closingCase) {
+ int pageIndex = ServletUtils.getParameterToInt("pageIndex");
+ int pageSize = ServletUtils.getParameterToInt(TableSupport.PAGE_SIZE);
+ closingCase.setOffset(pageIndex <= 1 ? 0 : (pageIndex - 1) * pageSize);
+ closingCase.setLimit(pageSize);
+
+ int total = uvClosingCaseService.pageCount(closingCase);
+ List list = uvClosingCaseService.pageList(closingCase);
+ return getDataTable(list, total);
+ }
+
+ /**
+ * es的模糊查找
+ *
+ * @param text
+ * @return
+ */
+ @PreAuthorize("@ss.hasPermi('cases:uvClosingCase:list')")
+ @GetMapping("/closing/query")
+ public TableDataInfo closingCaseInESList(@RequestParam("text") String text) {
+ List list = uvClosingCaseService.findByText(text);
+ return getDataTable(list, list.size());
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/UVBasePrice.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/UVBasePrice.java
index 97727fd28..469d55f29 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/UVBasePrice.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/UVBasePrice.java
@@ -28,12 +28,12 @@ public class UVBasePrice extends BaseEntity {
/**
* 基价(售价、租金)
*/
- @Excel(name = "主力基价", cellType = Excel.ColumnType.NUMERIC)
+ @Excel(name = "主力基价")
private BigDecimal standardPrice;
/**
* 主力面积基价(售价、租金)
*/
- @Excel(name = "主力面积基价", cellType = Excel.ColumnType.NUMERIC)
+ @Excel(name = "主力面积基价")
private BigDecimal mainAreaPrice;
/**
* 价值时点
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/UvClosingCase.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/UvClosingCase.java
new file mode 100644
index 000000000..9e4285b80
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/UvClosingCase.java
@@ -0,0 +1,269 @@
+package com.ruoyi.project.data.basis.domain;
+
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.ruoyi.framework.aspectj.lang.annotation.Excel;
+import com.ruoyi.framework.web.domain.BaseEntity;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * 联城买卖成交案例
+ *
+ * @author lihe
+ */
+public class UvClosingCase extends BaseEntity {
+
+ /**
+ * pk 案例id(唯一)
+ */
+ private String dealId;
+ /**
+ * 案例类型(一手、二手)
+ */
+ private String dealType;
+
+ /**
+ * 区域
+ */
+ private String caseDistrict;
+ private String caseBlock;
+ private String caseLoop;
+
+ /**
+ * 总价(元)
+ */
+ private BigDecimal caseTotalPrice;
+ /**
+ * 单价(元)
+ */
+ private BigDecimal caseUnitPrice;
+ /**
+ * 案例小区名称
+ */
+ private String caseCommunityName;
+ /**
+ * 案例地址
+ */
+ private String caseAddress;
+ /**
+ * 案例面积
+ */
+ private BigDecimal caseArea;
+ /**
+ * 案例房屋类型
+ */
+ private String caseHouseType;
+ /**
+ * 案例房屋性质
+ */
+ private String caseHouseProperty;
+ /**
+ * 签约日期
+ */
+ private Date caseContractDate;
+ /**
+ * 楼层
+ */
+ private String caseFloor;
+ /**
+ * 案例房型
+ */
+ private String caseApartmentLayout;
+ /**
+ * 物业类型
+ */
+ private String propertyType;
+ /**
+ * 小区id
+ */
+ private String communityId;
+ private String communityName;
+ /**
+ * 楼栋id
+ */
+ private String buildingId;
+ private String buildingName;
+ /**
+ * 单套id
+ */
+ private String condoId;
+ private String condoName;
+
+ public String getDealId() {
+ return dealId;
+ }
+
+ public void setDealId(String dealId) {
+ this.dealId = dealId;
+ }
+
+ public String getDealType() {
+ return dealType;
+ }
+
+ public void setDealType(String dealType) {
+ this.dealType = dealType;
+ }
+
+ public String getCaseDistrict() {
+ return caseDistrict;
+ }
+
+ public void setCaseDistrict(String caseDistrict) {
+ this.caseDistrict = caseDistrict;
+ }
+
+ public String getCaseBlock() {
+ return caseBlock;
+ }
+
+ public void setCaseBlock(String caseBlock) {
+ this.caseBlock = caseBlock;
+ }
+
+ public String getCaseLoop() {
+ return caseLoop;
+ }
+
+ public void setCaseLoop(String caseLoop) {
+ this.caseLoop = caseLoop;
+ }
+
+ public BigDecimal getCaseTotalPrice() {
+ return caseTotalPrice;
+ }
+
+ public void setCaseTotalPrice(BigDecimal caseTotalPrice) {
+ this.caseTotalPrice = caseTotalPrice;
+ }
+
+ public BigDecimal getCaseUnitPrice() {
+ return caseUnitPrice;
+ }
+
+ public void setCaseUnitPrice(BigDecimal caseUnitPrice) {
+ this.caseUnitPrice = caseUnitPrice;
+ }
+
+ public String getCaseCommunityName() {
+ return caseCommunityName;
+ }
+
+ public void setCaseCommunityName(String caseCommunityName) {
+ this.caseCommunityName = caseCommunityName;
+ }
+
+ public String getCaseAddress() {
+ return caseAddress;
+ }
+
+ public void setCaseAddress(String caseAddress) {
+ this.caseAddress = caseAddress;
+ }
+
+ public BigDecimal getCaseArea() {
+ return caseArea;
+ }
+
+ public void setCaseArea(BigDecimal caseArea) {
+ this.caseArea = caseArea;
+ }
+
+ public String getCaseHouseType() {
+ return caseHouseType;
+ }
+
+ public void setCaseHouseType(String caseHouseType) {
+ this.caseHouseType = caseHouseType;
+ }
+
+ public String getCaseHouseProperty() {
+ return caseHouseProperty;
+ }
+
+ public void setCaseHouseProperty(String caseHouseProperty) {
+ this.caseHouseProperty = caseHouseProperty;
+ }
+
+ public Date getCaseContractDate() {
+ return caseContractDate;
+ }
+
+ public void setCaseContractDate(Date caseContractDate) {
+ this.caseContractDate = caseContractDate;
+ }
+
+ public String getCaseFloor() {
+ return caseFloor;
+ }
+
+ public void setCaseFloor(String caseFloor) {
+ this.caseFloor = caseFloor;
+ }
+
+ public String getPropertyType() {
+ return propertyType;
+ }
+
+ public void setPropertyType(String propertyType) {
+ this.propertyType = propertyType;
+ }
+
+ public String getCommunityId() {
+ return communityId;
+ }
+
+ public void setCommunityId(String communityId) {
+ this.communityId = communityId;
+ }
+
+ public String getBuildingId() {
+ return buildingId;
+ }
+
+ public void setBuildingId(String buildingId) {
+ this.buildingId = buildingId;
+ }
+
+ public String getCondoId() {
+ return condoId;
+ }
+
+ public void setCondoId(String condoId) {
+ this.condoId = condoId;
+ }
+
+ public String getCommunityName() {
+ return communityName;
+ }
+
+ public void setCommunityName(String communityName) {
+ this.communityName = communityName;
+ }
+
+ public String getBuildingName() {
+ return buildingName;
+ }
+
+ public void setBuildingName(String buildingName) {
+ this.buildingName = buildingName;
+ }
+
+ public String getCondoName() {
+ return condoName;
+ }
+
+ public void setCondoName(String condoName) {
+ this.condoName = condoName;
+ }
+
+ public String getCaseApartmentLayout() {
+ return caseApartmentLayout;
+ }
+
+ public void setCaseApartmentLayout(String caseApartmentLayout) {
+ this.caseApartmentLayout = caseApartmentLayout;
+ }
+
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/UvTradingCase.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/UvTradingCase.java
new file mode 100644
index 000000000..c9c6d4be3
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/domain/UvTradingCase.java
@@ -0,0 +1,62 @@
+package com.ruoyi.project.data.basis.domain;
+
+import java.io.Serializable;
+
+/**
+ * 联城买卖成交案例
+ *
+ * @author lihe
+ */
+public class UvTradingCase implements Serializable {
+
+ private static final long serialVersionUID = 8510634155374943623L;
+
+ /**
+ * 主键
+ */
+ private Long id;
+ /**
+ * 案例id
+ */
+ private String dealId;
+ /**
+ * 模糊地址
+ */
+ private String cleanAddress;
+ /**
+ * 区域
+ */
+ private String countryName;
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ public String getDealId() {
+ return dealId;
+ }
+
+ public void setDealId(String dealId) {
+ this.dealId = dealId;
+ }
+
+ public String getCleanAddress() {
+ return cleanAddress;
+ }
+
+ public void setCleanAddress(String cleanAddress) {
+ this.cleanAddress = cleanAddress;
+ }
+
+ public String getCountryName() {
+ return countryName;
+ }
+
+ public void setCountryName(String countryName) {
+ this.countryName = countryName;
+ }
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/mapper/UvClosingCaseMapper.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/mapper/UvClosingCaseMapper.java
new file mode 100644
index 000000000..d8b96d865
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/mapper/UvClosingCaseMapper.java
@@ -0,0 +1,33 @@
+package com.ruoyi.project.data.basis.mapper;
+
+import com.baomidou.dynamic.datasource.annotation.DS;
+import com.ruoyi.project.data.basis.domain.ClosingCaseAddress;
+import com.ruoyi.project.data.basis.domain.UvClosingCase;
+
+import java.util.List;
+
+/**
+ * 联城数库买卖成交案例
+ *
+ * @author lihe
+ */
+@DS("teemlink")
+public interface UvClosingCaseMapper {
+
+ /**
+ * 总数
+ *
+ * @param queryModel
+ * @return
+ */
+ int selectPageCount(UvClosingCase queryModel);
+
+ /**
+ * 分页查询
+ *
+ * @param queryModel
+ * @return
+ */
+ List selectPageList(UvClosingCase queryModel);
+
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/BaseElasticsearchService.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/BaseElasticsearchService.java
new file mode 100644
index 000000000..5601da8c7
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/BaseElasticsearchService.java
@@ -0,0 +1,195 @@
+package com.ruoyi.project.data.basis.service;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.ruoyi.common.exception.ElasticsearchException;
+import com.ruoyi.framework.config.ElasticsearchProperties;
+import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
+import org.elasticsearch.action.admin.indices.create.CreateIndexResponse;
+import org.elasticsearch.action.admin.indices.delete.DeleteIndexRequest;
+import org.elasticsearch.action.delete.DeleteRequest;
+import org.elasticsearch.action.index.IndexRequest;
+import org.elasticsearch.action.search.SearchRequest;
+import org.elasticsearch.action.search.SearchResponse;
+import org.elasticsearch.action.update.UpdateRequest;
+import org.elasticsearch.client.HttpAsyncResponseConsumerFactory;
+import org.elasticsearch.client.RequestOptions;
+import org.elasticsearch.client.RestHighLevelClient;
+import org.elasticsearch.common.settings.Settings;
+import org.elasticsearch.common.xcontent.XContentType;
+import org.elasticsearch.index.query.BoolQueryBuilder;
+import org.elasticsearch.index.query.QueryBuilders;
+import org.elasticsearch.search.builder.SearchSourceBuilder;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.annotation.Resource;
+import java.io.IOException;
+import java.util.Map;
+
+public abstract class BaseElasticsearchService {
+
+ private static Logger log = LoggerFactory.getLogger(BaseElasticsearchService.class);
+
+ @Resource
+ protected RestHighLevelClient client;
+
+ @Resource
+ private ElasticsearchProperties elasticsearchProperties;
+
+ protected static final RequestOptions COMMON_OPTIONS;
+
+ static {
+ RequestOptions.Builder builder = RequestOptions.DEFAULT.toBuilder();
+
+ // 默认缓冲限制为100MB,此处修改为30MB。
+ builder.setHttpAsyncResponseConsumerFactory(new HttpAsyncResponseConsumerFactory.HeapBufferedResponseConsumerFactory(30 * 1024 * 1024));
+ COMMON_OPTIONS = builder.build();
+ }
+
+ /**
+ * create elasticsearch index (asyc)
+ *
+ * @param index elasticsearch index
+ * @author fxbin
+ */
+ protected void createIndexRequest(String index) {
+ try {
+ CreateIndexRequest request = new CreateIndexRequest(index);
+ // Settings for this index
+ request.settings(Settings.builder().put("index.number_of_shards",
+ elasticsearchProperties.getIndex().getNumberOfShards()).put("index.number_of_replicas",
+ elasticsearchProperties.getIndex().getNumberOfReplicas()));
+
+ CreateIndexResponse createIndexResponse = client.indices().create(request, COMMON_OPTIONS);
+
+ log.info(" whether all of the nodes have acknowledged the request : {}",
+ createIndexResponse.isAcknowledged());
+ log.info(" Indicates whether the requisite number of shard copies were started for each shard in the " +
+ "index before timing out :{}", createIndexResponse.isShardsAcknowledged());
+ } catch (IOException e) {
+ throw new ElasticsearchException("创建索引 {" + index + "} 失败");
+ }
+ }
+
+ /**
+ * delete elasticsearch index
+ *
+ * @param index elasticsearch index name
+ * @author fxbin
+ */
+ protected void deleteIndexRequest(String index) {
+ DeleteIndexRequest deleteIndexRequest = buildDeleteIndexRequest(index);
+ try {
+ client.indices().delete(deleteIndexRequest, COMMON_OPTIONS);
+ } catch (IOException e) {
+ throw new ElasticsearchException("删除索引 {" + index + "} 失败");
+ }
+ }
+
+ /**
+ * build DeleteIndexRequest
+ *
+ * @param index elasticsearch index name
+ * @author fxbin
+ */
+ private static DeleteIndexRequest buildDeleteIndexRequest(String index) {
+ return new DeleteIndexRequest(index);
+ }
+
+ /**
+ * build IndexRequest
+ *
+ * @param index elasticsearch index name
+ * @param id request object id
+ * @param object request object
+ * @return {@link org.elasticsearch.action.index.IndexRequest}
+ * @author fxbin
+ */
+ protected static IndexRequest buildIndexRequest(String index, String id, Object object) {
+ return new IndexRequest(index).id(id).source(BeanUtil.beanToMap(object), XContentType.JSON);
+ }
+
+ /**
+ * exec updateRequest
+ *
+ * @param index elasticsearch index name
+ * @param id Document id
+ * @param object request object
+ * @author fxbin
+ */
+ protected void updateRequest(String index, String id, Object object) {
+ try {
+ UpdateRequest updateRequest = new UpdateRequest(index, "", id).doc(BeanUtil.beanToMap(object),
+ XContentType.JSON);
+ client.update(updateRequest, COMMON_OPTIONS);
+ } catch (IOException e) {
+ throw new ElasticsearchException("更新索引 {" + index + "} 数据 {" + object + "} 失败");
+ }
+ }
+
+ /**
+ * exec deleteRequest
+ *
+ * @param index elasticsearch index name
+ * @param id Document id
+ * @author fxbin
+ */
+ protected void deleteRequest(String index, String id) {
+ try {
+ DeleteRequest deleteRequest = new DeleteRequest(index, "", id);
+ client.delete(deleteRequest, COMMON_OPTIONS);
+ } catch (IOException e) {
+ throw new ElasticsearchException("删除索引 {" + index + "} 数据id {" + id + "} 失败");
+ }
+ }
+
+ /**
+ * search all
+ *
+ * @param index elasticsearch index name
+ * @return {@link SearchResponse}
+ * @author fxbin
+ */
+ protected SearchResponse search(String index) {
+ SearchRequest searchRequest = new SearchRequest(index);
+ SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
+ searchSourceBuilder.query(QueryBuilders.matchAllQuery());
+ searchRequest.source(searchSourceBuilder);
+ SearchResponse searchResponse = null;
+ try {
+ searchResponse = client.search(searchRequest, COMMON_OPTIONS);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return searchResponse;
+ }
+
+ /**
+ * 查询
+ *
+ * @param index
+ * @param params
+ * @return
+ */
+ protected SearchResponse search(String index, Map params) {
+ SearchRequest searchRequest = new SearchRequest(index);
+ SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
+
+ BoolQueryBuilder boolQueryBuilder = QueryBuilders.boolQuery();
+ if (null != params) {
+ for (Map.Entry item : params.entrySet()) {
+ boolQueryBuilder.must().add(QueryBuilders.matchQuery(item.getKey(), item.getValue()));
+ }
+ }
+
+ searchSourceBuilder.from(0).size(20).query(boolQueryBuilder);
+ searchRequest.source(searchSourceBuilder);
+ SearchResponse searchResponse = null;
+ try {
+ searchResponse = client.search(searchRequest, COMMON_OPTIONS);
+ } catch (IOException e) {
+ e.printStackTrace();
+ }
+ return searchResponse;
+ }
+}
\ No newline at end of file
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/IUvClosingCaseService.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/IUvClosingCaseService.java
new file mode 100644
index 000000000..53e22ce0a
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/IUvClosingCaseService.java
@@ -0,0 +1,42 @@
+package com.ruoyi.project.data.basis.service;
+
+import com.ruoyi.project.data.basis.domain.UVBasePrice;
+import com.ruoyi.project.data.basis.domain.UVBasePriceQueryModel;
+import com.ruoyi.project.data.basis.domain.UvClosingCase;
+import com.ruoyi.project.data.basis.domain.UvTradingCase;
+
+import java.util.List;
+
+/**
+ * 联城数库,买卖成交案例
+ *
+ * @author lihe
+ */
+public interface IUvClosingCaseService {
+
+ /**
+ * 分页查询
+ *
+ * @param queryModel
+ * @return
+ */
+ List pageList(UvClosingCase queryModel);
+
+ /**
+ * 分页数量
+ *
+ * @param queryModel
+ * @return
+ */
+ Integer pageCount(UvClosingCase queryModel);
+
+ /**
+ * 查询es地址
+ *
+ * @param text
+ * @return
+ */
+ List findByText(String text);
+
+
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/impl/UvClosingCaseServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/impl/UvClosingCaseServiceImpl.java
new file mode 100644
index 000000000..3d6a4a5dd
--- /dev/null
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/basis/service/impl/UvClosingCaseServiceImpl.java
@@ -0,0 +1,55 @@
+package com.ruoyi.project.data.basis.service.impl;
+
+import cn.hutool.core.bean.BeanUtil;
+import com.ruoyi.project.data.basis.domain.UvClosingCase;
+import com.ruoyi.project.data.basis.domain.UvTradingCase;
+import com.ruoyi.project.data.basis.mapper.UvClosingCaseMapper;
+import com.ruoyi.project.data.basis.service.BaseElasticsearchService;
+import com.ruoyi.project.data.basis.service.IUvClosingCaseService;
+import org.elasticsearch.action.search.SearchResponse;
+import org.elasticsearch.search.SearchHit;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.*;
+
+/**
+ * 案例查询实现
+ *
+ * @author lihe
+ */
+@Service
+public class UvClosingCaseServiceImpl extends BaseElasticsearchService implements IUvClosingCaseService {
+
+ @Autowired
+ private UvClosingCaseMapper uvClosingCaseMapper;
+
+ @Override
+ public List pageList(UvClosingCase queryModel) {
+ return uvClosingCaseMapper.selectPageList(queryModel);
+ }
+
+ @Override
+ public Integer pageCount(UvClosingCase queryModel) {
+ return uvClosingCaseMapper.selectPageCount(queryModel);
+ }
+
+ @Override
+ public List findByText(String text) {
+ Map params = new HashMap<>();
+ params.put("cleanAddress",text);
+ SearchResponse searchResponse = search("trading",params);
+ SearchHit[] hits = searchResponse.getHits().getHits();
+
+ List caseList = new ArrayList<>();
+ Arrays.stream(hits).forEach(hit -> {
+ Map sourceAsMap = hit.getSourceAsMap();
+ UvTradingCase person = BeanUtil.mapToBean(sourceAsMap, UvTradingCase.class, true);
+ caseList.add(person);
+ });
+
+ return caseList;
+ }
+
+
+}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/IOriginalResidenceRentClosingCaseService.java b/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/IOriginalResidenceRentClosingCaseService.java
index e8444b7dc..a9510000e 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/IOriginalResidenceRentClosingCaseService.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/IOriginalResidenceRentClosingCaseService.java
@@ -10,4 +10,11 @@ public interface IOriginalResidenceRentClosingCaseService {
* 数据下载
*/
void pullData();
+
+ /**
+ * 推送数据
+ * @param yearMonth
+ * @param currentPriceTableRoute
+ */
+ void pushAggregateCase(Integer yearMonth, Integer currentPriceTableRoute);
}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceRentClosingCaseServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceRentClosingCaseServiceImpl.java
index 30ca3faea..f4d09c59b 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceRentClosingCaseServiceImpl.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceRentClosingCaseServiceImpl.java
@@ -3,11 +3,14 @@ package com.ruoyi.project.data.cases.service.impl;
import com.baomidou.dynamic.datasource.annotation.DS;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.LoadUtil;
+import com.ruoyi.project.data.cases.domain.CleanResidenceRentAggregationCase;
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase;
import com.ruoyi.project.data.cases.domain.OtherResidenceRentClosingCase;
import com.ruoyi.project.data.cases.mapper.OriginalResidenceRentClosingCaseMapper;
+import com.ruoyi.project.data.cases.mapper.ResidenceRentAggregationCaseMapper;
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceRentClosingCaseMapper;
import com.ruoyi.project.data.cases.mapper.sync.DownloadOtherResidenceRentClosingCaseMapper;
+import com.ruoyi.project.data.cases.mapper.sync.SyncResidenceRentCaseMapper;
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentClosingCaseService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -16,6 +19,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
import org.springframework.jdbc.core.namedparam.SqlParameterSource;
import org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils;
+import org.springframework.scheduling.annotation.Async;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;
@@ -39,6 +43,10 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
@Autowired
private JdbcTemplate jdbcTemplate;
+ @Autowired
+ private SyncResidenceRentCaseMapper syncResidenceRentCaseMapper;
+ @Autowired
+ private ResidenceRentAggregationCaseMapper residenceRentAggregationCaseMapper;
/**
*
@@ -128,5 +136,20 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
sql = rawSql.replace("#yearMonth#", yearMonth.toString())
.replace("#lastYearMonth#", lastYearMonth.toString());
jdbcTemplate.update(sql);
+
+ pushAggregateCase(yearMonth, lastYearMonth);
+ }
+
+ @Async
+ @Override
+ public void pushAggregateCase(Integer yearMonth, Integer currentPriceTableRoute) {
+ // 案例同步
+ syncResidenceRentCaseMapper.createAggregationCaseTable(currentPriceTableRoute);
+ List list = residenceRentAggregationCaseMapper.getMonthly(yearMonth);
+ list.parallelStream().forEach(cleanResidenceRentAggregationCase -> {
+ cleanResidenceRentAggregationCase.setYearMonth(currentPriceTableRoute);
+ syncResidenceRentCaseMapper.insertAggregationCaseTable(cleanResidenceRentAggregationCase);
+ });
+ logger.info("推送案例汇总数据完成");
}
}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceRentOpeningCaseServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceRentOpeningCaseServiceImpl.java
index 61ec03113..d50c78b53 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceRentOpeningCaseServiceImpl.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceRentOpeningCaseServiceImpl.java
@@ -32,14 +32,16 @@ public class OriginalResidenceRentOpeningCaseServiceImpl implements IOriginalRes
private OriginalResidenceRentOpeningCaseMapper originalResidenceRentOpeningCaseMapper;
@Autowired
private DownloadOriginalResidenceRentOpeningCaseMapper downloadOriginalResidenceRentOpeningCaseMapper;
+ @Autowired
+ private DownloadOriginalResidenceRentPlatformCaseMapper downloadOriginalResidenceRentPlatformCaseMapper;
+
@Autowired
private SyncOriginalResidenceRentOpeningCaseMapper syncOriginalResidenceRentOpeningCaseMapper;
@Autowired
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
@Autowired
private JdbcTemplate jdbcTemplate;
- @Autowired
- private DownloadOriginalResidenceRentPlatformCaseMapper downloadOriginalResidenceRentPlatformCaseMapper;
+
/**
* 29号拉取挂牌案例
@@ -136,6 +138,5 @@ public class OriginalResidenceRentOpeningCaseServiceImpl implements IOriginalRes
.replace("#lastYearMonth#", lastYearMonth.toString());
jdbcTemplate.update(sql);
- logger.debug("#作价完成#");
}
}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceSaleClosingCaseServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceSaleClosingCaseServiceImpl.java
deleted file mode 100644
index e69cfd31c..000000000
--- a/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceSaleClosingCaseServiceImpl.java
+++ /dev/null
@@ -1,113 +0,0 @@
-//package com.ruoyi.project.data.cases.service.impl;
-//
-//import com.baomidou.dynamic.datasource.annotation.DS;
-//import com.ruoyi.common.utils.LoadUtil;
-//import com.ruoyi.project.data.cases.domain.OriginalResidenceSaleClosingCase;
-//import com.ruoyi.project.data.cases.mapper.OriginalResidenceSaleClosingCaseMapper;
-//import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceSaleClosingCaseMapper;
-//import com.ruoyi.project.data.cases.service.IOriginalResidenceSaleClosingCaseService;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.jdbc.core.JdbcTemplate;
-//import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
-//import org.springframework.jdbc.core.namedparam.SqlParameterSource;
-//import org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils;
-//import org.springframework.scheduling.annotation.Scheduled;
-//import org.springframework.stereotype.Service;
-//
-//import java.util.Calendar;
-//import java.util.Date;
-//import java.util.List;
-//
-//@Service
-//@DS("compute")
-//public class OriginalResidenceSaleClosingCaseServiceImpl implements IOriginalResidenceSaleClosingCaseService {
-//
-// private static Logger logger = LoggerFactory.getLogger(OriginalResidenceSaleClosingCaseServiceImpl.class);
-//
-// @Autowired
-// private OriginalResidenceSaleClosingCaseMapper originalResidenceSaleClosingCaseMapper;
-// @Autowired
-// private DownloadOriginalResidenceSaleClosingCaseMapper downloadOriginalResidenceSaleClosingCaseMapper;
-// @Autowired
-// private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
-// @Autowired
-// private JdbcTemplate jdbcTemplate;
-//
-// /**
-// *
-// */
-// @Scheduled(cron = "0 0 5 9 * ?")
-// @Override
-// public void clear() {
-// Calendar calendar = Calendar.getInstance();
-// calendar.setTime(new Date());
-// Integer targetTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
-// calendar.get(Calendar.MONTH)));
-// calendar.add(Calendar.MONTH, 1);
-// Integer computeTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
-// calendar.get(Calendar.MONTH) + 1));
-//
-//// targetTableRoute = 202005;
-//// computeTableRoute = 202007;
-//
-// prepare(computeTableRoute);
-// List list =
-// downloadOriginalResidenceSaleClosingCaseMapper.download(targetTableRoute);
-// list.parallelStream().forEach(originalResidenceSaleClosingCase -> {
-// originalResidenceSaleClosingCase.setCaseId(originalResidenceSaleClosingCase.generateCaseId());
-// originalResidenceSaleClosingCase.setCleanPropertyType(originalResidenceSaleClosingCase.refinePropertyType());
-//// originalResidenceSaleClosingCase.setCleanCurrentFloor(originalResidenceSaleClosingCase
-//// .refineCurrentFloor());
-//// originalResidenceSaleClosingCase.setCleanBuildingAddress(originalResidenceSaleClosingCase
-//// .refineBuildingAddress());
-// });
-// running(computeTableRoute, list);
-// after(computeTableRoute);
-// }
-//
-// /**
-// * 准备工作 创建表
-// *
-// * @param computeTableRoute
-// */
-// public void prepare(Integer computeTableRoute) {
-// originalResidenceSaleClosingCaseMapper.createRawTable(computeTableRoute);
-// originalResidenceSaleClosingCaseMapper.createCleanTable(computeTableRoute);
-// }
-//
-// /**
-// * 批量入库
-// *
-// * @param computeTableRoute
-// * @param list
-// */
-// public void running(Integer computeTableRoute, List list) {
-// SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(list.toArray());
-// int[] updateCounts = namedParameterJdbcTemplate.batchUpdate("insert into dbo" +
-// ".original_residence_sale_closing_case_" + computeTableRoute + "(case_id,case_county_name," +
-// "case_block_name,case_loopline_name,case_community_name,case_address,case_area," +
-// "case_unit_price,case_total_price,case_house_type,case_signing_date,case_register_date," +
-// "case_agency_name,case_agency_type,case_seller_type,case_buyer_type,case_birthday," +
-// "case_deal_type,clean_property_type,create_time) " +
-// "values (:caseId,:caseCountyName,:caseBlockName,:caseLoopName,:caseCommunityName," +
-// ":caseAddress,:caseArea,:caseUnitPrice,:caseTotalPrice,:caseHouseType,:caseSigningDate," +
-// ":caseRegisterDate,:agencyName,:agencyType,:sellerType,:buyerType,:birthday," +
-// ":cleanCaseType,:cleanPropertyType,GETDATE());",
-// batchParams);
-// }
-//
-// /**
-// * 清洗成交数据
-// *
-// * @param yearMonth
-// */
-// public void after(Integer yearMonth) {
-// // sql-template/.sql
-//// String rawSql = LoadUtil.loadContent("sql-template/clear_residence_sale_closing_case.sql");
-// String rawSql = LoadUtil.loadContent("sql-template/clear_sale_closing_case.sql");
-// String sql = rawSql.replace("#yearMonth#", yearMonth.toString());
-// jdbcTemplate.update(sql);
-// }
-//}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceSaleOpeningCaseServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceSaleOpeningCaseServiceImpl.java
deleted file mode 100644
index 25a7abb1b..000000000
--- a/ruoyi/src/main/java/com/ruoyi/project/data/cases/service/impl/OriginalResidenceSaleOpeningCaseServiceImpl.java
+++ /dev/null
@@ -1,132 +0,0 @@
-//package com.ruoyi.project.data.cases.service.impl;
-//
-//import com.baomidou.dynamic.datasource.annotation.DS;
-//import com.ruoyi.common.utils.LoadUtil;
-//import com.ruoyi.project.data.cases.domain.OriginalResidenceSaleOpeningCase;
-//import com.ruoyi.project.data.cases.mapper.OriginalResidenceSaleOpeningCaseMapper;
-//import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceSaleOpeningCaseMapper;
-//import com.ruoyi.project.data.cases.mapper.sync.SyncOriginalResidenceSaleOpeningCaseMapper;
-//import com.ruoyi.project.data.cases.service.IOriginalResidenceSaleOpeningCaseService;
-//import org.slf4j.Logger;
-//import org.slf4j.LoggerFactory;
-//import org.springframework.beans.factory.annotation.Autowired;
-//import org.springframework.jdbc.core.JdbcTemplate;
-//import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
-//import org.springframework.jdbc.core.namedparam.SqlParameterSource;
-//import org.springframework.jdbc.core.namedparam.SqlParameterSourceUtils;
-//import org.springframework.scheduling.annotation.Scheduled;
-//import org.springframework.stereotype.Service;
-//
-//import java.util.Calendar;
-//import java.util.Date;
-//import java.util.List;
-//
-//@Service
-//@DS("compute")
-//public class OriginalResidenceSaleOpeningCaseServiceImpl implements IOriginalResidenceSaleOpeningCaseService {
-//
-// private static Logger logger = LoggerFactory.getLogger(OriginalResidenceSaleOpeningCaseServiceImpl.class);
-//
-// @Autowired
-// private OriginalResidenceSaleOpeningCaseMapper originalResidenceSaleOpeningCaseMapper;
-// @Autowired
-// private DownloadOriginalResidenceSaleOpeningCaseMapper downloadOriginalResidenceSaleOpeningCaseMapper;
-// @Autowired
-// private SyncOriginalResidenceSaleOpeningCaseMapper syncOriginalResidenceSaleOpeningCaseMapper;
-// @Autowired
-// private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
-// @Autowired
-// private JdbcTemplate jdbcTemplate;
-//
-// /**
-// *
-// */
-// @Scheduled(cron = "0 0 5 25 * ?")
-// @Override
-// public void clear() {
-// Calendar calendar = Calendar.getInstance();
-// calendar.setTime(new Date());
-// Integer syncTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
-// calendar.get(Calendar.MONTH)));
-// Integer lastYearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
-// calendar.get(Calendar.MONTH) + 1));
-// calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), 1);
-// Date valuePoint = calendar.getTime();
-// calendar.add(Calendar.MONTH, 1);
-// Integer computeTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
-// calendar.get(Calendar.MONTH) + 1));
-//// computeTableRoute = 202007;
-//// lastYearMonth = 202006;
-//
-// prepare(computeTableRoute, syncTableRoute);
-// List list = downloadOriginalResidenceSaleOpeningCaseMapper.download();
-// list.parallelStream().forEach(originalResidenceOpeningCase -> {
-//// originalResidenceOpeningCase.clear();
-//// originalResidenceOpeningCase.setYearMonth(syncTableRoute);
-//// syncOriginalResidenceSaleOpeningCaseMapper.insert(originalResidenceOpeningCase);
-// });
-// running(computeTableRoute, list);
-// after(computeTableRoute, lastYearMonth);
-// }
-//
-// /**
-// * 准备工作 创建表
-// *
-// * @param computeTableRoute
-// * @param syncTableRoute
-// */
-// public void prepare(Integer computeTableRoute, Integer syncTableRoute) {
-// originalResidenceSaleOpeningCaseMapper.createRawTable(computeTableRoute);
-// originalResidenceSaleOpeningCaseMapper.createCleanTable(computeTableRoute);
-// originalResidenceSaleOpeningCaseMapper.createAssembleTable(computeTableRoute);
-// originalResidenceSaleOpeningCaseMapper.createComputePriceTable(computeTableRoute);
-// originalResidenceSaleOpeningCaseMapper.createArtificialPriceTable(computeTableRoute);
-// originalResidenceSaleOpeningCaseMapper.createUltimatePriceTable(computeTableRoute);
-//// syncOriginalResidenceSaleOpeningCaseMapper.createTable(syncTableRoute);
-// }
-//
-// /**
-// * 批量入库
-// *
-// * @param computeTableRoute
-// * @param list
-// */
-// public void running(Integer computeTableRoute, List list) {
-// SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(list.toArray());
-// int[] updateCounts = namedParameterJdbcTemplate.batchUpdate("insert into dbo" +
-// ".ODS_HOUSINGCASELISTED_LJ_" + computeTableRoute + "_RAW(case_id, llid, lcid, Name, " +
-// "Roomtype, Area, Towards, Storey, Lastdeal, Condoelev, Decoration, Year, Address, Price, " +
-// "Cname, Visited_Num, First_Visit_Time, Visited_Num_15, Visited_Num_30, Url, Curl, CurlDate) " +
-// "values (:newCaseId,:caseLianJiaId,:caseLianJiaCommunityId,:caseTitle," +
-// ":caseApartmentLayout,:caseArea,:caseToward,:caseStorey,:caseLastDeal,:caseElevator" +
-// ",:caseDecoration,:caseYear,:caseAddress,:casePrice,:caseCommunityName,:caseVisitedNum," +
-// ":caseFirstVisitTime,:caseVisitedNum15,:caseVisitedNum30,:caseUrl,:caseCommunityUrl," +
-// ":caseGetDate);",
-// batchParams);
-// }
-//
-// /**
-// * 匹配数据
-// * 计算基价
-// *
-// * @param yearMonth
-// * @param lastYearMonth
-// */
-// public void after(Integer yearMonth, Integer lastYearMonth) {
-// // 清洗挂牌案例
-//
-// String rawSql = LoadUtil.loadContent("sql-template/clear_sale_opening_case.sql");
-//// String rawSql = LoadUtil.loadContent("sql-template/clear_residence_sale_opening_case.sql");
-// String sql = rawSql.replace("#yearMonth#", yearMonth.toString())
-// .replace("#lastYearMonth#", lastYearMonth.toString());
-// jdbcTemplate.update(sql);
-//
-// // 作价
-// rawSql = LoadUtil.loadContent("sql-template/compute_sale_price.sql");
-// sql = rawSql.replace("#yearMonth#", yearMonth.toString())
-// .replace("#lastYearMonth#", lastYearMonth.toString());
-// jdbcTemplate.update(sql);
-//
-// logger.debug("#作价完成#");
-// }
-//}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java
index 0fd9ec148..2077e8615 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceRentBasePriceController.java
@@ -94,7 +94,7 @@ public class ResidenceRentBasePriceController extends BaseController {
List list =
computeResidenceRentPriceService.selectPageList(computeResidenceRentBasePrice);
ExcelUtil util = new ExcelUtil<>(ComputeResidenceRentBasePrice.class);
- return util.exportExcel(list, "住宅租赁基价初始化-" + computeResidenceRentBasePrice.getYearMonth());
+ return util.exportExcel(list, "住宅租赁基价初始化" + computeResidenceRentBasePrice.getYearMonth());
}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceSaleBasePriceController.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceSaleBasePriceController.java
index 7366400b6..8d287d10b 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceSaleBasePriceController.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/ResidenceSaleBasePriceController.java
@@ -88,12 +88,14 @@ public class ResidenceSaleBasePriceController extends BaseController {
computeResidenceSaleBasePrice.setPageIndex(0);
computeResidenceSaleBasePrice.setPageSize(total);
List list = null;
- if (0 == total)
+ if (0 == total) {
list = new LinkedList<>();
- else
+ } else {
list = computeResidenceSalePriceService.selectList(computeResidenceSaleBasePrice);
+ }
+
ExcelUtil util = new ExcelUtil<>(ComputeResidenceSaleBasePrice.class);
- return util.exportExcel(list, "住宅销售基价" + computeResidenceSaleBasePrice.getYearMonth());
+ return util.exportExcel(list, "住宅销售基价初始化" + computeResidenceSaleBasePrice.getYearMonth());
}
/**
@@ -264,10 +266,12 @@ public class ResidenceSaleBasePriceController extends BaseController {
ultimateResidenceSaleBasePrice.setPageIndex(0);
ultimateResidenceSaleBasePrice.setPageSize(total);
List list = null;
- if (0 == total)
+ if (0 == total) {
list = new LinkedList<>();
- else
+ } else {
list = ultimateResidenceSalePriceService.selectList(ultimateResidenceSaleBasePrice);
+ }
+
ExcelUtil util = new ExcelUtil<>(UltimateResidenceSaleBasePrice.class);
return util.exportExcel(list, "住宅销售基价" + ultimateResidenceSaleBasePrice.getYearMonth());
}
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/UltimateOfficeBasePriceController.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/UltimateOfficeBasePriceController.java
index 9fb571de3..fa9832321 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/UltimateOfficeBasePriceController.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/controller/UltimateOfficeBasePriceController.java
@@ -73,15 +73,6 @@ public class UltimateOfficeBasePriceController extends BaseController {
return AjaxResult.success(officeBasePriceUltimateService.getById(yearMonth, id));
}
-// /**
-// * 修改办公基价
-// */
-// @PreAuthorize("@ss.hasPermi('system:user:edit')")
-// @Log(title = "办公基价", businessType = BusinessType.UPDATE)
-// @PutMapping
-// public AjaxResult update(@RequestBody UltimateOfficeBasePrice officeBasePriceUltimate) {
-// return toAjax(officeBasePriceUltimateService.update(officeBasePriceUltimate));
-// }
/**
* 导出办公基价列表
diff --git a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ArtificialResidenceRentPriceServiceImpl.java b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ArtificialResidenceRentPriceServiceImpl.java
index cac8262d7..33dac4a19 100644
--- a/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ArtificialResidenceRentPriceServiceImpl.java
+++ b/ruoyi/src/main/java/com/ruoyi/project/data/price/service/impl/ArtificialResidenceRentPriceServiceImpl.java
@@ -56,8 +56,6 @@ public class ArtificialResidenceRentPriceServiceImpl implements IArtificialResid
@Autowired
private SyncResidenceRentCaseMapper syncResidenceRentCaseMapper;
@Autowired
- private ResidenceRentAggregationCaseMapper residenceRentAggregationCaseMapper;
- @Autowired
private UltimateResidenceRentPriceMapper ultimateResidenceRentPriceMapper;
@Override
@@ -217,14 +215,6 @@ public class ArtificialResidenceRentPriceServiceImpl implements IArtificialResid
@Async
public void pushData(Integer yearMonth, Integer currentPriceTableRoute, Integer lastPriceTableRoute) {
try {
- // 案例同步
- syncResidenceRentCaseMapper.createAggregationCaseTable(currentPriceTableRoute);
- List list = residenceRentAggregationCaseMapper.getMonthly(yearMonth);
- list.parallelStream().forEach(cleanResidenceRentAggregationCase -> {
- cleanResidenceRentAggregationCase.setYearMonth(currentPriceTableRoute);
- syncResidenceRentCaseMapper.insertAggregationCaseTable(cleanResidenceRentAggregationCase);
- });
-
// 当期价格同步
syncResidenceRentCaseMapper.createUltimatePriceTable(currentPriceTableRoute);
List ultimateResidenceRentBasePrices =
diff --git a/ruoyi/src/main/resources/application-dev.yml b/ruoyi/src/main/resources/application-dev.yml
index ec1af67e8..f7fe6397d 100644
--- a/ruoyi/src/main/resources/application-dev.yml
+++ b/ruoyi/src/main/resources/application-dev.yml
@@ -11,6 +11,13 @@ ruoyi:
profile: D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled: false
+ data:
+ elasticsearch:
+ cluster-name: elasticsearch
+ cluster-nodes: 172.16.30.243:9200
+ index:
+ number-of-replicas: 0
+ number-of-shards: 3
# web服务器配置
server:
diff --git a/ruoyi/src/main/resources/logback-spring.xml b/ruoyi/src/main/resources/logback-spring.xml
index 5538041da..10f3cf85b 100644
--- a/ruoyi/src/main/resources/logback-spring.xml
+++ b/ruoyi/src/main/resources/logback-spring.xml
@@ -140,6 +140,7 @@
+
diff --git a/ruoyi/src/main/resources/mybatis/data/ResidenceRentAggregationCaseMapper.xml b/ruoyi/src/main/resources/mybatis/data/ResidenceRentAggregationCaseMapper.xml
index 07161788d..1c8fee292 100644
--- a/ruoyi/src/main/resources/mybatis/data/ResidenceRentAggregationCaseMapper.xml
+++ b/ruoyi/src/main/resources/mybatis/data/ResidenceRentAggregationCaseMapper.xml
@@ -62,7 +62,7 @@
-