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
cff2199f
Commit
cff2199f
authored
Feb 19, 2021
by
lings
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
4、预约详情接口
5、当前预约排队人数接口 6、现场签到接口
parent
2ea5c8fa
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
89 additions
and
262 deletions
+89
-262
hmit-admin.iml
hmit-admin/hmit-admin.iml
+0
-257
AppointmentOrderController.java
...es/appointment/controller/AppointmentOrderController.java
+50
-1
AppointmentOrderDao.java
.../io/hmit/modules/appointment/dao/AppointmentOrderDao.java
+4
-1
AppointmentOrderService.java
.../modules/appointment/service/AppointmentOrderService.java
+5
-1
AppointmentOrderServiceImpl.java
...appointment/service/impl/AppointmentOrderServiceImpl.java
+13
-1
AppointmentOrderDao.xml
...main/resources/mapper/appointment/AppointmentOrderDao.xml
+17
-1
No files found.
hmit-admin/hmit-admin.iml
deleted
100644 → 0
View file @
2ea5c8fa
This diff is collapsed.
Click to expand it.
hmit-api/src/main/java/io/hmit/modules/appointment/controller/AppointmentOrderController.java
View file @
cff2199f
...
...
@@ -2,6 +2,7 @@ package io.hmit.modules.appointment.controller;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.utils.DateUtils
;
import
io.hmit.common.utils.Result
;
import
io.hmit.common.validator.AssertUtils
;
import
io.hmit.common.validator.ValidatorUtils
;
...
...
@@ -56,7 +57,7 @@ public class AppointmentOrderController {
}
@GetMapping
(
"{id}"
)
@ApiOperation
(
"信息"
)
@ApiOperation
(
"信息
,预约详情接口
"
)
public
Result
<
AppointmentOrderDTO
>
get
(
@PathVariable
(
"id"
)
Long
id
){
AppointmentOrderDTO
data
=
appointmentOrderService
.
get
(
id
);
...
...
@@ -108,6 +109,54 @@ public class AppointmentOrderController {
return
new
Result
();
}
@GetMapping
(
value
=
"/signin/{appointmentOrderId}"
)
@ApiOperation
(
"签到"
)
public
Result
signin
(
@PathVariable
(
value
=
"appointmentOrderId"
)
Long
appointmentOrderId
){
//根据appointmentOrderId获取到订单实体
AppointmentOrderDTO
appointmentOrderDTO
=
appointmentOrderService
.
get
(
appointmentOrderId
);
//判断签到时间是否在预约时间前
if
(
appointmentOrderDTO
.
getAppointmentTime
().
getTime
()
>
new
Date
().
getTime
())
{
appointmentOrderDTO
.
setStatus
(
2
);
appointmentOrderDTO
.
setStatusName
(
"签到"
);
appointmentOrderDTO
.
setUpdateDate
(
new
Date
());
appointmentOrderService
.
update
(
appointmentOrderDTO
);
return
new
Result
();
}
else
{
return
new
Result
().
error
(
"预约时间已过,签到失败!"
);
}
}
@GetMapping
(
value
=
"/waitingNum/{appointmentOrderId}"
)
@ApiOperation
(
"获取当前预约的排队人数"
)
public
Result
waitingNum
(
@PathVariable
(
value
=
"appointmentOrderId"
)
Long
appointmentOrderId
){
//根据appointmentOrderId获取到订单实体
AppointmentOrderDTO
appointmentOrderDTO
=
appointmentOrderService
.
get
(
appointmentOrderId
);
//获取当前订单预约时间
Integer
waitingNum
=
appointmentOrderService
.
waitingNum
(
DateUtils
.
format
(
appointmentOrderDTO
.
getAppointmentTime
()));
return
new
Result
().
ok
(
waitingNum
);
}
@GetMapping
(
value
=
"/serviceWaitingNum/{serviceId}"
)
@ApiOperation
(
"获取当前事项的预约排队人数"
)
public
Result
serviceWaitingNum
(
@PathVariable
(
value
=
"serviceId"
)
Long
serviceId
){
Integer
serviceWaitingNum
=
appointmentOrderService
.
serviceWaitingNum
(
serviceId
);
return
new
Result
().
ok
(
serviceWaitingNum
);
}
@PutMapping
@ApiOperation
(
"修改"
)
public
Result
update
(
@RequestBody
AppointmentOrderDTO
dto
){
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/dao/AppointmentOrderDao.java
View file @
cff2199f
...
...
@@ -5,6 +5,7 @@ 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
;
import
org.apache.ibatis.annotations.Param
;
/**
* 预约订单表
...
...
@@ -16,5 +17,7 @@ import org.apache.ibatis.annotations.Mapper;
public
interface
AppointmentOrderDao
extends
BaseDao
<
AppointmentOrderEntity
>
{
IPage
<
AppointmentOrderDTO
>
getAppointmentInfo
(
IPage
<
AppointmentOrderEntity
>
page
,
String
phone
,
String
idCard
);
Integer
waitingNum
(
@Param
(
"appointmentTime"
)
String
appointmentTime
);
Integer
serviceWaitingNum
(
@Param
(
"serviceId"
)
Long
serviceId
);
}
hmit-api/src/main/java/io/hmit/modules/appointment/service/AppointmentOrderService.java
View file @
cff2199f
...
...
@@ -17,4 +17,8 @@ public interface AppointmentOrderService extends CrudService<AppointmentOrderEnt
PageData
<
AppointmentOrderDTO
>
getAppointmentInfoPage
(
Map
<
String
,
Object
>
params
,
String
identity
);
Integer
waitingNum
(
String
appointmentTime
);
Integer
serviceWaitingNum
(
Long
serviceId
);
}
hmit-api/src/main/java/io/hmit/modules/appointment/service/impl/AppointmentOrderServiceImpl.java
View file @
cff2199f
...
...
@@ -62,4 +62,16 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
IPage
<
AppointmentOrderDTO
>
appointmentOrderDTOIPage
=
appointmentOrderDao
.
getAppointmentInfo
(
page
,
phone
,
idCard
);
return
getPageData
(
appointmentOrderDTOIPage
,
AppointmentOrderDTO
.
class
);
}
@Override
public
Integer
waitingNum
(
String
appointmentTime
)
{
return
appointmentOrderDao
.
waitingNum
(
appointmentTime
);
}
@Override
public
Integer
serviceWaitingNum
(
Long
serviceId
)
{
return
appointmentOrderDao
.
serviceWaitingNum
(
serviceId
)
;
}
}
hmit-api/src/main/resources/mapper/appointment/AppointmentOrderDao.xml
View file @
cff2199f
...
...
@@ -42,4 +42,20 @@
</choose>
</select>
<select
id=
"waitingNum"
resultType=
"int"
>
SELECT count(*) FROM appointment_order where 1=1
<if
test=
"appointmentTime != null and appointmentTime.trim() != ''"
>
and #{appointmentTime} >= appointmentTime
</if>
and status = 2
</select>
<select
id=
"serviceWaitingNum"
resultType=
"int"
>
SELECT count(*) FROM appointment_order where 1=1
<if
test=
"serviceId != null "
>
and service_id = #{serviceId}
</if>
and (status = 1 or status = 2)
</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