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 ab541bd9
authored
Jun 08, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
DAO修订
1 parent
c3f78348
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
5 deletions
project-order/src/main/java/com/alibaba/cloud/integration/order/dao/EngineerInfoDao.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dao/OrgTeamEngineerDao.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dao/ProductCategoryDao.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/OrganizationServiceImpl.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dao/EngineerInfoDao.java
View file @
ab541bd
...
@@ -6,6 +6,6 @@ import org.springframework.data.jpa.repository.JpaRepository;
...
@@ -6,6 +6,6 @@ import org.springframework.data.jpa.repository.JpaRepository;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
@Repository
@Repository
public
interface
EngineerInfoDao
extends
JpaRepository
{
public
interface
EngineerInfoDao
extends
JpaRepository
<
EngineerInfoEntity
,
Integer
>
{
EngineerInfoEntity
getByEngineerCode
(
String
engineerCode
);
EngineerInfoEntity
getByEngineerCode
(
String
engineerCode
);
}
}
project-order/src/main/java/com/alibaba/cloud/integration/order/dao/OrgTeamEngineerDao.java
View file @
ab541bd
...
@@ -2,14 +2,16 @@ package com.alibaba.cloud.integration.order.dao;
...
@@ -2,14 +2,16 @@ package com.alibaba.cloud.integration.order.dao;
import
com.alibaba.cloud.integration.order.entity.OrgTeamEngineerEntity
;
import
com.alibaba.cloud.integration.order.entity.OrgTeamEngineerEntity
;
import
org.hibernate.annotations.Where
;
import
org.hibernate.annotations.Where
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
import
java.util.Collection
;
import
java.util.List
;
import
java.util.List
;
@Repository
@Repository
@Where
(
clause
=
"status = 1"
)
@Where
(
clause
=
"status = 1"
)
public
interface
OrgTeamEngineerDao
{
public
interface
OrgTeamEngineerDao
extends
JpaRepository
<
OrgTeamEngineerEntity
,
Integer
>
{
List
<
OrgTeamEngineerEntity
>
findAllByTeam
idIn
(
String
[]
teamIds
);
List
<
OrgTeamEngineerEntity
>
findAllByTeam
IdIn
(
Collection
<
String
>
teamIds
);
}
}
project-order/src/main/java/com/alibaba/cloud/integration/order/dao/ProductCategoryDao.java
View file @
ab541bd
...
@@ -3,7 +3,9 @@ package com.alibaba.cloud.integration.order.dao;
...
@@ -3,7 +3,9 @@ package com.alibaba.cloud.integration.order.dao;
import
com.alibaba.cloud.integration.order.entity.ProductCategoryEntity
;
import
com.alibaba.cloud.integration.order.entity.ProductCategoryEntity
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.data.jpa.repository.Query
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
ProductCategoryDao
extends
JpaRepository
<
ProductCategoryEntity
,
Long
>
{
public
interface
ProductCategoryDao
extends
JpaRepository
<
ProductCategoryEntity
,
Long
>
{
ProductCategoryEntity
getProductCategoryEntityByBrandAndTypeAndSkill
(
String
brand
,
String
type
,
String
skill
);
ProductCategoryEntity
getProductCategoryEntityByBrandAndTypeAndSkill
(
String
brand
,
String
type
,
String
skill
);
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/OrganizationServiceImpl.java
View file @
ab541bd
...
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
...
@@ -76,10 +77,10 @@ public class OrganizationServiceImpl implements OrganizationService {
...
@@ -76,10 +77,10 @@ public class OrganizationServiceImpl implements OrganizationService {
@Override
@Override
public
Result
<?>
getEngineersByTeams
(
String
[]
teamIds
)
{
public
Result
<?>
getEngineersByTeams
(
String
[]
teamIds
)
{
List
<
OrganizationEngineersRespDTO
.
Engineer
>
engineers
=
new
ArrayList
<>();
List
<
OrganizationEngineersRespDTO
.
Engineer
>
engineers
=
new
ArrayList
<>();
for
(
OrgTeamEngineerEntity
e
:
orgTeamEngineerDao
.
findAllByTeam
idIn
(
teamIds
))
{
for
(
OrgTeamEngineerEntity
e
:
orgTeamEngineerDao
.
findAllByTeam
IdIn
(
Arrays
.
asList
(
teamIds
)
))
{
EngineerInfoEntity
engineerInfoEntity
=
engineerInfoDao
.
getByEngineerCode
(
e
.
getEngineerCode
());
EngineerInfoEntity
engineerInfoEntity
=
engineerInfoDao
.
getByEngineerCode
(
e
.
getEngineerCode
());
if
(
engineerInfoEntity
==
null
)
{
if
(
engineerInfoEntity
==
null
)
{
log
.
error
(
"技术员信息不存在!engineer_code
[%s]
"
,
e
.
getEngineerCode
());
log
.
error
(
"技术员信息不存在!engineer_code
: {}
"
,
e
.
getEngineerCode
());
continue
;
continue
;
}
}
engineers
.
add
(
new
OrganizationEngineersRespDTO
.
Engineer
(
e
.
getTeamId
(),
e
.
getEngineerCode
(),
engineerInfoEntity
.
getName
()));
engineers
.
add
(
new
OrganizationEngineersRespDTO
.
Engineer
(
e
.
getTeamId
(),
e
.
getEngineerCode
(),
engineerInfoEntity
.
getName
()));
...
...
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