Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
bailuntec-cost
Overview
Overview
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
huluobin
bailuntec-cost
Commits
8acd20e4
Commit
8acd20e4
authored
Aug 27, 2021
by
liyanlin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加分页
parent
12f83ea0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
24 additions
and
22 deletions
+24
-22
ApprovalHistoryController.java
...her/module/cost/controller/ApprovalHistoryController.java
+4
-11
ApprovalHistoryMapper.java
.../com/blt/other/module/cost/dao/ApprovalHistoryMapper.java
+3
-1
ApprovalHistoryReq.java
...blt/other/module/cost/dto/request/ApprovalHistoryReq.java
+3
-1
ApprovalHistoryService.java
...blt/other/module/cost/service/ApprovalHistoryService.java
+3
-1
ApprovalHistoryServiceImpl.java
.../module/cost/service/impl/ApprovalHistoryServiceImpl.java
+5
-2
ApprovalHistoryMapper.xml
...rvice/src/main/resources/mapper/ApprovalHistoryMapper.xml
+6
-6
No files found.
cost-service/src/main/java/com/blt/other/module/cost/controller/ApprovalHistoryController.java
View file @
8acd20e4
package
com
.
blt
.
other
.
module
.
cost
.
controller
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.blt.other.module.cost.dto.request.ApprovalHistoryReq
;
import
com.blt.other.module.cost.dto.response.ApprovalHistoryResult
;
import
com.blt.other.module.cost.service.ApprovalHistoryService
;
...
...
@@ -29,16 +31,7 @@ public class ApprovalHistoryController {
@ApiOperation
(
"获取审批历史列表"
)
@GetMapping
public
ApprovalHistoryResult
get
(
ApprovalHistoryReq
req
)
{
ApprovalHistoryResult
result
=
new
ApprovalHistoryResult
();
try
{
List
<
ApprovalHistoryVo
>
list
=
approvalHistoryService
.
getApprovalHistoryList
(
req
);
result
.
setSuccess
(
true
);
result
.
setList
(
list
);
}
catch
(
Exception
ex
)
{
result
.
setSuccess
(
false
);
result
.
setMsg
(
ex
.
getMessage
());
}
return
result
;
public
Page
<
ApprovalHistoryVo
>
get
(
ApprovalHistoryReq
req
)
{
return
approvalHistoryService
.
getApprovalHistoryList
(
req
);
}
}
cost-service/src/main/java/com/blt/other/module/cost/dao/ApprovalHistoryMapper.java
View file @
8acd20e4
package
com
.
blt
.
other
.
module
.
cost
.
dao
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.blt.other.module.cost.dto.request.ApprovalHistoryReq
;
import
com.blt.other.module.cost.model.ApprovalHistoryDomain
;
import
com.blt.other.module.cost.vo.ApprovalHistoryVo
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -15,5 +17,5 @@ import java.util.List;
*/
public
interface
ApprovalHistoryMapper
extends
BaseMapper
<
ApprovalHistoryDomain
>
{
List
<
ApprovalHistoryVo
>
getApprovalHistoryList
(
ApprovalHistoryReq
req
);
IPage
<
ApprovalHistoryVo
>
getApprovalHistoryList
(
@Param
(
"page"
)
IPage
<
ApprovalHistoryVo
>
page
,
@Param
(
"req"
)
ApprovalHistoryReq
req
);
}
cost-service/src/main/java/com/blt/other/module/cost/dto/request/ApprovalHistoryReq.java
View file @
8acd20e4
package
com
.
blt
.
other
.
module
.
cost
.
dto
.
request
;
import
com.bailuntec.common.base.BaseRequest
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.checkerframework.common.value.qual.IntRange
;
import
org.springframework.format.annotation.DateTimeFormat
;
import
java.time.LocalDateTime
;
...
...
@@ -16,7 +18,7 @@ import java.time.LocalDateTime;
*/
@Data
@ApiModel
(
"审批请求Model"
)
public
class
ApprovalHistoryReq
{
public
class
ApprovalHistoryReq
extends
BaseRequest
{
@ApiModelProperty
(
value
=
"审批时间-起始时间"
,
required
=
true
,
example
=
"2021-08-25 00:00:00"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
...
...
cost-service/src/main/java/com/blt/other/module/cost/service/ApprovalHistoryService.java
View file @
8acd20e4
package
com
.
blt
.
other
.
module
.
cost
.
service
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.blt.other.module.cost.dao.ApprovalHistoryMapper
;
import
com.blt.other.module.cost.dto.request.ApprovalHistoryReq
;
...
...
@@ -21,5 +23,5 @@ public interface ApprovalHistoryService extends IService<ApprovalHistoryDomain>
* @param req
* @return
*/
List
<
ApprovalHistoryVo
>
getApprovalHistoryList
(
ApprovalHistoryReq
req
);
Page
<
ApprovalHistoryVo
>
getApprovalHistoryList
(
ApprovalHistoryReq
req
);
}
cost-service/src/main/java/com/blt/other/module/cost/service/impl/ApprovalHistoryServiceImpl.java
View file @
8acd20e4
package
com
.
blt
.
other
.
module
.
cost
.
service
.
impl
;
import
com.bailuntec.common.exception.BizException
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.blt.other.module.cost.dao.ApprovalHistoryMapper
;
import
com.blt.other.module.cost.dto.request.ApprovalHistoryReq
;
...
...
@@ -25,13 +27,14 @@ public class ApprovalHistoryServiceImpl extends ServiceImpl<ApprovalHistoryMappe
ApprovalHistoryMapper
approvalHistoryMapper
;
@Override
public
List
<
ApprovalHistoryVo
>
getApprovalHistoryList
(
ApprovalHistoryReq
req
)
{
public
Page
<
ApprovalHistoryVo
>
getApprovalHistoryList
(
ApprovalHistoryReq
req
)
{
IPage
<
ApprovalHistoryVo
>
page
=
new
Page
<>(
req
.
getPageNum
(),
req
.
getPageSize
());
if
(
req
.
getStartTime
()
==
null
||
req
.
getEndTime
()
==
null
){
throw
new
BizException
(
"查询时间不可为空"
);
}
if
(
req
.
getStartTime
().
isAfter
(
req
.
getEndTime
())){
throw
new
BizException
(
"查询起始时间不可大于查询结束时间"
);
}
return
approvalHistoryMapper
.
getApprovalHistoryList
(
req
);
return
(
Page
<
ApprovalHistoryVo
>)
approvalHistoryMapper
.
getApprovalHistoryList
(
page
,
req
);
}
}
cost-service/src/main/resources/mapper/ApprovalHistoryMapper.xml
View file @
8acd20e4
...
...
@@ -3,7 +3,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper
namespace=
"com.blt.other.module.cost.dao.ApprovalHistoryMapper"
>
<select
id=
"getApprovalHistoryList"
parameterType=
"com.blt.other.module.cost.dto.request.ApprovalHistoryReq"
<select
id=
"getApprovalHistoryList"
resultType=
"com.blt.other.module.cost.vo.ApprovalHistoryVo"
>
select ah.id, ah.cost_no as costNo ,c.cost_form as costFrom,c.is_lend as isLend, s2.statusvalue as costStatus
,ah.is_passed as isPassed ,ah.approval_time as approvalTime ,c.type_name as typeName,u.username
...
...
@@ -11,10 +11,10 @@
left join cost c on c.cost_no = ah.cost_no
left join `user` u on u.userid = ah.approval_user_id
left join status s2 on s2.statusname = 'cost_status' and s2.statuskey = ah.cost_status
where ah.approval_time between #{
startTime} and #{
endTime}
<if
test=
"costStatus != null"
>
and ah.cost_status = #{costStatus}
</if>
<if
test=
"
typeNo != null and typeNo != ''"
>
and c.type_no = #{
typeNo}
</if>
<if
test=
"
userId != null and userId != ''"
>
and ah.approval_user_id = #{
userId}
</if>
<if
test=
"
costNo != null and costNo != ''"
>
and ah.cost_no like concat('%',#{
costNo},'%')
</if>
where ah.approval_time between #{
req.startTime} and #{req.
endTime}
<if
test=
"
req.
costStatus != null"
>
and ah.cost_status = #{costStatus}
</if>
<if
test=
"
req.typeNo != null and req.typeNo != ''"
>
and c.type_no = #{req.
typeNo}
</if>
<if
test=
"
req.userId != null and req.userId != ''"
>
and ah.approval_user_id = #{req.
userId}
</if>
<if
test=
"
req.costNo != null and req.costNo != ''"
>
and ah.cost_no like concat('%',#{req.
costNo},'%')
</if>
</select>
</mapper>
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