feature (二手成交案例数据同步): 推送住宅销售二手成交案例到联城数库
This commit is contained in:
parent
0fb4e5901b
commit
d6dd7fca8e
@ -10,6 +10,7 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.jdbc.core.JdbcTemplate;
|
import org.springframework.jdbc.core.JdbcTemplate;
|
||||||
|
import org.springframework.scheduling.annotation.Async;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
@ -65,6 +66,8 @@ public class DownloadOriginalResidenceSaleClosingCaseServiceImpl {
|
|||||||
|
|
||||||
running(tableRoute, originalResidenceSaleClosingCases);
|
running(tableRoute, originalResidenceSaleClosingCases);
|
||||||
after(tableRoute);
|
after(tableRoute);
|
||||||
|
|
||||||
|
copy2UVData(tableRoute, remoteTableRoute);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -110,4 +113,23 @@ public class DownloadOriginalResidenceSaleClosingCaseServiceImpl {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拷贝数据到联城数库
|
||||||
|
*
|
||||||
|
* @param tableRoute
|
||||||
|
* @param remoteTableRoute
|
||||||
|
*/
|
||||||
|
@Async
|
||||||
|
public void copy2UVData(Integer tableRoute, Integer remoteTableRoute) {
|
||||||
|
try {
|
||||||
|
String yearMonth = String.format("%d-%02d", remoteTableRoute / 100, remoteTableRoute % 100);
|
||||||
|
String rawSql = LoadUtil.loadContent("sql-template/copy_ershou_data.sql");
|
||||||
|
String sql = rawSql.replace("#tableRoute#", tableRoute.toString())
|
||||||
|
.replace("#yearMonth#", yearMonth);
|
||||||
|
jdbcTemplate.update(sql);
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("住宅销售二手成交案例推送到联城数库异常", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -54,11 +54,11 @@ public class OriginalOfficeCaseServiceImpl implements IOriginalOfficeCaseService
|
|||||||
calendar.get(Calendar.MONTH) + 1));
|
calendar.get(Calendar.MONTH) + 1));
|
||||||
|
|
||||||
// yearMonth = 202007;
|
// yearMonth = 202007;
|
||||||
// lastYearMonth = 202006;
|
//// lastYearMonth = 202006;
|
||||||
// calendar.set(2020, 5, 16);
|
//// calendar.set(2020, 5, 16);
|
||||||
// startDate = calendar.getTime();
|
//// startDate = calendar.getTime();
|
||||||
// calendar.set(2020, 6, 16);
|
//// calendar.set(2020, 6, 16);
|
||||||
// endDate = calendar.getTime();
|
//// endDate = calendar.getTime();
|
||||||
|
|
||||||
before(yearMonth, startDate, endDate);
|
before(yearMonth, startDate, endDate);
|
||||||
running(yearMonth, lastYearMonth);
|
running(yearMonth, lastYearMonth);
|
||||||
|
@ -77,74 +77,4 @@ spring:
|
|||||||
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
|
||||||
username: purple
|
username: purple
|
||||||
password: liancheng
|
password: liancheng
|
||||||
|
|
||||||
# druid:
|
|
||||||
# statViewServlet:
|
|
||||||
# enabled: true
|
|
||||||
# # 设置白名单,不填则允许所有访问
|
|
||||||
# allow:
|
|
||||||
# url-pattern: /druid/*
|
|
||||||
# # 控制台管理用户名和密码
|
|
||||||
# login-username:
|
|
||||||
# login-password:
|
|
||||||
# dynamic:
|
|
||||||
# druid:
|
|
||||||
# # 初始连接数
|
|
||||||
# initialSize: 5
|
|
||||||
# # 最小连接池数量
|
|
||||||
# minIdle: 10
|
|
||||||
# # 最大连接池数量
|
|
||||||
# maxActive: 20
|
|
||||||
# # 配置获取连接等待超时的时间
|
|
||||||
# maxWait: 60000
|
|
||||||
# # 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒
|
|
||||||
# timeBetweenEvictionRunsMillis: 60000
|
|
||||||
# # 配置一个连接在池中最小生存的时间,单位是毫秒
|
|
||||||
# minEvictableIdleTimeMillis: 300000
|
|
||||||
# # 配置一个连接在池中最大生存的时间,单位是毫秒
|
|
||||||
# maxEvictableIdleTimeMillis: 900000
|
|
||||||
# # 配置检测连接是否有效
|
|
||||||
# validationQuery: SELECT 1
|
|
||||||
# testWhileIdle: true
|
|
||||||
# testOnBorrow: false
|
|
||||||
# testOnReturn: false
|
|
||||||
## webStatFilter:
|
|
||||||
## enabled: true
|
|
||||||
## filters: stat,wall
|
|
||||||
## wall:
|
|
||||||
## multiStatementAllow: true
|
|
||||||
# stat:
|
|
||||||
# log-slow-sql: true
|
|
||||||
# slow-sql-millis: 1000
|
|
||||||
# merge-sql: true
|
|
||||||
# primary: master
|
|
||||||
# datasource:
|
|
||||||
# # 主库数据源
|
|
||||||
# master:
|
|
||||||
# driver-class-name: com.mysql.jdbc.Driver
|
|
||||||
# url: jdbc:mysql://172.16.30.243:6060/ruoyi?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
|
||||||
# username: root
|
|
||||||
# password: LOLm2dI2UQF#RxOf
|
|
||||||
# # 从库数据源
|
|
||||||
## slave:
|
|
||||||
## # 从数据源开关/默认关闭
|
|
||||||
## enabled: false
|
|
||||||
## url:
|
|
||||||
## username:
|
|
||||||
## password:
|
|
||||||
# teemlink:
|
|
||||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
|
||||||
# url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=obpm_LianCheng_Data
|
|
||||||
# username: sa
|
|
||||||
# password: Lcdatacenter_888
|
|
||||||
# compute:
|
|
||||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
|
||||||
# url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_compute
|
|
||||||
# username: sa
|
|
||||||
# password: Lcdatacenter_888
|
|
||||||
# clean:
|
|
||||||
# driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
|
|
||||||
# url: jdbc:sqlserver://172.16.30.233:1433;DatabaseName=uv_clean
|
|
||||||
# username: sa
|
|
||||||
# password: Lcdatacenter_888
|
|
51
ruoyi/src/main/resources/sql-template/copy_ershou_data.sql
Normal file
51
ruoyi/src/main/resources/sql-template/copy_ershou_data.sql
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
delete from obpm_LianCheng_Data.dbo.TLK_成交案例 where ITEM_YEARMONTH='#yearMonth#';
|
||||||
|
|
||||||
|
declare @count int
|
||||||
|
|
||||||
|
SELECT @count=max(cast((substring(ITEM_DEALID,2,10) )as int)) FROM dbo.TLK_成交案例 where ITEM_DEALTYPE='二手';
|
||||||
|
-- 居住类型
|
||||||
|
insert into obpm_LianCheng_Data.dbo.TLK_成交案例(LASTMODIFIED, FORMNAME, AUTHOR, AUTHOR_DEPT_INDEX, CREATED, FORMID, ISTMP, VERSIONS, APPLICATIONID, STATEINT, LASTMODIFIER, DOMAINID, AUDITORLIST, COAUDITORLIST, ID, ITEM_DEALID, ITEM_SECTOR, ITEM_CIRCLEPOSITION, ITEM_DISTRICT, ITEM_RANAME, ITEM_HOUSEADDRESS, ITEM_AREA, ITEM_SUMPRICE, ITEM_UNITPRICE, ITEM_SIGNINGDATA, ITEM_FLOOR, ITEM_ROOMNATURE, ITEM_APARTMENT, ITEM_DEALTYPE, ITEM_REGISTER, ITEM_INTERMEDIARYCOMPANY, ITEM_INTERMEDIARYTYPE, ITEM_SELLERTYPE, ITEM_BUYERTYPE, ITEM_YEARMONTH, ITEM_AIRAID, ITEM_AIUNITID, ITEM_SINGLEID, ITEM_STANDARDSINGLEADDRESS, ITEM_HOUSETYPE, ITEM_IMPORTDATE,ITEM_PROPERTYTYPE)
|
||||||
|
select getdate(), N'物业信息管理/成交案例', N'PNDbyK6lSFWFGlLJFXj', 'Os6qe4Pmq5viTO8lTnW_3QBGkL7jqDjm2BRk7uJ', getdate(),
|
||||||
|
N'gTn1hQuxFRdwLakei6q', 0, 1, N'Ts7TykYmuEzzZgWhXHj', 0, N'PNDbyK6lSFWFGlLJFXj', N'BclzHtmfLQoAA5ICTb5', N'{}',
|
||||||
|
N'{}', newid(), 'b'+cast((row_number() over(order by case_id) + @count) as nvarchar(20)),case_block_name,
|
||||||
|
case_loopline_name,case_county_name,case_community_name,case_address,case_area,case_total_price,case_unit_price,
|
||||||
|
case_signing_date,null,case_house_property,case_apartment_layout,'二手',case_register_date,case_agency_name,
|
||||||
|
case_agency_type,case_seller_type,case_buyer_type,'#yearMonth#',clean_community_id,NULL,clean_condo_id,
|
||||||
|
clean_condo_address,case_house_type,getdate(),clean_property_type
|
||||||
|
from uv_compute.dbo.original_residence_sale_closing_case_#tableRoute#
|
||||||
|
|
||||||
|
insert into obpm_LianCheng_Data.dbo.T_DOCUMENT
|
||||||
|
(
|
||||||
|
ID
|
||||||
|
, LASTMODIFIED
|
||||||
|
, FORMNAME
|
||||||
|
, AUTHOR
|
||||||
|
, AUTHOR_DEPT_INDEX
|
||||||
|
, CREATED
|
||||||
|
, FORMID
|
||||||
|
, ISTMP
|
||||||
|
, VERSIONS
|
||||||
|
, APPLICATIONID
|
||||||
|
, LASTMODIFIER
|
||||||
|
, DOMAINID
|
||||||
|
, AUDITORLIST
|
||||||
|
, COAUDITORLIST
|
||||||
|
, MAPPINGID
|
||||||
|
)
|
||||||
|
SELECT ID
|
||||||
|
, LASTMODIFIED
|
||||||
|
, FORMNAME
|
||||||
|
, AUTHOR
|
||||||
|
, AUTHOR_DEPT_INDEX
|
||||||
|
, CREATED
|
||||||
|
, FORMID
|
||||||
|
, ISTMP
|
||||||
|
, VERSIONS
|
||||||
|
, APPLICATIONID
|
||||||
|
, LASTMODIFIER
|
||||||
|
, DOMAINID
|
||||||
|
, AUDITORLIST
|
||||||
|
, COAUDITORLIST
|
||||||
|
, ID
|
||||||
|
FROM obpm_LianCheng_Data.dbo.TLK_成交案例
|
||||||
|
where ITEM_YEARMONTH='#yearMonth#' and ITEM_DEALTYPE='二手';
|
@ -148,5 +148,11 @@ public class GenerateTableTests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void printLoop2(){
|
||||||
|
for (int i = 201901; i <= 201912; i++) {
|
||||||
|
System.out.println(i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,8 @@ import org.springframework.boot.test.context.SpringBootTest;
|
|||||||
import org.springframework.test.context.ActiveProfiles;
|
import org.springframework.test.context.ActiveProfiles;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@SpringBootTest(classes = RuoYiApplication.class)
|
@SpringBootTest(classes = RuoYiApplication.class)
|
||||||
@ActiveProfiles("dev")
|
@ActiveProfiles("dev")
|
||||||
@ -20,4 +22,22 @@ public class DownloadOriginalResidenceSaleClosingCaseServiceImplTests {
|
|||||||
public void testDownload() {
|
public void testDownload() {
|
||||||
downloadOriginalResidenceSaleClosingCaseService.download(202007, 202005);
|
downloadOriginalResidenceSaleClosingCaseService.download(202007, 202005);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testLoopDownload() {
|
||||||
|
// , 201912
|
||||||
|
// Arrays.asList(201901, 201902, 201903, 201904, 201905, 201906, 201907, 201908, 201909, 201910, 201911).parallelStream().forEach(i -> {
|
||||||
|
// downloadOriginalResidenceSaleClosingCaseService.download(i + 1, i);
|
||||||
|
// });
|
||||||
|
// downloadOriginalResidenceSaleClosingCaseService.download(202001, 201912);
|
||||||
|
downloadOriginalResidenceSaleClosingCaseService.download(202001, 201911);
|
||||||
|
downloadOriginalResidenceSaleClosingCaseService.download(202002, 201912);
|
||||||
|
downloadOriginalResidenceSaleClosingCaseService.download(202003, 202001);
|
||||||
|
downloadOriginalResidenceSaleClosingCaseService.download(202004, 202002);
|
||||||
|
downloadOriginalResidenceSaleClosingCaseService.download(202005, 202003);
|
||||||
|
downloadOriginalResidenceSaleClosingCaseService.download(202006, 202004);
|
||||||
|
downloadOriginalResidenceSaleClosingCaseService.download(202007, 202005);
|
||||||
|
downloadOriginalResidenceSaleClosingCaseService.download(202008, 202006);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user