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
7e286ec6
Commit
7e286ec6
authored
Mar 25, 2021
by
mengmeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BUG修改;增加预约总人数;增加跨域;线上测试版本V2
parent
8d7f2f5c
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
58 additions
and
6 deletions
+58
-6
ApiLoginController.java
.../src/main/java/io/hmit/controller/ApiLoginController.java
+2
-1
CorsInterceptor.java
...pi/src/main/java/io/hmit/interceptor/CorsInterceptor.java
+30
-0
AppointmentOrderController.java
...es/appointment/controller/AppointmentOrderController.java
+4
-1
AppointmentOrderDTO.java
.../io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
+3
-0
AppointmentOrderService.java
.../modules/appointment/service/AppointmentOrderService.java
+2
-0
AppointmentOrderServiceImpl.java
...appointment/service/impl/AppointmentOrderServiceImpl.java
+14
-1
CalendarDao.xml
...api/src/main/resources/mapper/appointment/CalendarDao.xml
+3
-3
No files found.
hmit-api/src/main/java/io/hmit/controller/ApiLoginController.java
View file @
7e286ec6
...
@@ -17,6 +17,7 @@ import io.swagger.annotations.Api;
...
@@ -17,6 +17,7 @@ import io.swagger.annotations.Api;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.codec.digest.DigestUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
springfox.documentation.annotations.ApiIgnore
;
...
@@ -98,7 +99,7 @@ public class ApiLoginController {
...
@@ -98,7 +99,7 @@ public class ApiLoginController {
UserEntity
user
=
new
UserEntity
();
UserEntity
user
=
new
UserEntity
();
user
.
setUsername
(
user_map
.
get
(
"username"
).
toString
());
user
.
setUsername
(
user_map
.
get
(
"username"
).
toString
());
user
.
setMobile
(
URLEncoder
.
encode
(
user_map
.
get
(
"mobile"
).
toString
(),
"UTF8"
));
user
.
setMobile
(
URLEncoder
.
encode
(
user_map
.
get
(
"mobile"
).
toString
(),
"UTF8"
));
user
.
setPassword
(
URLEncoder
.
encode
(
MD5
.
md5
(
user_map
.
get
(
"idnum"
).
toString
()),
"UTF8"
));
user
.
setPassword
(
URLEncoder
.
encode
(
DigestUtils
.
sha256Hex
(
user_map
.
get
(
"idnum"
).
toString
()),
"UTF8"
));
user
.
setIdCardNo
(
URLEncoder
.
encode
(
user_map
.
get
(
"idnum"
).
toString
(),
"UTF8"
));
user
.
setIdCardNo
(
URLEncoder
.
encode
(
user_map
.
get
(
"idnum"
).
toString
(),
"UTF8"
));
userService
.
insert
(
user
);
userService
.
insert
(
user
);
...
...
hmit-api/src/main/java/io/hmit/interceptor/CorsInterceptor.java
0 → 100644
View file @
7e286ec6
package
io
.
hmit
.
interceptor
;
import
org.springframework.http.HttpMethod
;
import
org.springframework.http.HttpStatus
;
import
org.springframework.stereotype.Component
;
import
org.springframework.web.servlet.HandlerInterceptor
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
@Component
public
class
CorsInterceptor
implements
HandlerInterceptor
{
@Override
public
boolean
preHandle
(
HttpServletRequest
request
,
HttpServletResponse
response
,
Object
handler
)
{
response
.
setHeader
(
"Access-Control-Allow-Origin"
,
"*"
);
response
.
setHeader
(
"Access-Control-Allow-Credentials"
,
"true"
);
response
.
setHeader
(
"Access-Control-Allow-Methods"
,
"GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS"
);
response
.
setHeader
(
"Access-Control-Max-Age"
,
"86400"
);
response
.
setHeader
(
"Access-Control-Allow-Headers"
,
"*"
);
/*// 如果是OPTIONS则结束请求
if (HttpMethod.OPTIONS.toString().equals(request.getMethod())) {
response.setStatus(HttpStatus.NO_CONTENT.value());
return false;
}*/
return
true
;
}
}
hmit-api/src/main/java/io/hmit/modules/appointment/controller/AppointmentOrderController.java
View file @
7e286ec6
...
@@ -69,6 +69,9 @@ public class AppointmentOrderController {
...
@@ -69,6 +69,9 @@ public class AppointmentOrderController {
params
.
put
(
"appointmentPhone"
,
userEntity
.
getMobile
());
params
.
put
(
"appointmentPhone"
,
userEntity
.
getMobile
());
PageData
<
AppointmentOrderDTO
>
page
=
appointmentOrderService
.
page
(
params
);
PageData
<
AppointmentOrderDTO
>
page
=
appointmentOrderService
.
page
(
params
);
page
.
getList
().
forEach
(
l
->{
page
.
getList
().
forEach
(
l
->{
//获取当前时间段事项预约总人数
Integer
rCount
=
appointmentOrderService
.
reservationAccount
(
l
.
getServiceId
(),
l
.
getAppointmentTime
());
l
.
setRCount
(
rCount
);
//判断已取号或者消除过号
//判断已取号或者消除过号
if
(
null
!=
l
.
getStatus
()
&&
Constant
.
ReservationStatus
.
GET_NUM
.
getValue
()<=
l
.
getStatus
()){
if
(
null
!=
l
.
getStatus
()
&&
Constant
.
ReservationStatus
.
GET_NUM
.
getValue
()<=
l
.
getStatus
()){
YynumberDTO
yynumberDTO
=
appointmentOrderService
.
findByYuNumber
(
l
.
getAppointmentNum
());
YynumberDTO
yynumberDTO
=
appointmentOrderService
.
findByYuNumber
(
l
.
getAppointmentNum
());
...
@@ -155,7 +158,7 @@ public class AppointmentOrderController {
...
@@ -155,7 +158,7 @@ public class AppointmentOrderController {
AppointmentOrderDTO
data
=
appointmentOrderService
.
get
(
id
);
AppointmentOrderDTO
data
=
appointmentOrderService
.
get
(
id
);
data
.
setStatus
(
Constant
.
ReservationStatus
.
CANCEL
.
getValue
());
data
.
setStatus
(
Constant
.
ReservationStatus
.
CANCEL
.
getValue
());
data
.
setS
ervice
Name
(
Constant
.
ReservationStatus
.
CANCEL
.
getMsg
());
data
.
setS
tatus
Name
(
Constant
.
ReservationStatus
.
CANCEL
.
getMsg
());
data
.
setUpdateDate
(
new
Date
());
data
.
setUpdateDate
(
new
Date
());
data
.
setUpdateDate
(
new
Date
());
data
.
setUpdateDate
(
new
Date
());
data
.
setUpdater
(
user
.
getId
());
data
.
setUpdater
(
user
.
getId
());
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
View file @
7e286ec6
...
@@ -94,6 +94,9 @@ public class AppointmentOrderDTO implements Serializable {
...
@@ -94,6 +94,9 @@ public class AppointmentOrderDTO implements Serializable {
@ApiModelProperty
(
value
=
"等候人数"
)
@ApiModelProperty
(
value
=
"等候人数"
)
private
Integer
waitNum
;
private
Integer
waitNum
;
@ApiModelProperty
(
value
=
"预约人数"
)
private
Integer
rCount
;
private
YynumberDTO
yynumberDTO
;
private
YynumberDTO
yynumberDTO
;
public
AppointmentOrderDTO
assembleAppointmentOrderDTO
(
ReservationDTO
reservationDTO
,
UserEntity
userEntity
){
public
AppointmentOrderDTO
assembleAppointmentOrderDTO
(
ReservationDTO
reservationDTO
,
UserEntity
userEntity
){
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/service/AppointmentOrderService.java
View file @
7e286ec6
...
@@ -28,6 +28,8 @@ public interface AppointmentOrderService extends CrudService<AppointmentOrderEnt
...
@@ -28,6 +28,8 @@ public interface AppointmentOrderService extends CrudService<AppointmentOrderEnt
Integer
waitingNum
(
String
appointmentTime
);
Integer
waitingNum
(
String
appointmentTime
);
Integer
reservationAccount
(
Long
serviceId
,
String
appointmentTime
);
Integer
serviceWaitingNum
(
Long
serviceId
);
Integer
serviceWaitingNum
(
Long
serviceId
);
YynumberDTO
findByYuNumber
(
String
sPaperNumber
);
YynumberDTO
findByYuNumber
(
String
sPaperNumber
);
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/service/impl/AppointmentOrderServiceImpl.java
View file @
7e286ec6
...
@@ -59,12 +59,17 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
...
@@ -59,12 +59,17 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
String
userId
=
(
String
)
params
.
get
(
"userId"
);
String
userId
=
(
String
)
params
.
get
(
"userId"
);
String
flag
=
(
String
)
params
.
get
(
"flag"
);
String
flag
=
(
String
)
params
.
get
(
"flag"
);
String
status
=
(
String
)
params
.
get
(
"status"
);
String
status
=
(
String
)
params
.
get
(
"status"
);
String
phone
=
(
String
)
params
.
get
(
"appointmentPhone"
);
String
idCard
=
(
String
)
params
.
get
(
"appointmentIdCard"
);
QueryWrapper
<
AppointmentOrderEntity
>
wrapper
=
new
QueryWrapper
<>();
QueryWrapper
<
AppointmentOrderEntity
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
wrapper
.
le
(
StringUtils
.
isNotBlank
(
flag
)
&&
"Y"
.
equals
(
flag
),
"status"
,
2
);
wrapper
.
le
(
StringUtils
.
isNotBlank
(
flag
)
&&
"Y"
.
equals
(
flag
),
"status"
,
2
);
wrapper
.
ge
(
StringUtils
.
isNotBlank
(
flag
)
&&
"Q"
.
equals
(
flag
),
"status"
,
3
);
wrapper
.
ge
(
StringUtils
.
isNotBlank
(
flag
)
&&
"Q"
.
equals
(
flag
),
"status"
,
3
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
status
),
"status"
,
status
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
status
),
"status"
,
status
)
.
eq
(
StringUtils
.
isNotBlank
(
phone
),
"appointment_phone"
,
phone
)
.
eq
(
StringUtils
.
isNotBlank
(
idCard
),
"appointment_id_card"
,
idCard
);
return
wrapper
;
return
wrapper
;
...
@@ -146,6 +151,14 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
...
@@ -146,6 +151,14 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
return
appointmentOrderDao
.
waitingNum
(
appointmentTime
);
return
appointmentOrderDao
.
waitingNum
(
appointmentTime
);
}
}
@Override
public
Integer
reservationAccount
(
Long
serviceId
,
String
appointmentTime
)
{
Integer
account
=
baseDao
.
selectCount
(
new
QueryWrapper
<
AppointmentOrderEntity
>()
.
eq
(
"service_id"
,
serviceId
).
eq
(
"appointment_time"
,
appointmentTime
));
return
account
;
}
@Override
@Override
public
Integer
serviceWaitingNum
(
Long
serviceId
)
{
public
Integer
serviceWaitingNum
(
Long
serviceId
)
{
...
...
hmit-api/src/main/resources/mapper/appointment/CalendarDao.xml
View file @
7e286ec6
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"io.hmit.modules.appointment.dao.Calendar
r
Dao"
>
<mapper
namespace=
"io.hmit.modules.appointment.dao.CalendarDao"
>
<resultMap
type=
"io.hmit.modules.appointment.entity.Calendar
r
Entity"
id=
"calendarMap"
>
<resultMap
type=
"io.hmit.modules.appointment.entity.CalendarEntity"
id=
"calendarMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"id"
column=
"id"
/>
<result
property=
"day"
column=
"day"
/>
<result
property=
"day"
column=
"day"
/>
<result
property=
"holiday"
column=
"holiday"
/>
<result
property=
"holiday"
column=
"holiday"
/>
...
...
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