Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
civil-bigdata
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
civil
civil-bigdata
Commits
0e9d1466
Commit
0e9d1466
authored
Mar 21, 2022
by
王健飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
火化开放搜索接口
parent
8cea37bd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
186 additions
and
0 deletions
+186
-0
open-server/src/main/java/com/zq/open/controller/api/CremationApi.java
+35
-0
open-server/src/main/java/com/zq/open/dao/FisCremationInfoSumDao.java
+21
-0
open-server/src/main/java/com/zq/open/entity/FisCremationInfoSum.java
+0
-0
open-server/src/main/java/com/zq/open/service/CremationService.java
+59
-0
open-server/src/main/java/com/zq/open/vo/CremationSearchVo.java
+24
-0
open-server/src/main/java/com/zq/open/vo/CremationVo.java
+47
-0
No files found.
open-server/src/main/java/com/zq/open/controller/api/CremationApi.java
0 → 100644
View file @
0e9d1466
package
com
.
zq
.
open
.
controller
.
api
;
import
cn.hutool.core.util.IdcardUtil
;
import
com.zq.common.utils.AssertUtils
;
import
com.zq.common.vo.ResultVo
;
import
com.zq.open.service.CremationService
;
import
com.zq.open.service.MarriageService
;
import
com.zq.open.vo.CremationSearchVo
;
import
com.zq.open.vo.MarriageSearchVo
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
@Api
(
tags
=
"火化相关接口"
)
@RequiredArgsConstructor
@RestController
@RequestMapping
(
value
=
"/open/api/cremation"
)
public
class
CremationApi
{
private
final
CremationService
cremationService
;
@ApiOperation
(
"火化信息搜素接口"
)
@PostMapping
(
value
=
"/search"
)
public
ResultVo
search
(
@RequestBody
CremationSearchVo
vo
)
{
AssertUtils
.
hasText
(
vo
.
getIdCard
(),
"缺少身份号"
);
AssertUtils
.
isTrue
(
IdcardUtil
.
isValidCard
(
vo
.
getIdCard
()),
"身份号不正确"
);
return
ResultVo
.
success
(
cremationService
.
search
(
vo
));
}
}
open-server/src/main/java/com/zq/open/dao/FisCremationInfoSumDao.java
0 → 100644
View file @
0e9d1466
package
com
.
zq
.
open
.
dao
;
import
com.baomidou.dynamic.datasource.annotation.DS
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.zq.common.constant.DBName
;
import
com.zq.open.entity.FisCremationInfoSum
;
import
com.zq.open.entity.Mrcase
;
import
org.springframework.stereotype.Repository
;
/**
*fis_cremation_info_sum火化数据库访问层
*
* @author makejava
* @since 2021-09-23 10:49:09
*/
@DS
(
DBName
.
GXBZ
)
@Repository
public
interface
FisCremationInfoSumDao
extends
BaseMapper
<
FisCremationInfoSum
>
{
}
\ No newline at end of file
open-server/src/main/java/com/zq/open/entity/FisCremationInfoSum.java
0 → 100644
View file @
0e9d1466
This diff is collapsed.
Click to expand it.
open-server/src/main/java/com/zq/open/service/CremationService.java
0 → 100644
View file @
0e9d1466
package
com
.
zq
.
open
.
service
;
import
cn.hutool.core.util.IdcardUtil
;
import
com.baomidou.mybatisplus.core.toolkit.Wrappers
;
import
com.zq.common.utils.AssertUtils
;
import
com.zq.open.dao.FisCremationInfoSumDao
;
import
com.zq.open.entity.FisCremationInfoSum
;
import
com.zq.open.vo.CremationSearchVo
;
import
com.zq.open.vo.CremationVo
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.Optional
;
/**
* @author wilmiam
* @since 2021/9/23 10:27
*/
@Service
@RequiredArgsConstructor
public
class
CremationService
{
private
final
FisCremationInfoSumDao
cremationInfoSumDao
;
public
List
<
CremationVo
>
search
(
CremationSearchVo
vo
)
{
if
(
vo
.
getSex
()
==
null
)
{
vo
.
setSex
(
IdcardUtil
.
getGenderByIdCard
(
vo
.
getIdCard
()));
}
List
<
FisCremationInfoSum
>
cremationInfoSumsList
=
cremationInfoSumDao
.
selectList
(
Wrappers
.
lambdaQuery
(
FisCremationInfoSum
.
builder
().
name
(
vo
.
getName
()).
idCard
(
vo
.
getIdCard
()).
cremationTime
(
vo
.
getCremationTime
()).
build
()));
if
(
vo
.
getQueryType
()
==
2
)
{
Optional
<
FisCremationInfoSum
>
infoSum
=
cremationInfoSumsList
.
stream
().
max
(
Comparator
.
comparing
(
FisCremationInfoSum:
:
getCremationTime
));
cremationInfoSumsList
=
new
ArrayList
<>();
infoSum
.
ifPresent
(
cremationInfoSumsList:
:
add
);
}
AssertUtils
.
notEmpty
(
cremationInfoSumsList
,
"查询为空"
);
List
<
CremationVo
>
returnList
=
new
ArrayList
<>();
for
(
FisCremationInfoSum
infoSum:
cremationInfoSumsList
){
CremationVo
build
=
CremationVo
.
builder
()
.
name
(
infoSum
.
getName
())
.
sex
(
infoSum
.
getSex
())
.
cremationTime
(
infoSum
.
getCremationTime
())
.
familyAdd
(
infoSum
.
getFamilyAdd
())
.
populace
(
infoSum
.
getPopulace
())
.
useId
(
infoSum
.
getUseId
())
.
deadId
(
infoSum
.
getDeadId
())
.
deathCause
(
infoSum
.
getDeathCause
())
.
deathDate
(
infoSum
.
getDeathDate
())
.
idCard
(
infoSum
.
getIdCard
())
.
build
();
returnList
.
add
(
build
);
}
return
returnList
;
}
}
open-server/src/main/java/com/zq/open/vo/CremationSearchVo.java
0 → 100644
View file @
0e9d1466
package
com
.
zq
.
open
.
vo
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
CremationSearchVo
{
@ApiModelProperty
(
"姓名"
)
private
String
name
;
@ApiModelProperty
(
"身份证号码"
)
private
String
idCard
;
@ApiModelProperty
(
"性别: 0-女, 1-男"
)
private
Integer
sex
;
@ApiModelProperty
(
"火化时间"
)
private
String
cremationTime
;
@ApiModelProperty
(
"查找类型: 1-历史, 2-最新"
)
private
Integer
queryType
=
2
;
}
open-server/src/main/java/com/zq/open/vo/CremationVo.java
0 → 100644
View file @
0e9d1466
package
com
.
zq
.
open
.
vo
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@JsonInclude
(
JsonInclude
.
Include
.
NON_NULL
)
public
class
CremationVo
{
@ApiModelProperty
(
"姓名"
)
private
String
name
;
@ApiModelProperty
(
"证件号码"
)
private
String
idCard
;
@ApiModelProperty
(
"去世时间"
)
private
String
deathDate
;
@ApiModelProperty
(
"性别"
)
private
String
sex
;
@ApiModelProperty
(
"家庭住址"
)
private
String
familyAdd
;
@ApiModelProperty
(
"户口所在地"
)
private
String
populace
;
@ApiModelProperty
(
"死亡原因"
)
private
String
deathCause
;
@ApiModelProperty
(
"火化时间"
)
private
String
cremationTime
;
@ApiModelProperty
(
"火化编号"
)
private
String
useId
;
@ApiModelProperty
(
"逝者编码"
)
private
String
deadId
;
}
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