Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
yangxiujun
/
paidan_demo
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 a487f6fc
authored
Aug 11, 2023
by
chamberone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修复小队接口报错
1 parent
5bf96c89
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
5 deletions
project-order/src/main/java/com/dituhui/pea/order/dao/OrgTeamEngineerDao.java
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessTeamServiceImpl.java
project-order/src/main/java/com/dituhui/pea/order/dao/OrgTeamEngineerDao.java
View file @
a487f6f
...
...
@@ -16,6 +16,9 @@ public interface OrgTeamEngineerDao extends JpaRepository<OrgTeamEngineerEntity,
@Query
(
"select t from OrgTeamEngineerEntity t where t.teamId = :teamId and t.status=1"
)
List
<
OrgTeamEngineerEntity
>
findAllByTeamId
(
String
teamId
);
@Query
(
"select t from OrgTeamEngineerEntity t where t.teamId = :teamId and t.engineerCode=:engineerCode"
)
OrgTeamEngineerEntity
findByTeamIdAndEngineerCode
(
String
teamId
,
String
engineerCode
);
@Query
(
"select t from OrgTeamEngineerEntity t where t.teamId in :teamIds and t.status=1"
)
List
<
OrgTeamEngineerEntity
>
findAllByTeamIdIn
(
List
<
String
>
teamIds
);
...
...
project-order/src/main/java/com/dituhui/pea/order/service/impl/BusinessTeamServiceImpl.java
View file @
a487f6f
...
...
@@ -215,11 +215,19 @@ public class BusinessTeamServiceImpl implements BusinessTeamService {
}
// 遍历新的关系映射,创建新的关系
for
(
OrgTeamEngineerEntity
newRelation
:
newRelationsMap
.
values
())
{
if
(!
existingRelations
.
contains
(
newRelation
))
{
orgTeamEngineerDao
.
save
(
newRelation
);
}
}
for
(
OrgTeamEngineerEntity
newRelation
:
newRelationsMap
.
values
())
{
if
(!
existingRelations
.
contains
(
newRelation
))
{
// 检查是否存在,已经存在的,只需要set status=1就可以了
OrgTeamEngineerEntity
exist
=
orgTeamEngineerDao
.
findByTeamIdAndEngineerCode
(
newRelation
.
getTeamId
(),
newRelation
.
getEngineerCode
());
if
(
null
!=
exist
&&
exist
.
getId
()
!=
null
)
{
exist
.
setStatus
(
1
);
orgTeamEngineerDao
.
save
(
exist
);
}
else
{
orgTeamEngineerDao
.
save
(
newRelation
);
}
}
}
}
@Override
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment