Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pension
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mengmeng
pension
Commits
226604c9
Commit
226604c9
authored
Mar 11, 2021
by
mlchun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.部分接口分页处理
parent
f589bb98
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
9 deletions
+26
-9
PensionOrderController.java
...dules/serviceOrder/controller/PensionOrderController.java
+0
-1
PensionOrderServiceImpl.java
...es/serviceOrder/service/impl/PensionOrderServiceImpl.java
+26
-8
No files found.
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionOrderController.java
View file @
226604c9
package
io
.
hmit
.
modules
.
serviceOrder
.
controller
;
package
io
.
hmit
.
modules
.
serviceOrder
.
controller
;
import
com.sun.xml.internal.bind.v2.TODO
;
import
io.hmit.annotation.Login
;
import
io.hmit.annotation.Login
;
import
io.hmit.annotation.LoginUser
;
import
io.hmit.annotation.LoginUser
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.constant.Constant
;
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionOrderServiceImpl.java
View file @
226604c9
...
@@ -6,12 +6,10 @@ import io.hmit.common.constant.Constant;
...
@@ -6,12 +6,10 @@ import io.hmit.common.constant.Constant;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.dao.UserDao
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.dao.PensionOrderDao
;
import
io.hmit.modules.serviceOrder.dao.PensionOrderDao
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderServiceDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderServiceDTO
;
import
io.hmit.modules.serviceOrder.dto.ReservationDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionOrderEntity
;
import
io.hmit.modules.serviceOrder.entity.PensionOrderEntity
;
import
io.hmit.modules.serviceOrder.service.PensionOrderService
;
import
io.hmit.modules.serviceOrder.service.PensionOrderService
;
import
io.hmit.modules.serviceOrder.service.PensionOrderServiceService
;
import
io.hmit.modules.serviceOrder.service.PensionOrderServiceService
;
...
@@ -113,7 +111,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
...
@@ -113,7 +111,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
@Override
@Override
public
PageData
<
PensionOrderDTO
>
getElderAllOrderOrByStatusPage
(
Map
<
String
,
Object
>
params
,
Long
creator
,
Integer
status
)
{
public
PageData
<
PensionOrderDTO
>
getElderAllOrderOrByStatusPage
(
Map
<
String
,
Object
>
params
,
Long
creator
,
Integer
status
)
{
IPage
<
PensionOrderEntity
>
page
=
getPage
(
params
,
Constant
.
CREATE_DATE
,
false
);
//
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
List
<
PensionOrderDTO
>
list
=
new
ArrayList
<>();
List
<
PensionOrderDTO
>
list
=
new
ArrayList
<>();
if
(
null
==
status
)
{
if
(
null
==
status
)
{
list
=
pensionOrderDao
.
getElderAllOrderOrByStatusList
(
params
,
creator
,
status
);
list
=
pensionOrderDao
.
getElderAllOrderOrByStatusList
(
params
,
creator
,
status
);
...
@@ -125,8 +123,8 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
...
@@ -125,8 +123,8 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
list
.
addAll
(
list1
);
list
.
addAll
(
list1
);
list
.
addAll
(
list2
);
list
.
addAll
(
list2
);
}
}
page
.
setTotal
(
list
.
size
());
//
page.setTotal(list.size());
return
getPageData
(
list
,
page
.
getTotal
(),
PensionOrderDTO
.
class
);
return
getPageData
(
getSubList
(
params
,
list
),
list
.
size
(),
PensionOrderDTO
.
class
);
}
}
@Override
@Override
...
@@ -146,7 +144,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
...
@@ -146,7 +144,7 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
@Override
@Override
public
PageData
<
PensionOrderDTO
>
getOrganizationOrder
(
Map
<
String
,
Object
>
params
,
Long
userId
)
{
public
PageData
<
PensionOrderDTO
>
getOrganizationOrder
(
Map
<
String
,
Object
>
params
,
Long
userId
)
{
//登录->查询登录人员所属机构ID->机构ID查询服务ID(List)->服务ID + 状态查询订单(List)
//登录->查询登录人员所属机构ID->机构ID查询服务ID(List)->服务ID + 状态查询订单(List)
IPage
<
PensionOrderEntity
>
page
=
getPage
(
params
,
Constant
.
CREATE_DATE
,
false
);
//
IPage<PensionOrderEntity> page = getPage(params, Constant.CREATE_DATE, false);
List
<
Long
>
serviceIds
=
pensionOrganizationService
.
findServiceIdListByServiceUserId
(
userId
);
List
<
Long
>
serviceIds
=
pensionOrganizationService
.
findServiceIdListByServiceUserId
(
userId
);
Integer
status
=
null
;
Integer
status
=
null
;
if
(
null
!=
params
.
get
(
"status"
))
{
if
(
null
!=
params
.
get
(
"status"
))
{
...
@@ -157,8 +155,9 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
...
@@ -157,8 +155,9 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
List
<
PensionOrderDTO
>
list
=
pensionOrderDao
.
getAllOrderByServiceId
(
id
,
status
);
List
<
PensionOrderDTO
>
list
=
pensionOrderDao
.
getAllOrderByServiceId
(
id
,
status
);
result
.
addAll
(
list
);
result
.
addAll
(
list
);
}
}
page
.
setTotal
(
result
.
size
());
// page.setTotal(result.size());
return
getPageData
(
result
,
page
.
getTotal
(),
PensionOrderDTO
.
class
);
return
getPageData
(
getSubList
(
params
,
result
),
result
.
size
(),
PensionOrderDTO
.
class
);
}
}
@Override
@Override
...
@@ -201,4 +200,23 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
...
@@ -201,4 +200,23 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return
true
;
return
true
;
}
}
//对List进行手动分页
private
List
<
PensionOrderDTO
>
getSubList
(
Map
<
String
,
Object
>
params
,
List
<
PensionOrderDTO
>
list
){
Integer
pageNum
=
Integer
.
parseInt
(
params
.
get
(
"page"
).
toString
());
Integer
pageSize
=
Integer
.
parseInt
(
params
.
get
(
"limit"
).
toString
());
Integer
count
=
list
.
size
();
Integer
pageNo
=
(
pageNum
-
1
)
*
pageSize
;
List
<
PensionOrderDTO
>
list2
;
if
(
pageNo
+
pageSize
>
count
)
{
if
(
pageNo
>
count
){
list2
=
null
;
}
else
{
list2
=
list
.
subList
(
pageNo
,
count
);
}
}
else
{
list2
=
list
.
subList
(
pageNo
,
pageNo
+
pageSize
);
}
return
list2
;
}
}
}
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