Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
5
51business
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
方斌
51business
Commits
16b90cda
Commit
16b90cda
authored
Jun 21, 2019
by
Hsinli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of t-git.51gjj.com:fangbin/51business
parents
67be9fab
f36bff08
Pipeline
#9329
passed with stage
in 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
10 deletions
+60
-10
Export190619.js
app/controller/house/v2/Export190619.js
+55
-6
export.js
app/router/export.js
+5
-4
No files found.
app/controller/house/v2/Export190619.js
View file @
16b90cda
...
...
@@ -322,6 +322,7 @@ class Export20190425 extends Controller {
ctx
.
success
(
ret
);
}
//租房数据迁移
async
moveRentalHouse
()
{
const
{
ctx
}
=
this
;
...
...
@@ -372,7 +373,7 @@ class Export20190425 extends Controller {
option_bizicircle_code
:
residential
.
region
,
developer_id
:
residential_developers
[
residential
.
id
],
rental_type
:
1
,
address
:
rental_house
.
address
,
address
:
rental_house
.
address
.
replace
(
'杭州市'
,
''
).
replace
(
'重庆市'
,
''
).
replace
(
'北京市'
,
''
)
,
price
:
rental_house
.
price
,
discount
:
rental_house
.
discount
,
image
:
rental_house
.
image
,
...
...
@@ -391,11 +392,13 @@ class Export20190425 extends Controller {
}
rental_house_data
.
push
(
tmp
);
}
const
rental_house_count
=
await
ctx
.
realestateModel
.
RentalHouse
.
bulkCreate
(
rental_house_data
);
const
rental_house_type_count
=
await
ctx
.
realestateModel
.
RentalHouseType
.
bulkCreate
(
rental_house_type_data
);
ctx
.
success
({
rental_house_count
,
rental_house_type_count
});
const
rental_house_ret
=
await
ctx
.
realestateModel
.
RentalHouse
.
bulkCreate
(
rental_house_data
);
const
rental_house_type_ret
=
await
ctx
.
realestateModel
.
RentalHouseType
.
bulkCreate
(
rental_house_type_data
);
const
ret
=
{
rental_house_count
:
rental_house_ret
.
length
,
rental_house_ret
,
rental_house_type_count
:
rental_house_type_ret
.
length
,
rental_house_type_ret
};
ctx
.
success
(
ret
);
}
//开发商数据迁移
async
moveDeveloper
()
{
const
{
ctx
}
=
this
;
...
...
@@ -430,8 +433,54 @@ class Export20190425 extends Controller {
});
}
const
developer_count
=
await
ctx
.
realestateModel
.
Developer
.
bulkCreate
(
developer_data
);
ctx
.
success
({
developer_count
});
const
developer_ret
=
await
ctx
.
realestateModel
.
Developer
.
bulkCreate
(
developer_data
);
const
ret
=
{
affect_count
:
developer_ret
.
length
,
developer_ret
};
ctx
.
success
(
ret
);
}
//
async
moveHouseImage
()
{
const
{
ctx
}
=
this
;
let
data
=
{
pageIndex
:
1
,
pageSize
:
500
,
orderConditions
:
[{
key
:
'id'
,
orderSequence
:
'asc'
,
}]
}
let
house_image_data
=
[];
const
now_time
=
moment
(
new
Date
()).
format
(
'YYYY-MM-DD HH:mm:ss'
);
for
(
let
i
=
1
;
i
<
999
;
i
++
)
{
data
.
pageIndex
=
i
;
const
result
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
HOUSE_SERVICE_API
+
'/v1/houseimage/list'
,
data
,
{
method
:
'POST'
});
if
(
result
.
status
!==
200
)
{
ctx
.
failed
(
'error'
);
}
const
house_images
=
result
.
data
.
results
;
if
(
house_images
.
length
===
0
)
break
;
for
(
let
j
in
house_images
)
{
const
house_image
=
house_images
[
j
];
if
(
house_image
.
state
===
0
)
continue
;
house_image_data
.
push
({
// id: house_image.id,
path
:
house_image
.
path
,
connect_id
:
house_image
.
connectId
,
type
:
house_image
.
type
,
description
:
house_image
.
description
,
remark
:
house_image
.
remark
,
status
:
'online'
,
valid
:
1
,
created_at
:
house_image
.
createdAt
,
updated_at
:
now_time
});
}
}
const
house_image_ret
=
await
ctx
.
realestateModel
.
HouseImage
.
bulkCreate
(
house_image_data
);
const
ret
=
{
affect_count
:
house_image_ret
.
length
,
house_image_ret
};
ctx
.
success
(
ret
);
}
}
...
...
app/router/export.js
View file @
16b90cda
...
...
@@ -3,12 +3,12 @@
module
.
exports
=
app
=>
{
const
router
=
app
.
router
.
namespace
(
app
.
config
.
projectRootPath
+
'/house/export'
);
router
.
get
(
'add'
,
'/house_image'
,
'house.export20190425.exportHouseImages'
);
//用户浏览记录列表
router
.
get
(
'add'
,
'/residential'
,
'house.export20190425.exportResidential'
);
//用户浏览记录列表
//
router.get('add', '/house_image', 'house.export20190425.exportHouseImages');//用户浏览记录列表
//
router.get('add', '/residential', 'house.export20190425.exportResidential');//用户浏览记录列表
router
.
get
(
'/new_house'
,
'house.export20190425.moveNewHouse'
);
router
.
get
(
'/new_house_type'
,
'house.export20190425.moveNewHouseType'
);
//
router.get('/new_house', 'house.export20190425.moveNewHouse');
//
router.get('/new_house_type', 'house.export20190425.moveNewHouseType');
//sqlserver迁移数据
...
...
@@ -19,6 +19,7 @@ module.exports = app => {
router
.
get
(
'third'
,
'/foot'
,
'house.v2.export190619.moveFoot'
);
router
.
get
(
'third'
,
'/rental_house_related'
,
'house.v2.export190619.moveRentalHouse'
);
router
.
get
(
'third'
,
'/developer'
,
'house.v2.export190619.moveDeveloper'
);
router
.
get
(
'third'
,
'/house_image'
,
'house.v2.export190619.moveHouseImage'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment