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
40f3f409
Commit
40f3f409
authored
Mar 10, 2025
by
lixuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 房源
parent
ed8c4204
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
26 deletions
+29
-26
HouseResourceServiceImpl.java
...i/system/service/house/impl/HouseResourceServiceImpl.java
+29
-26
No files found.
ruoyi-system/src/main/java/com/ruoyi/system/service/house/impl/HouseResourceServiceImpl.java
View file @
40f3f409
...
...
@@ -86,6 +86,8 @@ public class HouseResourceServiceImpl implements HouseResourceService {
houseResourceAssociationObject
.
setBusinessId
(
id
);
houseResourceAssociationObject
.
setType
(
2
);
houseResourceAssociationObjectMapper
.
insertHouseResourceObjectAssociation
(
houseResourceAssociationObject
);
}
else
{
throw
new
RuntimeException
(
"新增shop出错"
);
}
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"新增shop出错"
);
...
...
@@ -127,8 +129,21 @@ public class HouseResourceServiceImpl implements HouseResourceService {
}
houseResourceMapper
.
updateHouseResource
(
dto
.
getHouseResource
());
List
<
HouseResourceAssociationObject
>
houseResourceAssociationObjects
=
houseResourceAssociationObjectMapper
.
selectHouseResourceObjectAssociationByHouseResourceIdType
(
dto
.
getHouseResource
().
getId
());
houseResourceAssociationObjectMapper
.
deleteByHouseResourceId
(
dto
.
getHouseResource
().
getId
());
houseResourceAssociationObjects
.
forEach
(
x
->
{
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
(
GridCompany
gridCompany
:
dto
.
getCompanyList
())
{
if
(!
StringUtils
.
hasText
(
gridCompany
.
getId
()))
{
AjaxResult
result
=
gridCompanyService
.
add
(
gridCompany
);
if
(
result
.
isSuccess
())
{
String
id
=
result
.
get
(
"data"
).
toString
();
...
...
@@ -139,19 +154,11 @@ public class HouseResourceServiceImpl implements HouseResourceService {
houseResourceAssociationObject
.
setType
(
1
);
houseResourceAssociationObjectMapper
.
insertHouseResourceObjectAssociation
(
houseResourceAssociationObject
);
}
}
else
{
gridCompanyService
.
edit
(
gridCompany
);
}
}
for
(
GridShop
gridShop
:
dto
.
getShopList
())
{
if
(
Objects
.
isNull
(
gridShop
.
getId
()))
{
AjaxResult
result
=
null
;
try
{
result
=
gridShopService
.
addGridShop
(
gridShop
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"新增shop出错"
);
}
AjaxResult
result
=
gridShopService
.
addGridShop
(
gridShop
);
if
(
result
.
isSuccess
())
{
String
id
=
result
.
get
(
"data"
).
toString
();
HouseResourceAssociationObject
houseResourceAssociationObject
=
new
HouseResourceAssociationObject
();
...
...
@@ -163,12 +170,8 @@ public class HouseResourceServiceImpl implements HouseResourceService {
}
else
{
return
result
;
}
}
else
{
try
{
gridShopService
.
updateGridShop
(
gridShop
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
"更新shop出错"
);
}
throw
new
RuntimeException
(
"新增shop出错"
);
}
}
return
AjaxResult
.
success
();
...
...
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