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
3f690b4d
Commit
3f690b4d
authored
Jun 19, 2019
by
李尚科
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://t-git.51gjj.com/fangbin/51business
parents
34b40bd0
8f8aaa28
Pipeline
#9184
passed with stage
in 14 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
309 additions
and
2 deletions
+309
-2
Export190619.js
app/controller/house/v2/Export190619.js
+296
-0
export.js
app/router/export.js
+12
-1
new_house.js
app/service/house/v2/new_house.js
+1
-1
No files found.
app/controller/house/v2/Export190619.js
0 → 100644
View file @
3f690b4d
'use strict'
;
const
Controller
=
require
(
'egg'
).
Controller
;
class
Export20190425
extends
Controller
{
//新房 包含了对应的新房户型和小区信息
async
moveNewHouse
()
{
const
{
ctx
}
=
this
;
let
data
=
{
pageIndex
:
1
,
pageSize
:
999
,
orderConditions
:
[{
key
:
'id'
,
orderSequence
:
'asc'
,
}]
}
const
retList
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
HOUSE_SERVICE_API
+
'/v1/newhouse/list'
,
data
,
{
method
:
'POST'
});
if
(
retList
.
status
!==
200
)
{
ctx
.
failed
(
'error'
);
}
let
newHouseList
=
retList
.
data
;
let
ret
=
{
newHouse
:
[],
newHouseType
:
[],
};
if
(
newHouseList
.
rowCount
>
0
)
{
let
list
=
newHouseList
.
results
;
for
(
let
i
in
list
)
{
let
newHouseData
=
{
name
:
list
[
i
].
name
,
residential_id
:
list
[
i
].
residentialId
,
// developer_id: list[i].xxx,
province
:
list
[
i
].
province
,
city
:
list
[
i
].
city
,
area
:
list
[
i
].
county
,
address
:
list
[
i
].
address
,
sale_province
:
list
[
i
].
province
,
sale_city
:
list
[
i
].
city
,
sale_area
:
list
[
i
].
county
,
sale_address
:
list
[
i
].
saleAddress
,
tags
:
list
[
i
].
tags
,
sale_type
:
list
[
i
].
saleType
,
house_type
:
list
[
i
].
houseType
,
reference_avg_price
:
list
[
i
].
referenceAvgPrice
,
reference_total_price
:
list
[
i
].
referenceTotalPrice
,
image
:
list
[
i
].
image
,
corner
:
list
[
i
].
cornerMarker
,
discount
:
list
[
i
].
discount
,
favourable_info
:
list
[
i
].
favourableInfo
,
decoration_type
:
list
[
i
].
decorationType
,
description
:
list
[
i
].
description
,
open_date
:
list
[
i
].
openDate
,
due_date
:
list
[
i
].
dueDate
,
land_area
:
list
[
i
].
landArea
,
house_area
:
list
[
i
].
houseArea
,
area_ratio
:
list
[
i
].
areaRatio
,
green_ratio
:
list
[
i
].
greenRatio
,
plan_rooms
:
list
[
i
].
planRooms
,
plan_parks
:
list
[
i
].
planParks
,
plan_near_by
:
list
[
i
].
planNearBy
,
pre_sale_permit
:
list
[
i
].
preSalePermit
,
pre_sale_permit_date
:
list
[
i
].
preSalePermitDate
,
building_numbers
:
list
[
i
].
buildingNumbers
,
selling_qualification
:
list
[
i
].
xxx
,
remark
:
list
[
i
].
remark
,
// is_reality: list[i].xxx,
order_id
:
list
[
i
].
orderNum
,
status
:
Number
(
list
[
i
].
state
)
===
0
?
'offline'
:
'online'
,
valid
:
1
,
created_at
:
list
[
i
].
createdAt
,
updated_at
:
list
[
i
].
updatedAt
||
null
,
// deleted_at: list[i].xxx,
option_city_code
:
list
[
i
].
residential
.
city
,
option_district_code
:
list
[
i
].
residential
.
county
,
option_bizicircle_code
:
list
[
i
].
residential
.
region
,
residential_property_right_years
:
list
[
i
].
residential
.
propertyRightYears
,
residential_property_fee
:
list
[
i
].
residential
.
propertyFee
,
residential_property_company
:
list
[
i
].
residential
.
propertyCompany
,
residential_heat_supply_type
:
list
[
i
].
residential
.
heatSupplyType
,
residential_water_suppler_type
:
list
[
i
].
residential
.
waterSupplyType
,
residential_power_suppler_type
:
list
[
i
].
residential
.
powerSupplyType
,
residential_land_area
:
list
[
i
].
residential
.
landArea
,
residential_house_area
:
list
[
i
].
residential
.
houseArea
,
residential_area_ratio
:
list
[
i
].
residential
.
areaRatio
,
residential_green_ratio
:
list
[
i
].
residential
.
greenRatio
,
residential_arch_type
:
list
[
i
].
residential
.
archType
,
residential_nearby
:
list
[
i
].
residential
.
nearBy
,
}
//房源信息和小区信息
let
id
=
await
ctx
.
realestateModel
.
NewHouse
.
add
(
newHouseData
);
ret
.
newHouse
.
push
(
id
);
//户型
if
(
list
.
newHouseType
.
length
>
0
)
{
for
(
let
j
in
list
.
newHouseType
)
{
let
newHouseDataTypeData
=
{
new_house_id
:
list
.
newHouseType
[
j
].
newHouseId
,
type
:
list
.
newHouseType
[
j
].
type
,
image
:
list
.
newHouseType
[
j
].
image
,
tags
:
list
.
newHouseType
[
j
].
tags
,
apartment
:
list
.
newHouseType
[
j
].
apartment
,
sale_type
:
list
.
newHouseType
[
j
].
saleType
,
area
:
list
.
newHouseType
[
j
].
area
,
orientation
:
list
.
newHouseType
[
j
].
orientation
,
num
:
list
.
newHouseType
[
j
].
num
,
price
:
list
.
newHouseType
[
j
].
price
,
discount
:
list
.
newHouseType
[
j
].
discount
,
status
:
Number
(
list
.
newHouseType
[
j
].
state
)
===
0
?
'offline'
:
'online'
,
remark
:
list
.
newHouseType
[
j
].
remark
,
valid
:
1
,
created_at
:
list
.
newHouseType
[
j
].
created_at
,
updated_at
:
list
.
newHouseType
[
j
].
updated_at
||
null
,
// deleted_at: list.newHouseType[j].xxx,
}
let
typeId
=
await
ctx
.
realestateModel
.
NewHouseType
.
add
(
newHouseDataTypeData
);
ret
.
newHouseType
.
push
(
typeId
);
}
}
}
}
ctx
.
success
(
ret
);
}
//收藏
async
moveCollection
()
{
const
{
ctx
}
=
this
;
let
data
=
{
pageIndex
:
1
,
pageSize
:
99999
,
orderConditions
:
[{
key
:
'id'
,
orderSequence
:
'asc'
,
}]
}
const
retList
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
HOUSE_SERVICE_API
+
'/v1/collection/list'
,
data
,
{
method
:
'POST'
});
if
(
retList
.
status
!==
200
)
{
ctx
.
failed
(
'error'
);
}
let
res
=
retList
.
data
;
let
ret
=
{
id
:
[],
};
if
(
res
.
rowCount
>
0
)
{
let
list
=
res
.
results
;
for
(
let
i
in
list
)
{
let
addData
=
{
user_id
:
list
[
i
].
userId
,
app_user_id
:
list
[
i
].
appUserId
,
house_style
:
list
[
i
].
houseStyle
,
connect_id
:
list
[
i
].
connectId
,
state
:
list
[
i
].
state
,
remark
:
list
[
i
].
remark
,
created_at
:
list
[
i
].
createdAt
,
updated_at
:
list
[
i
].
updatedAt
||
null
,
deleted_at
:
list
[
i
].
xxx
,
}
let
id
=
await
ctx
.
realestateModel
.
Collection
.
add
(
addData
);
ret
.
id
.
push
(
id
);
}
}
ret
.
count
=
ret
.
id
.
length
;
ctx
.
success
(
ret
);
}
//预约
async
moveOrder
()
{
const
{
ctx
}
=
this
;
let
data
=
{
pageIndex
:
1
,
pageSize
:
99999
,
orderConditions
:
[{
key
:
'id'
,
orderSequence
:
'asc'
,
}]
}
const
retList
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
HOUSE_SERVICE_API
+
'/v1/order/list'
,
data
,
{
method
:
'POST'
});
if
(
retList
.
status
!==
200
)
{
ctx
.
failed
(
'error'
);
}
let
res
=
retList
.
data
;
let
ret
=
{
id
:
[],
};
if
(
res
.
rowCount
>
0
)
{
let
list
=
res
.
results
;
for
(
let
i
in
list
)
{
let
addData
=
{
user_id
:
list
[
i
].
userId
,
app_user_id
:
list
[
i
].
appUserId
,
house_style
:
list
[
i
].
houseStyle
,
connect_id
:
list
[
i
].
connectId
,
name
:
list
[
i
].
name
,
phone
:
list
[
i
].
phone
,
order_at
:
list
[
i
].
orderAt
,
state
:
list
[
i
].
state
,
remark
:
list
[
i
].
remark
,
created_at
:
list
[
i
].
createdAt
,
updated_at
:
list
[
i
].
updatedAt
||
null
,
// deleted_at:list[i].xxx,
}
let
id
=
await
ctx
.
realestateModel
.
Order
.
add
(
addData
);
ret
.
id
.
push
(
id
);
}
}
ret
.
count
=
ret
.
id
.
length
;
ctx
.
success
(
ret
);
}
//搜索历史
async
moveHistory
()
{
const
{
ctx
}
=
this
;
let
data
=
{
pageIndex
:
1
,
pageSize
:
99999
,
orderConditions
:
[{
key
:
'id'
,
orderSequence
:
'asc'
,
}]
}
const
retList
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
HOUSE_SERVICE_API
+
'/v1/searchhistory/list'
,
data
,
{
method
:
'POST'
});
if
(
retList
.
status
!==
200
)
{
ctx
.
failed
(
'error'
);
}
let
res
=
retList
.
data
;
let
ret
=
{
org_count
:
res
.
rowCount
,
id
:
[],
};
if
(
res
.
rowCount
>
0
)
{
let
list
=
res
.
results
;
for
(
let
i
in
list
)
{
let
addData
=
{
user_id
:
list
[
i
].
userId
,
app_user_id
:
list
[
i
].
appUserId
,
key_word
:
list
[
i
].
keyWord
,
house_style
:
list
[
i
].
houseStyle
,
state
:
list
[
i
].
state
,
created_at
:
list
[
i
].
createdAt
,
// updated_at: list[i].xxx,
// deleted_at: list[i].xxx,
}
let
id
=
await
ctx
.
realestateModel
.
SearchHistory
.
add
(
addData
);
ret
.
id
.
push
(
id
);
}
}
ret
.
count
=
ret
.
id
.
length
;
ctx
.
success
(
ret
);
}
//足迹
async
moveFoot
()
{
const
{
ctx
}
=
this
;
let
data
=
{
pageIndex
:
1
,
pageSize
:
99999
,
orderConditions
:
[{
key
:
'id'
,
orderSequence
:
'asc'
,
}]
}
const
retList
=
await
ctx
.
helper
.
send_request
(
this
.
config
.
HOUSE_SERVICE_API
+
'/v1/footprint/list'
,
data
,
{
method
:
'POST'
});
if
(
retList
.
status
!==
200
)
{
ctx
.
failed
(
'error'
);
}
let
res
=
retList
.
data
;
let
ret
=
{
org_count
:
res
.
rowCount
,
id
:
[],
};
if
(
res
.
rowCount
>
0
)
{
let
list
=
res
.
results
;
for
(
let
i
in
list
)
{
let
addData
=
{
user_id
:
list
[
i
].
userId
,
// app_type_id:list[i].xxx,
app_user_id
:
list
[
i
].
appUserId
,
house_style
:
list
[
i
].
xxx
,
connect_id
:
list
[
i
].
connectId
,
state
:
list
[
i
].
state
,
remark
:
list
[
i
].
remark
,
created_at
:
list
[
i
].
createdAt
,
updated_at
:
list
[
i
].
updatedAt
||
null
,
// deleted_at: list[i].xxx,
}
let
id
=
await
ctx
.
realestateModel
.
FootPrint
.
add
(
addData
);
ret
.
id
.
push
(
id
);
}
}
ret
.
count
=
ret
.
id
.
length
;
ctx
.
success
(
ret
);
}
}
module
.
exports
=
Export20190425
;
app/router/export
20190425
.js
→
app/router/export.js
View file @
3f690b4d
'use strict'
;
'use strict'
;
module
.
exports
=
app
=>
{
module
.
exports
=
app
=>
{
const
router
=
app
.
router
.
namespace
(
app
.
config
.
projectRootPath
+
'/house/export
20190425
'
);
const
router
=
app
.
router
.
namespace
(
app
.
config
.
projectRootPath
+
'/house/export'
);
router
.
get
(
'add'
,
'/house_image'
,
'house.export20190425.exportHouseImages'
);
//用户浏览记录列表
router
.
get
(
'add'
,
'/house_image'
,
'house.export20190425.exportHouseImages'
);
//用户浏览记录列表
router
.
get
(
'add'
,
'/residential'
,
'house.export20190425.exportResidential'
);
//用户浏览记录列表
router
.
get
(
'add'
,
'/residential'
,
'house.export20190425.exportResidential'
);
//用户浏览记录列表
...
@@ -10,4 +10,15 @@ module.exports = app => {
...
@@ -10,4 +10,15 @@ module.exports = app => {
router
.
get
(
'/new_house'
,
'house.export20190425.moveNewHouse'
);
router
.
get
(
'/new_house'
,
'house.export20190425.moveNewHouse'
);
router
.
get
(
'/new_house_type'
,
'house.export20190425.moveNewHouseType'
);
router
.
get
(
'/new_house_type'
,
'house.export20190425.moveNewHouseType'
);
//sqlserver迁移数据
router
.
get
(
'third'
,
'/new_house_related'
,
'house.v2.export190619.moveNewHouse'
);
router
.
get
(
'third'
,
'/collection'
,
'house.v2.export190619.moveCollection'
);
router
.
get
(
'third'
,
'/order'
,
'house.v2.export190619.moveOrder'
);
router
.
get
(
'third'
,
'/history'
,
'house.v2.export190619.moveHistory'
);
router
.
get
(
'third'
,
'/foot'
,
'house.v2.export190619.moveFoot'
);
};
};
app/service/house/v2/new_house.js
View file @
3f690b4d
...
@@ -342,7 +342,7 @@ class NewHouseService extends Service {
...
@@ -342,7 +342,7 @@ class NewHouseService extends Service {
if
(
type
===
'home'
)
{
if
(
type
===
'home'
)
{
//为您推荐只展示50条在售楼盘的数据,根据排序序号取数,数字小的排在前面,数字一样的情况下根据时间逆序排列,时间也一样的情况下随机排列;
//为您推荐只展示50条在售楼盘的数据,根据排序序号取数,数字小的排在前面,数字一样的情况下根据时间逆序排列,时间也一样的情况下随机排列;
filter
.
limit
=
Number
(
condition
.
page_size
)
||
50
;
filter
.
limit
=
Number
(
condition
.
page_size
)
||
50
;
filter
.
order
.
push
([
'order_id'
,
'
de
sc'
],
[
'created_at'
,
'desc'
]);
filter
.
order
.
push
([
'order_id'
,
'
a
sc'
],
[
'created_at'
,
'desc'
]);
}
else
if
(
type
===
'all'
)
{
}
else
if
(
type
===
'all'
)
{
filter
.
order
.
push
([
'sale_type'
,
'desc'
]);
filter
.
order
.
push
([
'sale_type'
,
'desc'
]);
}
else
if
(
type
===
'sale'
)
{
}
else
if
(
type
===
'sale'
)
{
...
...
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