Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
peizhen-java
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PeiZhen-Java
peizhen-java
Commits
daf489b7
Commit
daf489b7
authored
Sep 26, 2023
by
邹磊浩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改代码
parent
cbf8a54b
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
13 deletions
+28
-13
pz-system/src/main/java/com/pz/system/service/impl/BusinessServiceImpl.java
+11
-11
pz-system/src/main/java/com/pz/system/service/impl/ServicesServiceImpl.java
+17
-2
No files found.
pz-system/src/main/java/com/pz/system/service/impl/BusinessServiceImpl.java
View file @
daf489b7
...
...
@@ -84,17 +84,17 @@ public class BusinessServiceImpl implements IBusinessService {
.
collect
(
Collectors
.
toList
()));
}
}
// 获取关联服务
List
<
ServicesVo
>
servicesVos
=
servicesMapper
.
selectVoList
(
Wrappers
.<
Services
>
lambdaQuery
()
.
eq
(
Services:
:
getBid
,
businessVo
.
getId
()));
for
(
ServicesVo
servicesVo
:
servicesVos
)
{
CityVo
cityVo
=
cityMapper
.
selectVoById
(
servicesVo
.
getCityId
());
if
(
cityVo
!=
null
)
{
servicesVo
.
setCityName
(
cityVo
.
getName
());
}
}
businessVo
.
setServicesVoList
(
servicesVos
);
//
//
// 获取关联服务
//
List<ServicesVo> servicesVos = servicesMapper.selectVoList(Wrappers.<Services>lambdaQuery()
//
.eq(Services::getBid, businessVo.getId()));
//
for (ServicesVo servicesVo : servicesVos) {
//
CityVo cityVo = cityMapper.selectVoById(servicesVo.getCityId());
//
if (cityVo != null) {
//
servicesVo.setCityName(cityVo.getName());
//
}
//
}
//
businessVo.setServicesVoList(servicesVos);
}
}
return
TableDataInfo
.
build
(
result
);
...
...
pz-system/src/main/java/com/pz/system/service/impl/ServicesServiceImpl.java
View file @
daf489b7
...
...
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.pz.system.domain.Notice
;
import
com.pz.system.domain.vo.CityVo
;
import
com.pz.system.mapper.CityMapper
;
import
com.pz.system.mapper.NoticeMapper
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
...
...
@@ -36,6 +38,8 @@ public class ServicesServiceImpl implements IServicesService {
private
final
NoticeMapper
noticeMapper
;
private
final
CityMapper
cityMapper
;
/**
* 查询服务
*/
...
...
@@ -55,6 +59,17 @@ public class ServicesServiceImpl implements IServicesService {
noticeMapper.selectList(new LambdaQueryWrapper<Notice>().eq(Notice::getSite, 2))
.stream().findFirst().ifPresent(notices -> service.setNotice(notices.getInfo()));
});*/
Optional
.
ofNullable
(
result
.
getRecords
()).
ifPresent
(
servicesVos
->
{
for
(
ServicesVo
servicesVo
:
servicesVos
)
{
CityVo
cityVo
=
cityMapper
.
selectVoById
(
servicesVo
.
getCityId
());
if
(
cityVo
!=
null
)
{
servicesVo
.
setCityName
(
cityVo
.
getName
());
}
}
}
);
return
TableDataInfo
.
build
(
result
);
}
...
...
@@ -110,7 +125,7 @@ public class ServicesServiceImpl implements IServicesService {
/**
* 保存前的数据校验
*/
private
void
validEntityBeforeSave
(
Services
entity
){
private
void
validEntityBeforeSave
(
Services
entity
)
{
//TODO 做一些数据校验,如唯一约束
}
...
...
@@ -119,7 +134,7 @@ public class ServicesServiceImpl implements IServicesService {
*/
@Override
public
Boolean
deleteWithValidByIds
(
Collection
<
Integer
>
ids
,
Boolean
isValid
)
{
if
(
isValid
)
{
if
(
isValid
)
{
//TODO 做一些业务上的校验,判断是否需要校验
}
return
baseMapper
.
deleteBatchIds
(
ids
)
>
0
;
...
...
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