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 5d15fe0f
authored
Jun 09, 2023
by
丁伟峰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
改成直接传递dto
1 parent
ab541bd9
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
7 deletions
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/WorkbenchController.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/WorkbenchService.java
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/WorkbenchServiceImpl.java
project-order/src/main/java/com/alibaba/cloud/integration/order/controller/WorkbenchController.java
View file @
5d15fe0
...
@@ -22,7 +22,7 @@ public class WorkbenchController {
...
@@ -22,7 +22,7 @@ public class WorkbenchController {
public
Result
<?>
orderChangeList
(
@Validated
@RequestBody
WorkbenchOrderChangeListReqDTO
reqDTO
)
{
public
Result
<?>
orderChangeList
(
@Validated
@RequestBody
WorkbenchOrderChangeListReqDTO
reqDTO
)
{
Result
<?>
res
=
null
;
Result
<?>
res
=
null
;
try
{
try
{
res
=
workbenchService
.
getOrderChangeList
(
reqDTO
.
getLevelType
(),
reqDTO
.
getLevelValue
(),
reqDTO
.
getPage
(),
reqDTO
.
getSize
()
);
res
=
workbenchService
.
getOrderChangeList
(
reqDTO
);
}
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/service/WorkbenchService.java
View file @
5d15fe0
package
com
.
alibaba
.
cloud
.
integration
.
order
.
service
;
package
com
.
alibaba
.
cloud
.
integration
.
order
.
service
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListReqDTO
;
public
interface
WorkbenchService
{
public
interface
WorkbenchService
{
Result
<?>
getOrderChangeList
(
String
levelType
,
String
levelId
,
int
page
,
int
pageSize
);
Result
<?>
getOrderChangeList
(
WorkbenchOrderChangeListReqDTO
orderChangeListReqDTO
);
}
}
project-order/src/main/java/com/alibaba/cloud/integration/order/service/impl/WorkbenchServiceImpl.java
View file @
5d15fe0
...
@@ -3,6 +3,7 @@ package com.alibaba.cloud.integration.order.service.impl;
...
@@ -3,6 +3,7 @@ package com.alibaba.cloud.integration.order.service.impl;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.common.Result
;
import
com.alibaba.cloud.integration.order.dao.OrderChangeDao
;
import
com.alibaba.cloud.integration.order.dao.OrderChangeDao
;
import
com.alibaba.cloud.integration.order.dao.OrderRequestDao
;
import
com.alibaba.cloud.integration.order.dao.OrderRequestDao
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListReqDTO
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListRespDTO
;
import
com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListRespDTO
;
import
com.alibaba.cloud.integration.order.entity.OrderChangeEntity
;
import
com.alibaba.cloud.integration.order.entity.OrderChangeEntity
;
import
com.alibaba.cloud.integration.order.entity.OrderRequestEntity
;
import
com.alibaba.cloud.integration.order.entity.OrderRequestEntity
;
...
@@ -28,15 +29,17 @@ public class WorkbenchServiceImpl implements WorkbenchService {
...
@@ -28,15 +29,17 @@ public class WorkbenchServiceImpl implements WorkbenchService {
private
OrderRequestDao
orderRequestDao
;
private
OrderRequestDao
orderRequestDao
;
@Override
@Override
public
Result
<?>
getOrderChangeList
(
String
levelType
,
String
levelId
,
int
page
,
int
pageSize
)
{
public
Result
<?>
getOrderChangeList
(
WorkbenchOrderChangeListReqDTO
orderChangeListReqDTO
)
{
Pageable
pageable
=
PageRequest
.
of
(
page
-
1
,
pageSize
);
Pageable
pageable
=
PageRequest
.
of
(
orderChangeListReqDTO
.
getPage
()
-
1
,
orderChangeListReqDTO
.
getSize
()
);
Page
<?>
changes
;
Page
<?>
changes
;
String
levelType
=
orderChangeListReqDTO
.
getLevelType
();
String
levelValue
=
orderChangeListReqDTO
.
getLevelValue
();
if
(
"cluster"
.
equals
(
levelType
))
{
if
(
"cluster"
.
equals
(
levelType
))
{
changes
=
orderChangeDao
.
findAllByClusterId
(
pageable
,
levelId
);
changes
=
orderChangeDao
.
findAllByClusterId
(
levelValue
,
pageable
);
}
else
if
(
"branch"
.
equals
(
levelType
))
{
}
else
if
(
"branch"
.
equals
(
levelType
))
{
changes
=
orderChangeDao
.
findAllByBranchId
(
pageable
,
levelId
);
changes
=
orderChangeDao
.
findAllByBranchId
(
levelValue
,
pageable
);
}
else
{
}
else
{
changes
=
orderChangeDao
.
findAllByGroupId
(
pageable
,
levelId
);
changes
=
orderChangeDao
.
findAllByGroupId
(
levelValue
,
pageable
);
}
}
List
<
WorkbenchOrderChangeListRespDTO
.
Content
>
contents
=
new
ArrayList
<>();
List
<
WorkbenchOrderChangeListRespDTO
.
Content
>
contents
=
new
ArrayList
<>();
for
(
Object
e1
:
changes
.
getContent
())
{
for
(
Object
e1
:
changes
.
getContent
())
{
...
...
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