Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Y
yifu-mvp
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
fangxinjiang
yifu-mvp
Commits
7a9c6c73
Commit
7a9c6c73
authored
Jun 28, 2022
by
fangxinjiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码优化
parent
806eaa2f
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
6 deletions
+84
-6
CertRecordSearchVo.java
...fu/cloud/plus/v1/yifu/archives/vo/CertRecordSearchVo.java
+24
-0
TCertRecordController.java
...us/v1/yifu/archives/controller/TCertRecordController.java
+7
-6
TCertRecordService.java
...oud/plus/v1/yifu/archives/service/TCertRecordService.java
+9
-0
TCertRecordServiceImpl.java
...v1/yifu/archives/service/impl/TCertRecordServiceImpl.java
+44
-0
No files found.
yifu-archives/yifu-archives-api/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/vo/CertRecordSearchVo.java
0 → 100644
View file @
7a9c6c73
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
vo
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord
;
import
io.swagger.v3.oas.annotations.media.Schema
;
import
lombok.Data
;
import
java.time.LocalDateTime
;
/**
* @Author fxj
* @Date 2022/6/28
* @Description
* @Version 1.0
*/
@Data
public
class
CertRecordSearchVo
extends
TCertRecord
{
private
String
ids
;
/**
* 创建时间区间 [开始时间,结束时间]
*/
@Schema
(
description
=
"创建时间区间"
)
private
LocalDateTime
[]
createTimes
;
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/controller/TCertRecordController.java
View file @
7a9c6c73
...
...
@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TCertRecordService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.CertRecordSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TCertRecordVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog
;
...
...
@@ -54,25 +55,25 @@ public class TCertRecordController {
/**
* 分页查询
* @param page 分页对象
* @param
tCertRecord
证明开具记录表
* @param
searchVo
证明开具记录表
* @return
*/
@Operation
(
summary
=
"分页查询"
,
description
=
"分页查询"
)
@GetMapping
(
"/page"
)
//@PreAuthorize("@pms.hasPermission('demo_tcertrecord_get')" )
public
R
<
IPage
<
TCertRecord
>>
getTCertRecordPage
(
Page
page
,
TCertRecord
tCertRecord
)
{
return
R
.
ok
(
tCertRecordService
.
page
(
page
,
Wrappers
.
query
(
tCertRecord
)
));
public
R
<
IPage
<
TCertRecord
>>
getTCertRecordPage
(
Page
page
,
CertRecordSearchVo
searchVo
)
{
return
R
.
ok
(
tCertRecordService
.
page
Diy
(
page
,
searchVo
));
}
/**
* 不分页查询
* @param
tCertRecord
证明开具记录表
* @param
searchVo
证明开具记录表
* @return
*/
@Operation
(
summary
=
"不分页查询"
,
description
=
"不分页查询"
)
@GetMapping
(
"/noPage"
)
//@PreAuthorize("@pms.hasPermission('demo_tcertrecord_get')" )
public
R
<
List
<
TCertRecord
>>
getTCertRecordNoPage
(
TCertRecord
tCertRecord
)
{
return
R
.
ok
(
tCertRecordService
.
list
(
Wrappers
.
query
(
tCertRecord
)
));
public
R
<
List
<
TCertRecord
>>
getTCertRecordNoPage
(
CertRecordSearchVo
searchVo
)
{
return
R
.
ok
(
tCertRecordService
.
getTCertRecordNoPage
(
searchVo
));
}
/**
...
...
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/TCertRecordService.java
View file @
7a9c6c73
...
...
@@ -17,11 +17,16 @@
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
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.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.CertRecordSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TCertRecordVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
java.util.List
;
/**
* 证明开具记录表
*
...
...
@@ -31,4 +36,8 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
public
interface
TCertRecordService
extends
IService
<
TCertRecord
>
{
R
<
TCertRecordVo
>
getCertRecordInfo
(
String
id
);
IPage
<
List
<
TCertRecord
>>
pageDiy
(
Page
page
,
CertRecordSearchVo
searchVo
);
List
<
TCertRecord
>
getTCertRecordNoPage
(
CertRecordSearchVo
searchVo
);
}
yifu-archives/yifu-archives-biz/src/main/java/com/yifu/cloud/plus/v1/yifu/archives/service/impl/TCertRecordServiceImpl.java
View file @
7a9c6c73
...
...
@@ -16,6 +16,11 @@
*/
package
com
.
yifu
.
cloud
.
plus
.
v1
.
yifu
.
archives
.
service
.
impl
;
import
cn.hutool.core.util.ArrayUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TCertRecord
;
import
com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeInfo
;
...
...
@@ -24,13 +29,17 @@ import com.yifu.cloud.plus.v1.yifu.archives.mapper.TCertRecordMapper;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeInfoMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeProjectMapper
;
import
com.yifu.cloud.plus.v1.yifu.archives.service.TCertRecordService
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.CertRecordSearchVo
;
import
com.yifu.cloud.plus.v1.yifu.archives.vo.TCertRecordVo
;
import
com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.Common
;
import
com.yifu.cloud.plus.v1.yifu.common.core.util.R
;
import
com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
/**
* 证明开具记录表
*
...
...
@@ -79,4 +88,39 @@ public class TCertRecordServiceImpl extends ServiceImpl<TCertRecordMapper, TCert
vo
.
setSocialTime
(
null
);
return
R
.
ok
(
vo
);
}
@Override
public
IPage
<
List
<
TCertRecord
>>
pageDiy
(
Page
page
,
CertRecordSearchVo
searchVo
)
{
LambdaQueryWrapper
<
TCertRecord
>
wrapper
=
buildQueryWrapper
(
searchVo
);
wrapper
.
orderByDesc
(
BaseEntity:
:
getCreateTime
);
return
baseMapper
.
selectPage
(
page
,
wrapper
);
}
@Override
public
List
<
TCertRecord
>
getTCertRecordNoPage
(
CertRecordSearchVo
searchVo
)
{
LambdaQueryWrapper
<
TCertRecord
>
wrapper
=
buildQueryWrapper
(
searchVo
);
List
<
String
>
idList
=
Common
.
getList
(
searchVo
.
getIds
());
if
(
Common
.
isNotNull
(
idList
)){
wrapper
.
in
(
TCertRecord:
:
getId
,
idList
);
}
return
baseMapper
.
selectList
(
wrapper
);
}
private
LambdaQueryWrapper
buildQueryWrapper
(
CertRecordSearchVo
entity
){
LambdaQueryWrapper
<
TCertRecord
>
wrapper
=
Wrappers
.
lambdaQuery
();
if
(
ArrayUtil
.
isNotEmpty
(
entity
.
getCreateTimes
()))
{
wrapper
.
ge
(
TCertRecord:
:
getCreateTime
,
entity
.
getCreateTimes
()[
0
])
.
le
(
TCertRecord:
:
getCreateTime
,
entity
.
getCreateTimes
()[
1
]);
}
if
(
Common
.
isNotNull
(
entity
.
getEmpName
())){
wrapper
.
likeRight
(
TCertRecord:
:
getEmpName
,
entity
.
getEmpName
());
}
if
(
Common
.
isNotNull
(
entity
.
getEmpIdcard
())){
wrapper
.
likeRight
(
TCertRecord:
:
getEmpIdcard
,
entity
.
getEmpIdcard
());
}
if
(
Common
.
isNotNull
(
entity
.
getCreateName
())){
wrapper
.
eq
(
TCertRecord:
:
getCreateName
,
entity
.
getCreateName
());
}
return
wrapper
;
}
}
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