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 cab5aecc
authored
Jun 12, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
发现原先使用RequestParam String[], 调用的时候出错,现在改成dto方式
1 parent
5ea68c29
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
5 deletions
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/OrganizationController.java
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/OrganizationEngineersReqDTO.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/OrganizationService.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/controller/OrganizationController.java
View file @
cab5aec
...
@@ -3,6 +3,7 @@ package com.alibaba.cloud.integration.order.controller;
...
@@ -3,6 +3,7 @@ package com.alibaba.cloud.integration.order.controller;
import
com.alibaba.cloud.integration.common.BusinessException
;
import
com.alibaba.cloud.integration.common.BusinessException
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.order.dto.LevelReqDTO
;
import
com.alibaba.cloud.integration.order.dto.LevelReqDTO
;
import
com.alibaba.cloud.integration.order.dto.OrganizationEngineersReqDTO
;
import
com.alibaba.cloud.integration.order.service.OrganizationService
;
import
com.alibaba.cloud.integration.order.service.OrganizationService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -42,10 +43,10 @@ public class OrganizationController {
...
@@ -42,10 +43,10 @@ public class OrganizationController {
}
}
@GetMapping
(
"/organization/engineer/list"
)
@GetMapping
(
"/organization/engineer/list"
)
public
Result
<?>
getTeamsEngineers
(
@RequestParam
String
[]
teamIds
)
{
public
Result
<?>
getTeamsEngineers
(
OrganizationEngineersReqDTO
reqDTO
)
{
Result
<?>
res
=
null
;
Result
<?>
res
=
null
;
try
{
try
{
res
=
organizationService
.
getEngineersByTeams
(
teamIds
);
res
=
organizationService
.
getEngineersByTeams
(
reqDTO
.
getTeamIds
()
);
}
catch
(
BusinessException
e
)
{
}
catch
(
BusinessException
e
)
{
return
Result
.
failed
(
e
.
getMessage
());
return
Result
.
failed
(
e
.
getMessage
());
}
}
...
...
project-order/src/main/java/com/alibaba/cloud/integration/order/dto/OrganizationEngineersReqDTO.java
0 → 100644
View file @
cab5aec
package
com
.
alibaba
.
cloud
.
integration
.
order
.
dto
;
import
lombok.experimental.Accessors
;
import
java.util.List
;
@lombok
.
Data
public
class
OrganizationEngineersReqDTO
{
private
List
<
String
>
teamIds
;
}
project-order/src/main/java/com/alibaba/cloud/integration/order/service/OrganizationService.java
View file @
cab5aec
...
@@ -2,10 +2,12 @@ package com.alibaba.cloud.integration.order.service;
...
@@ -2,10 +2,12 @@ package com.alibaba.cloud.integration.order.service;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.common.Result
;
import
java.util.List
;
public
interface
OrganizationService
{
public
interface
OrganizationService
{
Result
<?>
getOrganizationTree
(
String
levelType
,
String
levelId
);
Result
<?>
getOrganizationTree
(
String
levelType
,
String
levelId
);
Result
<?>
getEngineersByTeams
(
String
[]
teamIds
);
Result
<?>
getEngineersByTeams
(
List
<
String
>
teamIds
);
Result
<?>
getTeamsByLevel
(
String
levelType
,
String
levelValue
);
Result
<?>
getTeamsByLevel
(
String
levelType
,
String
levelValue
);
}
}
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/OrganizationServiceImpl.java
View file @
cab5aec
...
@@ -75,9 +75,9 @@ public class OrganizationServiceImpl implements OrganizationService {
...
@@ -75,9 +75,9 @@ public class OrganizationServiceImpl implements OrganizationService {
}
}
@Override
@Override
public
Result
<?>
getEngineersByTeams
(
String
[]
teamIds
)
{
public
Result
<?>
getEngineersByTeams
(
List
<
String
>
teamIds
)
{
List
<
OrganizationEngineersRespDTO
.
Engineer
>
engineers
=
new
ArrayList
<>();
List
<
OrganizationEngineersRespDTO
.
Engineer
>
engineers
=
new
ArrayList
<>();
for
(
OrgTeamEngineerEntity
e
:
orgTeamEngineerDao
.
findAllByTeamIdIn
(
Arrays
.
asList
(
teamIds
)
))
{
for
(
OrgTeamEngineerEntity
e
:
orgTeamEngineerDao
.
findAllByTeamIdIn
(
teamIds
))
{
EngineerInfoEntity
engineerInfoEntity
=
engineerInfoDao
.
getByEngineerCode
(
e
.
getEngineerCode
());
EngineerInfoEntity
engineerInfoEntity
=
engineerInfoDao
.
getByEngineerCode
(
e
.
getEngineerCode
());
if
(
engineerInfoEntity
==
null
)
{
if
(
engineerInfoEntity
==
null
)
{
log
.
error
(
"技术员信息不存在!engineer_code: {}"
,
e
.
getEngineerCode
());
log
.
error
(
"技术员信息不存在!engineer_code: {}"
,
e
.
getEngineerCode
());
...
@@ -90,6 +90,7 @@ public class OrganizationServiceImpl implements OrganizationService {
...
@@ -90,6 +90,7 @@ public class OrganizationServiceImpl implements OrganizationService {
@Override
@Override
public
Result
<?>
getTeamsByLevel
(
String
levelType
,
String
levelValue
)
{
public
Result
<?>
getTeamsByLevel
(
String
levelType
,
String
levelValue
)
{
log
.
debug
(
"getTeamsByLevel({}, {})"
,
levelType
,
levelValue
);
List
<
OrgTeamEntity
>
entities
;
List
<
OrgTeamEntity
>
entities
;
if
(
"cluster"
.
equals
(
levelType
))
{
if
(
"cluster"
.
equals
(
levelType
))
{
entities
=
orgTeamDao
.
findAllByClusterId
(
levelValue
);
entities
=
orgTeamDao
.
findAllByClusterId
(
levelValue
);
...
...
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