Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yichengstreet-be
Project
Project
Details
Activity
Releases
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
yichengstreet
yichengstreet-be
Commits
cb66ca0b
Commit
cb66ca0b
authored
Mar 11, 2025
by
lixuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 房源
parent
d1a86d8e
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
327 additions
and
115 deletions
+327
-115
HouseResourceController.java
...m/ruoyi/web/controller/house/HouseResourceController.java
+2
-1
BusinessEntityInfo.java
...ava/com/ruoyi/system/domain/house/BusinessEntityInfo.java
+27
-0
BusinessEntitySell.java
...ava/com/ruoyi/system/domain/house/BusinessEntitySell.java
+19
-0
HouseResource.java
...ain/java/com/ruoyi/system/domain/house/HouseResource.java
+6
-0
HouseEnums.java
.../java/com/ruoyi/system/domain/house/enums/HouseEnums.java
+5
-4
BusinessEntityDto.java
...a/com/ruoyi/system/domain/house/vo/BusinessEntityDto.java
+30
-0
HouseResourceDetail.java
...com/ruoyi/system/domain/house/vo/HouseResourceDetail.java
+6
-0
HouseResourcePage.java
...a/com/ruoyi/system/domain/house/vo/HouseResourcePage.java
+8
-0
HouseResourceSaveUpdateDto.java
...yi/system/domain/house/vo/HouseResourceSaveUpdateDto.java
+1
-5
BusinessEntityInfoMapper.java
...m/ruoyi/system/mapper/house/BusinessEntityInfoMapper.java
+28
-0
BusinessEntitySellMapper.java
...m/ruoyi/system/mapper/house/BusinessEntitySellMapper.java
+27
-0
HouseResourceService.java
.../com/ruoyi/system/service/house/HouseResourceService.java
+1
-2
HouseResourceServiceImpl.java
...i/system/service/house/impl/HouseResourceServiceImpl.java
+42
-98
BusinessEntityInfoMapper.xml
.../main/resources/mapper/house/BusinessEntityInfoMapper.xml
+61
-0
BusinessEntitySellMapper.xml
.../main/resources/mapper/house/BusinessEntitySellMapper.xml
+53
-0
HouseResourceMapper.xml
...m/src/main/resources/mapper/house/HouseResourceMapper.xml
+11
-5
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/house/HouseResourceController.java
View file @
cb66ca0b
...
@@ -32,7 +32,8 @@ public class HouseResourceController {
...
@@ -32,7 +32,8 @@ public class HouseResourceController {
@PutMapping
@PutMapping
public
AjaxResult
updateHouseResource
(
@RequestBody
HouseResourceSaveUpdateDto
dto
)
{
public
AjaxResult
updateHouseResource
(
@RequestBody
HouseResourceSaveUpdateDto
dto
)
{
return
houseResourceService
.
updateHouseResource
(
dto
);
houseResourceService
.
updateHouseResource
(
dto
);
return
AjaxResult
.
success
();
}
}
@DeleteMapping
@DeleteMapping
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/BusinessEntityInfo.java
0 → 100644
View file @
cb66ca0b
package
com
.
ruoyi
.
system
.
domain
.
house
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
BusinessEntityInfo
implements
Serializable
{
private
String
id
;
private
String
houseResourceId
;
private
String
name
;
private
String
nature
;
private
String
socialCreditCode
;
private
String
principal
;
private
String
principalTel
;
private
String
business
;
private
Integer
workerNumber
;
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/BusinessEntitySell.java
0 → 100644
View file @
cb66ca0b
package
com
.
ruoyi
.
system
.
domain
.
house
;
import
lombok.Data
;
@Data
public
class
BusinessEntitySell
{
private
String
id
;
private
String
businessEntityInfoId
;
private
Integer
year
;
private
String
yearSell
;
private
String
yearTax
;
private
String
compare
;
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/HouseResource.java
View file @
cb66ca0b
...
@@ -65,4 +65,10 @@ public class HouseResource implements Serializable {
...
@@ -65,4 +65,10 @@ public class HouseResource implements Serializable {
private
String
planeGraphUrl
;
private
String
planeGraphUrl
;
private
int
hireStatus
;
private
int
hireStatus
;
private
String
address
;
private
String
log
;
private
String
lat
;
}
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/enums/HouseEnums.java
View file @
cb66ca0b
...
@@ -5,8 +5,8 @@ public class HouseEnums {
...
@@ -5,8 +5,8 @@ public class HouseEnums {
public
enum
HouseResourceAttributeEnum
{
public
enum
HouseResourceAttributeEnum
{
// 房源属性
// 房源属性
ZL
(
0
,
"租赁"
),
ZL
(
0
,
"租赁"
),
XS
(
1
,
"销售
"
),
QT
(
1
,
"其他
"
),
ZY
(
2
,
"自
用
"
);
ZY
(
2
,
"自
有
"
);
private
final
int
code
;
private
final
int
code
;
private
final
String
desc
;
private
final
String
desc
;
...
@@ -36,8 +36,9 @@ public class HouseEnums {
...
@@ -36,8 +36,9 @@ public class HouseEnums {
public
enum
HouseResourceTypeEnum
{
public
enum
HouseResourceTypeEnum
{
// 房源类型
// 房源类型
FY
(
0
,
"房源"
),
ZY
(
0
,
"在营"
),
QTQY
(
1
,
"其他区域"
);
KZ
(
1
,
"空置"
),
GK
(
2
,
"挂靠"
);
private
final
int
code
;
private
final
int
code
;
private
final
String
desc
;
private
final
String
desc
;
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/vo/BusinessEntityDto.java
0 → 100644
View file @
cb66ca0b
package
com
.
ruoyi
.
system
.
domain
.
house
.
vo
;
import
com.ruoyi.system.domain.house.BusinessEntitySell
;
import
lombok.Data
;
import
java.util.List
;
@Data
public
class
BusinessEntityDto
{
private
String
id
;
private
String
houseResourceId
;
private
String
name
;
private
String
nature
;
private
String
socialCreditCode
;
private
String
principal
;
private
String
principalTel
;
private
String
business
;
private
Integer
workerNumber
;
private
List
<
BusinessEntitySell
>
businessEntitySells
;
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/vo/HouseResourceDetail.java
View file @
cb66ca0b
...
@@ -83,4 +83,10 @@ public class HouseResourceDetail {
...
@@ -83,4 +83,10 @@ public class HouseResourceDetail {
private
int
hireStatus
;
private
int
hireStatus
;
private
String
hireStatusText
;
private
String
hireStatusText
;
private
String
address
;
private
String
log
;
private
String
lat
;
}
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/vo/HouseResourcePage.java
View file @
cb66ca0b
...
@@ -83,4 +83,12 @@ public class HouseResourcePage {
...
@@ -83,4 +83,12 @@ public class HouseResourcePage {
private
int
hireStatus
;
private
int
hireStatus
;
private
String
hireStatusText
;
private
String
hireStatusText
;
private
String
address
;
private
String
log
;
private
String
lat
;
private
List
<
String
>
businessEntityInfoNames
;
}
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/house/vo/HouseResourceSaveUpdateDto.java
View file @
cb66ca0b
package
com
.
ruoyi
.
system
.
domain
.
house
.
vo
;
package
com
.
ruoyi
.
system
.
domain
.
house
.
vo
;
import
com.ruoyi.system.domain.grid.GridCompany
;
import
com.ruoyi.system.domain.grid.GridShop
;
import
com.ruoyi.system.domain.house.HouseResource
;
import
com.ruoyi.system.domain.house.HouseResource
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -12,7 +10,5 @@ public class HouseResourceSaveUpdateDto {
...
@@ -12,7 +10,5 @@ public class HouseResourceSaveUpdateDto {
private
HouseResource
houseResource
;
private
HouseResource
houseResource
;
private
List
<
GridCompany
>
companyList
;
private
List
<
BusinessEntityDto
>
businessEntityDtoList
;
private
List
<
GridShop
>
shopList
;
}
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/house/BusinessEntityInfoMapper.java
0 → 100644
View file @
cb66ca0b
package
com
.
ruoyi
.
system
.
mapper
.
house
;
import
com.ruoyi.system.domain.house.BusinessEntityInfo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
BusinessEntityInfoMapper
{
// 插入业务实体信息
void
insertBusinessEntityInfo
(
BusinessEntityInfo
businessEntityInfo
);
// 根据ID查询业务实体信息
BusinessEntityInfo
selectBusinessEntityInfoById
(
@Param
(
"id"
)
String
id
);
// 更新业务实体信息
void
updateBusinessEntityInfo
(
BusinessEntityInfo
businessEntityInfo
);
// 删除业务实体信息
void
deleteBusinessEntityInfoById
(
@Param
(
"id"
)
String
id
);
// 查询所有业务实体信息
List
<
BusinessEntityInfo
>
selectAllBusinessEntityInfos
();
void
deleteByHouseResourceId
(
@Param
(
"houseResourceId"
)
String
houseResourceId
);
List
<
BusinessEntityInfo
>
selectAllBusinessEntityInfosByHouseResourceId
(
@Param
(
"houseResourceId"
)
String
houseResourceId
);
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/house/BusinessEntitySellMapper.java
0 → 100644
View file @
cb66ca0b
package
com
.
ruoyi
.
system
.
mapper
.
house
;
import
com.ruoyi.system.domain.house.BusinessEntitySell
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
public
interface
BusinessEntitySellMapper
{
// 插入业务实体销售信息
void
insertBusinessEntitySell
(
BusinessEntitySell
businessEntitySell
);
// 根据ID查询业务实体销售信息
BusinessEntitySell
selectBusinessEntitySellById
(
@Param
(
"id"
)
String
id
);
// 更新业务实体销售信息
void
updateBusinessEntitySell
(
BusinessEntitySell
businessEntitySell
);
// 删除业务实体销售信息
void
deleteBusinessEntitySellById
(
@Param
(
"id"
)
String
id
);
// 查询所有业务实体销售信息
List
<
BusinessEntitySell
>
selectAllBusinessEntitySells
();
void
deleteBusinessEntitySellByEntityId
(
@Param
(
"businessEntityId"
)
String
businessEntityId
);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/house/HouseResourceService.java
View file @
cb66ca0b
package
com
.
ruoyi
.
system
.
service
.
house
;
package
com
.
ruoyi
.
system
.
service
.
house
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.system.domain.house.HouseResource
;
import
com.ruoyi.system.domain.house.HouseResource
;
import
com.ruoyi.system.domain.house.vo.HouseResourceDetail
;
import
com.ruoyi.system.domain.house.vo.HouseResourceDetail
;
import
com.ruoyi.system.domain.house.vo.HouseResourcePage
;
import
com.ruoyi.system.domain.house.vo.HouseResourcePage
;
...
@@ -16,7 +15,7 @@ public interface HouseResourceService {
...
@@ -16,7 +15,7 @@ public interface HouseResourceService {
HouseResourceDetail
queryHouseResourceById
(
String
id
);
HouseResourceDetail
queryHouseResourceById
(
String
id
);
AjaxResult
updateHouseResource
(
HouseResourceSaveUpdateDto
dto
);
void
updateHouseResource
(
HouseResourceSaveUpdateDto
dto
);
void
deleteHouseResourceById
(
String
id
);
void
deleteHouseResourceById
(
String
id
);
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/house/impl/HouseResourceServiceImpl.java
View file @
cb66ca0b
...
@@ -2,30 +2,23 @@ package com.ruoyi.system.service.house.impl;
...
@@ -2,30 +2,23 @@ package com.ruoyi.system.service.house.impl;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.system.domain.grid.GridCompany
;
import
com.ruoyi.system.domain.grid.GridRegion
;
import
com.ruoyi.system.domain.grid.GridRegion
;
import
com.ruoyi.system.domain.grid.GridRegionExample
;
import
com.ruoyi.system.domain.grid.GridRegionExample
;
import
com.ruoyi.system.domain.grid.GridShop
;
import
com.ruoyi.system.domain.house.BusinessEntityInfo
;
import
com.ruoyi.system.domain.house.BusinessEntitySell
;
import
com.ruoyi.system.domain.house.HouseResource
;
import
com.ruoyi.system.domain.house.HouseResource
;
import
com.ruoyi.system.domain.house.HouseResourceAssociationObject
;
import
com.ruoyi.system.domain.house.enums.HouseEnums
;
import
com.ruoyi.system.domain.house.enums.HouseEnums
;
import
com.ruoyi.system.domain.house.vo.HouseResourceDetail
;
import
com.ruoyi.system.domain.house.vo.*
;
import
com.ruoyi.system.domain.house.vo.HouseResourcePage
;
import
com.ruoyi.system.domain.house.vo.HouseResourcePageQuery
;
import
com.ruoyi.system.domain.house.vo.HouseResourceSaveUpdateDto
;
import
com.ruoyi.system.domain.other.Labels
;
import
com.ruoyi.system.domain.other.LabelsExample
;
import
com.ruoyi.system.mapper.grid.GridRegionMapper
;
import
com.ruoyi.system.mapper.grid.GridRegionMapper
;
import
com.ruoyi.system.mapper.house.BusinessEntityInfoMapper
;
import
com.ruoyi.system.mapper.house.BusinessEntitySellMapper
;
import
com.ruoyi.system.mapper.house.HouseResourceAssociationObjectMapper
;
import
com.ruoyi.system.mapper.house.HouseResourceAssociationObjectMapper
;
import
com.ruoyi.system.mapper.house.HouseResourceMapper
;
import
com.ruoyi.system.mapper.house.HouseResourceMapper
;
import
com.ruoyi.system.mapper.other.LabelsMapper
;
import
com.ruoyi.system.service.grid.GridCompanyService
;
import
com.ruoyi.system.service.grid.GridShopService
;
import
com.ruoyi.system.service.house.HouseResourceService
;
import
com.ruoyi.system.service.house.HouseResourceService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.util.StringUtils
;
import
org.springframework.util.StringUtils
;
import
java.util.*
;
import
java.util.*
;
...
@@ -36,23 +29,17 @@ public class HouseResourceServiceImpl implements HouseResourceService {
...
@@ -36,23 +29,17 @@ public class HouseResourceServiceImpl implements HouseResourceService {
private
final
HouseResourceMapper
houseResourceMapper
;
private
final
HouseResourceMapper
houseResourceMapper
;
private
final
HouseResourceAssociationObjectMapper
houseResourceAssociationObject
Mapper
;
private
final
BusinessEntityInfoMapper
businessEntityInfo
Mapper
;
private
final
GridRegionMapper
gridRegionMapper
;
private
final
BusinessEntitySellMapper
businessEntitySellMapper
;
private
final
GridCompanyService
gridCompanyService
;
private
final
GridShopService
gridShopService
;
private
final
GridRegionMapper
gridRegionMapper
;
private
final
LabelsMapper
labelsMapper
;
public
HouseResourceServiceImpl
(
HouseResourceMapper
houseResourceMapper
,
HouseResourceAssociationObjectMapper
houseResourceAssociationObjectMapper
,
GridRegionMapper
gridRegionMapper
,
GridCompanyService
gridCompanyService
,
GridShopService
gridShopService
,
LabelsMapper
labels
Mapper
)
{
public
HouseResourceServiceImpl
(
HouseResourceMapper
houseResourceMapper
,
BusinessEntityInfoMapper
businessEntityInfoMapper
,
BusinessEntitySellMapper
businessEntitySellMapper
,
GridRegionMapper
gridRegion
Mapper
)
{
this
.
houseResourceMapper
=
houseResourceMapper
;
this
.
houseResourceMapper
=
houseResourceMapper
;
this
.
houseResourceAssociationObjectMapper
=
houseResourceAssociationObjectMapper
;
this
.
businessEntityInfoMapper
=
businessEntityInfoMapper
;
this
.
businessEntitySellMapper
=
businessEntitySellMapper
;
this
.
gridRegionMapper
=
gridRegionMapper
;
this
.
gridRegionMapper
=
gridRegionMapper
;
this
.
gridCompanyService
=
gridCompanyService
;
this
.
gridShopService
=
gridShopService
;
this
.
labelsMapper
=
labelsMapper
;
}
}
@Override
@Override
...
@@ -62,35 +49,17 @@ public class HouseResourceServiceImpl implements HouseResourceService {
...
@@ -62,35 +49,17 @@ public class HouseResourceServiceImpl implements HouseResourceService {
dto
.
getHouseResource
().
setId
(
houseResourceId
);
dto
.
getHouseResource
().
setId
(
houseResourceId
);
houseResourceMapper
.
insertHouseResource
(
dto
.
getHouseResource
());
houseResourceMapper
.
insertHouseResource
(
dto
.
getHouseResource
());
for
(
GridCompany
gridCompany
:
dto
.
getCompanyList
())
{
for
(
BusinessEntityDto
businessEntityDto
:
dto
.
getBusinessEntityDtoList
())
{
AjaxResult
result
=
gridCompanyService
.
add
(
gridCompany
);
BusinessEntityInfo
businessEntityInfo
=
new
BusinessEntityInfo
();
if
(
result
.
isSuccess
())
{
BeanUtils
.
copyProperties
(
businessEntityDto
,
businessEntityInfo
);
String
id
=
result
.
get
(
"data"
).
toString
();
String
businessEntityInfoId
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
HouseResourceAssociationObject
houseResourceAssociationObject
=
new
HouseResourceAssociationObject
();
businessEntityInfo
.
setId
(
businessEntityInfoId
);
houseResourceAssociationObject
.
setId
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
businessEntityInfo
.
setHouseResourceId
(
houseResourceId
);
houseResourceAssociationObject
.
setHouseResourceId
(
houseResourceId
);
businessEntityInfoMapper
.
insertBusinessEntityInfo
(
businessEntityInfo
);
houseResourceAssociationObject
.
setBusinessId
(
id
);
houseResourceAssociationObject
.
setType
(
1
);
houseResourceAssociationObjectMapper
.
insertHouseResourceObjectAssociation
(
houseResourceAssociationObject
);
}
}
for
(
GridShop
gridShop
:
dto
.
getShopList
())
{
for
(
BusinessEntitySell
businessEntitySell
:
businessEntityDto
.
getBusinessEntitySells
())
{
try
{
businessEntitySell
.
setBusinessEntityInfoId
(
businessEntityInfoId
);
AjaxResult
result
=
gridShopService
.
addGridShop
(
gridShop
);
businessEntitySellMapper
.
insertBusinessEntitySell
(
businessEntitySell
);
if
(
result
.
isSuccess
())
{
String
id
=
result
.
get
(
"data"
).
toString
();
HouseResourceAssociationObject
houseResourceAssociationObject
=
new
HouseResourceAssociationObject
();
houseResourceAssociationObject
.
setId
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
houseResourceAssociationObject
.
setHouseResourceId
(
houseResourceId
);
houseResourceAssociationObject
.
setBusinessId
(
id
);
houseResourceAssociationObject
.
setType
(
2
);
houseResourceAssociationObjectMapper
.
insertHouseResourceObjectAssociation
(
houseResourceAssociationObject
);
}
else
{
throw
new
RuntimeException
(
"新增shop出错"
);
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"新增shop出错"
);
}
}
}
}
}
}
...
@@ -123,58 +92,29 @@ public class HouseResourceServiceImpl implements HouseResourceService {
...
@@ -123,58 +92,29 @@ public class HouseResourceServiceImpl implements HouseResourceService {
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
AjaxResult
updateHouseResource
(
HouseResourceSaveUpdateDto
dto
)
{
public
void
updateHouseResource
(
HouseResourceSaveUpdateDto
dto
)
{
if
(
Objects
.
isNull
(
dto
.
getHouseResource
().
getId
()))
{
if
(
Objects
.
isNull
(
dto
.
getHouseResource
().
getId
()))
{
throw
new
RuntimeException
(
"房源id不能为空"
);
throw
new
RuntimeException
(
"房源id不能为空"
);
}
}
houseResourceMapper
.
updateHouseResource
(
dto
.
getHouseResource
());
houseResourceMapper
.
updateHouseResource
(
dto
.
getHouseResource
());
List
<
HouseResourceAssociationObject
>
houseResourceAssociationObjects
=
houseResourceAssociationObjectMapper
.
selectHouseResourceObjectAssociationByHouseResourceIdType
(
dto
.
getHouseResource
().
getId
());
businessEntityInfoMapper
.
deleteByHouseResourceId
(
dto
.
getHouseResource
().
getId
());
houseResourceAssociationObjectMapper
.
deleteByHouseResourceId
(
dto
.
getHouseResource
().
getId
());
for
(
String
s
:
dto
.
getBusinessEntityDtoList
().
stream
().
map
(
BusinessEntityDto:
:
getId
).
collect
(
Collectors
.
toList
()))
{
houseResourceAssociationObjects
.
forEach
(
x
->
{
businessEntitySellMapper
.
deleteBusinessEntitySellById
(
s
);
if
(
x
.
getType
()
==
1
)
{
gridCompanyService
.
delete
(
x
.
getBusinessId
());
}
if
(
x
.
getType
()
==
2
)
{
long
id
=
Long
.
parseLong
(
x
.
getBusinessId
());
Long
[]
longArray
=
{
id
};
gridShopService
.
batchRemove
(
longArray
);
}
}
});
for
(
BusinessEntityDto
businessEntityDto
:
dto
.
getBusinessEntityDtoList
())
{
BusinessEntityInfo
businessEntityInfo
=
new
BusinessEntityInfo
();
BeanUtils
.
copyProperties
(
businessEntityDto
,
businessEntityInfo
);
String
businessEntityInfoId
=
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
);
businessEntityInfo
.
setId
(
businessEntityInfoId
);
businessEntityInfo
.
setHouseResourceId
(
dto
.
getHouseResource
().
getId
());
businessEntityInfoMapper
.
insertBusinessEntityInfo
(
businessEntityInfo
);
for
(
GridCompany
gridCompany
:
dto
.
getCompanyList
())
{
for
(
BusinessEntitySell
businessEntitySell
:
businessEntityDto
.
getBusinessEntitySells
())
{
AjaxResult
result
=
gridCompanyService
.
add
(
gridCompany
);
businessEntitySell
.
setBusinessEntityInfoId
(
businessEntityInfoId
);
if
(
result
.
isSuccess
())
{
businessEntitySellMapper
.
insertBusinessEntitySell
(
businessEntitySell
);
String
id
=
result
.
get
(
"data"
).
toString
();
HouseResourceAssociationObject
houseResourceAssociationObject
=
new
HouseResourceAssociationObject
();
houseResourceAssociationObject
.
setId
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
houseResourceAssociationObject
.
setHouseResourceId
(
dto
.
getHouseResource
().
getId
());
houseResourceAssociationObject
.
setBusinessId
(
id
);
houseResourceAssociationObject
.
setType
(
1
);
houseResourceAssociationObjectMapper
.
insertHouseResourceObjectAssociation
(
houseResourceAssociationObject
);
}
}
}
}
for
(
GridShop
gridShop
:
dto
.
getShopList
())
{
try
{
AjaxResult
result
=
gridShopService
.
addGridShop
(
gridShop
);
if
(
result
.
isSuccess
())
{
String
id
=
result
.
get
(
"data"
).
toString
();
HouseResourceAssociationObject
houseResourceAssociationObject
=
new
HouseResourceAssociationObject
();
houseResourceAssociationObject
.
setId
(
UUID
.
randomUUID
().
toString
().
replaceAll
(
"-"
,
""
));
houseResourceAssociationObject
.
setHouseResourceId
(
dto
.
getHouseResource
().
getId
());
houseResourceAssociationObject
.
setBusinessId
(
id
);
houseResourceAssociationObject
.
setType
(
2
);
houseResourceAssociationObjectMapper
.
insertHouseResourceObjectAssociation
(
houseResourceAssociationObject
);
}
else
{
return
result
;
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"新增shop出错"
);
}
}
return
AjaxResult
.
success
();
}
}
@Override
@Override
...
@@ -208,6 +148,10 @@ public class HouseResourceServiceImpl implements HouseResourceService {
...
@@ -208,6 +148,10 @@ public class HouseResourceServiceImpl implements HouseResourceService {
x
.
setDecorationConditionText
(
HouseEnums
.
DecorationConditionEnum
.
getDescByCode
(
x
.
getDecorationCondition
()));
x
.
setDecorationConditionText
(
HouseEnums
.
DecorationConditionEnum
.
getDescByCode
(
x
.
getDecorationCondition
()));
x
.
setRentalUnitText
(
HouseEnums
.
RentalUnitEnum
.
getDescByCode
(
x
.
getRentalUnit
()));
x
.
setRentalUnitText
(
HouseEnums
.
RentalUnitEnum
.
getDescByCode
(
x
.
getRentalUnit
()));
x
.
setHireStatusText
(
HouseEnums
.
hireStatusTextEnum
.
getDescByCode
(
x
.
getHireStatus
()));
x
.
setHireStatusText
(
HouseEnums
.
hireStatusTextEnum
.
getDescByCode
(
x
.
getHireStatus
()));
List
<
BusinessEntityInfo
>
businessEntityInfos
=
businessEntityInfoMapper
.
selectAllBusinessEntityInfosByHouseResourceId
(
x
.
getId
());
if
(!
CollectionUtils
.
isEmpty
(
businessEntityInfos
))
{
x
.
setBusinessEntityInfoNames
(
businessEntityInfos
.
stream
().
map
(
BusinessEntityInfo:
:
getName
).
collect
(
Collectors
.
toList
()));
}
});
});
return
page
;
return
page
;
}
}
...
...
ruoyi-system/src/main/resources/mapper/house/BusinessEntityInfoMapper.xml
0 → 100644
View file @
cb66ca0b
<?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.system.mapper.house.BusinessEntityInfoMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.ruoyi.system.domain.house.BusinessEntityInfo"
>
<id
column=
"id"
property=
"id"
jdbcType=
"VARCHAR"
/>
<result
column=
"house_resource_id"
property=
"houseResourceId"
jdbcType=
"VARCHAR"
/>
<result
column=
"name"
property=
"name"
jdbcType=
"VARCHAR"
/>
<result
column=
"nature"
property=
"nature"
jdbcType=
"VARCHAR"
/>
<result
column=
"social_credit_code"
property=
"socialCreditCode"
jdbcType=
"VARCHAR"
/>
<result
column=
"principal"
property=
"principal"
jdbcType=
"VARCHAR"
/>
<result
column=
"principal_tel"
property=
"principalTel"
jdbcType=
"VARCHAR"
/>
<result
column=
"business"
property=
"business"
jdbcType=
"VARCHAR"
/>
<result
column=
"worker_number"
property=
"workerNumber"
jdbcType=
"INTEGER"
/>
</resultMap>
<insert
id=
"insertBusinessEntityInfo"
parameterType=
"com.ruoyi.system.domain.house.BusinessEntityInfo"
>
INSERT INTO business_entity_info (
id, house_resource_id, name, nature, social_credit_code,
principal, principal_tel, business, worker_number
) VALUES (
#{id}, #{houseResourceId}, #{name}, #{nature}, #{socialCreditCode},
#{principal}, #{principalTel}, #{business}, #{workerNumber}
)
</insert>
<select
id=
"selectBusinessEntityInfoById"
resultMap=
"BaseResultMap"
>
SELECT * FROM business_entity_info WHERE id = #{id}
</select>
<update
id=
"updateBusinessEntityInfo"
parameterType=
"com.ruoyi.system.domain.house.BusinessEntityInfo"
>
UPDATE business_entity_info
<set>
<if
test=
"houseResourceId != null"
>
house_resource_id=#{houseResourceId},
</if>
<if
test=
"name != null"
>
name=#{name},
</if>
<if
test=
"nature != null"
>
nature=#{nature},
</if>
<if
test=
"socialCreditCode != null"
>
social_credit_code=#{socialCreditCode},
</if>
<if
test=
"principal != null"
>
principal=#{principal},
</if>
<if
test=
"principalTel != null"
>
principal_tel=#{principalTel},
</if>
<if
test=
"business != null"
>
business=#{business},
</if>
<if
test=
"workerNumber != null"
>
worker_number=#{workerNumber},
</if>
</set>
WHERE id=#{id}
</update>
<delete
id=
"deleteBusinessEntityInfoById"
>
DELETE FROM business_entity_info WHERE id = #{id}
</delete>
<select
id=
"selectAllBusinessEntityInfos"
resultMap=
"BaseResultMap"
>
SELECT * FROM business_entity_info
</select>
<delete
id=
"deleteByHouseResourceId"
>
DELETE FROM business_entity_info WHERE house_resource_id = #{houseResourceId}
</delete>
<select
id=
"selectAllBusinessEntityInfosByHouseResourceId"
resultType=
"com.ruoyi.system.domain.house.BusinessEntityInfo"
>
SELECT * FROM business_entity_info WHERE house_resource_id = #{houseResourceId}
</select>
</mapper>
\ No newline at end of file
ruoyi-system/src/main/resources/mapper/house/BusinessEntitySellMapper.xml
0 → 100644
View file @
cb66ca0b
<?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.system.mapper.house.BusinessEntitySellMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"com.ruoyi.system.domain.house.BusinessEntitySell"
>
<id
column=
"id"
property=
"id"
jdbcType=
"VARCHAR"
/>
<result
column=
"business_entity_info_id"
property=
"businessEntityInfoId"
jdbcType=
"VARCHAR"
/>
<result
column=
"year"
property=
"year"
jdbcType=
"INTEGER"
/>
<result
column=
"year_sell"
property=
"yearSell"
jdbcType=
"VARCHAR"
/>
<result
column=
"year_tax"
property=
"yearTax"
jdbcType=
"VARCHAR"
/>
<result
column=
"compare"
property=
"compare"
jdbcType=
"VARCHAR"
/>
</resultMap>
<!-- 插入操作 -->
<insert
id=
"insertBusinessEntitySell"
parameterType=
"com.ruoyi.system.domain.house.BusinessEntitySell"
>
INSERT INTO business_entity_sell (
id, business_entity_info_id, year, year_sell, year_tax, compare
) VALUES (
#{id}, #{businessEntityInfoId}, #{year}, #{yearSell}, #{yearTax}, #{compare}
)
</insert>
<!-- 根据ID查询操作 -->
<select
id=
"selectBusinessEntitySellById"
resultMap=
"BaseResultMap"
>
SELECT * FROM business_entity_sell WHERE id = #{id}
</select>
<!-- 更新操作 -->
<update
id=
"updateBusinessEntitySell"
parameterType=
"com.ruoyi.system.domain.house.BusinessEntitySell"
>
UPDATE business_entity_sell
<set>
<if
test=
"BusinessEntityInfoId != null"
>
business_entity_info_id=#{businessEntityInfoId},
</if>
<if
test=
"year != null"
>
year=#{year},
</if>
<if
test=
"yearSell != null"
>
year_sell=#{yearSell},
</if>
<if
test=
"yearTax != null"
>
year_tax=#{yearTax},
</if>
<if
test=
"compare != null"
>
compare=#{compare},
</if>
</set>
WHERE id=#{id}
</update>
<!-- 删除操作 -->
<delete
id=
"deleteBusinessEntitySellById"
>
DELETE FROM business_entity_sell WHERE id = #{id}
</delete>
<!-- 查询所有记录操作 -->
<select
id=
"selectAllBusinessEntitySells"
resultMap=
"BaseResultMap"
>
SELECT * FROM business_entity_sell
</select>
<delete
id=
"deleteBusinessEntitySellByEntityId"
>
DELETE FROM business_entity_sell WHERE business_entity_info_id = #{businessEntityId}
</delete>
</mapper>
\ No newline at end of file
ruoyi-system/src/main/resources/mapper/house/HouseResourceMapper.xml
View file @
cb66ca0b
...
@@ -31,6 +31,9 @@
...
@@ -31,6 +31,9 @@
<result
property=
"rentalUnit"
column=
"rental_unit"
jdbcType=
"INTEGER"
/>
<result
property=
"rentalUnit"
column=
"rental_unit"
jdbcType=
"INTEGER"
/>
<result
property=
"planeGraphUrl"
column=
"plane_graph_url"
jdbcType=
"VARCHAR"
/>
<result
property=
"planeGraphUrl"
column=
"plane_graph_url"
jdbcType=
"VARCHAR"
/>
<result
property=
"hireStatus"
column=
"hire_status"
jdbcType=
"INTEGER"
/>
<result
property=
"hireStatus"
column=
"hire_status"
jdbcType=
"INTEGER"
/>
<result
property=
"address"
column=
"address"
jdbcType=
"VARCHAR"
/>
<result
property=
"log"
column=
"log"
jdbcType=
"VARCHAR"
/>
<result
property=
"lat"
column=
"lat"
jdbcType=
"VARCHAR"
/>
</resultMap>
</resultMap>
<insert
id=
"insertHouseResource"
parameterType=
"com.ruoyi.system.domain.house.HouseResource"
>
<insert
id=
"insertHouseResource"
parameterType=
"com.ruoyi.system.domain.house.HouseResource"
>
...
@@ -38,12 +41,12 @@
...
@@ -38,12 +41,12 @@
(id, relation_id, two, three, four, type, project_id, house_resource_url, house_number, house_area,
(id, relation_id, two, three, four, type, project_id, house_resource_url, house_number, house_area,
house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, house_resource_equity_tel, ownership,
house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, house_resource_equity_tel, ownership,
decoration_condition, orientation, landing_head_flag, common_area_number, office_number,
decoration_condition, orientation, landing_head_flag, common_area_number, office_number,
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status)
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status
, address, log, lat
)
VALUES
VALUES
(#{id}, #{relationId}, #{two}, #{three}, #{four}, #{type}, #{projectId}, #{houseResourceUrl}, #{houseNumber}, #{houseArea},
(#{id}, #{relationId}, #{two}, #{three}, #{four}, #{type}, #{projectId}, #{houseResourceUrl}, #{houseNumber}, #{houseArea},
#{houseResourceAttribute}, #{houseResourceType}, #{houseResourceUse}, #{houseResourceEquity}, #{houseResourceEquityTel}, #{ownership},
#{houseResourceAttribute}, #{houseResourceType}, #{houseResourceUse}, #{houseResourceEquity}, #{houseResourceEquityTel}, #{ownership},
#{decorationCondition}, #{orientation}, #{landingHeadFlag}, #{commonAreaNumber}, #{officeNumber},
#{decorationCondition}, #{orientation}, #{landingHeadFlag}, #{commonAreaNumber}, #{officeNumber},
#{meetingNumber}, #{stationNumber}, #{setUp}, #{labelId}, #{unitPrice}, #{rentalUnit}, #{planeGraphUrl}, #{hireStatus})
#{meetingNumber}, #{stationNumber}, #{setUp}, #{labelId}, #{unitPrice}, #{rentalUnit}, #{planeGraphUrl}, #{hireStatus}
, #{address}, #{log}, #{lat}
)
</insert>
</insert>
<select
id=
"selectHouseResourceById"
resultType=
"com.ruoyi.system.domain.house.HouseResource"
parameterType=
"string"
>
<select
id=
"selectHouseResourceById"
resultType=
"com.ruoyi.system.domain.house.HouseResource"
parameterType=
"string"
>
...
@@ -79,7 +82,10 @@
...
@@ -79,7 +82,10 @@
unit_price = #{unitPrice},
unit_price = #{unitPrice},
rental_unit = #{rentalUnit},
rental_unit = #{rentalUnit},
plane_graph_url = #{planeGraphUrl},
plane_graph_url = #{planeGraphUrl},
hire_status = #{hireStatus}
hire_status = #{hireStatus},
address = #{address},
log = #{log},
lat = #{lat}
WHERE id = #{id}
WHERE id = #{id}
</update>
</update>
...
@@ -92,7 +98,7 @@
...
@@ -92,7 +98,7 @@
(id, relation_id, two, three, four, type, project_id, house_resource_url, house_number, house_area,
(id, relation_id, two, three, four, type, project_id, house_resource_url, house_number, house_area,
house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, house_resource_equity_tel, ownership,
house_resource_attribute, house_resource_type, house_resource_use, house_resource_equity, house_resource_equity_tel, ownership,
decoration_condition, orientation, landing_head_flag, common_area_number, office_number,
decoration_condition, orientation, landing_head_flag, common_area_number, office_number,
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status)
meeting_number, station_number, set_up, label_id, unit_price, rental_unit, plane_graph_url, hire_status
, address, log, lat
)
VALUES
VALUES
<foreach
collection=
"list"
item=
"item"
separator=
","
>
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.id}, #{item.relationId}, #{two}, #{three}, #{four}, #{item.type}, #{item.projectId}, #{item.houseResourceUrl},
(#{item.id}, #{item.relationId}, #{two}, #{three}, #{four}, #{item.type}, #{item.projectId}, #{item.houseResourceUrl},
...
@@ -100,7 +106,7 @@
...
@@ -100,7 +106,7 @@
#{item.houseResourceUse}, #{item.houseResourceEquity}, #{item.houseResourceEquityTel}, #{ownership}, #{item.decorationCondition},
#{item.houseResourceUse}, #{item.houseResourceEquity}, #{item.houseResourceEquityTel}, #{ownership}, #{item.decorationCondition},
#{item.orientation}, #{item.landingHeadFlag}, #{item.commonAreaNumber}, #{item.officeNumber},
#{item.orientation}, #{item.landingHeadFlag}, #{item.commonAreaNumber}, #{item.officeNumber},
#{item.meetingNumber}, #{item.stationNumber}, #{item.setUp}, #{item.labelId}, #{item.unitPrice}, #{item.rentalUnit},
#{item.meetingNumber}, #{item.stationNumber}, #{item.setUp}, #{item.labelId}, #{item.unitPrice}, #{item.rentalUnit},
#{item.planeGraphUrl}, #{item.hireStatus})
#{item.planeGraphUrl}, #{item.hireStatus}
, #{item.address}, #{item.log}, #{item.lat}
)
</foreach>
</foreach>
</insert>
</insert>
...
...
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