Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
Q
queueForTicket_bl
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
queueForTicket_bl
Commits
ef71e9da
Commit
ef71e9da
authored
Feb 18, 2021
by
mlchun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.添加预约信息查询接口(根据身份证号码或手机号)
parent
ba552e51
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
83 additions
and
9 deletions
+83
-9
hmit-api.iml
hmit-api/hmit-api.iml
+0
-7
AppointmentOrderController.java
...es/appointment/controller/AppointmentOrderController.java
+15
-0
AppointmentOrderDao.java
.../io/hmit/modules/appointment/dao/AppointmentOrderDao.java
+5
-1
AppointmentOrderService.java
.../modules/appointment/service/AppointmentOrderService.java
+5
-0
AppointmentOrderServiceImpl.java
...appointment/service/impl/AppointmentOrderServiceImpl.java
+32
-1
AppointmentOrderDao.xml
...main/resources/mapper/appointment/AppointmentOrderDao.xml
+13
-0
AppointmentOrderController.class
...s/appointment/controller/AppointmentOrderController.class
+0
-0
AppointmentOrderDao.class
...io/hmit/modules/appointment/dao/AppointmentOrderDao.class
+0
-0
AppointmentOrderService.class
...modules/appointment/service/AppointmentOrderService.class
+0
-0
AppointmentOrderServiceImpl.class
...ppointment/service/impl/AppointmentOrderServiceImpl.class
+0
-0
AppointmentOrderDao.xml
...target/classes/mapper/appointment/AppointmentOrderDao.xml
+13
-0
No files found.
hmit-api/hmit-api.iml
View file @
ef71e9da
<?xml version="1.0" encoding="UTF-8"?>
<module
org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=
"true"
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"CheckStyle-IDEA-Module"
>
<option
name=
"configuration"
>
<map
/>
</option>
</component>
<component
name=
"FacetManager"
>
<facet
type=
"Spring"
name=
"Spring"
>
<configuration
/>
...
...
@@ -57,8 +52,6 @@
<orderEntry
type=
"library"
name=
"Maven: org.springframework:spring-jcl:5.1.9.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.springframework:spring-test:5.1.9.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: org.xmlunit:xmlunit-core:2.6.3"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: javax.xml.bind:jaxb-api:2.3.1"
level=
"project"
/>
<orderEntry
type=
"library"
scope=
"TEST"
name=
"Maven: javax.activation:javax.activation-api:1.2.0"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-web:2.1.8.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: org.springframework.boot:spring-boot-starter-json:2.1.8.RELEASE"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Maven: com.fasterxml.jackson.core:jackson-databind:2.9.9.3"
level=
"project"
/>
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/controller/AppointmentOrderController.java
View file @
ef71e9da
...
...
@@ -56,6 +56,21 @@ public class AppointmentOrderController {
return
new
Result
<
AppointmentOrderDTO
>().
ok
(
data
);
}
@GetMapping
(
"identity/{identity}"
)
@ApiOperation
(
"根据手机号或身份证号获取信息"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
Constant
.
PAGE
,
value
=
"当前页码,从1开始"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
LIMIT
,
value
=
"每页显示记录数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER_FIELD
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER
,
value
=
"排序方式,可选值(asc、desc)"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
public
Result
<
PageData
<
AppointmentOrderDTO
>>
queryInfo
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
,
@PathVariable
(
"identity"
)
String
identity
){
PageData
<
AppointmentOrderDTO
>
pageData
=
appointmentOrderService
.
getAppointmentInfoPage
(
params
,
identity
);
return
new
Result
<
PageData
<
AppointmentOrderDTO
>>().
ok
(
pageData
);
}
@PostMapping
@ApiOperation
(
"保存"
)
public
Result
save
(
@RequestBody
AppointmentOrderDTO
dto
){
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/dao/AppointmentOrderDao.java
View file @
ef71e9da
package
io
.
hmit
.
modules
.
appointment
.
dao
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
io.hmit.common.dao.BaseDao
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.entity.AppointmentOrderEntity
;
import
org.apache.ibatis.annotations.Mapper
;
...
...
@@ -12,5 +14,7 @@ import org.apache.ibatis.annotations.Mapper;
*/
@Mapper
public
interface
AppointmentOrderDao
extends
BaseDao
<
AppointmentOrderEntity
>
{
IPage
<
AppointmentOrderDTO
>
getAppointmentInfo
(
IPage
<
AppointmentOrderEntity
>
page
,
String
phone
,
String
idCard
);
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/appointment/service/AppointmentOrderService.java
View file @
ef71e9da
package
io
.
hmit
.
modules
.
appointment
.
service
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.service.CrudService
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.entity.AppointmentOrderEntity
;
import
java.util.Map
;
/**
* 预约订单表
*
...
...
@@ -12,4 +15,6 @@ import io.hmit.modules.appointment.entity.AppointmentOrderEntity;
*/
public
interface
AppointmentOrderService
extends
CrudService
<
AppointmentOrderEntity
,
AppointmentOrderDTO
>
{
PageData
<
AppointmentOrderDTO
>
getAppointmentInfoPage
(
Map
<
String
,
Object
>
params
,
String
identity
);
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/appointment/service/impl/AppointmentOrderServiceImpl.java
View file @
ef71e9da
package
io
.
hmit
.
modules
.
appointment
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.modules.appointment.dao.AppointmentOrderDao
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.entity.AppointmentOrderEntity
;
...
...
@@ -9,6 +13,7 @@ import io.hmit.modules.appointment.service.AppointmentOrderService;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.Map
;
/**
...
...
@@ -20,6 +25,19 @@ import java.util.Map;
@Service
public
class
AppointmentOrderServiceImpl
extends
CrudServiceImpl
<
AppointmentOrderDao
,
AppointmentOrderEntity
,
AppointmentOrderDTO
>
implements
AppointmentOrderService
{
@Resource
private
AppointmentOrderDao
appointmentOrderDao
;
/**
* 电话号码校验(不包含港澳台手机号)
*/
final
static
String
VALIDATE_PHONE
=
"^(13[0-9]|14[579]|15[0-3,5-9]|16[0-9]|17[0135678]|18[0-9]|19[89])\\d{8}$"
;
/**
* 身份证校验
*/
final
static
String
ID_NUMBER
=
"^[1-9]\\d{5}(18|19|20|(3\\d))\\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\\d{3}[0-9Xx]$"
;
@Override
public
QueryWrapper
<
AppointmentOrderEntity
>
getWrapper
(
Map
<
String
,
Object
>
params
){
String
id
=
(
String
)
params
.
get
(
"id"
);
...
...
@@ -30,5 +48,18 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
return
wrapper
;
}
@Override
public
PageData
<
AppointmentOrderDTO
>
getAppointmentInfoPage
(
Map
<
String
,
Object
>
params
,
String
identity
)
{
String
phone
=
null
;
String
idCard
=
null
;
if
(
identity
.
matches
(
VALIDATE_PHONE
))
{
phone
=
identity
;
}
if
(
identity
.
matches
(
ID_NUMBER
))
{
idCard
=
identity
;
}
IPage
<
AppointmentOrderEntity
>
page
=
getPage
(
params
,
Constant
.
CREATE_DATE
,
false
);
IPage
<
AppointmentOrderDTO
>
appointmentOrderDTOIPage
=
appointmentOrderDao
.
getAppointmentInfo
(
page
,
phone
,
idCard
);
return
getPageData
(
appointmentOrderDTOIPage
,
AppointmentOrderDTO
.
class
);
}
}
\ No newline at end of file
hmit-api/src/main/resources/mapper/appointment/AppointmentOrderDao.xml
View file @
ef71e9da
...
...
@@ -28,5 +28,18 @@
<result
property=
"updateDate"
column=
"update_date"
/>
</resultMap>
<select
id=
"getAppointmentInfo"
resultType=
"io.hmit.modules.appointment.dto.AppointmentOrderDTO"
>
SELECT *
FROM appointment_order ao
WHERE
<choose>
<when
test=
"phone != null"
>
ao.appointment_phone = #{phone}
</when>
<otherwise>
ao.appointment_id_card = #{idCard}
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
hmit-api/target/classes/io/hmit/modules/appointment/controller/AppointmentOrderController.class
View file @
ef71e9da
No preview for this file type
hmit-api/target/classes/io/hmit/modules/appointment/dao/AppointmentOrderDao.class
View file @
ef71e9da
No preview for this file type
hmit-api/target/classes/io/hmit/modules/appointment/service/AppointmentOrderService.class
View file @
ef71e9da
No preview for this file type
hmit-api/target/classes/io/hmit/modules/appointment/service/impl/AppointmentOrderServiceImpl.class
View file @
ef71e9da
No preview for this file type
hmit-api/target/classes/mapper/appointment/AppointmentOrderDao.xml
View file @
ef71e9da
...
...
@@ -28,5 +28,18 @@
<result
property=
"updateDate"
column=
"update_date"
/>
</resultMap>
<select
id=
"getAppointmentInfo"
resultType=
"io.hmit.modules.appointment.dto.AppointmentOrderDTO"
>
SELECT *
FROM appointment_order ao
WHERE
<choose>
<when
test=
"phone != null"
>
ao.appointment_phone = #{phone}
</when>
<otherwise>
ao.appointment_id_card = #{idCard}
</otherwise>
</choose>
</select>
</mapper>
\ No newline at end of file
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