Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
黄嘉阳
/
iot-platform-server
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
f6bb0606
authored
Nov 10, 2023
by
huangjy
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
fix:平台端子女端列表编辑删除问题
parent
18e7380b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
7 deletions
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderChildrenInfoServiceImpl.java
server-service/src/main/java/com/makeit/service/platform/elder/impl/PlatElderChildrenInfoServiceImpl.java
View file @
f6bb0606
...
...
@@ -162,18 +162,39 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
//
// }
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
edit
(
PlatElderChildrenInfoDTOVO
dto
)
{
check
(
BeanDtoVoUtils
.
convert
(
dto
,
PlatElderChildrenInfoDTOVO
.
class
));
PlatElderChildrenInfo
db
=
getById
(
dto
.
getId
());
BeanUtils
.
copyProperties
(
dto
,
db
);
List
<
PlatElderChildrenInfo
>
platElderChildrenInfoList
=
list
(
new
QueryWrapper
<
PlatElderChildrenInfo
>().
lambda
()
.
eq
(
PlatElderChildrenInfo:
:
getOpenid
,
db
.
getOpenid
()));
List
<
String
>
idList
=
StreamUtil
.
map
(
platElderChildrenInfoList
,
BaseEntity:
:
getId
);
removeByIds
(
idList
);
CommonUserVO
commonUserVO
=
CommonUserUtil
.
getUser
();
db
.
setCreateBy
(
commonUserVO
.
getName
());
updateById
(
db
);
ArrayList
<
String
>
elderIdList
=
Lists
.
newArrayList
(
dto
.
getElderId
().
split
(
","
));
List
<
PlatElder
>
platElders
=
platElderService
.
listByIds
(
elderIdList
);
Map
<
String
,
PlatElder
>
platElderMap
=
StreamUtil
.
toMap
(
platElders
,
BaseEntity:
:
getId
);
for
(
String
elderId
:
elderIdList
)
{
PlatElderChildrenInfo
elderChildrenInfo
=
new
PlatElderChildrenInfo
();
BeanUtils
.
copyProperties
(
db
,
elderChildrenInfo
,
"id"
);
PlatElder
platElder
=
platElderMap
.
get
(
elderId
);
if
(
platElder
!=
null
)
{
elderChildrenInfo
.
setOrgId
(
platElder
.
getOrgId
());
elderChildrenInfo
.
setCityOrgId
(
platElder
.
getCityOrgId
());
elderChildrenInfo
.
setDistrictOrgId
(
platElder
.
getDistrictOrgId
());
elderChildrenInfo
.
setStreetOrgId
(
platElder
.
getStreetOrgId
());
elderChildrenInfo
.
setOrgPath
(
platElder
.
getOrgPath
());
}
elderChildrenInfo
.
setPhone
(
dto
.
getPhone
());
elderChildrenInfo
.
setName
(
dto
.
getName
());
elderChildrenInfo
.
setElderId
(
elderId
);
elderChildrenInfo
.
setCreateBy
(
commonUserVO
.
getName
());
save
(
elderChildrenInfo
);
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
...
@@ -204,10 +225,15 @@ public class PlatElderChildrenInfoServiceImpl extends ServiceImpl<PlatElderChild
}
@Transactional
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Override
public
void
del
(
String
id
)
{
removeById
(
id
);
PlatElderChildrenInfo
db
=
getById
(
id
);
List
<
PlatElderChildrenInfo
>
platElderChildrenInfoList
=
list
(
new
QueryWrapper
<
PlatElderChildrenInfo
>().
lambda
()
.
eq
(
PlatElderChildrenInfo:
:
getOpenid
,
db
.
getOpenid
()));
List
<
String
>
idList
=
StreamUtil
.
map
(
platElderChildrenInfoList
,
BaseEntity:
:
getId
);
removeByIds
(
idList
);
}
/*子女端小程序*/
...
...
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