Merge branch 'master' of gitee.com:purplelihe/RuoYi-Vue
Conflicts: ruoyi/src/test/java/com/ruoyi/GenerateTableTests.java
This commit is contained in:
commit
ee82313818
@ -79,6 +79,7 @@
|
||||
<el-table-column label="租金主力面积系数" align="center" prop="mainCoefficientRent" />
|
||||
<el-table-column label="AI租金(草稿)" align="center" prop="rentPriceDft" />
|
||||
<el-table-column label="主力面积租金(草稿)" align="center" prop="mainRentPriceDft" />
|
||||
<el-table-column label="主力面积(㎡)" align="center" prop="area" />
|
||||
<el-table-column label="上月AI租金" align="center" prop="rentPrice_1" />
|
||||
<el-table-column label="成交均价(上周期)" align="center" prop="priceDealMean_1" />
|
||||
<el-table-column label="成交最大价(上周期)" align="center" prop="priceDealMax_1" />
|
||||
|
@ -1,5 +1,8 @@
|
||||
FROM 172.16.30.92:5000/uv:jdk-1.8.0
|
||||
|
||||
# 设置时区
|
||||
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
|
||||
|
||||
VOLUME /tmp
|
||||
# 将jar包添加到容器中并更名为app.jar
|
||||
|
||||
|
@ -99,13 +99,21 @@
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<!-- <scope>runtime</scope>-->
|
||||
</dependency>
|
||||
<!-- <dependency>-->
|
||||
<!-- <groupId>com.microsoft.sqlserver</groupId>-->
|
||||
<!-- <artifactId>mssql-jdbc</artifactId>-->
|
||||
<!--<!– <scope>runtime</scope>–>-->
|
||||
<!-- <version>7.4.0.jre8</version>-->
|
||||
<!-- </dependency>-->
|
||||
|
||||
<!-- https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc -->
|
||||
<dependency>
|
||||
<groupId>com.microsoft.sqlserver</groupId>
|
||||
<artifactId>mssql-jdbc</artifactId>
|
||||
<!-- <scope>runtime</scope>-->
|
||||
<version>7.4.0.jre8</version>
|
||||
<version>8.2.2.jre8</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
<!-- SpringBoot集成mybatis框架 -->
|
||||
<dependency>
|
||||
<groupId>org.mybatis.spring.boot</groupId>
|
||||
|
@ -0,0 +1,27 @@
|
||||
package com.ruoyi.common.exception;
|
||||
|
||||
import com.ruoyi.common.utils.MessageUtils;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
/**
|
||||
* 作价数据未找到
|
||||
*
|
||||
* @author ruoyi
|
||||
*/
|
||||
public class ComputeDataNotFoundException extends RuntimeException {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 所属模块
|
||||
*/
|
||||
private String module;
|
||||
|
||||
public ComputeDataNotFoundException(String module) {
|
||||
this.module = module;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return module + "未找到相关案例数据。";
|
||||
}
|
||||
}
|
@ -1,5 +1,7 @@
|
||||
package com.ruoyi.framework.task;
|
||||
|
||||
import com.ruoyi.project.data.cases.service.IOriginalOfficeCaseService;
|
||||
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentClosingCaseService;
|
||||
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentOpeningCaseService;
|
||||
import com.ruoyi.project.data.cases.service.impl.DownloadOriginalNewHouseCaseServiceImpl;
|
||||
import com.ruoyi.project.data.cases.service.impl.DownloadOriginalResidenceSaleClosingCaseServiceImpl;
|
||||
@ -22,6 +24,12 @@ public class RyTask {
|
||||
private DownloadOriginalResidenceSaleClosingCaseServiceImpl downloadOriginalResidenceSaleClosingCaseService;
|
||||
@Autowired
|
||||
private DownloadOriginalNewHouseCaseServiceImpl downloadOriginalNewHouseCaseService;
|
||||
@Autowired
|
||||
private IOriginalOfficeCaseService originalOfficeCaseService;
|
||||
@Autowired
|
||||
private IOriginalResidenceRentOpeningCaseService originalResidenceRentOpeningCaseService;
|
||||
@Autowired
|
||||
private IOriginalResidenceRentClosingCaseService originalResidenceRentClosingCaseService;
|
||||
|
||||
public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
|
||||
System.out.println(StringUtils.format("执行多参方法: 字符串类型{},布尔类型{},长整型{},浮点型{},整形{}", s, b, l, d, i));
|
||||
@ -63,4 +71,24 @@ public class RyTask {
|
||||
downloadOriginalNewHouseCaseService.downloadSecond();
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载办公案例和作价
|
||||
*/
|
||||
public void downloadOfficeCase() {
|
||||
originalOfficeCaseService.compute();
|
||||
}
|
||||
|
||||
/**
|
||||
* 住宅租赁挂牌案例下载
|
||||
*/
|
||||
public void downloadRentOpeningCase() {
|
||||
originalResidenceRentOpeningCaseService.pullData();
|
||||
}
|
||||
|
||||
/**
|
||||
* 住宅租赁成交案例下载
|
||||
*/
|
||||
public void downloadRentClosingCase() {
|
||||
originalResidenceRentClosingCaseService.pullData();
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,30 @@
|
||||
package com.ruoyi.project.data.basis.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 百度地图apiResponse
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class BaiDuMapResponse {
|
||||
|
||||
private Integer status;
|
||||
private List<BaiDuPoint> result;
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public List<BaiDuPoint> getResult() {
|
||||
return result;
|
||||
}
|
||||
|
||||
public void setResult(List<BaiDuPoint> result) {
|
||||
this.result = result;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
package com.ruoyi.project.data.basis.domain;
|
||||
|
||||
/**
|
||||
* 百度地图点
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class BaiDuPoint {
|
||||
|
||||
private Double x;
|
||||
private Double y;
|
||||
|
||||
public Double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(Double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public Double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(Double y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return x + " " + y;
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.ruoyi.project.data.basis.domain;
|
||||
|
||||
/**
|
||||
* Geo对象
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class UvGeo {
|
||||
private Integer id;
|
||||
private String geoText;
|
||||
/**
|
||||
* 1 百度
|
||||
* 2 高德
|
||||
* 3 84
|
||||
*/
|
||||
private Integer coordinateType;
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getGeoText() {
|
||||
return geoText;
|
||||
}
|
||||
|
||||
public void setGeoText(String geoText) {
|
||||
this.geoText = geoText;
|
||||
}
|
||||
|
||||
public Integer getCoordinateType() {
|
||||
return coordinateType;
|
||||
}
|
||||
|
||||
public void setCoordinateType(Integer coordinateType) {
|
||||
this.coordinateType = coordinateType;
|
||||
}
|
||||
}
|
@ -4,6 +4,8 @@ import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.data.basis.domain.UVBasePrice;
|
||||
import com.ruoyi.project.data.basis.domain.UVBasePriceQueryModel;
|
||||
import com.ruoyi.project.data.basis.domain.UvCommunityGeo;
|
||||
import com.ruoyi.project.data.basis.domain.UvGeo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -30,4 +32,21 @@ public interface UvCommunityGeoMapper {
|
||||
*/
|
||||
int updateGaoDeCoordinate(UvCommunityGeo uvCommunityGeo);
|
||||
|
||||
/**
|
||||
* 获取指定表的geo数据
|
||||
*
|
||||
* @param tableName
|
||||
* @return
|
||||
*/
|
||||
List<UvGeo> getSomeGeo(@Param("tableName") String tableName);
|
||||
|
||||
/**
|
||||
* 更新geo
|
||||
* @param tableName
|
||||
* @param id
|
||||
* @param geo
|
||||
* @return
|
||||
*/
|
||||
int updateSomeGeo(@Param("tableName") String tableName, @Param("geo") String geo, @Param("id") Integer id);
|
||||
|
||||
}
|
||||
|
@ -7,6 +7,7 @@ import java.util.Date;
|
||||
|
||||
/**
|
||||
* 租赁成交案例
|
||||
* @author lihe
|
||||
*/
|
||||
public class OriginalResidenceRentClosingCase {
|
||||
private String caseId;
|
||||
|
@ -0,0 +1,184 @@
|
||||
package com.ruoyi.project.data.cases.domain;
|
||||
|
||||
import org.springframework.util.DigestUtils;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* 新的租赁成交案例
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class OtherResidenceRentClosingCase {
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
private String caseId;
|
||||
/**
|
||||
* 案例区域
|
||||
*/
|
||||
private String caseDistrict;
|
||||
/**
|
||||
* 案例小区名称
|
||||
*/
|
||||
private String caseCommunityName;
|
||||
/**
|
||||
* 案例地址
|
||||
*/
|
||||
private String caseAddress;
|
||||
/**
|
||||
* 面积
|
||||
*/
|
||||
private BigDecimal caseArea;
|
||||
/**
|
||||
* 成交日期
|
||||
*/
|
||||
private Date closingDate;
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
private BigDecimal caseTotalPrice;
|
||||
/**
|
||||
* 朝向
|
||||
*/
|
||||
private String caseDecoration;
|
||||
/**
|
||||
* 总楼层
|
||||
*/
|
||||
private Integer caseTotalFloor;
|
||||
/**
|
||||
* 所在层
|
||||
*/
|
||||
private String caseCurrentFloor;
|
||||
/**
|
||||
* 朝向
|
||||
*/
|
||||
private String caseToward;
|
||||
/**
|
||||
* 楼层
|
||||
*/
|
||||
private String caseFloor;
|
||||
/**
|
||||
* 小区
|
||||
*/
|
||||
private String uvCommunityId;
|
||||
/**
|
||||
* 楼栋
|
||||
*/
|
||||
private String uvBuildingId;
|
||||
|
||||
|
||||
public String getCaseId() {
|
||||
return UUID.randomUUID().toString().replace("-","");
|
||||
}
|
||||
|
||||
public void setCaseId(String caseId) {
|
||||
this.caseId = caseId;
|
||||
}
|
||||
|
||||
public String getCaseDistrict() {
|
||||
return caseDistrict;
|
||||
}
|
||||
|
||||
public void setCaseDistrict(String caseDistrict) {
|
||||
this.caseDistrict = caseDistrict;
|
||||
}
|
||||
|
||||
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 Date getClosingDate() {
|
||||
return closingDate;
|
||||
}
|
||||
|
||||
public void setClosingDate(Date closingDate) {
|
||||
this.closingDate = closingDate;
|
||||
}
|
||||
|
||||
public BigDecimal getCaseTotalPrice() {
|
||||
return caseTotalPrice;
|
||||
}
|
||||
|
||||
public void setCaseTotalPrice(BigDecimal caseTotalPrice) {
|
||||
this.caseTotalPrice = caseTotalPrice;
|
||||
}
|
||||
|
||||
public String getCaseDecoration() {
|
||||
return caseDecoration;
|
||||
}
|
||||
|
||||
public void setCaseDecoration(String caseDecoration) {
|
||||
this.caseDecoration = caseDecoration;
|
||||
}
|
||||
|
||||
public Integer getCaseTotalFloor() {
|
||||
return caseTotalFloor;
|
||||
}
|
||||
|
||||
public void setCaseTotalFloor(Integer caseTotalFloor) {
|
||||
this.caseTotalFloor = caseTotalFloor;
|
||||
}
|
||||
|
||||
public String getCaseCurrentFloor() {
|
||||
return caseCurrentFloor;
|
||||
}
|
||||
|
||||
public void setCaseCurrentFloor(String caseCurrentFloor) {
|
||||
this.caseCurrentFloor = caseCurrentFloor;
|
||||
}
|
||||
|
||||
public String getCaseToward() {
|
||||
return caseToward;
|
||||
}
|
||||
|
||||
public void setCaseToward(String caseToward) {
|
||||
this.caseToward = caseToward;
|
||||
}
|
||||
|
||||
public String getCaseFloor() {
|
||||
return caseFloor;
|
||||
}
|
||||
|
||||
public void setCaseFloor(String caseFloor) {
|
||||
this.caseFloor = caseFloor;
|
||||
}
|
||||
|
||||
public String getUvCommunityId() {
|
||||
return uvCommunityId;
|
||||
}
|
||||
|
||||
public void setUvCommunityId(String uvCommunityId) {
|
||||
this.uvCommunityId = uvCommunityId;
|
||||
}
|
||||
|
||||
public String getUvBuildingId() {
|
||||
return uvBuildingId;
|
||||
}
|
||||
|
||||
public void setUvBuildingId(String uvBuildingId) {
|
||||
this.uvBuildingId = uvBuildingId;
|
||||
}
|
||||
}
|
@ -26,13 +26,13 @@ public interface OriginalOfficeCaseMapper {
|
||||
* @param yearMonth
|
||||
*/
|
||||
void createArtificialTable(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
/**
|
||||
* 创建案例汇总表
|
||||
*
|
||||
* @param yearMonth
|
||||
*/
|
||||
void createAssembleTable(@Param("yearMonth") Integer yearMonth);
|
||||
//
|
||||
// /**
|
||||
// * 创建案例汇总表
|
||||
// *
|
||||
// * @param yearMonth
|
||||
// */
|
||||
// void createAssembleTable(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
/**
|
||||
* 初始化案例汇总表
|
||||
|
@ -18,6 +18,14 @@ public interface OriginalResidenceRentClosingCaseMapper {
|
||||
*/
|
||||
int createRawTable(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
/**
|
||||
* 创建其他住宅租赁成交案例
|
||||
*
|
||||
* @param tableRoute
|
||||
* @return
|
||||
*/
|
||||
int createOtherRawTable(@Param("yearMonth") Integer tableRoute);
|
||||
|
||||
/**
|
||||
* 创建清洗完成之后的表ODS_HOUSINGCASELISTED_LJ_YYYYMM
|
||||
*
|
||||
@ -33,8 +41,10 @@ public interface OriginalResidenceRentClosingCaseMapper {
|
||||
* @return
|
||||
*/
|
||||
int createAssembleTable(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
/**
|
||||
* 作价表
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
@ -42,6 +52,7 @@ public interface OriginalResidenceRentClosingCaseMapper {
|
||||
|
||||
/**
|
||||
* 人工修正价格表
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
|
@ -25,6 +25,8 @@ public interface OriginalResidenceSaleClosingCaseMapper {
|
||||
*/
|
||||
int createRawTable(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 插入住宅销售成交案例
|
||||
*
|
||||
@ -54,4 +56,6 @@ public interface OriginalResidenceSaleClosingCaseMapper {
|
||||
* @return
|
||||
*/
|
||||
List<OriginalResidenceSaleOpeningCase> pageList(OriginalResidenceSaleOpeningCaseQueryModel queryModel);
|
||||
|
||||
|
||||
}
|
||||
|
@ -2,18 +2,24 @@ package com.ruoyi.project.data.cases.mapper.sync;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.data.cases.domain.OriginalOfficeCase;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 爬取库中的办公案例
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
@DS("spider")
|
||||
public interface DownloadOriginalOfficeCaseMapper {
|
||||
/**
|
||||
* 下载案例
|
||||
* 下载办公案例
|
||||
*
|
||||
* @param startDate
|
||||
* @param endDate
|
||||
* @return
|
||||
*/
|
||||
List<OriginalOfficeCase> download(Date startDate, Date endDate);
|
||||
List<OriginalOfficeCase> download(@Param("startDate") Date startDate,@Param("endDate") Date endDate);
|
||||
}
|
||||
|
@ -6,13 +6,20 @@ import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 住宅租赁成交案例下载
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
@DS("calc")
|
||||
public interface DownloadOriginalResidenceRentClosingCaseMapper {
|
||||
|
||||
/**
|
||||
* 租赁成交案例数据下载
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
List<OriginalResidenceRentClosingCase> download(@Param("yearMonth") Integer yearMonth);
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,25 @@
|
||||
package com.ruoyi.project.data.cases.mapper.sync;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase;
|
||||
import com.ruoyi.project.data.cases.domain.OtherResidenceRentClosingCase;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 其他住宅租赁案例下载
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
@DS("spider2")
|
||||
public interface DownloadOtherResidenceRentClosingCaseMapper {
|
||||
|
||||
/**
|
||||
* 租赁成交案例数据下载
|
||||
*
|
||||
* @param yearMonth
|
||||
* @return
|
||||
*/
|
||||
List<OtherResidenceRentClosingCase> download(@Param("yearMonth") Integer yearMonth);
|
||||
}
|
@ -1,5 +1,10 @@
|
||||
package com.ruoyi.project.data.cases.service;
|
||||
|
||||
/**
|
||||
* 办公基价计算Service
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public interface IOriginalOfficeCaseService {
|
||||
/**
|
||||
* 计算
|
||||
|
@ -1,5 +1,13 @@
|
||||
package com.ruoyi.project.data.cases.service;
|
||||
|
||||
/**
|
||||
* 住宅租赁成交案例Service
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public interface IOriginalResidenceRentClosingCaseService {
|
||||
/**
|
||||
* 数据下载
|
||||
*/
|
||||
void pullData();
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ public class DownloadOriginalResidenceSaleOpeningCaseServiceImpl {
|
||||
*/
|
||||
public void download() {
|
||||
Integer tableRoute = DateUtils.getNextYearMonth();
|
||||
Integer remoteTableRoute = DateUtils.getLastYearMonth();
|
||||
Integer remoteTableRoute = DateUtils.getYearMonth();
|
||||
|
||||
download(tableRoute, remoteTableRoute);
|
||||
}
|
||||
@ -82,6 +82,9 @@ public class DownloadOriginalResidenceSaleOpeningCaseServiceImpl {
|
||||
originalResidenceSaleOpeningCaseMapper.createRawTable(tableRoute);
|
||||
originalResidenceSaleOpeningCaseMapper.createCleanTable(tableRoute);
|
||||
originalResidenceSaleOpeningCaseMapper.createAssembleTable(tableRoute);
|
||||
originalResidenceSaleOpeningCaseMapper.createComputePriceTable(tableRoute);
|
||||
originalResidenceSaleOpeningCaseMapper.createArtificialPriceTable(tableRoute);
|
||||
originalResidenceSaleOpeningCaseMapper.createUltimatePriceTable(tableRoute);
|
||||
syncOriginalResidenceSaleOpeningCaseMapper.createRawTable(remoteTableRoute);
|
||||
}
|
||||
|
||||
|
@ -1,6 +1,8 @@
|
||||
package com.ruoyi.project.data.cases.service.impl;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.ruoyi.common.exception.ComputeDataNotFoundException;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.LoadUtil;
|
||||
import com.ruoyi.project.data.cases.domain.OriginalOfficeCase;
|
||||
import com.ruoyi.project.data.cases.mapper.OriginalOfficeCaseMapper;
|
||||
@ -20,6 +22,11 @@ import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 办公基价计算Service
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
@Service
|
||||
@DS("compute")
|
||||
public class OriginalOfficeCaseServiceImpl implements IOriginalOfficeCaseService {
|
||||
@ -39,26 +46,18 @@ public class OriginalOfficeCaseServiceImpl implements IOriginalOfficeCaseService
|
||||
* 计算
|
||||
*/
|
||||
@Override
|
||||
@Scheduled(cron = "0 0 17 28 * ?")
|
||||
public void compute() {
|
||||
|
||||
Integer yearMonth = DateUtils.getNextYearMonth();
|
||||
Integer lastYearMonth = DateUtils.getYearMonth();
|
||||
|
||||
Date date = new Date();
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(date);
|
||||
calendar.set(calendar.get(Calendar.YEAR), calendar.get(Calendar.MONTH), 15);
|
||||
Date startDate = calendar.getTime();
|
||||
Integer lastYearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
||||
calendar.get(Calendar.MONTH) + 1));
|
||||
calendar.add(Calendar.MONTH, 1);
|
||||
Date endDate = calendar.getTime();
|
||||
Integer yearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
||||
calendar.get(Calendar.MONTH) + 1));
|
||||
|
||||
// yearMonth = 202007;
|
||||
//// lastYearMonth = 202006;
|
||||
//// calendar.set(2020, 5, 16);
|
||||
//// startDate = calendar.getTime();
|
||||
//// calendar.set(2020, 6, 16);
|
||||
//// endDate = calendar.getTime();
|
||||
|
||||
before(yearMonth, startDate, endDate);
|
||||
running(yearMonth, lastYearMonth);
|
||||
@ -72,23 +71,29 @@ public class OriginalOfficeCaseServiceImpl implements IOriginalOfficeCaseService
|
||||
private void before(Integer yearMonth, Date startDate, Date endDate) {
|
||||
// 创建表
|
||||
originalOfficeCaseMapper.createTable(yearMonth);
|
||||
originalOfficeCaseMapper.createArtificialTable(yearMonth);
|
||||
originalOfficeCaseMapper.initAssembleTable(yearMonth);
|
||||
originalOfficeCaseMapper.initPriceTable(yearMonth);
|
||||
originalOfficeCaseMapper.createArtificialTable(yearMonth);
|
||||
|
||||
// 下载列表
|
||||
List<OriginalOfficeCase> downloadList = downloadOriginalOfficeCaseMapper.download(startDate, endDate);
|
||||
if (0 == downloadList.size()) {
|
||||
throw new ComputeDataNotFoundException("办公作价");
|
||||
}
|
||||
SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(downloadList.toArray());
|
||||
namedParameterJdbcTemplate.batchUpdate("insert into dbo.ODS_OFFICECASELISTED_" + yearMonth.toString() + "_RAW" +
|
||||
"(case_id,url, title,容积率,总价售,均价售, 楼盘名称, 楼盘名称_M, 楼层, 面积, 物业费, 工位数, 地址, 地铁, 发布时间, 房源编号, 百度lng, 百度lat, " +
|
||||
"区域, 分类, " +
|
||||
"来源, 等级, 楼盘网址, 装修,类型, 板块, 挂牌中介, 月租金租, 标准租金租, 得房率, 总价, 单价,更新时间) values(replace(newid(),'-',''),:url," +
|
||||
":title," +
|
||||
":floorAreaRatio," +
|
||||
":caseTotalPrice," +
|
||||
":caseUnitPrice,:name,:name_m,:caseFloor,:area,:managementFee,:seatCount,:address,:metro," +
|
||||
":publishDate,:sourceNo,:lng,:lat,:county,:catalog,:source,:level,:homePageUrl,:decoration," +
|
||||
":type,:block,:agency,:rentOfMonthly,:rentOfStandard,:score,:totalPrice,:unitPrice,:updateDate) ",
|
||||
"(case_id,url, title,容积率,总价售,均价售, 楼盘名称, 楼盘名称_M, 楼层, 面积, 物业费, 工位数, 地址, 地铁, 发布时间, 房源编号, 百度lng, " +
|
||||
"百度lat, " +
|
||||
"区域, 分类, " +
|
||||
"来源, 等级, 楼盘网址, 装修,类型, 板块, 挂牌中介, 月租金租, 标准租金租, 得房率, 总价, 单价,更新时间) values(replace(newid(),'-','')" +
|
||||
",:url," +
|
||||
":title," +
|
||||
":floorAreaRatio," +
|
||||
":caseTotalPrice," +
|
||||
":caseUnitPrice,:name,:name_m,:caseFloor,:area,:managementFee,:seatCount,:address,:metro," +
|
||||
":publishDate,:sourceNo,:lng,:lat,:county,:catalog,:source,:level,:homePageUrl,:decoration," +
|
||||
":type,:block,:agency,:rentOfMonthly,:rentOfStandard,:score,:totalPrice,:unitPrice," +
|
||||
":updateDate) ",
|
||||
batchParams);
|
||||
}
|
||||
|
||||
|
@ -1,10 +1,13 @@
|
||||
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.OriginalResidenceRentClosingCase;
|
||||
import com.ruoyi.project.data.cases.domain.OtherResidenceRentClosingCase;
|
||||
import com.ruoyi.project.data.cases.mapper.OriginalResidenceRentClosingCaseMapper;
|
||||
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceRentClosingCaseMapper;
|
||||
import com.ruoyi.project.data.cases.mapper.sync.DownloadOtherResidenceRentClosingCaseMapper;
|
||||
import com.ruoyi.project.data.cases.service.IOriginalResidenceRentClosingCaseService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
@ -31,6 +34,8 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
||||
@Autowired
|
||||
private DownloadOriginalResidenceRentClosingCaseMapper downloadOriginalResidenceRentClosingCaseMapper;
|
||||
@Autowired
|
||||
private DownloadOtherResidenceRentClosingCaseMapper downloadOtherResidenceRentClosingCaseMapper;
|
||||
@Autowired
|
||||
private NamedParameterJdbcTemplate namedParameterJdbcTemplate;
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate;
|
||||
@ -38,26 +43,19 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Scheduled(cron = "0 0 15 29 * ?")
|
||||
@Override
|
||||
public void pullData() {
|
||||
Calendar calendar = Calendar.getInstance();
|
||||
calendar.setTime(new Date());
|
||||
Integer targetTableRoute = 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.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;
|
||||
Integer targetTableRoute = DateUtils.getLastYearMonth();
|
||||
Integer lastYearMonth = DateUtils.getYearMonth();
|
||||
Integer computeTableRoute = DateUtils.getNextYearMonth();
|
||||
|
||||
prepare(computeTableRoute);
|
||||
List<OriginalResidenceRentClosingCase> list =
|
||||
downloadOriginalResidenceRentClosingCaseMapper.download(targetTableRoute);
|
||||
running(computeTableRoute, list);
|
||||
|
||||
List<OtherResidenceRentClosingCase> otherResidenceRentClosingCaseList =
|
||||
downloadOtherResidenceRentClosingCaseMapper.download(targetTableRoute);
|
||||
running(computeTableRoute, list, otherResidenceRentClosingCaseList);
|
||||
after(computeTableRoute, lastYearMonth);
|
||||
}
|
||||
|
||||
@ -68,6 +66,8 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
||||
*/
|
||||
public void prepare(Integer computeTableRoute) {
|
||||
originalResidenceRentClosingCaseMapper.createRawTable(computeTableRoute);
|
||||
// 新增住宅租赁成交案例
|
||||
originalResidenceRentClosingCaseMapper.createOtherRawTable(computeTableRoute);
|
||||
originalResidenceRentClosingCaseMapper.createCleanTable(computeTableRoute);
|
||||
originalResidenceRentClosingCaseMapper.createAssembleTable(computeTableRoute);
|
||||
originalResidenceRentClosingCaseMapper.createComputeTable(computeTableRoute);
|
||||
@ -81,7 +81,8 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
||||
* @param computeTableRoute
|
||||
* @param list
|
||||
*/
|
||||
public void running(Integer computeTableRoute, List<OriginalResidenceRentClosingCase> list) {
|
||||
public void running(Integer computeTableRoute, List<OriginalResidenceRentClosingCase> list,
|
||||
List<OtherResidenceRentClosingCase> otherResidenceRentClosingCaseList) {
|
||||
SqlParameterSource[] batchParams = SqlParameterSourceUtils.createBatch(list.toArray());
|
||||
int[] updateCounts = namedParameterJdbcTemplate.batchUpdate("insert into dbo" +
|
||||
".ODS_HOUSINGCASEDEAL_RENT_" + computeTableRoute + "_RAW(case_id, case_contract_no, " +
|
||||
@ -92,6 +93,18 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
||||
":caseRentPrice,:caseTotalFloor,:caseArea,:caseToward,:caseApartmentLayout,:caseDecoration," +
|
||||
":cleanCommunityId,:cleanBuildingId);",
|
||||
batchParams);
|
||||
|
||||
batchParams = SqlParameterSourceUtils.createBatch(otherResidenceRentClosingCaseList.toArray());
|
||||
updateCounts = namedParameterJdbcTemplate.batchUpdate("insert into dbo" +
|
||||
".TEMP_ODS_HOUSINGCASEDEAL_RENT_" + computeTableRoute + "_RAW(case_id,case_district," +
|
||||
"case_community_name,case_address,case_area,case_closing_date,case_total_price," +
|
||||
"case_decoration,case_total_floor,case_current_floor,case_toward,case_floor,uv_community_id," +
|
||||
"uv_building_id) " +
|
||||
"values (:caseId,:caseDistrict,:caseCommunityName,:caseAddress,:caseArea,:closingDate," +
|
||||
":caseTotalPrice,:caseDecoration,:caseTotalFloor,:caseCurrentFloor,:caseToward,:caseFloor," +
|
||||
":uvCommunityId,:uvBuildingId);",
|
||||
batchParams);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -104,6 +117,12 @@ public class OriginalResidenceRentClosingCaseServiceImpl implements IOriginalRes
|
||||
String rawSql = LoadUtil.loadContent("sql-template/clear_rent_closing_case.sql");
|
||||
String sql = rawSql.replace("#yearMonth#", yearMonth.toString());
|
||||
jdbcTemplate.update(sql);
|
||||
|
||||
// 其他住宅租赁成交案例
|
||||
rawSql = LoadUtil.loadContent("sql-template/clear_other_rent_closing_case.sql");
|
||||
sql = rawSql.replace("#yearMonth#", yearMonth.toString());
|
||||
jdbcTemplate.update(sql);
|
||||
|
||||
// 计算
|
||||
rawSql = LoadUtil.loadContent("sql-template/compute_rent_price.sql");
|
||||
sql = rawSql.replace("#yearMonth#", yearMonth.toString())
|
||||
|
@ -1,6 +1,7 @@
|
||||
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.OriginalResidencePlatformRentOpeningCase;
|
||||
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase;
|
||||
@ -43,22 +44,20 @@ public class OriginalResidenceRentOpeningCaseServiceImpl implements IOriginalRes
|
||||
/**
|
||||
* 29号拉取挂牌案例
|
||||
*/
|
||||
@Scheduled(cron = "0 0 5 29 * ?")
|
||||
@Override
|
||||
public void pullData() {
|
||||
|
||||
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 startDate = calendar.getTime();
|
||||
calendar.add(Calendar.MONTH, 1);
|
||||
Integer computeTableRoute = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
||||
calendar.get(Calendar.MONTH) + 1));
|
||||
Date endDate = calendar.getTime();
|
||||
|
||||
Integer computeTableRoute = DateUtils.getNextYearMonth();
|
||||
Integer lastYearMonth = DateUtils.getYearMonth();
|
||||
Integer syncTableRoute = DateUtils.getLastYearMonth();
|
||||
|
||||
prepare(computeTableRoute, syncTableRoute);
|
||||
// 拉取案例
|
||||
List<OriginalResidenceRentOpeningCase> list = downloadOriginalResidenceRentOpeningCaseMapper.download();
|
||||
|
@ -18,6 +18,8 @@ public interface ComputeResidenceRentPriceMapper {
|
||||
|
||||
/**
|
||||
* 查询列表
|
||||
* @param ComputeResidenceRentBasePrice
|
||||
* @return
|
||||
*/
|
||||
List<ComputeResidenceRentBasePrice> selectPageList(ComputeResidenceRentBasePrice ComputeResidenceRentBasePrice);
|
||||
|
||||
|
@ -0,0 +1,33 @@
|
||||
package com.ruoyi.project.tool.address;
|
||||
|
||||
import com.ruoyi.project.tool.address.model.CleanAddress;
|
||||
import com.ruoyi.project.tool.address.model.CleanAddressBuilder;
|
||||
import com.ruoyi.project.tool.address.service.impl.NoSignalAddressHandler;
|
||||
import com.ruoyi.project.tool.address.service.impl.SignalAddressHandler;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 地址清洗
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class CleanUtil {
|
||||
|
||||
/**
|
||||
* 清洗
|
||||
*
|
||||
* @param rawAddress
|
||||
* @return
|
||||
*/
|
||||
public static CleanAddress clear(String rawAddress) {
|
||||
CleanAddress cleanAddress = new CleanAddress(rawAddress);
|
||||
if (cleanAddress.getContainsSpecialChar()) {
|
||||
new SignalAddressHandler().clear(cleanAddress);
|
||||
} else {
|
||||
new NoSignalAddressHandler().clear(cleanAddress);
|
||||
}
|
||||
return cleanAddress;
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.project.tool.address.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 室地址
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class BuildingAddress extends PartialAddress {
|
||||
|
||||
public BuildingAddress(String address) {
|
||||
super(address);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PartialAddress> getPartialAddress() {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,243 @@
|
||||
package com.ruoyi.project.tool.address.model;
|
||||
|
||||
import com.ruoyi.project.tool.address.service.impl.SignalAddressHandler;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 清洗地址
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class CleanAddress {
|
||||
/**
|
||||
* 原地址
|
||||
*/
|
||||
private String rawAddress;
|
||||
/**
|
||||
* 待处理的地址
|
||||
*/
|
||||
private StringBuilder boundAddress;
|
||||
/**
|
||||
* 区域
|
||||
*/
|
||||
private String district;
|
||||
/**
|
||||
* 镇
|
||||
*/
|
||||
private String region;
|
||||
/**
|
||||
* 板块
|
||||
*/
|
||||
private String block;
|
||||
/**
|
||||
* 路名(可能交叉路)
|
||||
*/
|
||||
private String road;
|
||||
/**
|
||||
* 小区名称
|
||||
*/
|
||||
private String communityName;
|
||||
/**
|
||||
* 楼层
|
||||
* (和地下有关系)
|
||||
*/
|
||||
private String floor;
|
||||
/**
|
||||
* 小区地址
|
||||
*/
|
||||
private PartialAddress communityAddress;
|
||||
/**
|
||||
* 楼栋地址
|
||||
*/
|
||||
private PartialAddress buildingAddress;
|
||||
/**
|
||||
* 单套地址
|
||||
*/
|
||||
private PartialAddress condoAddress;
|
||||
/**
|
||||
* 物业(普通、车位)
|
||||
*/
|
||||
private String propertyType;
|
||||
/**
|
||||
* 独栋
|
||||
*/
|
||||
private Boolean independent;
|
||||
/**
|
||||
* 多个地址
|
||||
*/
|
||||
private List<PartialAddress> addressList = new LinkedList<>();
|
||||
|
||||
/**
|
||||
* 是否包含特殊字符
|
||||
*/
|
||||
private Boolean containsSpecialChar;
|
||||
|
||||
private static List<String> specialChar = new LinkedList<>();
|
||||
|
||||
static {
|
||||
specialChar.add("。");
|
||||
specialChar.add(".");
|
||||
specialChar.add(",");
|
||||
specialChar.add(",");
|
||||
specialChar.add("-");
|
||||
specialChar.add("——");
|
||||
specialChar.add("_");
|
||||
specialChar.add("、");
|
||||
specialChar.add("(");
|
||||
specialChar.add(")");
|
||||
specialChar.add("(");
|
||||
specialChar.add(")");
|
||||
specialChar.add("《");
|
||||
specialChar.add("》");
|
||||
}
|
||||
|
||||
public CleanAddress(String rawAddress) {
|
||||
this.rawAddress = rawAddress;
|
||||
|
||||
}
|
||||
|
||||
public String getRawAddress() {
|
||||
return rawAddress;
|
||||
}
|
||||
|
||||
public void setRawAddress(String rawAddress) {
|
||||
this.rawAddress = rawAddress;
|
||||
}
|
||||
|
||||
public String getDistrict() {
|
||||
return district;
|
||||
}
|
||||
|
||||
public void setDistrict(String district) {
|
||||
this.district = district;
|
||||
}
|
||||
|
||||
public String getRegion() {
|
||||
return region;
|
||||
}
|
||||
|
||||
public void setRegion(String region) {
|
||||
this.region = region;
|
||||
}
|
||||
|
||||
public String getBlock() {
|
||||
return block;
|
||||
}
|
||||
|
||||
public void setBlock(String block) {
|
||||
this.block = block;
|
||||
}
|
||||
|
||||
public String getRoad() {
|
||||
return road;
|
||||
}
|
||||
|
||||
public void setRoad(String road) {
|
||||
this.road = road;
|
||||
}
|
||||
|
||||
public String getCommunityName() {
|
||||
return communityName;
|
||||
}
|
||||
|
||||
public void setCommunityName(String communityName) {
|
||||
this.communityName = communityName;
|
||||
}
|
||||
|
||||
public String getFloor() {
|
||||
return floor;
|
||||
}
|
||||
|
||||
public void setFloor(String floor) {
|
||||
this.floor = floor;
|
||||
}
|
||||
|
||||
public PartialAddress getCommunityAddress() {
|
||||
return communityAddress;
|
||||
}
|
||||
|
||||
public void setCommunityAddress(PartialAddress communityAddress) {
|
||||
this.communityAddress = communityAddress;
|
||||
}
|
||||
|
||||
public PartialAddress getBuildingAddress() {
|
||||
return buildingAddress;
|
||||
}
|
||||
|
||||
public void setBuildingAddress(PartialAddress buildingAddress) {
|
||||
this.buildingAddress = buildingAddress;
|
||||
}
|
||||
|
||||
public PartialAddress getCondoAddress() {
|
||||
return condoAddress;
|
||||
}
|
||||
|
||||
public void setCondoAddress(PartialAddress condoAddress) {
|
||||
this.condoAddress = condoAddress;
|
||||
}
|
||||
|
||||
public String getPropertyType() {
|
||||
return propertyType;
|
||||
}
|
||||
|
||||
public void setPropertyType(String propertyType) {
|
||||
this.propertyType = propertyType;
|
||||
}
|
||||
|
||||
public List<PartialAddress> getAddressList() {
|
||||
return addressList;
|
||||
}
|
||||
|
||||
public void addAddress(PartialAddress partialAddress) {
|
||||
this.addressList.add(partialAddress);
|
||||
}
|
||||
|
||||
public Boolean getIndependent() {
|
||||
return independent;
|
||||
}
|
||||
|
||||
public void setIndependent(Boolean independent) {
|
||||
this.independent = independent;
|
||||
}
|
||||
|
||||
public StringBuilder getBoundAddress() {
|
||||
return boundAddress;
|
||||
}
|
||||
|
||||
public Boolean getContainsSpecialChar() {
|
||||
String todoAddress = rawAddress.trim()
|
||||
.replace("\t", "")
|
||||
.replace(" ", "");
|
||||
|
||||
this.boundAddress = new StringBuilder(rawAddress);
|
||||
for (int i = 0; i < specialChar.size(); i++) {
|
||||
if (todoAddress.contains(specialChar.get(i))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "CleanAddress{" +
|
||||
"rawAddress='" + rawAddress + '\'' +
|
||||
", district='" + district + '\'' +
|
||||
", region='" + region + '\'' +
|
||||
", block='" + block + '\'' +
|
||||
", road='" + road + '\'' +
|
||||
", communityName='" + communityName + '\'' +
|
||||
", floor=" + floor +
|
||||
", communityAddress=" + communityAddress +
|
||||
", buildingAddress=" + buildingAddress +
|
||||
", condoAddress=" + condoAddress +
|
||||
", propertyType='" + propertyType + '\'' +
|
||||
", independent=" + independent +
|
||||
", addressList=" + addressList +
|
||||
", containsSpecialChar=" + containsSpecialChar +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,227 @@
|
||||
package com.ruoyi.project.tool.address.model;
|
||||
|
||||
import com.ruoyi.common.utils.LoadUtil;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 清洗地址构建
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class CleanAddressBuilder {
|
||||
|
||||
private Map<String, String> districtMap = LoadUtil.loadDict("address-dict/district.dict");
|
||||
private List<String> regionList = LoadUtil.loadList("address-dict/region.dict");
|
||||
private List<String> blockList = LoadUtil.loadList("address-dict/block.dict");
|
||||
private List<String> roadList = LoadUtil.loadList("address-dict/road.dict");
|
||||
private CleanAddress cleanAddress;
|
||||
private static final int DISTRICT_LENGTH = 8;
|
||||
private static final String SHANGHAI_SHI = "上海市";
|
||||
private static final String SHANGHAI = "上海";
|
||||
private static final String SHANG = "上";
|
||||
private static final String HAO = "号";
|
||||
private static final String SHANG_SHANG = "上上";
|
||||
private static final String SHI_PATTERN = "([\\dA-Za-z]+)(室?)$";
|
||||
private static final String CHINESE_FLOOR_PATTERN = "([一二三四五六七八九十]+)层";
|
||||
private static final String NUMBER_FLOOR_PATTERN = "(\\d+)层";
|
||||
private static final String HAO_PATTERN = "([\\dA-Za-z]+)号";
|
||||
|
||||
private CleanAddressBuilder(CleanAddress cleanAddress) {
|
||||
this.cleanAddress = cleanAddress;
|
||||
}
|
||||
|
||||
public static CleanAddressBuilder builder(CleanAddress cleanAddress) {
|
||||
return new CleanAddressBuilder(cleanAddress);
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析区域
|
||||
* 前面7个字符
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CleanAddressBuilder parseDistrict() {
|
||||
String shanghaiAndDistrict = null;
|
||||
if (cleanAddress.getBoundAddress().length() >= DISTRICT_LENGTH) {
|
||||
shanghaiAndDistrict = (SHANG + cleanAddress.getBoundAddress().substring(0, 7)).replace(SHANG_SHANG, SHANG);
|
||||
} else {
|
||||
shanghaiAndDistrict = (SHANG + cleanAddress.getBoundAddress()).replace(SHANG_SHANG, SHANG);
|
||||
}
|
||||
|
||||
//
|
||||
if (!shanghaiAndDistrict.startsWith(SHANGHAI_SHI) && !shanghaiAndDistrict.startsWith(SHANGHAI) && shanghaiAndDistrict.startsWith(SHANG)) {
|
||||
shanghaiAndDistrict = shanghaiAndDistrict.substring(1, shanghaiAndDistrict.length() - 1);
|
||||
}
|
||||
|
||||
for (Map.Entry<String, String> district : districtMap.entrySet()) {
|
||||
if (shanghaiAndDistrict.startsWith(district.getKey())) {
|
||||
cleanAddress.setDistrict(district.getValue());
|
||||
break;
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析镇
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public CleanAddressBuilder parseRegion() {
|
||||
for (int i = 0; i < regionList.size(); i++) {
|
||||
if (-1 != cleanAddress.getBoundAddress().indexOf(regionList.get(i))) {
|
||||
cleanAddress.setRegion(regionList.get(i));
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析板块
|
||||
*/
|
||||
public CleanAddressBuilder parseBlock() {
|
||||
for (int i = 0; i < blockList.size(); i++) {
|
||||
if (-1 != cleanAddress.getBoundAddress().indexOf(blockList.get(i))) {
|
||||
cleanAddress.setBlock(regionList.get(i));
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析路(可能缺失“路”)
|
||||
*/
|
||||
public CleanAddressBuilder parseRoad() {
|
||||
for (int i = 0; i < roadList.size(); i++) {
|
||||
if (-1 != cleanAddress.getBoundAddress().indexOf(roadList.get(i))) {
|
||||
cleanAddress.setRoad(roadList.get(i));
|
||||
}
|
||||
}
|
||||
//
|
||||
if (StringUtils.isEmpty(cleanAddress.getRoad())) {
|
||||
for (int i = 0; i < roadList.size(); i++) {
|
||||
// 砍掉“路”
|
||||
String noRoad = roadList.get(i);
|
||||
if (noRoad.endsWith("路")) {
|
||||
noRoad = noRoad.substring(0, noRoad.length() - 1);
|
||||
}
|
||||
|
||||
if (-1 != cleanAddress.getBoundAddress().indexOf(noRoad)) {
|
||||
cleanAddress.setRoad(noRoad);
|
||||
}
|
||||
}
|
||||
}
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析小区名称(路名和小区名称重定义)
|
||||
*/
|
||||
public CleanAddressBuilder parseCommunityName() {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 是否独栋?“全”“全幢”
|
||||
* 别墅?
|
||||
*/
|
||||
public CleanAddressBuilder parseIndependent() {
|
||||
Pattern shiPattern = Pattern.compile(SHI_PATTERN);
|
||||
Matcher matcher = shiPattern.matcher(cleanAddress.getBoundAddress());
|
||||
if (matcher.find()) {
|
||||
getCondoAddress();
|
||||
cleanAddress.setIndependent(Boolean.FALSE);
|
||||
} else {
|
||||
cleanAddress.setIndependent(Boolean.TRUE);
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析地址
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public void parseAddress() {
|
||||
getCondoAddress();
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取楼层
|
||||
*/
|
||||
private void getFloorText() {
|
||||
Pattern pattern = Pattern.compile(CHINESE_FLOOR_PATTERN);
|
||||
Matcher matcher = pattern.matcher(cleanAddress.getBoundAddress());
|
||||
if (matcher.find()) {
|
||||
cleanAddress.setFloor(matcher.group(1));
|
||||
return;
|
||||
}
|
||||
pattern = Pattern.compile(NUMBER_FLOOR_PATTERN);
|
||||
matcher = pattern.matcher(cleanAddress.getBoundAddress());
|
||||
if (matcher.find()) {
|
||||
cleanAddress.setFloor(matcher.group(1));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 小区地址
|
||||
*/
|
||||
private void getCommunityAddress(String buildingAddressText) {
|
||||
// 只有号、号号,弄(支弄)号
|
||||
Pattern pattern = Pattern.compile(HAO_PATTERN);
|
||||
Matcher matcher = pattern.matcher(buildingAddressText);
|
||||
if (matcher.find()) {
|
||||
String communityText = buildingAddressText.replace(matcher.group(0), "");
|
||||
CommunityAddress communityAddress = new CommunityAddress(communityText);
|
||||
this.cleanAddress.addAddress(communityAddress);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取清洗地址
|
||||
*/
|
||||
private void getCondoAddress() {
|
||||
getFloorText();
|
||||
// 有路
|
||||
if (!StringUtils.isEmpty(cleanAddress.getRoad())) {
|
||||
int roadIndex = cleanAddress.getBoundAddress().indexOf(cleanAddress.getRoad());
|
||||
String condoAddressText =
|
||||
cleanAddress.getBoundAddress().substring(roadIndex);
|
||||
|
||||
// 单套
|
||||
CondoAddress condoAddress = new CondoAddress(condoAddressText);
|
||||
cleanAddress.setCondoAddress(condoAddress);
|
||||
cleanAddress.addAddress(condoAddress);
|
||||
|
||||
int haoIndex = condoAddressText.lastIndexOf(HAO);
|
||||
String buildingAddressText = condoAddressText.substring(0, haoIndex + 1);
|
||||
BuildingAddress buildingAddress = new BuildingAddress(buildingAddressText);
|
||||
// 楼栋
|
||||
cleanAddress.setBuildingAddress(buildingAddress);
|
||||
cleanAddress.addAddress(condoAddress);
|
||||
cleanAddress.addAddress(buildingAddress);
|
||||
|
||||
cleanAddress.addAddress(condoAddress);
|
||||
cleanAddress.addAddress(buildingAddress);
|
||||
getCommunityAddress(buildingAddressText);
|
||||
} else if (!StringUtils.isEmpty(cleanAddress.getCommunityName())) {
|
||||
|
||||
} else {
|
||||
// 没有路,没有小区
|
||||
}
|
||||
|
||||
// 从路找到最后面。
|
||||
// 把室号去掉
|
||||
// 把号去掉
|
||||
// 单套地址、楼栋地址、小区地址
|
||||
}
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
package com.ruoyi.project.tool.address.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 小区地址
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class CommunityAddress extends PartialAddress {
|
||||
|
||||
public CommunityAddress(String address) {
|
||||
super(address);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PartialAddress> getPartialAddress() {
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.ruoyi.project.tool.address.model;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 室地址
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class CondoAddress extends PartialAddress {
|
||||
|
||||
public CondoAddress(String address) {
|
||||
super(address);
|
||||
this.shi = parseShi();
|
||||
this.floor = parseFloor();
|
||||
this.hao = parseHAO();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PartialAddress> getPartialAddress() {
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,113 @@
|
||||
package com.ruoyi.project.tool.address.model;
|
||||
|
||||
import com.ruoyi.common.exception.CustomException;
|
||||
import com.ruoyi.common.utils.StringUtils;
|
||||
import io.swagger.models.auth.In;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
/**
|
||||
* 清洗地址
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public abstract class PartialAddress {
|
||||
protected String address;
|
||||
protected String hao;
|
||||
protected String shi;
|
||||
protected Integer floor;
|
||||
protected final static String SHI_PATTERN = "([\\dA-Za-z]+)室$";
|
||||
protected final static String HAO_PATTERN = "([\\dA-Za-z]+)(甲乙丙丁戊己庚辛仍亏)?号";
|
||||
protected final static String NUMBER_PATTERN = "\\d+";
|
||||
protected final int HUNDRED = 100;
|
||||
protected final int TEN_THOUSAND = 10 * 1000;
|
||||
|
||||
public PartialAddress(String address) {
|
||||
this.address = address;
|
||||
}
|
||||
|
||||
public String getHao() {
|
||||
return hao;
|
||||
}
|
||||
|
||||
public String getShi() {
|
||||
return shi;
|
||||
}
|
||||
|
||||
public Integer getFloor() {
|
||||
return floor;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取地址(单套、楼栋、小区)
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public abstract List<PartialAddress> getPartialAddress();
|
||||
|
||||
/**
|
||||
* 室解析
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected String parseShi() {
|
||||
Pattern pattern = Pattern.compile(SHI_PATTERN);
|
||||
Matcher matcher = pattern.matcher(this.address);
|
||||
// 这个需要优化,地下层没有考虑
|
||||
if (matcher.find()) {
|
||||
return matcher.group(1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 楼层解析
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected Integer parseFloor() {
|
||||
if (StringUtils.isEmpty(this.shi)) {
|
||||
return null;
|
||||
}
|
||||
Pattern pattern = Pattern.compile(NUMBER_PATTERN);
|
||||
Matcher matcher = pattern.matcher(this.shi);
|
||||
// 这个需要优化,地下层没有考虑
|
||||
if (matcher.find()) {
|
||||
Integer num = new Integer(matcher.group(0));
|
||||
if (num <= HUNDRED) {
|
||||
return num / 10;
|
||||
} else if (num > HUNDRED && num <= TEN_THOUSAND) {
|
||||
return num / 100;
|
||||
} else {
|
||||
throw new CustomException("室号太大");
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 号
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
protected String parseHAO() {
|
||||
Pattern pattern = Pattern.compile(HAO_PATTERN);
|
||||
Matcher matcher = pattern.matcher(this.address);
|
||||
// 这个需要优化,地下层没有考虑
|
||||
if (matcher.find()) {
|
||||
return matcher.group(1);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PartialAddress{" +
|
||||
"hao='" + hao + '\'' +
|
||||
", shi='" + shi + '\'' +
|
||||
", floor=" + floor +
|
||||
'}';
|
||||
}
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
package com.ruoyi.project.tool.address.service;
|
||||
|
||||
import com.ruoyi.project.tool.address.model.CleanAddress;
|
||||
|
||||
/**
|
||||
* 地址处理方法
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public interface AddressHandler {
|
||||
|
||||
/**
|
||||
* 地址清洗
|
||||
*
|
||||
* @param cleanAddress
|
||||
*/
|
||||
void clear(CleanAddress cleanAddress);
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.ruoyi.project.tool.address.service.impl;
|
||||
|
||||
import com.ruoyi.project.tool.address.model.CleanAddress;
|
||||
import com.ruoyi.project.tool.address.model.CleanAddressBuilder;
|
||||
import com.ruoyi.project.tool.address.service.AddressHandler;
|
||||
|
||||
/**
|
||||
* 没有特殊符号的地址清洗
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class NoSignalAddressHandler implements AddressHandler {
|
||||
|
||||
@Override
|
||||
public void clear(CleanAddress cleanAddress) {
|
||||
CleanAddressBuilder.builder(cleanAddress)
|
||||
.parseDistrict()
|
||||
.parseRegion()
|
||||
.parseBlock()
|
||||
.parseRoad()
|
||||
.parseIndependent()
|
||||
.parseAddress();
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.ruoyi.project.tool.address.service.impl;
|
||||
|
||||
import com.ruoyi.project.tool.address.model.CleanAddress;
|
||||
import com.ruoyi.project.tool.address.service.AddressHandler;
|
||||
|
||||
/**
|
||||
* 带有字符的地址
|
||||
*
|
||||
* @author lihe
|
||||
*/
|
||||
public class SignalAddressHandler implements AddressHandler {
|
||||
|
||||
|
||||
@Override
|
||||
public void clear(CleanAddress cleanAddress) {
|
||||
|
||||
}
|
||||
}
|
121
ruoyi/src/main/resources/address-dict/block.dict
Normal file
121
ruoyi/src/main/resources/address-dict/block.dict
Normal file
@ -0,0 +1,121 @@
|
||||
大华
|
||||
青浦新城
|
||||
老西门
|
||||
曲阳
|
||||
佘山
|
||||
龙华
|
||||
江川路
|
||||
洋泾
|
||||
长寿
|
||||
黄兴
|
||||
新华路
|
||||
曹杨
|
||||
临港新城
|
||||
大宁
|
||||
华漕
|
||||
曹家渡
|
||||
张江
|
||||
安亭汽车城
|
||||
桃浦
|
||||
彭浦
|
||||
衡山路
|
||||
颛桥
|
||||
黄浦滨江
|
||||
朱泾
|
||||
长桥
|
||||
东外滩
|
||||
长兴岛
|
||||
武宁
|
||||
南京西路
|
||||
花木
|
||||
金山新城
|
||||
海湾
|
||||
江宁路
|
||||
金山中部
|
||||
曹路
|
||||
松江南部
|
||||
松江新城东区
|
||||
青浦北部
|
||||
田林
|
||||
浦江
|
||||
嘉定北部
|
||||
打浦桥
|
||||
碧云
|
||||
九亭
|
||||
庄行
|
||||
亭林
|
||||
外高桥
|
||||
松江中部
|
||||
新江湾城
|
||||
张庙
|
||||
横沙岛
|
||||
崇明其他
|
||||
古美罗阳
|
||||
大场
|
||||
唐镇
|
||||
七宝
|
||||
塘桥
|
||||
南桥新城
|
||||
西郊
|
||||
北蔡
|
||||
凉城
|
||||
虹桥
|
||||
淞南高境
|
||||
柘林
|
||||
长风
|
||||
莘庄
|
||||
马桥
|
||||
枫泾
|
||||
光新
|
||||
泗泾
|
||||
月浦
|
||||
梅陇春申
|
||||
金汇
|
||||
真新
|
||||
陈家镇
|
||||
北外滩
|
||||
江桥
|
||||
中原
|
||||
华泾
|
||||
长征
|
||||
嘉定主城区
|
||||
南翔
|
||||
四川北路
|
||||
枫林
|
||||
惠南
|
||||
淮海中路
|
||||
金虹桥
|
||||
淞宝
|
||||
南站
|
||||
古北
|
||||
松江新城西区
|
||||
万里
|
||||
吴泾
|
||||
新场
|
||||
杨行
|
||||
徐家汇
|
||||
赵巷
|
||||
漕泾
|
||||
人民广场
|
||||
不夜城
|
||||
三林
|
||||
祝桥
|
||||
川沙
|
||||
浦东世博
|
||||
中山公园
|
||||
金桥
|
||||
罗店
|
||||
真如
|
||||
周康
|
||||
陆家嘴滨江
|
||||
顾村
|
||||
航头
|
||||
徐泾
|
||||
五角场
|
||||
朱家角
|
||||
新桥
|
||||
崇明新城
|
||||
堡镇
|
||||
奉城
|
||||
罗泾
|
||||
鞍山
|
70
ruoyi/src/main/resources/address-dict/district.dict
Normal file
70
ruoyi/src/main/resources/address-dict/district.dict
Normal file
@ -0,0 +1,70 @@
|
||||
上海市浦东新区 浦东
|
||||
上海市宝山区 宝山
|
||||
上海市长宁区 长宁
|
||||
上海市崇明区 崇明
|
||||
上海市奉贤区 奉贤
|
||||
上海市虹口区 虹口
|
||||
上海市黄浦区 黄浦
|
||||
上海市嘉定区 嘉定
|
||||
上海市金山区 金山
|
||||
上海市静安区 静安
|
||||
上海市卢湾区 卢湾
|
||||
上海市闵行区 闵行
|
||||
上海市南汇区 浦东
|
||||
上海市普陀区 普陀
|
||||
上海市青浦区 青浦
|
||||
上海市松江区 松江
|
||||
上海市徐汇区 徐汇
|
||||
上海市杨浦区 杨浦
|
||||
上海市闸北区 闸北
|
||||
上海市宝山 宝山
|
||||
上海市长宁 长宁
|
||||
上海市崇明 崇明
|
||||
上海市奉贤 奉贤
|
||||
上海市虹口 虹口
|
||||
上海市黄浦 黄浦
|
||||
上海市嘉定 嘉定
|
||||
上海市金山 金山
|
||||
上海市静安 静安
|
||||
上海市闵行 闵行
|
||||
上海市普陀 普陀
|
||||
上海市浦东 浦东
|
||||
上海市青浦 青浦
|
||||
上海市松江 松江
|
||||
上海市徐汇 徐汇
|
||||
上海市杨浦 杨浦
|
||||
浦东南汇 浦东
|
||||
浦东新区 浦东
|
||||
宝山区 宝山
|
||||
长宁区 长宁
|
||||
崇明区 崇明
|
||||
奉贤区 奉贤
|
||||
虹口区 虹口
|
||||
黄浦区 黄浦
|
||||
嘉定区 嘉定
|
||||
金山区 金山
|
||||
静安区 静安
|
||||
闵行区 闵行
|
||||
普陀区 普陀
|
||||
青浦区 青浦
|
||||
松江区 松江
|
||||
徐汇区 徐汇
|
||||
杨浦区 杨浦
|
||||
宝山 宝山
|
||||
长宁 长宁
|
||||
崇明 崇明
|
||||
奉贤 奉贤
|
||||
虹口 虹口
|
||||
黄浦 黄浦
|
||||
嘉定 嘉定
|
||||
金山 金山
|
||||
静安 静安
|
||||
卢湾 卢湾
|
||||
闵行 闵行
|
||||
普陀 普陀
|
||||
浦东 浦东
|
||||
青浦 青浦
|
||||
松江 松江
|
||||
徐汇 徐汇
|
||||
杨浦 杨浦
|
||||
闸北 闸北
|
431
ruoyi/src/main/resources/address-dict/region.dict
Normal file
431
ruoyi/src/main/resources/address-dict/region.dict
Normal file
@ -0,0 +1,431 @@
|
||||
艾镇镇
|
||||
安亭镇
|
||||
八滧镇
|
||||
白鹤镇
|
||||
白玉路街道
|
||||
半淞园路街道
|
||||
浜镇镇
|
||||
保安镇
|
||||
堡镇
|
||||
堡镇镇
|
||||
北蔡镇
|
||||
北川沙镇
|
||||
北桥镇
|
||||
北新泾街道
|
||||
北新泾镇
|
||||
北新桥镇
|
||||
北闸镇
|
||||
蔡路镇
|
||||
仓桥镇
|
||||
曹行镇
|
||||
曹家渡街道
|
||||
曹路镇
|
||||
曹王镇
|
||||
曹杨新村街道
|
||||
漕河泾镇
|
||||
漕泾镇
|
||||
草棚镇
|
||||
草镇镇
|
||||
长白新村街道
|
||||
长浜镇
|
||||
长风新村街道
|
||||
长江农场
|
||||
长桥街道
|
||||
长兴乡
|
||||
长兴镇
|
||||
长征镇
|
||||
车墩镇
|
||||
辰山镇
|
||||
陈坊桥镇
|
||||
陈行镇
|
||||
陈家行镇
|
||||
陈家镇
|
||||
城北镇
|
||||
城桥镇
|
||||
城厢镇
|
||||
澄桥镇
|
||||
盛桥镇
|
||||
盛梓庙镇
|
||||
程家桥街道
|
||||
储店镇
|
||||
川沙县
|
||||
川沙镇
|
||||
大场镇
|
||||
大椿镇
|
||||
大港镇
|
||||
大宁路街道
|
||||
大桥街道
|
||||
大团镇
|
||||
大新镇
|
||||
大盈镇
|
||||
邓镇镇
|
||||
丁棚镇
|
||||
定海路街道
|
||||
东风农场
|
||||
东沟镇
|
||||
东海镇
|
||||
东新路街道
|
||||
东新镇
|
||||
董家渡街道
|
||||
洞泾镇
|
||||
杜坊镇
|
||||
杜行镇
|
||||
二堡镇
|
||||
二条竖河镇
|
||||
蕃瓜弄镇
|
||||
方家窑镇
|
||||
方泰镇
|
||||
彷徨镇
|
||||
丰乐镇
|
||||
封浜镇
|
||||
枫泾镇
|
||||
凤凰镇
|
||||
凤溪镇
|
||||
奉城镇
|
||||
奉浦工业区
|
||||
奉贤镇
|
||||
奉新镇
|
||||
富民镇
|
||||
干巷镇
|
||||
港东乡
|
||||
港口镇
|
||||
港西镇
|
||||
港沿镇
|
||||
高东镇
|
||||
高行镇
|
||||
高桥镇
|
||||
葛隆镇
|
||||
龚路镇
|
||||
共和新路街道
|
||||
顾村镇
|
||||
顾路镇
|
||||
关港镇
|
||||
光明镇
|
||||
广福镇
|
||||
广富林镇
|
||||
广中路街道
|
||||
海滨新村街道
|
||||
海桥乡
|
||||
海桥镇
|
||||
海湾镇
|
||||
航头镇
|
||||
合庆镇
|
||||
合兴乡
|
||||
合兴镇
|
||||
合作镇
|
||||
横沔镇
|
||||
横沙乡
|
||||
洪庙镇
|
||||
红卫镇
|
||||
红星农场
|
||||
红星镇
|
||||
虹桥街道
|
||||
虹桥镇
|
||||
侯家镇
|
||||
后岗镇
|
||||
胡桥镇
|
||||
花木镇
|
||||
华漕镇
|
||||
华泾镇
|
||||
华路镇
|
||||
华亭镇
|
||||
华新镇
|
||||
华阳桥镇
|
||||
华阳镇
|
||||
欢庵镇
|
||||
黄埔区
|
||||
黄渡镇
|
||||
黄楼镇
|
||||
黄路镇
|
||||
惠南镇
|
||||
机杨镇
|
||||
汲浜镇
|
||||
纪王镇
|
||||
嘉定工业区
|
||||
嘉定工业园区
|
||||
嘉定镇
|
||||
戬浜桥镇
|
||||
戬浜镇
|
||||
建设镇
|
||||
江海镇
|
||||
江口镇
|
||||
江浦路街道
|
||||
江桥镇
|
||||
江湾镇
|
||||
江镇镇
|
||||
蒋庄镇
|
||||
界排镇
|
||||
金汇镇
|
||||
金桥镇
|
||||
金山工业区
|
||||
金山区镇
|
||||
金山卫
|
||||
金山卫镇
|
||||
金山嘴镇
|
||||
金卫镇
|
||||
金泽镇
|
||||
九亭镇
|
||||
菊园新区
|
||||
康桥镇
|
||||
控江路街道
|
||||
廊下镇
|
||||
老港镇
|
||||
老西门街道
|
||||
李塔汇镇
|
||||
莲盛镇
|
||||
练塘镇
|
||||
燎原农场
|
||||
凌桥镇
|
||||
刘行镇
|
||||
刘夏镇
|
||||
六里镇
|
||||
六团镇
|
||||
六灶镇
|
||||
龙华镇
|
||||
娄塘镇
|
||||
芦潮港
|
||||
芦潮港镇
|
||||
鲁汇镇
|
||||
陆行镇
|
||||
陆家巷镇
|
||||
陆家嘴街道
|
||||
罗店镇
|
||||
罗泾镇
|
||||
罗南镇
|
||||
吕巷镇
|
||||
绿华镇
|
||||
马陆镇
|
||||
马桥镇
|
||||
毛家镇
|
||||
泖港镇
|
||||
泖桥镇
|
||||
梅陇镇
|
||||
梅园街道
|
||||
猛将庙镇
|
||||
庙行镇
|
||||
庙镇镇
|
||||
木杓镇
|
||||
南二条竖河镇
|
||||
南盘滧镇
|
||||
南桥镇
|
||||
南翔镇
|
||||
南星镇
|
||||
南苑镇
|
||||
泥彩镇
|
||||
泥城镇
|
||||
牛棚镇
|
||||
排衙镇
|
||||
潘桥镇
|
||||
潘石镇
|
||||
蟠龙镇
|
||||
彭浦镇
|
||||
彭镇镇
|
||||
平安镇
|
||||
平凉路街道
|
||||
浦东杨思
|
||||
浦江镇
|
||||
七宝镇
|
||||
七滧镇
|
||||
七灶镇
|
||||
戚家墩镇
|
||||
祁连镇
|
||||
齐贤镇
|
||||
前卫农场
|
||||
钱门塘镇
|
||||
钱桥镇
|
||||
钱圩镇
|
||||
秦镇镇
|
||||
青村
|
||||
青村镇
|
||||
青墩镇
|
||||
青浦镇
|
||||
邱移庙镇
|
||||
茸北镇
|
||||
阮巷镇
|
||||
三岔港镇
|
||||
三墩镇
|
||||
三光镇
|
||||
三林镇
|
||||
三桥镇
|
||||
三星镇
|
||||
三灶镇
|
||||
山阳镇
|
||||
商塌镇
|
||||
邵厂镇
|
||||
佘山镇
|
||||
申港街道
|
||||
莘庄镇
|
||||
沈巷镇
|
||||
沈家湾镇
|
||||
沈家镇
|
||||
沈庄镇
|
||||
施镇镇
|
||||
石湖荡镇
|
||||
石皮泐镇
|
||||
石泉路街道
|
||||
书院镇
|
||||
竖河镇
|
||||
竖新镇
|
||||
四平路街道
|
||||
四团镇
|
||||
四滧镇
|
||||
泗泾镇
|
||||
松江工业区
|
||||
松江新城区
|
||||
松江新桥
|
||||
松江镇
|
||||
松隐镇
|
||||
苏民镇
|
||||
孙桥镇
|
||||
泰日镇
|
||||
谈家港镇
|
||||
坦直镇
|
||||
唐行镇
|
||||
唐家行镇
|
||||
唐镇镇
|
||||
塘桥镇
|
||||
塘外镇
|
||||
塘湾镇
|
||||
桃浦镇
|
||||
题桥镇
|
||||
天马山镇
|
||||
天目西路街道
|
||||
田林街道
|
||||
亭林镇
|
||||
头桥镇
|
||||
瓦屑镇
|
||||
外冈镇
|
||||
湾镇镇
|
||||
万安镇
|
||||
万祥镇
|
||||
王港镇
|
||||
王鲁玙镇
|
||||
望仙桥镇
|
||||
望新镇
|
||||
邬桥镇
|
||||
吴店镇
|
||||
吴淞镇
|
||||
吴淞镇街道
|
||||
五角场镇
|
||||
五厍镇
|
||||
五四农场
|
||||
五滧乡
|
||||
五滧镇
|
||||
西岑镇
|
||||
西渡街道
|
||||
西渡镇
|
||||
西护塘镇
|
||||
西门镇
|
||||
西三江口镇
|
||||
下坊渡镇
|
||||
下三星镇
|
||||
下沙镇
|
||||
下协隆镇
|
||||
夏阳街道
|
||||
香花桥街道
|
||||
香花桥镇
|
||||
响哃镇
|
||||
向化镇
|
||||
萧塘镇
|
||||
小东门街道
|
||||
小横河镇
|
||||
小昆山镇
|
||||
小竖河镇
|
||||
小湾镇
|
||||
小营房镇
|
||||
小蒸镇
|
||||
滧村镇
|
||||
协隆镇
|
||||
斜土路街道
|
||||
新安镇
|
||||
新浜镇
|
||||
新场镇
|
||||
新城街道
|
||||
新城区
|
||||
新成街道
|
||||
新成路街道
|
||||
新村乡
|
||||
新村镇
|
||||
新风镇
|
||||
新港路街道
|
||||
新港镇
|
||||
新海农场
|
||||
新海镇
|
||||
新河镇
|
||||
新泾镇
|
||||
新绿镇
|
||||
新米行镇
|
||||
新民镇
|
||||
新农镇
|
||||
新桥镇
|
||||
新寺镇
|
||||
新镇镇
|
||||
兴塔镇
|
||||
星火开发区
|
||||
徐行镇
|
||||
徐家行镇
|
||||
徐家汇街道
|
||||
徐泾镇
|
||||
徐路镇
|
||||
宣桥镇
|
||||
殷行街道
|
||||
烟墩头镇
|
||||
严桥镇
|
||||
延吉新村街道
|
||||
盐仓镇
|
||||
杨行镇
|
||||
杨家桥镇
|
||||
杨家镇镇
|
||||
杨柳桥镇
|
||||
杨思镇
|
||||
杨园镇
|
||||
洋泾街道
|
||||
洋泾镇
|
||||
洋桥镇
|
||||
叶榭镇
|
||||
一号桥镇
|
||||
盈浦街道
|
||||
永隆镇
|
||||
油桥镇
|
||||
友谊路街道
|
||||
御桥镇
|
||||
裕安镇
|
||||
圆沙镇
|
||||
月浦镇
|
||||
跃进农场
|
||||
张家桥镇
|
||||
张江镇
|
||||
张桥镇
|
||||
张堰镇
|
||||
张泽镇
|
||||
章堰镇
|
||||
朝阳镇
|
||||
召楼镇
|
||||
赵港镇
|
||||
赵行镇
|
||||
赵巷镇
|
||||
赵屯镇
|
||||
柘林镇
|
||||
真如镇
|
||||
真新街道
|
||||
真新新村街道
|
||||
蒸淀镇
|
||||
芷江西路街道
|
||||
中港镇
|
||||
中山北路街道
|
||||
中山街道
|
||||
中兴镇
|
||||
重固镇
|
||||
周家渡
|
||||
周浦区
|
||||
周浦镇
|
||||
朱行镇
|
||||
朱家角镇
|
||||
朱家桥镇
|
||||
朱泾镇
|
||||
诸翟镇
|
||||
竹桥镇
|
||||
祝桥鎮
|
||||
祝桥镇
|
||||
颛桥镇
|
||||
庄行镇
|
3772
ruoyi/src/main/resources/address-dict/road.dict
Normal file
3772
ruoyi/src/main/resources/address-dict/road.dict
Normal file
File diff suppressed because it is too large
Load Diff
@ -77,4 +77,9 @@ spring:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
||||
username: purple
|
||||
password: liancheng
|
||||
password: liancheng
|
||||
spider2:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://172.16.30.246:1433;DatabaseName=LCSP
|
||||
username: lc_spider
|
||||
password: lc123456
|
@ -83,4 +83,9 @@ spring:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
||||
username: purple
|
||||
password: liancheng
|
||||
password: liancheng
|
||||
spider2:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://172.16.30.246:1433;DatabaseName=LCSP
|
||||
username: lc_spider
|
||||
password: lc123456
|
@ -77,4 +77,9 @@ spring:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
||||
username: purple
|
||||
password: liancheng
|
||||
password: liancheng
|
||||
spider2:
|
||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||
url: jdbc:sqlserver://172.16.30.246:1433;DatabaseName=LCSP
|
||||
username: lc_spider
|
||||
password: lc123456
|
@ -65,6 +65,7 @@
|
||||
<result property="bind_MixProject_Pst" column="bind_MixProject_Pst"/>
|
||||
<result property="voppat" column="voppat"/>
|
||||
<result property="voppa" column="voppa"/>
|
||||
<result property="area" column="area" javaType="DECIMAL"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectOfficeBasePriceUltimateVo">
|
||||
@ -127,6 +128,7 @@
|
||||
,Bind_MixProject_Pst
|
||||
,VOPPAT
|
||||
,VOPPA
|
||||
,area
|
||||
FROM dbo.DWA_PROJECTBASEPRICE_RENT_IMDT_${yearMonth}
|
||||
</sql>
|
||||
|
||||
@ -143,10 +145,11 @@
|
||||
<select id="selectPageList"
|
||||
parameterType="com.ruoyi.project.data.price.domain.ComputeResidenceRentBasePrice"
|
||||
resultMap="MainMappingResult">
|
||||
<![CDATA[ SELECT ID,ProjectID,ProjectName,ProjectAddr,County,Block,[Loop] as loopLine,IsIndxGen,IsPstCalc,StatusRun,PropertyType,ProjectType,ProjectTypeDtl,ProjectLevel,PropertyDevPeriod,BindClassID,MainCoff_Rent,RentPriceDft,MainRentPriceDft,RentPrice_1,PriceDealMean_1,PriceDealMax_1,SumDeal_1,PriceDeal_1_ToAI_Pst,PriceDealMean,PriceDealMax,SumDeal,PriceDeal_ToAI_Pst,PriceDeal_ToLst_Pst,PriceCaseOff,PriceCaseOff_ToLst_Pst,PriceListedMin,PriceLstMn_ToAI_Pst,PriceCase1_ToAI_Pst,PriceCase2_ToAI_Pst,PriceCase1_ToLst_Pst,PriceCase2_ToLst_Pst,PriceCase1,PriceCase1AdjPst,SumCase1,PriceCase2,PriceCase2AdjPst,SumCase2,VOPPBT,VOPPB,BindProjID,Bind_Proj_Pst,Bind_Block_Class,Bind_Block_Class_Pst,Bind_Block_Plevel,Bind_Block_Plevel_Pst,Bind_Block_PType,Bind_Block_Ptype_Pst,Bind_County_PType,Bind_County_Ptype_Pst,Bind_MixProject_PType,Bind_MixProject_Pst,VOPPAT,VOPPA ]]>
|
||||
FROM dbo.DWA_PROJECTBASEPRICE_RENT_IMDT_${yearMonth}
|
||||
order by ProjectID ASC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only
|
||||
</select>
|
||||
<![CDATA[
|
||||
SELECT ID,ProjectID,ProjectName,ProjectAddr,County,Block,[Loop] as loopLine,IsIndxGen,IsPstCalc,StatusRun,PropertyType,ProjectType,ProjectTypeDtl,ProjectLevel,PropertyDevPeriod,BindClassID,MainCoff_Rent,RentPriceDft,MainRentPriceDft,RentPrice_1,PriceDealMean_1,PriceDealMax_1,SumDeal_1,PriceDeal_1_ToAI_Pst,PriceDealMean,PriceDealMax,SumDeal,PriceDeal_ToAI_Pst,PriceDeal_ToLst_Pst,PriceCaseOff,PriceCaseOff_ToLst_Pst,PriceListedMin,PriceLstMn_ToAI_Pst,PriceCase1_ToAI_Pst,PriceCase2_ToAI_Pst,PriceCase1_ToLst_Pst,PriceCase2_ToLst_Pst,PriceCase1,PriceCase1AdjPst,SumCase1,PriceCase2,PriceCase2AdjPst,SumCase2,VOPPBT,VOPPB,BindProjID,Bind_Proj_Pst,Bind_Block_Class,Bind_Block_Class_Pst,Bind_Block_Plevel,Bind_Block_Plevel_Pst,Bind_Block_PType,Bind_Block_Ptype_Pst,Bind_County_PType,Bind_County_Ptype_Pst,Bind_MixProject_PType,Bind_MixProject_Pst,VOPPAT,VOPPA,area ]]>
|
||||
FROM dbo.DWA_PROJECTBASEPRICE_RENT_IMDT_${yearMonth}
|
||||
order by ProjectID ASC OFFSET #{pageIndex} rows fetch next #{pageSize} rows only
|
||||
</select>
|
||||
|
||||
<!-- -->
|
||||
<select id="selectById" parameterType="String" resultMap="MainMappingResult">
|
||||
|
@ -36,16 +36,17 @@
|
||||
<result property="unitPrice" column="单价" javaType="java.math.BigDecimal"/>
|
||||
<result property="updateDate" column="更新时间" javaType="java.sql.Date"/>
|
||||
</resultMap>
|
||||
<!-- 获取爬虫库中的办公案例 -->
|
||||
<select id="download" resultMap="DownloadMapping">
|
||||
select url, title, 容积率, 总价售, 均价售, 楼盘名称, 楼层, case 面积 when 'nan' then NULL ELSE 面积 END 面积,
|
||||
物业费, 工位数, 地址, 地铁,
|
||||
发布时间,房源编号, 百度lng, 百度lat, 区域, 分类, 来源, 等级, 楼盘网址, 装修,
|
||||
类型, 板块, 挂牌中介, 月租金租, 标准租金租, 更新时间, 得房率,
|
||||
case when 分类 = '售' then (case 总价售 when 'nan' then NULL ELSE 总价售 END)
|
||||
when 分类 = '租' then (case 月租金租 when 'nan' then NULL ELSE 月租金租 END) end as 总价,
|
||||
case when 分类 = '售' then (case 均价售 when 'nan' then NULL ELSE 均价售 END)
|
||||
when 分类 = '租' then (case 标准租金租 when 'nan' then NULL ELSE 标准租金租 END) end as 单价
|
||||
case when 分类 = '售' then (case when ISNUMERIC(总价售)=1 then 总价售 ELSE NULL END)
|
||||
when 分类 = '租' then (case when ISNUMERIC(月租金租)=1 then 月租金租 ELSE NULL END) end as 总价,
|
||||
case when 分类 = '售' then (case when ISNUMERIC(均价售)=1 then 均价售 ELSE NULL END)
|
||||
when 分类 = '租' then (case when ISNUMERIC(标准租金租)=1 then 标准租金租 ELSE NULL END) end as 单价
|
||||
from dbo.办公
|
||||
where 更新时间 >= #{startDate} and 更新时间 <![CDATA[ < ]]> #{endDate}
|
||||
where 更新时间 >= #{startDate,jdbcType=DATE} and 更新时间 <![CDATA[ < ]]> #{endDate,jdbcType=DATE}
|
||||
</select>
|
||||
</mapper>
|
@ -4,18 +4,18 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalResidenceRentClosingCaseMapper">
|
||||
<select id="download" resultType="com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase">
|
||||
SELECT 合同编号 as caseContractNo
|
||||
,小区名称 as caseCommunityName
|
||||
,挂牌时间 as caseOpeningDate
|
||||
,交易时间 as caseClosingDate
|
||||
,租金 as caseRentPrice
|
||||
,建筑面积 as caseArea
|
||||
,住宅楼总楼层数 as caseTotalFloor
|
||||
SELECT 案例ID as caseContractNo
|
||||
,NULL as caseCommunityName
|
||||
,NULL as caseOpeningDate
|
||||
,成交时间 as caseClosingDate
|
||||
,"租金(元/月)" as caseRentPrice
|
||||
,面积 as caseArea
|
||||
,总楼层 as caseTotalFloor
|
||||
,朝向 as caseToward
|
||||
,户型 as caseApartmentLayout
|
||||
,装修状况 as caseDecoration
|
||||
,小区ID as caseCommunityId
|
||||
,室厅 as caseApartmentLayout
|
||||
,NULL as caseDecoration
|
||||
,AIID as caseCommunityId
|
||||
,楼栋ID as caseBuildingId
|
||||
FROM dbo.ODS_HOUSINGCASEDEAL_RENT_${yearMonth}_RAW
|
||||
FROM dbo.住宅租赁成交案例_链家_${yearMonth}
|
||||
</select>
|
||||
</mapper>
|
@ -30,7 +30,7 @@
|
||||
<result property="caseProvider" column="caseProvider"/>
|
||||
</resultMap>
|
||||
<select id="download" resultMap="resultMapping">
|
||||
SELECT top 1000 llid
|
||||
SELECT llid
|
||||
,lcid
|
||||
,airaid
|
||||
,name
|
||||
|
@ -23,7 +23,7 @@
|
||||
|
||||
</resultMap>
|
||||
<select id="download" resultMap="resultMapping">
|
||||
select top 100 面积
|
||||
select 面积
|
||||
,block
|
||||
,地址
|
||||
,小区名
|
||||
|
@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.ruoyi.project.data.cases.mapper.sync.DownloadOtherResidenceRentClosingCaseMapper">
|
||||
<resultMap id="DownloadMapping" type="com.ruoyi.project.data.cases.domain.OtherResidenceRentClosingCase">
|
||||
<result property="caseDistrict" column="County"/>
|
||||
<result property="caseCommunityName" column="ProjectName_SRC"/>
|
||||
<result property="caseAddress" column="HouseholdsAddr_SRC" />
|
||||
<result property="caseArea" column="Area" javaType="java.math.BigDecimal"/>
|
||||
<result property="closingDate" column="PriceDateOut" javaType="java.sql.Date"/>
|
||||
<result property="caseTotalPrice" column="PriceTotal" javaType="java.math.BigDecimal"/>
|
||||
<result property="caseDecoration" column="Decoration" />
|
||||
<result property="caseTotalFloor" column="UpperFloorSum" />
|
||||
<result property="caseCurrentFloor" column="UpperFloorNum" />
|
||||
<result property="caseToward" column="Towards" />
|
||||
<result property="caseFloor" column="Storey" />
|
||||
<result property="uvCommunityId" column="ProjectID" />
|
||||
<result property="uvBuildingId" column="BuildingID" />
|
||||
</resultMap>
|
||||
<select id="download" resultMap="DownloadMapping">
|
||||
SELECT County
|
||||
,ProjectName_SRC
|
||||
,HouseholdsAddr_SRC
|
||||
,Area
|
||||
,PriceDateOut
|
||||
,PriceTotal
|
||||
,Decoration
|
||||
,UpperFloorSum
|
||||
,UpperFloorNum
|
||||
,Towards
|
||||
,Storey
|
||||
,ProjectID
|
||||
,BuildingID
|
||||
FROM dbo.TEMP_ODS_HOUSINGCASEDEAL_RENT_${yearMonth}_RAW
|
||||
</select>
|
||||
</mapper>
|
@ -10,19 +10,40 @@
|
||||
|
||||
CREATE TABLE ${targetTableName}
|
||||
(
|
||||
case_id varchar(32) not null,
|
||||
case_contract_no nvarchar (32) NOT null primary key,
|
||||
case_community_name nvarchar (512) NULL,
|
||||
case_opening_date date NULL,
|
||||
case_closing_date date NULL,
|
||||
case_rent_price decimal (18, 2) NULL,
|
||||
case_area decimal (18, 2) NULL,
|
||||
case_total_floor int NULL,
|
||||
case_toward nvarchar (16) NULL,
|
||||
case_apartment_layout nvarchar (16) NULL,
|
||||
case_decoration nvarchar (16) NULL,
|
||||
clean_community_id nvarchar (32) NULL,
|
||||
clean_building_id nvarchar (32) NULL
|
||||
case_id varchar(32) not null,
|
||||
case_contract_no nvarchar (32) NOT null primary key,
|
||||
case_community_name nvarchar (512) NULL,
|
||||
case_opening_date date NULL,
|
||||
case_closing_date date NULL,
|
||||
case_rent_price decimal (18, 2) NULL,
|
||||
case_area decimal (18, 2) NULL,
|
||||
case_total_floor int NULL,
|
||||
case_toward nvarchar (16) NULL,
|
||||
case_apartment_layout nvarchar (16) NULL,
|
||||
case_decoration nvarchar (16) NULL,
|
||||
clean_community_id nvarchar (32) NULL,
|
||||
clean_building_id nvarchar (32) NULL
|
||||
)
|
||||
</update>
|
||||
<update id="createOtherRawTable">
|
||||
<bind name="targetTableName" value="'dbo.TEMP_ODS_HOUSINGCASEDEAL_RENT_' + yearMonth+'_RAW'"/>
|
||||
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||
drop table ${targetTableName};
|
||||
CREATE TABLE ${targetTableName}(
|
||||
case_id varchar(32) NOT NULL primary key,
|
||||
case_district nvarchar(64) NULL,
|
||||
case_community_name nvarchar(1024) NULL,
|
||||
case_address nvarchar(1024) NULL,
|
||||
case_area decimal(18, 2) NULL,
|
||||
case_closing_date date NULL,
|
||||
case_total_price decimal(18, 2) NOT NULL,
|
||||
case_decoration nvarchar(64) NULL,
|
||||
case_total_floor int null,
|
||||
case_current_floor nvarchar(32) NULL,
|
||||
case_toward nvarchar(64) NULL,
|
||||
case_floor nvarchar(32) NULL,
|
||||
uv_community_id nvarchar(20) null,
|
||||
uv_building_id nvarchar(20) null
|
||||
)
|
||||
</update>
|
||||
<update id="createCleanTable">
|
||||
|
@ -79,7 +79,7 @@
|
||||
#{casePrice},
|
||||
#{caseCommunityName},
|
||||
#{caseVisitedNum},
|
||||
#{caseFirstVisitTime},
|
||||
#{caseFirstVisitTime,jdbcType=DATE},
|
||||
#{caseVisitedNum15},
|
||||
#{caseVisitedNum30},
|
||||
#{caseUrl},
|
||||
@ -262,65 +262,65 @@
|
||||
|
||||
create table ${targetTableName}
|
||||
(
|
||||
SID int not null identity(1,1)
|
||||
, ProjectID nvarchar(20) primary key
|
||||
, ProjectName nvarchar(1024)
|
||||
, ProjectAddr nvarchar(1024)
|
||||
, County nvarchar(512)
|
||||
, Block nvarchar(512)
|
||||
, Loop nvarchar(512)
|
||||
, IsIndxGen tinyint
|
||||
, IsPstCalc tinyint
|
||||
, StatusRun tinyint
|
||||
, ProjectSPLabel nvarchar(64)
|
||||
, PropertyType nvarchar(256)
|
||||
, ProjectType nvarchar(256)
|
||||
, ProjectTypeDtl nvarchar(256)
|
||||
, ProjectLevel nvarchar(64)
|
||||
, Year int
|
||||
, MainArea decimal(18, 2)
|
||||
, AreaCoff decimal(7, 4)
|
||||
, YearCoff decimal(7, 4)
|
||||
, PriceNote nvarchar(1024)
|
||||
, BasePriceDft decimal(18, 2)
|
||||
, MainPriceDft decimal(18, 2)
|
||||
, BasePrice_1 decimal(18, 2)
|
||||
, PriceUnitAdj decimal(18, 2)
|
||||
, Visited_Num int
|
||||
, First_Visit_Time date
|
||||
, Visited_Num_15 int
|
||||
, Visited_Num_30 int
|
||||
, PriceDealMean_1 decimal(18, 2)
|
||||
, PriceDealMax_1 decimal(18, 2)
|
||||
, SumDeal_1 int
|
||||
, PriceDealMean decimal(18, 2)
|
||||
, PriceDealMax decimal(18, 2)
|
||||
, SumDeal int
|
||||
, PriceListedMin decimal(18, 2)
|
||||
, PriceCase1_ToAI_Pst decimal(18, 6)
|
||||
, PriceCase2_ToAI_Pst decimal(18, 6)
|
||||
, PriceCase1_ToLst_Pst decimal(18, 6)
|
||||
, PriceCase2_ToLst_Pst decimal(18, 6)
|
||||
, PriceCase1 decimal(18, 2)
|
||||
, PriceCase1AdjPst decimal(18, 6)
|
||||
, SumCase1 int
|
||||
, PriceCase2 decimal(18, 2)
|
||||
, PriceCase2AdjPst decimal(18, 6)
|
||||
, SumCase2 int
|
||||
, VOPPBT varchar(64)
|
||||
, VOPPB decimal(18, 6)
|
||||
, BindProjID int
|
||||
, Bind_Proj_Pst decimal(18, 6)
|
||||
, Bind_Block_Class nvarchar(128)
|
||||
, Bind_Block_Class_Pst decimal(18, 6)
|
||||
, Bind_Block_Plevel nvarchar(128)
|
||||
, Bind_Block_Plevel_Pst decimal(18, 6)
|
||||
, Bind_Block_PType nvarchar(128)
|
||||
, Bind_Block_Ptype_Pst decimal(18, 6)
|
||||
, Bind_County_PType nvarchar(128)
|
||||
, Bind_County_Ptype_Pst decimal(18, 6)
|
||||
, VOPPAT varchar(64)
|
||||
, VOPPA decimal(18, 6)
|
||||
SID int not null identity(1,1)
|
||||
, ProjectID nvarchar(20) primary key
|
||||
, ProjectName nvarchar(1024)
|
||||
, ProjectAddr nvarchar(1024)
|
||||
, County nvarchar(512)
|
||||
, Block nvarchar(512)
|
||||
, Loop nvarchar(512)
|
||||
, IsIndxGen tinyint
|
||||
, IsPstCalc tinyint
|
||||
, StatusRun tinyint
|
||||
, ProjectSPLabel nvarchar(64)
|
||||
, PropertyType nvarchar(256)
|
||||
, ProjectType nvarchar(256)
|
||||
, ProjectTypeDtl nvarchar(256)
|
||||
, ProjectLevel nvarchar(64)
|
||||
, Year int
|
||||
, MainArea decimal(18, 2)
|
||||
, AreaCoff decimal(7, 4)
|
||||
, YearCoff decimal(7, 4)
|
||||
, PriceNote nvarchar(1024)
|
||||
, BasePriceDft decimal(18, 2)
|
||||
, MainPriceDft decimal(18, 2)
|
||||
, BasePrice_1 decimal(18, 2)
|
||||
, PriceUnitAdj decimal(18, 2)
|
||||
, Visited_Num int
|
||||
, First_Visit_Time date
|
||||
, Visited_Num_15 int
|
||||
, Visited_Num_30 int
|
||||
, PriceDealMean_1 decimal(18, 2)
|
||||
, PriceDealMax_1 decimal(18, 2)
|
||||
, SumDeal_1 int
|
||||
, PriceDealMean decimal(18, 2)
|
||||
, PriceDealMax decimal(18, 2)
|
||||
, SumDeal int
|
||||
, PriceListedMin decimal(18, 2)
|
||||
, PriceCase1_ToAI_Pst decimal(18, 6)
|
||||
, PriceCase2_ToAI_Pst decimal(18, 6)
|
||||
, PriceCase1_ToLst_Pst decimal(18, 6)
|
||||
, PriceCase2_ToLst_Pst decimal(18, 6)
|
||||
, PriceCase1 decimal(18, 2)
|
||||
, PriceCase1AdjPst decimal(18, 6)
|
||||
, SumCase1 int
|
||||
, PriceCase2 decimal(18, 2)
|
||||
, PriceCase2AdjPst decimal(18, 6)
|
||||
, SumCase2 int
|
||||
, VOPPBT varchar(64)
|
||||
, VOPPB decimal(18, 6)
|
||||
, BindProjID int
|
||||
, Bind_Proj_Pst decimal(18, 6)
|
||||
, Bind_Block_Class nvarchar(128)
|
||||
, Bind_Block_Class_Pst decimal(18, 6)
|
||||
, Bind_Block_Plevel nvarchar(128)
|
||||
, Bind_Block_Plevel_Pst decimal(18, 6)
|
||||
, Bind_Block_PType nvarchar(128)
|
||||
, Bind_Block_Ptype_Pst decimal(18, 6)
|
||||
, Bind_County_PType nvarchar(128)
|
||||
, Bind_County_Ptype_Pst decimal(18, 6)
|
||||
, VOPPAT varchar(64)
|
||||
, VOPPA decimal(18, 6)
|
||||
);
|
||||
</update>
|
||||
<!-- 人工修正价格表和作价表一摸一样 -->
|
||||
|
@ -11,4 +11,12 @@
|
||||
update gis_community set gaode_lng=#{gaodeLng},gaode_lat=#{gaodeLat},update_time=getdate() where
|
||||
community_id=#{communityId}
|
||||
</update>
|
||||
<select id="getSomeGeo" resultType="com.ruoyi.project.data.basis.domain.UvGeo">
|
||||
select OBJECTID as id, Shape.STAsText() as geoText
|
||||
from ${tableName}
|
||||
where BD_shape is null
|
||||
</select>
|
||||
<update id="updateSomeGeo">
|
||||
update ${tableName} set BD_Shape=#{geo} where OBJECTID=#{id};
|
||||
</update>
|
||||
</mapper>
|
@ -0,0 +1,258 @@
|
||||
delete from ODS_HOUSINGCASEDEAL_RENT_#yearMonth# where Origin='太平洋';
|
||||
|
||||
create table #HousingCaseListAdj
|
||||
(
|
||||
case_id varchar(32) not null
|
||||
, HouseholdsID_SRC nvarchar(64) primary key
|
||||
, ProjectID_SRC nvarchar(64) not null
|
||||
, ProjectID nvarchar(64)
|
||||
, BuildingID nvarchar(64)
|
||||
, RentType tinyint
|
||||
, Area decimal(18, 2)
|
||||
, Towards nvarchar(64)
|
||||
, UpperFloorSum nvarchar(32)
|
||||
, UpperFloorNum nvarchar(32)
|
||||
, Decoration nvarchar(64)
|
||||
, PriceTotal decimal(18, 2) not null
|
||||
, PriceUnit decimal(18, 2) not null
|
||||
, PriceDateOut date
|
||||
, CaseName nvarchar(512)
|
||||
);
|
||||
|
||||
declare @HouseholdsID_SRC nvarchar(64)
|
||||
, @CaseName nvarchar(512)
|
||||
, @ProjectID nvarchar(64)
|
||||
, @BuildingID nvarchar(64)
|
||||
, @roomtype nvarchar(50)
|
||||
, @UpperFloorSum nvarchar(32)
|
||||
, @UpperFloorNum nvarchar(32)
|
||||
, @area decimal(28, 2)
|
||||
, @towards nvarchar(50)
|
||||
, @decora nvarchar(64)
|
||||
, @price decimal(28, 2)
|
||||
, @dueDate date
|
||||
, @case_id varchar(32)
|
||||
, @RentType tinyint
|
||||
, @priceunit decimal(28, 2);
|
||||
declare Record2Insert cursor for
|
||||
SELECT case_id
|
||||
,case_id
|
||||
,case_community_name
|
||||
,case_closing_date
|
||||
,case_total_price
|
||||
,case_area
|
||||
,case_total_floor
|
||||
,case_current_floor
|
||||
,case_toward
|
||||
,case_decoration
|
||||
,uv_community_id
|
||||
,uv_building_id
|
||||
FROM dbo.TEMP_ODS_HOUSINGCASEDEAL_RENT_#yearMonth#_RAW;
|
||||
open Record2Insert;
|
||||
fetch next from Record2Insert
|
||||
into @case_id
|
||||
, @HouseholdsID_SRC
|
||||
, @CaseName
|
||||
, @dueDate
|
||||
, @price
|
||||
, @area
|
||||
, @UpperFloorSum
|
||||
, @UpperFloorNum
|
||||
, @towards
|
||||
, @decora
|
||||
, @ProjectID
|
||||
, @BuildingID;
|
||||
set nocount on; --忽略行数显示
|
||||
while @@fetch_status = 0
|
||||
begin
|
||||
begin
|
||||
--租赁类型
|
||||
set @RentType = case
|
||||
when @area < 30 then
|
||||
3
|
||||
else
|
||||
2
|
||||
end; --散租
|
||||
--面积
|
||||
set @area = case
|
||||
when @area <> 0 then
|
||||
@area
|
||||
end;
|
||||
--单价
|
||||
set @priceunit = @price * 1.0 / isnull(@area, 1.0);
|
||||
--插入数据
|
||||
insert into #HousingCaseListAdj(case_id,HouseholdsID_SRC,ProjectID_SRC,ProjectID,BuildingID,RentType,Area,Towards,
|
||||
UpperFloorSum,UpperFloorNum,Decoration,PriceTotal,PriceUnit,PriceDateOut,CaseName)
|
||||
values
|
||||
(@case_id, @HouseholdsID_SRC, '-1', @ProjectID, @BuildingID, @RentType, @area
|
||||
, @towards, @UpperFloorSum, @UpperFloorNum, @decora, @price, @priceunit, @dueDate, @CaseName);
|
||||
end;
|
||||
fetch next from Record2Insert
|
||||
into @case_id
|
||||
, @HouseholdsID_SRC
|
||||
, @CaseName
|
||||
, @dueDate
|
||||
, @price
|
||||
, @area
|
||||
, @UpperFloorSum
|
||||
, @UpperFloorNum
|
||||
, @towards
|
||||
, @decora
|
||||
, @ProjectID
|
||||
, @BuildingID;
|
||||
end;
|
||||
close Record2Insert;
|
||||
deallocate Record2Insert;
|
||||
set nocount off;
|
||||
|
||||
create table #HousingCaseListSTD
|
||||
(
|
||||
case_id varchar(32)
|
||||
, HouseholdsID_SRC nvarchar(64)
|
||||
, ProjectID_SRC nvarchar(64)
|
||||
, ProjectID nvarchar(64)
|
||||
, BuildingID nvarchar(64)
|
||||
, AreaCoff decimal(7, 4)
|
||||
, TowardsCoff decimal(7, 4)
|
||||
, FloorCoff decimal(7, 4)
|
||||
, DecorationRng int
|
||||
, YearCoff decimal(7, 4)
|
||||
, BuildingCoff decimal(7, 4)
|
||||
, RoomTypeCoff decimal(7, 4)
|
||||
, PriceUnit decimal(18, 2) not null
|
||||
, PriceScatterRent decimal(18, 2) --散租单价
|
||||
, PriceEntireRent decimal(18, 2) --整租单价
|
||||
, PriceShareRent0 decimal(18, 2) --合租单间价
|
||||
, PriceShareRent decimal(18, 2) --合租折算价
|
||||
);
|
||||
|
||||
insert into #HousingCaseListSTD
|
||||
select a.case_id
|
||||
, A.HouseholdsID_SRC
|
||||
, A.ProjectID_SRC
|
||||
, A.ProjectID
|
||||
, null
|
||||
, D.CoefficientA * A.Area + D.CoefficientB as AreaCoff
|
||||
, E.Coefficient as TowardsCoff
|
||||
, F.Coefficient as FloorCoff
|
||||
, G.Coefficient as DecorationRng
|
||||
, null as YearCoff
|
||||
, null as BuildingCoff
|
||||
, NULL as RoomTypeCoff
|
||||
, A.PriceUnit
|
||||
, (A.PriceUnit - isnull(G.Coefficient, 0)) * 1.0 / isnull(D.CoefficientA * A.Area + D.CoefficientB, 1)
|
||||
/ isnull(E.Coefficient, 1) / isnull(F.Coefficient, 1) PriceScatterRent
|
||||
, (A.PriceUnit - isnull(G.Coefficient, 0)) * 1.0 / isnull(D.CoefficientA * A.Area + D.CoefficientB, 1)
|
||||
/ isnull(E.Coefficient, 1) / isnull(F.Coefficient, 1) + isnull(G.Coefficient, 0) PriceEntireRent
|
||||
, A.PriceTotal * 1.0 / isnull(F.Coefficient, 1) / isnull(E.Coefficient, 1) as PriceShareRent0
|
||||
, null as PriceShareRent
|
||||
from #HousingCaseListAdj A
|
||||
left join
|
||||
(select projectid,ProjectLevel from obpm_LianCheng_Data.dbo.V_RESIDENCE_COMMUNITY) C
|
||||
on A.ProjectID = C.projectid
|
||||
left join
|
||||
(
|
||||
select ProjectLevel
|
||||
, UpperKey
|
||||
, LowerKey
|
||||
, CoefficientA
|
||||
, CoefficientB
|
||||
from obpm_LianCheng_Data.dbo.DIM_PARAMETERS
|
||||
where CoffType = '面积修正(租金)'
|
||||
and ProjectType = '公寓'
|
||||
) D --面积修正
|
||||
on C.ProjectLevel = D.ProjectLevel
|
||||
and
|
||||
(
|
||||
A.Area > D.LowerKey
|
||||
and A.Area <= D.UpperKey
|
||||
)
|
||||
left join
|
||||
(
|
||||
select SingleKey
|
||||
, Coefficient
|
||||
from obpm_LianCheng_Data.dbo.DIM_PARAMETERS
|
||||
where CoffType = '朝向(租金)'
|
||||
and ProjectType = '公寓'
|
||||
) E --朝向修正
|
||||
on A.Towards = E.SingleKey
|
||||
left join
|
||||
(
|
||||
select UpperKey
|
||||
, LowerKey
|
||||
, Elevator
|
||||
, Coefficient
|
||||
from obpm_LianCheng_Data.dbo.DIM_PARAMETERS
|
||||
where CoffType = '楼层(租金)'
|
||||
and ProjectType = '公寓'
|
||||
) F --楼层修正
|
||||
on F.Elevator is null
|
||||
and A.UpperFloorSum = F.UpperKey
|
||||
and A.UpperFloorNum = F.LowerKey
|
||||
left join
|
||||
(
|
||||
select SingleKey
|
||||
, Coefficient
|
||||
from obpm_LianCheng_Data.dbo.DIM_PARAMETERS
|
||||
where CoffType = '室内装修(租金)'
|
||||
and ProjectType = '公寓'
|
||||
) G --装修修正
|
||||
on A.Decoration = G.SingleKey;
|
||||
|
||||
|
||||
insert into ODS_HOUSINGCASEDEAL_RENT_#yearMonth#
|
||||
select a.case_id
|
||||
, A.HouseholdsID_SRC
|
||||
, A.ProjectID_SRC
|
||||
, A.ProjectID
|
||||
, A.BuildingID
|
||||
, A.RentType
|
||||
, NULL
|
||||
, NULL
|
||||
, NULL
|
||||
, A.Area
|
||||
, A.Towards
|
||||
, A.UpperFloorSum
|
||||
, A.UpperFloorNum
|
||||
, null Elevator
|
||||
, A.Decoration
|
||||
, null as Year
|
||||
, B.AreaCoff
|
||||
, B.TowardsCoff
|
||||
, B.FloorCoff
|
||||
, B.DecorationRng
|
||||
, B.YearCoff
|
||||
, B.BuildingCoff
|
||||
, B.RoomTypeCoff
|
||||
, A.PriceTotal
|
||||
, A.PriceUnit
|
||||
, B.PriceScatterRent
|
||||
, B.PriceEntireRent
|
||||
, B.PriceShareRent0
|
||||
, B.PriceShareRent
|
||||
, null
|
||||
, null
|
||||
, null
|
||||
, null
|
||||
, 4 as Status
|
||||
, null
|
||||
, null
|
||||
, null
|
||||
, null
|
||||
, null
|
||||
, null
|
||||
, null
|
||||
, A.PriceTotal PriceTotalIn
|
||||
, A.PriceTotal PriceTotalOut
|
||||
, NULL
|
||||
, A.PriceDateOut
|
||||
, '太平洋'
|
||||
, null
|
||||
, null
|
||||
, CaseName
|
||||
from #HousingCaseListAdj A
|
||||
left join #HousingCaseListSTD B
|
||||
on A.HouseholdsID_SRC = B.HouseholdsID_SRC;
|
||||
|
||||
drop table #HousingCaseListAdj
|
||||
, #HousingCaseListSTD;
|
@ -1,3 +1,5 @@
|
||||
truncate table ODS_HOUSINGCASELISTED_LJ_#yearMonth#;
|
||||
|
||||
update a
|
||||
set a.uv_community_id=b.ITEM_ProjectID,
|
||||
a.uv_building_id=b.ITEM_BuildingID,
|
||||
|
56
ruoyi/src/test/java/com/ruoyi/CleanUtilTests.java
Normal file
56
ruoyi/src/test/java/com/ruoyi/CleanUtilTests.java
Normal file
@ -0,0 +1,56 @@
|
||||
package com.ruoyi;
|
||||
|
||||
import com.ruoyi.common.utils.LoadUtil;
|
||||
import com.ruoyi.project.tool.address.CleanUtil;
|
||||
import com.ruoyi.project.tool.address.model.CleanAddress;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.Base64;
|
||||
import java.util.List;
|
||||
|
||||
public class CleanUtilTests {
|
||||
|
||||
@Test
|
||||
public void testSortDistrict() {
|
||||
List<String> textList = LoadUtil.loadList("temp.dict");
|
||||
textList.sort((x, y) -> y.length() - x.length());
|
||||
textList.forEach(item -> {
|
||||
System.out.println(item);
|
||||
});
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testClear() {
|
||||
List<String> textList = LoadUtil.loadList("icbc.dict");
|
||||
|
||||
textList.forEach(item -> {
|
||||
CleanAddress cleanAddress = CleanUtil.clear(item);
|
||||
System.out.println(cleanAddress);
|
||||
});
|
||||
|
||||
|
||||
// Assert.assertEquals(cleanAddress.getDistrict(), "");
|
||||
// Assert.assertEquals(cleanAddress.getDistrict(), "");
|
||||
// Assert.assertEquals(cleanAddress.getDistrict(), "");
|
||||
// Assert.assertEquals(cleanAddress.getDistrict(), "");
|
||||
// Assert.assertEquals(cleanAddress.getDistrict(), "");
|
||||
// Assert.assertEquals(cleanAddress.getDistrict(), "");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testBase64() throws IOException {
|
||||
Base64.Decoder decoder = Base64.getDecoder();
|
||||
byte[] buffer = decoder.decode(
|
||||
"d09GRgABAAAAAAjwAAsAAAAADLwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADMAAABCsP6z7U9TLzIAAAE8AAAARAAAAFZW7lfsY21hcAAAAYAAAAC6AAACTDrfrlZnbHlmAAACPAAABFUAAAU4MuhjUmhlYWQAAAaUAAAAMQAAADYWO4/laGhlYQAABsgAAAAgAAAAJAeIAzlobXR4AAAG6AAAABYAAAAwGp7//mxvY2EAAAcAAAAAGgAAABoHsgZObWF4cAAABxwAAAAfAAAAIAEZAEZuYW1lAAAHPAAAAVcAAAKFkAhoC3Bvc3QAAAiUAAAAXAAAAI/hSrfMeJxjYGRgYOBikGPQYWB0cfMJYeBgYGGAAJAMY05meiJQDMoDyrGAaQ4gZoOIAgCKIwNPAHicY2BksmCcwMDKwMHUyXSGgYGhH0IzvmYwYuRgYGBiYGVmwAoC0lxTGBwYKn5kMev812GIYdZhuAIUZgTJAQDi1wt/eJzFkr0Ng0AMhd+FnySQImWGyBZscSMwARNkgixBS5VJaEFC4gqqaxBU5BnTRCJt4tN3kp9PtmUfgAhAQO4kBMwLBmIVVbPqAZJVD/Ggf8OVyglFa7uyty5z81B5+Gasp3xZ+OJ7ZM8MM+4diaQ4slKEA2snOCOWTk38JdMPzPyv9Kdd1vu5eSkpNthiaxXRu1LhJNFbhTOFyxTZv5sVzhlDpchf8FBk/75RuAWMtcJ9YMoVBG99YUXkAAB4nEWUS2zbZADH/TmNnVfjPGx/Sd0kjtPYebhN4mfT5p006Tr6pi20nVpou9GWobKBBBocQIIxaUjcOCFx2AnES9okxG0nJCbxRqwS19125QYpn51u+JMs67P8/b7/4zMGMOzsMaZgNIZjmKkydJzOYOiy5k/xIP49lkLzLGRNxdA1SRRIgpTCTiZN1oCqQJZkSSIlSKJ0yyOmJ5ubsvyqIPCNKrja/4ujZ8Z2202CmOq9uTXbcH3RLYySBwtdTY67Ex7wfmyN+4WNtIy3drqbnfFtm/knHkDMAoalYVozDdOoA8McjAmQsukDMEMT5NMBCRJ3+PoBr5vy00pMqmQybM7hmO9OShLY8d04OukUBTk2IpSy1JiPI9yuygHFx/1jkYgajNd0GC+r+pxCrXgOj9XWxsSiCpO8GoHQh67hp36AD/EfMArDnGTYwkqDfcEwuH0yzGsXAkOtKY6hQ5or6sfX5KgQOoBqNBpnHP/y1hrI4bOfcS/+E/JUQ0uKkmgr8gMGaWItTeiZRNPWyqoBWQhodGNVxUDWpxCTAXd8bFrPQx0ODycvaS+V6mn2SvtwoUcQCwtHG6bp639EC2yKr61mstWKnMPdOhQhPxVf0woFSmsddirTdbd7Zfn+H0dzrrKy2v+1IudZdvuTnOyU5N651kcoh++wKIaFpTT83+nUkzAMM1kjwG9DGUFIpWIiRbmueCk8wDcYKSn07+B7s1QnoZTrRk9Z3D/Ia1rtxuVuoSA98eEUd6OcWUxEBG2QKNJPDFB2oSABWcW0S0eKSHleO156rToaDHidxHBM05auaz1w2ZPQ3s7lzVhdLU2AxXc+Xb+Ub83tKS09szQZe+b5h+S96UrT/Prb6rTX29bvYg6bHUJsiNhlRBd1zVAQmkQbsPCIrVv6aGS7aUjGoPOO8yAs6daWJD+498q1+6/jx51UyumcaZy2Wr7IWKltlMYybpwuHvKCLxgKliIFjhthcvl8s7EKrmevrhxfm39RSYql9m690aju90rFz4xGMlGSRYHntP6XmSJkQxRJx+a76ZzHs4r8Ouujc+HGH2Beu316WgJmGDIUKICwQwUX+z+OgO02ubfv64Z9jx6nv/Jugt/JfjxQht8w/4C1/ud2pg9xH9JtoPMcB9CSqNkFNBV0vmvAViWc1xrlEQeojrYr6KhZiZjvURe604I0lMlVOSXscQxR41vJxKQ2mvVuBqem1yuop9ERpVmM3D5+oT4H7s53nE5ZbtbSsmcR4A5HpVngo2SO6QS2iwoX2SxlCzpgC4XZnZtT5W27Fw/wYbTHHDY5+OsMDDdroAoM6bwZKC9VQe8CVlUkqyom0JAQgqEHH9wMJ0NFIx5MQL/T5fZE67CxfKH27sHMG4l4IlatLG/opncdcM+Wq8/l8rXyePbjGseFwzxvjExyLieR50aarZdPPpi/ONP/e2tFnvIXixskmF7Y2l1qFWVZxP4DF+z4GQAAAHicY2BkYGAAYt4bwZbx/DZfGbhZGEDgZr+aOoz+/+//aRYGpvNALgcDE0gUACHjCzIAAAB4nGNgZGBg1vmvwxDDwvD/HwMDCwMDUAQF8AAAYhwDynicY2EAghQGBiZLfPj/PxgbAFUaBLQAAAAAAAAADABGAJQAtgEKAToBeAHSAfQCRgKcAAB4nGNgZGBg4GGwYmBmAAEmIOYCQgaG/2A+AwAPfQFgAHicZZG7bsJAFETHPPIAKUKJlCaKtE3SEMxDqVA6JCgjUdAbswYjv7RekEiXD8h35RPSpcsnpM9grhvHK++eOzN3fSUDuMY3HJyee74ndnDB6sQ1nONBuE79SbhBfhZuoo0X4TPqM+EWungVbuMGb7zBaVyyGuND2EEHn8I1XOFLuE79R7hB/hVu4tZpCp+h49wJt7BwusJtPDrvLaUmRntWr9TyoII0sT3fMybUhk7op8lRmuv1LvJMWZbnQps8TBM1dAelNNOJNuVt+X49sjZQgUljNaWroyhVmUm32rfuxtps3O8Hort+GnM8xTWBgYYHy33FeokD9wApEmo9+PQMV0jfSE9I9eiXqTm9NXaIimzVrdaL4qac+rFWGMLF4F9qxlRSJKuz5djzayOqlunjrIY9MWkqvZqTRGSFrPC2VHzqLjZFV8af3ecKKnm3mCH+A9idcsEAeJxtijsOgCAUBN/iH/EuKIJaQoC72NiZeHzjo3WbyUyWBJVJ+p+CQIUaDVp06DFAYoTCRHi6+zrTlo+PeXeePYSl9NVwd9GxG8+/5Cz/8hxzodbctfVELyMOF6A=");
|
||||
FileOutputStream out = new FileOutputStream("C:\\Work\\uv\\fonts2.woff");
|
||||
out.write(buffer);
|
||||
out.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,6 +14,14 @@ import java.util.stream.Stream;
|
||||
|
||||
public class GenerateTableTests {
|
||||
|
||||
@Test
|
||||
public void testLastYearMonth() {
|
||||
|
||||
Integer lastYearMonth = DateUtils.getLastYearMonth();
|
||||
Assert.assertTrue(202007 == lastYearMonth);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getELTableColumn() {
|
||||
Class<?> targetClass = ComputeResidenceSaleBasePrice.class;
|
||||
@ -226,4 +234,68 @@ public class GenerateTableTests {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Test
|
||||
public void testPrintLoop() {
|
||||
|
||||
/**
|
||||
* 成交案例总数
|
||||
* 成交套数
|
||||
* 成交价格
|
||||
*/
|
||||
List<String> list = new LinkedList<>();
|
||||
list.add("425280");
|
||||
list.add("428770");
|
||||
list.add("427490");
|
||||
list.add("428790");
|
||||
list.add("427780");
|
||||
list.add("430050");
|
||||
list.add("425028");
|
||||
list.add("429710");
|
||||
list.add("425700");
|
||||
for (int j = 0; j < list.size(); j++) {
|
||||
|
||||
System.out.println("select " + list.get(j) + " as community_id , sum(count) as count,sum(total_price) as " +
|
||||
"total_price," +
|
||||
"avg" +
|
||||
"(avg_price) as avg_price ,sum(total_area) as total_area,avg(avg_area) as avg_area from (");
|
||||
|
||||
for (int i = 201901; i <= 201906; i++) {
|
||||
System.out.println("select COUNT(1) " +
|
||||
"as count" +
|
||||
" ,sum" +
|
||||
"(PriceTotal) as total_price ,avg" +
|
||||
"(PriceTotal) as avg_price," +
|
||||
"sum(Area) as total_area ,avg" +
|
||||
"(Area) as avg_area from " +
|
||||
"ODS_HOUSINGCASE_DEAL_" + i + " where ProjectID=" + list.get(j));
|
||||
if (i != 201906)
|
||||
System.out.println("union");
|
||||
}
|
||||
System.out.println(") as t;\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void printUUID() {
|
||||
System.out.println(UUID.randomUUID().toString().replace("-", ""));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void appendDouHao() {
|
||||
List<String> list = LoadUtil.loadList("temp.dict");
|
||||
|
||||
list.forEach(x -> {
|
||||
int index = x.indexOf("大道");
|
||||
if(-1 != index) {
|
||||
System.out.println(x.substring(0,index+2));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -27,9 +27,9 @@ public class DownloadOriginalResidenceSaleClosingCaseServiceImplTests {
|
||||
@Test
|
||||
public void testLoopDownload() {
|
||||
// , 201912
|
||||
Arrays.asList(201901, 201902, 201903, 201904, 201905, 201906, 201907, 201908, 201909, 201910).parallelStream().forEach(i -> {
|
||||
downloadOriginalResidenceSaleClosingCaseService.download(i + 2, i);
|
||||
});
|
||||
// Arrays.asList(201901, 201902, 201903, 201904, 201905, 201906, 201907, 201908, 201909, 201910).parallelStream().forEach(i -> {
|
||||
// downloadOriginalResidenceSaleClosingCaseService.download(i + 2, i);
|
||||
// });
|
||||
// downloadOriginalResidenceSaleClosingCaseService.download(202001, 201911);
|
||||
// downloadOriginalResidenceSaleClosingCaseService.download(202002, 201912);
|
||||
// downloadOriginalResidenceSaleClosingCaseService.download(202003, 202001);
|
||||
|
@ -12,7 +12,7 @@ import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = RuoYiApplication.class)
|
||||
@ActiveProfiles("uat")
|
||||
@ActiveProfiles("dev")
|
||||
public class ResidenceRentBasePriceTests {
|
||||
|
||||
@Autowired
|
||||
|
@ -2,10 +2,15 @@ package com.ruoyi.routine;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.microsoft.sqlserver.jdbc.Geometry;
|
||||
import com.microsoft.sqlserver.jdbc.SQLServerException;
|
||||
import com.microsoft.sqlserver.jdbc.spatialdatatypes.Figure;
|
||||
import com.microsoft.sqlserver.jdbc.spatialdatatypes.Point;
|
||||
import com.ruoyi.RuoYiApplication;
|
||||
import com.ruoyi.project.data.basis.domain.GDConvertCordinateResult;
|
||||
import com.ruoyi.project.data.basis.domain.UvCommunityGeo;
|
||||
import com.ruoyi.project.data.basis.domain.*;
|
||||
import com.ruoyi.project.data.basis.mapper.UvCommunityGeoMapper;
|
||||
import com.sun.org.apache.regexp.internal.RE;
|
||||
import com.sun.scenario.effect.impl.sw.sse.SSEBlend_SRC_OUTPeer;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
@ -24,8 +29,10 @@ import java.math.BigDecimal;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = RuoYiApplication.class)
|
||||
@ -80,4 +87,137 @@ public class GeoTests {
|
||||
});
|
||||
}
|
||||
|
||||
private String convertGaoDe2BaiDu(List<Figure> figureList, List<Point> pointList) {
|
||||
|
||||
OkHttpClient client = new OkHttpClient();
|
||||
String baseUrl = "http://api.map.baidu.com/geoconv/v1/?ak=GNPGIGijImWZHguFphH6GcsPmAYrEfMX&from=3&to" +
|
||||
"=5&coords=";
|
||||
StringBuilder baiDuGeoSb = new StringBuilder("POLYGON (");
|
||||
List<String> polygonPointList = new LinkedList<>();
|
||||
for (int i = 0; i < figureList.size(); i++) {
|
||||
List<Point> partialPointList = null;
|
||||
List<BaiDuPoint> allBaiDuPointList = new LinkedList<>();
|
||||
if (i == figureList.size() - 1) {
|
||||
partialPointList = pointList.stream()
|
||||
.skip(figureList.get(i).getPointOffset())
|
||||
.collect(Collectors.toList());
|
||||
} else {
|
||||
partialPointList = pointList.stream()
|
||||
.skip(figureList.get(i).getPointOffset())
|
||||
.limit(figureList.get(i + 1).getPointOffset() - figureList.get(i).getPointOffset())
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
int groupCount = partialPointList.size() / 100;
|
||||
if (0 != partialPointList.size() % 100) {
|
||||
groupCount += 1;
|
||||
}
|
||||
|
||||
for (int j = 0; j < groupCount; j++) {
|
||||
StringBuilder sb = new StringBuilder(baseUrl);
|
||||
sb.append(String.join(";",
|
||||
partialPointList.stream().skip(j * 100).limit(100).map(p -> p.getX() + "," + p.getY()).collect(Collectors.toList())));
|
||||
Request request = new Request.Builder()
|
||||
.url(sb.toString())
|
||||
.build();
|
||||
System.out.println(request.url().toString());
|
||||
try (Response response = client.newCall(request).execute()) {
|
||||
String content = response.body().string();
|
||||
BaiDuMapResponse priceApiResult = JSON.parseObject(content,
|
||||
BaiDuMapResponse.class);
|
||||
if (Objects.equals(0, priceApiResult.getStatus())) {
|
||||
List<BaiDuPoint> baiDuPointList = priceApiResult.getResult();
|
||||
allBaiDuPointList.addAll(baiDuPointList);
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
String partialWKT = String.join(", ",
|
||||
allBaiDuPointList.stream().map(BaiDuPoint::toString).collect(Collectors.toList()));
|
||||
System.out.println(partialWKT);
|
||||
polygonPointList.add(partialWKT);
|
||||
}
|
||||
|
||||
baiDuGeoSb.append(String.join(", ",
|
||||
polygonPointList.stream().map(s -> "(" + s + ")").collect(Collectors.toList())));
|
||||
baiDuGeoSb.append(")");
|
||||
|
||||
return baiDuGeoSb.toString();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 高德坐标转百度
|
||||
*/
|
||||
@Test
|
||||
@DS("teemlink")
|
||||
public void convertGeoGD2Baidu() {
|
||||
String tableName = "上海基准地价2010办公";
|
||||
List<UvGeo> uvGeoList = uvCommunityGeoMapper.getSomeGeo(tableName);
|
||||
|
||||
//
|
||||
uvGeoList.parallelStream().forEach(gaoDeGeo -> {
|
||||
try {
|
||||
Geometry geometry = Geometry.parse(gaoDeGeo.getGeoText());
|
||||
List<Figure> figureList = geometry.getFigureList();
|
||||
List<Point> pointList = geometry.getPointList();
|
||||
|
||||
String baiDuGeoWKT = convertGaoDe2BaiDu(figureList, pointList);
|
||||
uvCommunityGeoMapper.updateSomeGeo(tableName, baiDuGeoWKT, gaoDeGeo.getId());
|
||||
} catch (SQLServerException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// StringBuilder baiDuGeoText = new StringBuilder("POLYGON ((");
|
||||
// String geoText = gaoDeGeo.getGeoText().replace("POLYGON ((", "").replace("))", "");
|
||||
// String[] segmentList = geoText.split(",");
|
||||
//
|
||||
//
|
||||
// List<String> polygonPointList = new LinkedList<>();
|
||||
// for (String item : segmentList) {
|
||||
// String[] point = item.trim().split(" ");
|
||||
// polygonPointList.add(String.format("%s,%s", point[0], point[1]));
|
||||
// }
|
||||
//
|
||||
// // 每100个点一组
|
||||
// int groupCount = polygonPointList.size() / 100;
|
||||
// if (0 != polygonPointList.size() % 100) {
|
||||
// groupCount += 1;
|
||||
// }
|
||||
// for (int i = 0; i < groupCount; i++) {
|
||||
// StringBuilder sb = new StringBuilder(baseUrl);
|
||||
// sb.append(String.join(";",
|
||||
// polygonPointList.stream().skip(i * 100).limit(100).collect(Collectors.toList())));
|
||||
// Request request = new Request.Builder()
|
||||
// .url(sb.toString())
|
||||
// .build();
|
||||
// try (Response response = client.newCall(request).execute()) {
|
||||
// String content = response.body().string();
|
||||
// BaiDuMapResponse priceApiResult = JSON.parseObject(content,
|
||||
// BaiDuMapResponse.class);
|
||||
// if (Objects.equals(0, priceApiResult.getStatus())) {
|
||||
// List<BaiDuPoint> baiDuPointList = priceApiResult.getResult();
|
||||
// allBaiDuPointList.addAll(baiDuPointList);
|
||||
// }
|
||||
// } catch (IOException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// try {
|
||||
// String rawBaiDuPointText = String.join(",",
|
||||
// allBaiDuPointList.stream().map(BaiDuPoint::toString).collect(Collectors.toList()));
|
||||
//
|
||||
// baiDuGeoText.append(rawBaiDuPointText);
|
||||
// baiDuGeoText.append("))");
|
||||
// uvCommunityGeoMapper.updateSomeGeo(tableName, baiDuGeoText.toString(), gaoDeGeo.getId());
|
||||
// } catch (Exception e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
82659
ruoyi/src/test/resources/icbc.dict
Normal file
82659
ruoyi/src/test/resources/icbc.dict
Normal file
File diff suppressed because it is too large
Load Diff
70
ruoyi/src/test/resources/temp.dict
Normal file
70
ruoyi/src/test/resources/temp.dict
Normal file
@ -0,0 +1,70 @@
|
||||
宝山
|
||||
宝山区
|
||||
长宁
|
||||
长宁区
|
||||
崇明
|
||||
崇明区
|
||||
奉贤
|
||||
奉贤区
|
||||
虹口
|
||||
虹口区
|
||||
黄浦
|
||||
黄浦区
|
||||
嘉定
|
||||
嘉定区
|
||||
金山
|
||||
金山区
|
||||
静安
|
||||
静安区
|
||||
卢湾
|
||||
闵行
|
||||
闵行区
|
||||
普陀
|
||||
普陀区
|
||||
浦东
|
||||
浦东南汇
|
||||
浦东新区
|
||||
青浦
|
||||
青浦区
|
||||
上海市宝山
|
||||
上海市宝山区
|
||||
上海市长宁
|
||||
上海市长宁区
|
||||
上海市崇明
|
||||
上海市崇明区
|
||||
上海市奉贤
|
||||
上海市奉贤区
|
||||
上海市虹口
|
||||
上海市虹口区
|
||||
上海市黄浦
|
||||
上海市黄浦区
|
||||
上海市嘉定
|
||||
上海市嘉定区
|
||||
上海市金山
|
||||
上海市金山区
|
||||
上海市静安
|
||||
上海市静安区
|
||||
上海市卢湾区
|
||||
上海市闵行
|
||||
上海市闵行区
|
||||
上海市南汇区
|
||||
上海市普陀
|
||||
上海市普陀区
|
||||
上海市浦东
|
||||
上海市浦东新区
|
||||
上海市青浦
|
||||
上海市青浦区
|
||||
上海市松江
|
||||
上海市松江区
|
||||
上海市徐汇
|
||||
上海市徐汇区
|
||||
上海市杨浦
|
||||
上海市杨浦区
|
||||
上海市闸北区
|
||||
松江
|
||||
松江区
|
||||
徐汇
|
||||
徐汇区
|
||||
杨浦
|
||||
杨浦区
|
||||
闸北
|
Loading…
x
Reference in New Issue
Block a user