feature (一手案例批次同步): 下载一手案例批次
1. 分批次下载一手房案例数据 2. 修复租赁案例下载缺少两个字段(created,modifydate)
This commit is contained in:
@ -0,0 +1,26 @@
|
|||||||
|
package com.ruoyi.common.constant;
|
||||||
|
|
||||||
|
import io.jsonwebtoken.Claims;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 通用常量信息
|
||||||
|
*
|
||||||
|
* @author ruoyi
|
||||||
|
*/
|
||||||
|
public class LabelConstants {
|
||||||
|
/**
|
||||||
|
* 其他
|
||||||
|
*/
|
||||||
|
public static final String OTHER = "其它";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车位
|
||||||
|
*/
|
||||||
|
public static final String CHE = "车";
|
||||||
|
public static final String CHE_DI_XIA = "地下";
|
||||||
|
public static final String CHE_WEI = "车位";
|
||||||
|
public static final String CHE_KU = "车库";
|
||||||
|
public static final String CHE_REN_FANG = "人防";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,251 @@
|
|||||||
|
package com.ruoyi.project.data.cases.domain;
|
||||||
|
|
||||||
|
import org.springframework.util.DigestUtils;
|
||||||
|
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一手房案例
|
||||||
|
*
|
||||||
|
* @author lihe
|
||||||
|
* @date 2020年7月9日
|
||||||
|
*/
|
||||||
|
public class OriginalNewHouseCase {
|
||||||
|
private static final SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
|
private Integer yearMonth;
|
||||||
|
/**
|
||||||
|
* 案例id
|
||||||
|
*/
|
||||||
|
private String caseId;
|
||||||
|
/**
|
||||||
|
* 案例标签
|
||||||
|
*/
|
||||||
|
private String caseLabel;
|
||||||
|
/**
|
||||||
|
* 区域
|
||||||
|
*/
|
||||||
|
private String caseCounty;
|
||||||
|
/**
|
||||||
|
* 板块
|
||||||
|
*/
|
||||||
|
private String caseBlock;
|
||||||
|
/**
|
||||||
|
* 环线
|
||||||
|
*/
|
||||||
|
private String caseLoop;
|
||||||
|
/**
|
||||||
|
* 小区名称
|
||||||
|
*/
|
||||||
|
private String caseCommunityName;
|
||||||
|
/**
|
||||||
|
* 地址
|
||||||
|
*/
|
||||||
|
private String caseAddress;
|
||||||
|
/**
|
||||||
|
* 面积
|
||||||
|
*/
|
||||||
|
private BigDecimal caseArea;
|
||||||
|
/**
|
||||||
|
* 总价
|
||||||
|
*/
|
||||||
|
private BigDecimal caseTotalPrice;
|
||||||
|
/**
|
||||||
|
* 单价
|
||||||
|
*/
|
||||||
|
private BigDecimal caseUnitPrice;
|
||||||
|
/**
|
||||||
|
* 房屋类型
|
||||||
|
*/
|
||||||
|
private String caseHouseType;
|
||||||
|
/**
|
||||||
|
* 签约日期
|
||||||
|
*/
|
||||||
|
private Date caseSigningDate;
|
||||||
|
/**
|
||||||
|
* 楼层
|
||||||
|
*/
|
||||||
|
private Integer caseFloor;
|
||||||
|
/**
|
||||||
|
* 房屋性质
|
||||||
|
*/
|
||||||
|
private String caseHouseProperty;
|
||||||
|
/**
|
||||||
|
* 户型
|
||||||
|
*/
|
||||||
|
private String caseApartmentLayout;
|
||||||
|
/**
|
||||||
|
* 计算单价
|
||||||
|
*/
|
||||||
|
private BigDecimal computeUnitPrice;
|
||||||
|
/**
|
||||||
|
* 计算总价
|
||||||
|
*/
|
||||||
|
private BigDecimal computeTotalPrice;
|
||||||
|
/**
|
||||||
|
* 参考单价
|
||||||
|
*/
|
||||||
|
private BigDecimal referenceUnitPrice;
|
||||||
|
/**
|
||||||
|
* 参考总价
|
||||||
|
*/
|
||||||
|
private BigDecimal referenceTotalPrice;
|
||||||
|
|
||||||
|
public String getCaseCounty() {
|
||||||
|
return caseCounty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseCounty(String caseCounty) {
|
||||||
|
this.caseCounty = caseCounty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseBlock() {
|
||||||
|
return caseBlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseBlock(String caseBlock) {
|
||||||
|
this.caseBlock = caseBlock;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseLoop() {
|
||||||
|
return caseLoop;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseLoop(String caseLoop) {
|
||||||
|
this.caseLoop = caseLoop;
|
||||||
|
}
|
||||||
|
|
||||||
|
public 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 BigDecimal getCaseTotalPrice() {
|
||||||
|
return caseTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseTotalPrice(BigDecimal caseTotalPrice) {
|
||||||
|
this.caseTotalPrice = caseTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getCaseUnitPrice() {
|
||||||
|
return caseUnitPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseUnitPrice(BigDecimal caseUnitPrice) {
|
||||||
|
this.caseUnitPrice = caseUnitPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseHouseType() {
|
||||||
|
return caseHouseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseHouseType(String caseHouseType) {
|
||||||
|
this.caseHouseType = caseHouseType;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Date getCaseSigningDate() {
|
||||||
|
return caseSigningDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseSigningDate(Date caseSigningDate) {
|
||||||
|
this.caseSigningDate = caseSigningDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getCaseFloor() {
|
||||||
|
return caseFloor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseFloor(Integer caseFloor) {
|
||||||
|
this.caseFloor = caseFloor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseHouseProperty() {
|
||||||
|
return caseHouseProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseHouseProperty(String caseHouseProperty) {
|
||||||
|
this.caseHouseProperty = caseHouseProperty;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseApartmentLayout() {
|
||||||
|
return caseApartmentLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseApartmentLayout(String caseApartmentLayout) {
|
||||||
|
this.caseApartmentLayout = caseApartmentLayout;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getComputeUnitPrice() {
|
||||||
|
return computeUnitPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComputeUnitPrice(BigDecimal computeUnitPrice) {
|
||||||
|
this.computeUnitPrice = computeUnitPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getComputeTotalPrice() {
|
||||||
|
return computeTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setComputeTotalPrice(BigDecimal computeTotalPrice) {
|
||||||
|
this.computeTotalPrice = computeTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getReferenceUnitPrice() {
|
||||||
|
return referenceUnitPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReferenceUnitPrice(BigDecimal referenceUnitPrice) {
|
||||||
|
this.referenceUnitPrice = referenceUnitPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BigDecimal getReferenceTotalPrice() {
|
||||||
|
return referenceTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setReferenceTotalPrice(BigDecimal referenceTotalPrice) {
|
||||||
|
this.referenceTotalPrice = referenceTotalPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer getYearMonth() {
|
||||||
|
return yearMonth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setYearMonth(Integer yearMonth) {
|
||||||
|
this.yearMonth = yearMonth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseId() {
|
||||||
|
String text = getCaseCounty() + getCaseAddress() + simpleDateFormat.format(getCaseSigningDate());
|
||||||
|
return DigestUtils.md5DigestAsHex(text.getBytes());
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getCaseLabel() {
|
||||||
|
return caseLabel;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setCaseLabel(String caseLabel) {
|
||||||
|
this.caseLabel = caseLabel;
|
||||||
|
}
|
||||||
|
}
|
@ -1,9 +1,11 @@
|
|||||||
package com.ruoyi.project.data.cases.domain;
|
package com.ruoyi.project.data.cases.domain;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
|
import java.util.Date;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 租赁挂牌案例
|
* 租赁挂牌案例
|
||||||
|
* @author lihe
|
||||||
*/
|
*/
|
||||||
public class OriginalResidenceRentOpeningCase extends OriginalResidenceSaleOpeningCase {
|
public class OriginalResidenceRentOpeningCase extends OriginalResidenceSaleOpeningCase {
|
||||||
|
|
||||||
@ -47,6 +49,7 @@ public class OriginalResidenceRentOpeningCase extends OriginalResidenceSaleOpeni
|
|||||||
* 室数量
|
* 室数量
|
||||||
*/
|
*/
|
||||||
private Integer caseRoomNum;
|
private Integer caseRoomNum;
|
||||||
|
private Date updateDate;
|
||||||
|
|
||||||
public String getCaseNo() {
|
public String getCaseNo() {
|
||||||
return caseNo;
|
return caseNo;
|
||||||
@ -127,4 +130,12 @@ public class OriginalResidenceRentOpeningCase extends OriginalResidenceSaleOpeni
|
|||||||
public void setCleanCommunityId(String cleanCommunityId) {
|
public void setCleanCommunityId(String cleanCommunityId) {
|
||||||
this.cleanCommunityId = cleanCommunityId;
|
this.cleanCommunityId = cleanCommunityId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Date getUpdateDate() {
|
||||||
|
return updateDate;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setUpdateDate(Date updateDate) {
|
||||||
|
this.updateDate = updateDate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,51 @@
|
|||||||
|
package com.ruoyi.project.data.cases.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.ruoyi.project.data.cases.domain.OfficeAggregationCase;
|
||||||
|
import com.ruoyi.project.data.cases.domain.OriginalNewHouseCase;
|
||||||
|
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalNewHouseCaseMapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一手房案例下载备份
|
||||||
|
*
|
||||||
|
* @author lihe
|
||||||
|
* @date 2020年7月9日
|
||||||
|
*/
|
||||||
|
@DS("compute")
|
||||||
|
public interface OriginalNewHouseCaseMapper {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建第一批一手房案例表
|
||||||
|
*
|
||||||
|
* @param yearMonth
|
||||||
|
*/
|
||||||
|
void createFirstTable(@Param("yearMonth") Integer yearMonth);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建第一批一手房案例
|
||||||
|
*
|
||||||
|
* @param originalNewHouseCase
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int insertFirstTable(OriginalNewHouseCase originalNewHouseCase);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建第二批一手房案例表
|
||||||
|
*
|
||||||
|
* @param yearMonth
|
||||||
|
*/
|
||||||
|
void createSecondTable(@Param("yearMonth") Integer yearMonth);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建第二批一手房案例
|
||||||
|
*
|
||||||
|
* @param originalNewHouseCase
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int insertSecondTable(OriginalNewHouseCase originalNewHouseCase);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
@ -0,0 +1,32 @@
|
|||||||
|
package com.ruoyi.project.data.cases.mapper.sync;
|
||||||
|
|
||||||
|
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||||
|
import com.ruoyi.project.data.cases.domain.OriginalNewHouseCase;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 一手房DAO
|
||||||
|
*
|
||||||
|
* @author lihe
|
||||||
|
* @date 2020年7月9日
|
||||||
|
*/
|
||||||
|
@DS("calc")
|
||||||
|
public interface DownloadOriginalNewHouseCaseMapper {
|
||||||
|
/**
|
||||||
|
* 获取第一批一手房数据
|
||||||
|
*
|
||||||
|
* @param yearMonth
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OriginalNewHouseCase> getFirst(@Param("yearMonth") Integer yearMonth);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取第二批一手房数据
|
||||||
|
*
|
||||||
|
* @param yearMonth
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
List<OriginalNewHouseCase> getSecond(@Param("yearMonth") Integer yearMonth);
|
||||||
|
}
|
@ -5,10 +5,17 @@ import com.ruoyi.project.data.cases.domain.OriginalResidenceRentOpeningCase;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 外网租赁案例
|
||||||
|
*
|
||||||
|
* @author lihe
|
||||||
|
*/
|
||||||
@DS("oldProd")
|
@DS("oldProd")
|
||||||
public interface DownloadOriginalResidenceRentOpeningCaseMapper {
|
public interface DownloadOriginalResidenceRentOpeningCaseMapper {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* 拉取外网租赁案例
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<OriginalResidenceRentOpeningCase> download();
|
List<OriginalResidenceRentOpeningCase> download();
|
||||||
|
@ -0,0 +1,144 @@
|
|||||||
|
package com.ruoyi.project.data.cases.service.impl;
|
||||||
|
|
||||||
|
import com.ruoyi.common.constant.LabelConstants;
|
||||||
|
import com.ruoyi.project.data.cases.domain.OriginalNewHouseCase;
|
||||||
|
import com.ruoyi.project.data.cases.mapper.OriginalNewHouseCaseMapper;
|
||||||
|
import com.ruoyi.project.data.cases.mapper.sync.DownloadOriginalNewHouseCaseMapper;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定时下载一手房案例数据并且推送到联城数库中
|
||||||
|
*
|
||||||
|
* @author lihe
|
||||||
|
* @date 2020年7月9日
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class DownloadOriginalNewHouseCaseServiceImpl {
|
||||||
|
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(DownloadOriginalNewHouseCaseServiceImpl.class);
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DownloadOriginalNewHouseCaseMapper downloadOriginalNewHouseCaseMapper;
|
||||||
|
@Autowired
|
||||||
|
private OriginalNewHouseCaseMapper originalNewHouseCaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每月9号下载第一批案例数据
|
||||||
|
*/
|
||||||
|
@Scheduled(cron = "0 0 0 9 * ?")
|
||||||
|
public void downloadFirst() {
|
||||||
|
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(new Date());
|
||||||
|
calendar.add(Calendar.MONTH, -1);
|
||||||
|
|
||||||
|
Integer yearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
||||||
|
calendar.get(Calendar.MONTH) + 1));
|
||||||
|
downloadFirst(yearMonth);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载指定月份的第一批一手房案例
|
||||||
|
*
|
||||||
|
* @param yearMonth
|
||||||
|
*/
|
||||||
|
public void downloadFirst(Integer yearMonth) {
|
||||||
|
try {
|
||||||
|
// 创建表
|
||||||
|
originalNewHouseCaseMapper.createFirstTable(yearMonth);
|
||||||
|
// 拉取数据
|
||||||
|
List<OriginalNewHouseCase> originalNewHouseCaseList =
|
||||||
|
downloadOriginalNewHouseCaseMapper.getFirst(yearMonth);
|
||||||
|
|
||||||
|
makeTag(originalNewHouseCaseList);
|
||||||
|
|
||||||
|
// 数据入库
|
||||||
|
originalNewHouseCaseList.parallelStream().forEach(originalNewHouseCase -> {
|
||||||
|
originalNewHouseCase.setYearMonth(yearMonth);
|
||||||
|
try {
|
||||||
|
originalNewHouseCaseMapper.insertFirstTable(originalNewHouseCase);
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("下载第一批一手房案例出错", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 每月25号下载第二批案例数据并且清洗第一批案例数据
|
||||||
|
*/
|
||||||
|
@Scheduled(cron = "0 0 0 25 * ?")
|
||||||
|
public void downloadSecond() {
|
||||||
|
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.setTime(new Date());
|
||||||
|
calendar.add(Calendar.MONTH, -1);
|
||||||
|
|
||||||
|
Integer yearMonth = new Integer(String.format("%d%02d", calendar.get(Calendar.YEAR),
|
||||||
|
calendar.get(Calendar.MONTH) + 1));
|
||||||
|
downloadSecond(yearMonth);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载指定月份的第二批一手房案例
|
||||||
|
*
|
||||||
|
* @param yearMonth
|
||||||
|
*/
|
||||||
|
public void downloadSecond(Integer yearMonth) {
|
||||||
|
try {
|
||||||
|
// 创建表
|
||||||
|
originalNewHouseCaseMapper.createSecondTable(yearMonth);
|
||||||
|
// 拉取数据
|
||||||
|
List<OriginalNewHouseCase> originalNewHouseCaseList =
|
||||||
|
downloadOriginalNewHouseCaseMapper.getSecond(yearMonth);
|
||||||
|
|
||||||
|
makeTag(originalNewHouseCaseList);
|
||||||
|
// 数据入库
|
||||||
|
originalNewHouseCaseList.parallelStream().forEach(originalNewHouseCase -> {
|
||||||
|
originalNewHouseCase.setYearMonth(yearMonth);
|
||||||
|
originalNewHouseCaseMapper.insertSecondTable(originalNewHouseCase);
|
||||||
|
});
|
||||||
|
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("下载第二批一手房案例出错", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void makeTag(List<OriginalNewHouseCase> originalNewHouseCaseList) {
|
||||||
|
originalNewHouseCaseList.parallelStream().forEach(originalNewHouseCase -> {
|
||||||
|
if (LabelConstants.OTHER.equals(originalNewHouseCase.getCaseHouseType())) {
|
||||||
|
if (originalNewHouseCase.getCaseAddress().contains(LabelConstants.CHE) ||
|
||||||
|
originalNewHouseCase.getCaseAddress().contains(LabelConstants.CHE_DI_XIA) ||
|
||||||
|
originalNewHouseCase.getCaseAddress().contains(LabelConstants.CHE_REN_FANG) ||
|
||||||
|
originalNewHouseCase.getCaseAddress().contains(LabelConstants.CHE_KU) ||
|
||||||
|
originalNewHouseCase.getCaseAddress().contains(LabelConstants.CHE_WEI)) {
|
||||||
|
originalNewHouseCase.setCaseLabel(LabelConstants.CHE_WEI);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
// Map<String, List<OriginalNewHouseCase>> originalNewHouseCasePerCaseId =
|
||||||
|
// originalNewHouseCaseList.stream().collect(Collectors.groupingBy(OriginalNewHouseCase::getCaseId));
|
||||||
|
//
|
||||||
|
// originalNewHouseCasePerCaseId.entrySet().stream().filter(x -> x.getValue().size() > 1).forEach(caseIdGroup
|
||||||
|
// -> {
|
||||||
|
// caseIdGroup.getValue().stream().forEach(originalNewHouseCase -> {
|
||||||
|
//
|
||||||
|
// });
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
}
|
@ -59,16 +59,8 @@ public class OriginalResidenceRentOpeningCaseServiceImpl implements IOriginalRes
|
|||||||
calendar.get(Calendar.MONTH) + 1));
|
calendar.get(Calendar.MONTH) + 1));
|
||||||
Date endDate = calendar.getTime();
|
Date endDate = calendar.getTime();
|
||||||
|
|
||||||
computeTableRoute = 202007;
|
|
||||||
lastYearMonth = 202006;
|
|
||||||
syncTableRoute = 202005;
|
|
||||||
|
|
||||||
calendar.set(2020, 5, 15);
|
|
||||||
startDate = calendar.getTime();
|
|
||||||
calendar.set(2020, 6, 15);
|
|
||||||
endDate = calendar.getTime();
|
|
||||||
|
|
||||||
prepare(computeTableRoute, syncTableRoute);
|
prepare(computeTableRoute, syncTableRoute);
|
||||||
|
// 拉取案例
|
||||||
List<OriginalResidenceRentOpeningCase> list = downloadOriginalResidenceRentOpeningCaseMapper.download();
|
List<OriginalResidenceRentOpeningCase> list = downloadOriginalResidenceRentOpeningCaseMapper.download();
|
||||||
List<OriginalResidencePlatformRentOpeningCase> platformCaseList =
|
List<OriginalResidencePlatformRentOpeningCase> platformCaseList =
|
||||||
downloadOriginalResidenceRentPlatformCaseMapper.download(startDate, endDate);
|
downloadOriginalResidenceRentPlatformCaseMapper.download(startDate, endDate);
|
||||||
@ -108,12 +100,13 @@ public class OriginalResidenceRentOpeningCaseServiceImpl implements IOriginalRes
|
|||||||
".ODS_HOUSINGCASELISTED_RENT_LJ_" + computeTableRoute + "_RAW (case_id, Llid,Lcid,Airaid," +
|
".ODS_HOUSINGCASELISTED_RENT_LJ_" + computeTableRoute + "_RAW (case_id, Llid,Lcid,Airaid," +
|
||||||
"Name,Type,Roomtype,Area,TotalArea,Towards,Storey,Visited_Num,First_Visit_Time," +
|
"Name,Type,Roomtype,Area,TotalArea,Towards,Storey,Visited_Num,First_Visit_Time," +
|
||||||
"Visited_Num_15,Visited_Num_30,Decoration,Address," +
|
"Visited_Num_15,Visited_Num_30,Decoration,Address," +
|
||||||
"StatusTxt,Price,Url,Curl,Cname,SynDate) values " +
|
"StatusTxt,Price,Url,Curl,Cname,SynDate,Created,Modified) values " +
|
||||||
"(:newCaseId,:caseLianJiaId,:caseLianJiaCommunityId,:cleanCommunityId,:caseTitle," +
|
"(:newCaseId,:caseLianJiaId,:caseLianJiaCommunityId,:cleanCommunityId,:caseTitle," +
|
||||||
":caseRentType," +
|
":caseRentType," +
|
||||||
":caseApartmentLayout,:caseArea,:caseTotalArea,:caseToward,:caseStorey,:caseVisitedNum," +
|
":caseApartmentLayout,:caseArea,:caseTotalArea,:caseToward,:caseStorey,:caseVisitedNum," +
|
||||||
":caseFirstVisitTime,:caseVisitedNum15,:caseVisitedNum30,:caseDecoration,:caseAddress," +
|
":caseFirstVisitTime,:caseVisitedNum15,:caseVisitedNum30,:caseDecoration,:caseAddress," +
|
||||||
":caseStatus,:casePrice,:caseUrl,:caseCommunityUrl,:caseCommunityName,GETDATE());",
|
":caseStatus,:casePrice,:caseUrl,:caseCommunityUrl,:caseCommunityName,GETDATE(),:caseGetDate," +
|
||||||
|
":updateDate);",
|
||||||
batchParams);
|
batchParams);
|
||||||
|
|
||||||
// 租赁平台案例入库
|
// 租赁平台案例入库
|
||||||
|
@ -60,7 +60,7 @@ spring:
|
|||||||
password: lc1234
|
password: lc1234
|
||||||
compute:
|
compute:
|
||||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_compute
|
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_calc
|
||||||
username: sa
|
username: sa
|
||||||
password: Lcdatacenter_888
|
password: Lcdatacenter_888
|
||||||
clean:
|
clean:
|
||||||
@ -70,9 +70,9 @@ spring:
|
|||||||
password: Lcdatacenter_888
|
password: Lcdatacenter_888
|
||||||
calc:
|
calc:
|
||||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_calc
|
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=CALC
|
||||||
username: sa
|
username: purple
|
||||||
password: Lcdatacenter_888
|
password: liancheng
|
||||||
spider:
|
spider:
|
||||||
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
||||||
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
url: jdbc:sqlserver://139.196.201.83:1433;DatabaseName=TEST
|
||||||
|
@ -0,0 +1,69 @@
|
|||||||
|
<?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.DownloadOriginalNewHouseCaseMapper">
|
||||||
|
<resultMap id="ResultMapping" type="com.ruoyi.project.data.cases.domain.OriginalNewHouseCase">
|
||||||
|
<result property="caseCounty" column="区域"/>
|
||||||
|
<result property="caseBlock" column="板块"/>
|
||||||
|
<result property="caseLoop" column="环线"/>
|
||||||
|
<result property="caseCommunityName" column="小区名称"/>
|
||||||
|
<result property="caseAddress" column="房屋地址"/>
|
||||||
|
<result property="caseArea" column="面积"/>
|
||||||
|
<result property="caseTotalPrice" column="总价"/>
|
||||||
|
<result property="caseUnitPrice" column="单价"/>
|
||||||
|
<result property="caseHouseType" column="房屋类型"/>
|
||||||
|
<result property="caseSigningDate" column="签约日期" jdbcType="DATE"/>
|
||||||
|
<result property="caseFloor" column="楼层"/>
|
||||||
|
<result property="caseHouseProperty" column="房屋性质"/>
|
||||||
|
<result property="caseApartmentLayout" column="户型"/>
|
||||||
|
<result property="computeUnitPrice" column="计算单价"/>
|
||||||
|
<result property="computeTotalPrice" column="计算总价"/>
|
||||||
|
<result property="referenceTotalPrice" column="参考单价"/>
|
||||||
|
<result property="referenceUnitPrice" column="参考总价"/>
|
||||||
|
<result property="yearMonth" column="yearMonth"/>
|
||||||
|
</resultMap>
|
||||||
|
<select id="getFirst" resultMap="ResultMapping">
|
||||||
|
SELECT 区域
|
||||||
|
,板块
|
||||||
|
,环线
|
||||||
|
,小区名称
|
||||||
|
,房屋地址
|
||||||
|
,面积
|
||||||
|
,总价
|
||||||
|
,单价
|
||||||
|
,房屋类型
|
||||||
|
,签约日期
|
||||||
|
,楼层
|
||||||
|
,房屋性质
|
||||||
|
,户型
|
||||||
|
,计算单价
|
||||||
|
,计算总价
|
||||||
|
,参考单价
|
||||||
|
,参考总价
|
||||||
|
,${yearMonth} as yearMonth
|
||||||
|
FROM dbo.一手房成交数据${yearMonth}
|
||||||
|
</select>
|
||||||
|
<select id="getSecond" resultMap="ResultMapping">
|
||||||
|
<bind name="targetTableName" value="'dbo.一手房成交数据' + yearMonth+'_update'"/>
|
||||||
|
SELECT 区域
|
||||||
|
,板块
|
||||||
|
,环线
|
||||||
|
,小区名称
|
||||||
|
,房屋地址
|
||||||
|
,面积
|
||||||
|
,总价
|
||||||
|
,单价
|
||||||
|
,房屋类型
|
||||||
|
,签约日期
|
||||||
|
,楼层
|
||||||
|
,房屋性质
|
||||||
|
,户型
|
||||||
|
,计算单价
|
||||||
|
,计算总价
|
||||||
|
,参考单价
|
||||||
|
,参考总价
|
||||||
|
,${yearMonth} as yearMonth
|
||||||
|
FROM ${targetTableName}
|
||||||
|
</select>
|
||||||
|
</mapper>
|
@ -26,6 +26,7 @@
|
|||||||
<result property="caseCommunityUrl" column="curl"/>
|
<result property="caseCommunityUrl" column="curl"/>
|
||||||
<result property="caseCommunityName" column="cname"/>
|
<result property="caseCommunityName" column="cname"/>
|
||||||
<result property="caseGetDate" column="created" javaType="java.sql.Date"/>
|
<result property="caseGetDate" column="created" javaType="java.sql.Date"/>
|
||||||
|
<result property="updateDate" column="modified" javaType="java.sql.Date"/>
|
||||||
<result property="caseProvider" column="caseProvider"/>
|
<result property="caseProvider" column="caseProvider"/>
|
||||||
</resultMap>
|
</resultMap>
|
||||||
<select id="download" resultMap="resultMapping">
|
<select id="download" resultMap="resultMapping">
|
||||||
@ -51,6 +52,7 @@
|
|||||||
,curl
|
,curl
|
||||||
,cname
|
,cname
|
||||||
,created
|
,created
|
||||||
|
,modified
|
||||||
, '链家' as caseProvider
|
, '链家' as caseProvider
|
||||||
FROM dbo.ZListing_Lianjia
|
FROM dbo.ZListing_Lianjia
|
||||||
</select>
|
</select>
|
||||||
|
@ -0,0 +1,166 @@
|
|||||||
|
<?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.OriginalNewHouseCaseMapper">
|
||||||
|
<!--第一批一手房案例表-->
|
||||||
|
<update id="createFirstTable">
|
||||||
|
<bind name="targetTableName" value="'dbo.original_new_house_case_' + yearMonth"/>
|
||||||
|
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||||
|
drop table ${targetTableName};
|
||||||
|
|
||||||
|
create TABLE ${targetTableName}
|
||||||
|
(
|
||||||
|
case_id varchar(32) not null,
|
||||||
|
case_county varchar (20) NULL,
|
||||||
|
case_block varchar (200) NULL,
|
||||||
|
case_loop varchar (200) NULL,
|
||||||
|
case_community_name nvarchar (255) NULL,
|
||||||
|
case_address nvarchar (1024) NULL,
|
||||||
|
case_area decimal(18,2) NULL,
|
||||||
|
case_unit_price decimal(18,2) NULL,
|
||||||
|
case_total_price decimal(18,2) NULL,
|
||||||
|
case_house_type nvarchar(255) null,
|
||||||
|
case_signing_date date null,
|
||||||
|
case_floor int null,
|
||||||
|
case_house_property nvarchar(255) null,
|
||||||
|
case_apartment_layout nvarchar(255) null,
|
||||||
|
compute_unit_price decimal(18,2) NULL,
|
||||||
|
compute_total_price decimal(18,2) NULL,
|
||||||
|
reference_unit_price decimal(18,2) NULL,
|
||||||
|
reference_total_price decimal(18,2) NULL,
|
||||||
|
case_label nvarchar(512) null,
|
||||||
|
create_time datetime not null
|
||||||
|
);
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insertFirstTable" parameterType="com.ruoyi.project.data.cases.domain.OriginalNewHouseCase">
|
||||||
|
<bind name="targetTableName" value="'dbo.original_new_house_case_' + yearMonth"/>
|
||||||
|
insert into ${targetTableName}
|
||||||
|
(
|
||||||
|
case_id
|
||||||
|
, case_county
|
||||||
|
, case_block
|
||||||
|
, case_loop
|
||||||
|
, case_community_name
|
||||||
|
, case_address
|
||||||
|
, case_area
|
||||||
|
, case_unit_price
|
||||||
|
, case_total_price
|
||||||
|
, case_house_type
|
||||||
|
, case_signing_date
|
||||||
|
, case_floor
|
||||||
|
, case_house_property
|
||||||
|
, case_apartment_layout
|
||||||
|
, compute_unit_price
|
||||||
|
, compute_total_price
|
||||||
|
, reference_unit_price
|
||||||
|
, reference_total_price
|
||||||
|
, case_label
|
||||||
|
, create_time
|
||||||
|
)
|
||||||
|
values(
|
||||||
|
#{caseId},
|
||||||
|
#{caseCounty},
|
||||||
|
#{caseBlock},
|
||||||
|
#{caseLoop},
|
||||||
|
#{caseCommunityName},
|
||||||
|
#{caseAddress},
|
||||||
|
#{caseArea},
|
||||||
|
#{caseUnitPrice},
|
||||||
|
#{caseTotalPrice},
|
||||||
|
#{caseHouseType},
|
||||||
|
#{caseSigningDate,jdbcType=DATE},
|
||||||
|
#{caseFloor},
|
||||||
|
#{caseHouseProperty},
|
||||||
|
#{caseApartmentLayout},
|
||||||
|
#{computeUnitPrice},
|
||||||
|
#{computeTotalPrice},
|
||||||
|
#{referenceUnitPrice},
|
||||||
|
#{referenceTotalPrice},
|
||||||
|
#{caseLabel},
|
||||||
|
getdate()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<!--第二批一手房案例表-->
|
||||||
|
<update id="createSecondTable">
|
||||||
|
<bind name="targetTableName" value="'dbo.original_new_house_case_' + yearMonth+'_update'"/>
|
||||||
|
IF OBJECT_ID(#{targetTableName}, 'U') IS NOT NULL
|
||||||
|
drop table ${targetTableName};
|
||||||
|
|
||||||
|
create TABLE ${targetTableName}
|
||||||
|
(
|
||||||
|
case_id varchar(32) not null,
|
||||||
|
case_county varchar (20) NULL,
|
||||||
|
case_block varchar (200) NULL,
|
||||||
|
case_loop varchar (200) NULL,
|
||||||
|
case_community_name nvarchar (255) NULL,
|
||||||
|
case_address nvarchar (1024) NULL,
|
||||||
|
case_area decimal(18,2) NULL,
|
||||||
|
case_unit_price decimal(18,2) NULL,
|
||||||
|
case_total_price decimal(18,2) NULL,
|
||||||
|
case_house_type nvarchar(255) null,
|
||||||
|
case_signing_date date null,
|
||||||
|
case_floor int null,
|
||||||
|
case_house_property nvarchar(255) null,
|
||||||
|
case_apartment_layout nvarchar(255) null,
|
||||||
|
compute_unit_price decimal(18,2) NULL,
|
||||||
|
compute_total_price decimal(18,2) NULL,
|
||||||
|
reference_unit_price decimal(18,2) NULL,
|
||||||
|
reference_total_price decimal(18,2) NULL,
|
||||||
|
case_label nvarchar(512) null,
|
||||||
|
create_time datetime not null
|
||||||
|
);
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<insert id="insertSecondTable" parameterType="com.ruoyi.project.data.cases.domain.OriginalNewHouseCase">
|
||||||
|
<bind name="targetTableName" value="'dbo.original_new_house_case_' + yearMonth+'_update'"/>
|
||||||
|
insert into ${targetTableName}
|
||||||
|
(
|
||||||
|
case_id
|
||||||
|
, case_county
|
||||||
|
, case_block
|
||||||
|
, case_loop
|
||||||
|
, case_community_name
|
||||||
|
, case_address
|
||||||
|
, case_area
|
||||||
|
, case_unit_price
|
||||||
|
, case_total_price
|
||||||
|
, case_house_type
|
||||||
|
, case_signing_date
|
||||||
|
, case_floor
|
||||||
|
, case_house_property
|
||||||
|
, case_apartment_layout
|
||||||
|
, compute_unit_price
|
||||||
|
, compute_total_price
|
||||||
|
, reference_unit_price
|
||||||
|
, reference_total_price
|
||||||
|
, case_label
|
||||||
|
, create_time
|
||||||
|
)
|
||||||
|
values(
|
||||||
|
#{caseId},
|
||||||
|
#{caseCounty},
|
||||||
|
#{caseBlock},
|
||||||
|
#{caseLoop},
|
||||||
|
#{caseCommunityName},
|
||||||
|
#{caseAddress},
|
||||||
|
#{caseArea},
|
||||||
|
#{caseUnitPrice},
|
||||||
|
#{caseTotalPrice},
|
||||||
|
#{caseHouseType},
|
||||||
|
#{caseSigningDate,jdbcType=DATE},
|
||||||
|
#{caseFloor},
|
||||||
|
#{caseHouseProperty},
|
||||||
|
#{caseApartmentLayout},
|
||||||
|
#{computeUnitPrice},
|
||||||
|
#{computeTotalPrice},
|
||||||
|
#{referenceUnitPrice},
|
||||||
|
#{referenceTotalPrice},
|
||||||
|
#{caseLabel},
|
||||||
|
getdate()
|
||||||
|
)
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
</mapper>
|
@ -3,15 +3,15 @@ package com.ruoyi;
|
|||||||
|
|
||||||
import com.ruoyi.project.data.cases.domain.CleanResidenceRentAggregationCase;
|
import com.ruoyi.project.data.cases.domain.CleanResidenceRentAggregationCase;
|
||||||
import com.ruoyi.project.data.cases.domain.OfficeAggregationCase;
|
import com.ruoyi.project.data.cases.domain.OfficeAggregationCase;
|
||||||
|
import com.ruoyi.project.data.cases.domain.OriginalNewHouseCase;
|
||||||
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase;
|
import com.ruoyi.project.data.cases.domain.OriginalResidenceRentClosingCase;
|
||||||
import com.ruoyi.project.data.price.domain.ComputeResidenceSaleBasePrice;
|
import com.ruoyi.project.data.price.domain.ComputeResidenceSaleBasePrice;
|
||||||
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
import com.ruoyi.project.data.price.domain.UltimateOfficeBasePrice;
|
||||||
|
import org.junit.Assert;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.util.ArrayList;
|
import java.util.*;
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
public class GenerateTableTests {
|
public class GenerateTableTests {
|
||||||
@ -96,7 +96,7 @@ public class GenerateTableTests {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void generateBatchGuoHaoInsertSqL() {
|
public void generateBatchGuoHaoInsertSqL() {
|
||||||
Class targetClass = CleanResidenceRentAggregationCase.class;
|
Class targetClass = OriginalNewHouseCase.class;
|
||||||
|
|
||||||
List<Field> fieldList = new ArrayList<>();
|
List<Field> fieldList = new ArrayList<>();
|
||||||
while (targetClass != null) {
|
while (targetClass != null) {
|
||||||
@ -107,10 +107,34 @@ public class GenerateTableTests {
|
|||||||
fieldList.toArray(fields);
|
fieldList.toArray(fields);
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (int i = 0; i < fields.length; i++) {
|
for (int i = 0; i < fields.length; i++) {
|
||||||
sb.append("#{"+fields[i].getName()+"},");
|
sb.append("#{" + fields[i].getName() + "},");
|
||||||
sb.append("\n");
|
sb.append("\n");
|
||||||
}
|
}
|
||||||
System.out.println(sb.toString());
|
System.out.println(sb.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testContains() {
|
||||||
|
OriginalNewHouseCase originalNewHouseCase = new OriginalNewHouseCase();
|
||||||
|
originalNewHouseCase.setCaseAddress("明兴路18弄124号地下1层车位288室");
|
||||||
|
if (originalNewHouseCase.getCaseAddress().contains("地下")) {
|
||||||
|
originalNewHouseCase.setCaseLabel("车位");
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.assertTrue(Objects.equals("车位",originalNewHouseCase.getCaseLabel()));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void printLoop() {
|
||||||
|
OriginalNewHouseCase originalNewHouseCase = new OriginalNewHouseCase();
|
||||||
|
originalNewHouseCase.setCaseCounty("浦东");
|
||||||
|
originalNewHouseCase.setCaseAddress("昌邑路55弄164室");
|
||||||
|
Calendar calendar = Calendar.getInstance();
|
||||||
|
calendar.set(2005,10,16);
|
||||||
|
originalNewHouseCase.setCaseSigningDate(calendar.getTime());
|
||||||
|
Assert.assertEquals("4868c51874ba68c7fa2c96eeac02cde7",originalNewHouseCase.getCaseId());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,75 @@
|
|||||||
|
package com.ruoyi.compute;
|
||||||
|
|
||||||
|
import com.ruoyi.RuoYiApplication;
|
||||||
|
import com.ruoyi.project.data.cases.service.impl.DownloadOriginalNewHouseCaseServiceImpl;
|
||||||
|
import org.junit.Test;
|
||||||
|
import org.junit.runner.RunWith;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@RunWith(SpringRunner.class)
|
||||||
|
@SpringBootTest(classes = RuoYiApplication.class)
|
||||||
|
@ActiveProfiles("dev")
|
||||||
|
public class DownloadOriginalNewHouseCaseServiceImplTests {
|
||||||
|
@Autowired
|
||||||
|
private DownloadOriginalNewHouseCaseServiceImpl downloadOriginalNewHouseCaseService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载第一批一手房案例
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDownloadFirst() {
|
||||||
|
downloadOriginalNewHouseCaseService.downloadFirst();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载第二批一手房案例
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void testDownloadSecond() {
|
||||||
|
downloadOriginalNewHouseCaseService.downloadSecond();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDownloadFistLoop() {
|
||||||
|
for (int i = 202001; i <= 202005; i++) {
|
||||||
|
downloadOriginalNewHouseCaseService.downloadFirst(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDownloadSecondLoop() {
|
||||||
|
for (int i = 202001; i <= 202005; i++) {
|
||||||
|
downloadOriginalNewHouseCaseService.downloadSecond(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDownloadLastYearFistLoop() {
|
||||||
|
Arrays.asList(201901, 201902, 201903, 201904, 201905, 201906, 201907, 201908, 201909, 201910, 201911, 201912).parallelStream().forEach(i -> {
|
||||||
|
downloadOriginalNewHouseCaseService.downloadFirst(i);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDownload201901First() {
|
||||||
|
downloadOriginalNewHouseCaseService.downloadFirst(201901);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDownloadLastYearSecondLoop() {
|
||||||
|
Arrays.asList(201901, 201902, 201903, 201904, 201905, 201906, 201907, 201908, 201909, 201910, 201911, 201912).parallelStream().forEach(i -> {
|
||||||
|
downloadOriginalNewHouseCaseService.downloadSecond(i);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDownload201902Second() {
|
||||||
|
downloadOriginalNewHouseCaseService.downloadSecond(201902);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user