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
155ab080
Commit
155ab080
authored
Feb 20, 2021
by
mengmeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'lings' into 'master'
4、预约详情接口 5、当前预约排队人数接口 6、现场签到接口 See merge request
!2
parents
cd69ad0f
cff2199f
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
105 additions
and
271 deletions
+105
-271
hmit-admin.iml
hmit-admin/hmit-admin.iml
+0
-257
AppointmentOrderController.java
...es/appointment/controller/AppointmentOrderController.java
+16
-9
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 @
cd69ad0f
This diff is collapsed.
Click to expand it.
hmit-admin/src/main/java/io/hmit/modules/appointment/controller/AppointmentOrderController.java
View file @
155ab080
...
...
@@ -23,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -77,15 +78,21 @@ public class AppointmentOrderController {
return
new
Result
();
}
@PutMapping
@ApiOperation
(
"修改"
)
@LogOperation
(
"修改"
)
@RequiresPermissions
(
"appointment:appointmentorder:update"
)
public
Result
update
(
@RequestBody
AppointmentOrderDTO
dto
){
//校验数据
ValidatorUtils
.
validateEntity
(
dto
,
UpdateGroup
.
class
,
DefaultGroup
.
class
);
appointmentOrderService
.
update
(
dto
);
@GetMapping
(
value
=
"/signin/{appointmentOrderId}"
)
@ApiOperation
(
"签到"
)
@LogOperation
(
"签到"
)
public
Result
update
(
@PathVariable
(
value
=
"appointmentOrderId"
)
Long
appointmentOrderId
){
//根据appointmentOrderId获取到订单实体
AppointmentOrderDTO
appointmentOrderDTO
=
appointmentOrderService
.
get
(
appointmentOrderId
);
if
(
appointmentOrderDTO
.
getAppointmentTime
().
getTime
()
>
new
Date
().
getTime
())
{
appointmentOrderDTO
.
setStatus
(
2
);
appointmentOrderDTO
.
setStatusName
(
"签到"
);
}
appointmentOrderService
.
update
(
appointmentOrderDTO
);
return
new
Result
();
}
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/controller/AppointmentOrderController.java
View file @
155ab080
...
...
@@ -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 @
155ab080
...
...
@@ -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 @
155ab080
...
...
@@ -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 @
155ab080
...
...
@@ -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 @
155ab080
...
...
@@ -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