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
3e8a0fae
Commit
3e8a0fae
authored
Mar 24, 2021
by
mengmeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
线上测试运行版本V1
parent
b6930e3c
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
215 additions
and
43 deletions
+215
-43
README.md
README.md
+10
-1
AppointmentOrderServiceImpl.java
...appointment/service/impl/AppointmentOrderServiceImpl.java
+3
-1
CheckReservationTimeTask.java
...va/io/hmit/modules/job/task/CheckReservationTimeTask.java
+50
-0
WebMvcConfig.java
hmit-api/src/main/java/io/hmit/config/WebMvcConfig.java
+9
-1
ApiLoginController.java
.../src/main/java/io/hmit/controller/ApiLoginController.java
+12
-1
AppointmentOrderController.java
...es/appointment/controller/AppointmentOrderController.java
+34
-25
AppointmentServiceController.java
.../appointment/controller/AppointmentServiceController.java
+1
-0
AppointmentOrderDTO.java
.../io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
+7
-4
AppointmentOrderServiceDTO.java
...t/modules/appointment/dto/AppointmentOrderServiceDTO.java
+6
-1
AppointmentOrderServiceImpl.java
...appointment/service/impl/AppointmentOrderServiceImpl.java
+4
-1
application-dev.yml
hmit-api/src/main/resources/application-dev.yml
+1
-1
hmit-api.kotlin_module
hmit-api/target/classes/META-INF/hmit-api.kotlin_module
+0
-0
Constant.java
...ommon/src/main/java/io/hmit/common/constant/Constant.java
+44
-2
BaseEntity.java
...ommon/src/main/java/io/hmit/common/entity/BaseEntity.java
+1
-1
DateUtils.java
...-common/src/main/java/io/hmit/common/utils/DateUtils.java
+33
-4
No files found.
README.md
View file @
3e8a0fae
# hmit-security-enterprise
\ No newline at end of file
# hmit-security-enterprise
## 订单状态 appointment_order 表 status
***
### status 0 失约/爽约
### status 1 已预约
### status 2 预约已取消
### status 3 已取号
### status 4 消除无效号码
***
hmit-admin/src/main/java/io/hmit/modules/appointment/service/impl/AppointmentOrderServiceImpl.java
View file @
3e8a0fae
...
...
@@ -23,12 +23,14 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
@Override
public
QueryWrapper
<
AppointmentOrderEntity
>
getWrapper
(
Map
<
String
,
Object
>
params
){
String
id
=
(
String
)
params
.
get
(
"id"
);
String
status
=
null
!=
params
.
get
(
"status"
)?
params
.
get
(
"status"
).
toString
():
""
;
QueryWrapper
<
AppointmentOrderEntity
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
status
),
"status"
,
status
);
return
wrapper
;
}
}
\ No newline at end of file
}
hmit-admin/src/main/java/io/hmit/modules/job/task/CheckReservationTimeTask.java
0 → 100644
View file @
3e8a0fae
package
io
.
hmit
.
modules
.
job
.
task
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.utils.DateUtils
;
import
io.hmit.modules.appointment.service.AppointmentOrderService
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
java.text.ParseException
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.Map
;
/**
* 检查是否超出预约时间还未取号
* 是 则将订单状态status改成0 爽约/失约
*
*/
@Component
(
"checkReservationTime"
)
public
class
CheckReservationTimeTask
implements
ITask
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
getClass
());
@Autowired
private
AppointmentOrderService
appointmentOrderService
;
@Override
public
void
run
(
String
params
)
{
logger
.
debug
(
"TestTask定时任务正在执行,参数为:{}"
,
params
);
Map
<
String
,
Object
>
queryParams
=
new
HashMap
<>();
queryParams
.
put
(
"status"
,
Constant
.
ReservationStatus
.
RESERVATION
.
getValue
());
appointmentOrderService
.
list
(
queryParams
).
stream
().
forEach
(
item
->{
System
.
out
.
println
(
"订单状态:"
+
item
.
getStatus
()+
" "
+
item
.
getServiceName
());
try
{
if
(
DateUtils
.
compareTime
(
item
.
getAppointmentTime
())){
item
.
setStatus
(
Constant
.
ReservationStatus
.
BREAK_APPOINTMENT
.
getValue
());
item
.
setStatusName
(
Constant
.
ReservationStatus
.
BREAK_APPOINTMENT
.
getMsg
());
item
.
setUpdateDate
(
new
Date
());
appointmentOrderService
.
update
(
item
);
}
}
catch
(
ParseException
e
)
{
e
.
printStackTrace
();
}
});
}
}
hmit-api/src/main/java/io/hmit/config/WebMvcConfig.java
View file @
3e8a0fae
...
...
@@ -6,6 +6,7 @@ import com.fasterxml.jackson.databind.module.SimpleModule;
import
com.fasterxml.jackson.databind.ser.std.ToStringSerializer
;
import
io.hmit.common.utils.DateUtils
;
import
io.hmit.interceptor.AuthorizationInterceptor
;
import
io.hmit.interceptor.CorsInterceptor
;
import
io.hmit.resolver.LoginUserHandlerMethodArgumentResolver
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
...
...
@@ -32,6 +33,9 @@ import java.util.TimeZone;
@Configuration
public
class
WebMvcConfig
implements
WebMvcConfigurer
{
@Autowired
private
CorsInterceptor
corsInterceptor
;
@Autowired
private
AuthorizationInterceptor
authorizationInterceptor
;
@Autowired
...
...
@@ -39,7 +43,11 @@ public class WebMvcConfig implements WebMvcConfigurer {
@Override
public
void
addInterceptors
(
InterceptorRegistry
registry
)
{
// 跨域拦截器需放在最上面
registry
.
addInterceptor
(
corsInterceptor
).
addPathPatterns
(
"/**"
);
registry
.
addInterceptor
(
authorizationInterceptor
).
addPathPatterns
(
"/api/**"
);
registry
.
addInterceptor
(
authorizationInterceptor
).
addPathPatterns
(
"/app/**"
);
}
@Override
...
...
@@ -78,4 +86,4 @@ public class WebMvcConfig implements WebMvcConfigurer {
converter
.
setObjectMapper
(
mapper
);
return
converter
;
}
}
\ No newline at end of file
}
hmit-api/src/main/java/io/hmit/controller/ApiLoginController.java
View file @
3e8a0fae
...
...
@@ -4,6 +4,7 @@ package io.hmit.controller;
import
com.baomidou.mybatisplus.extension.api.R
;
import
io.hmit.annotation.Login
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.utils.MD5
;
import
io.hmit.common.utils.Result
;
import
io.hmit.common.validator.ValidatorUtils
;
import
io.hmit.config.ZhelibanUtils
;
...
...
@@ -85,6 +86,9 @@ public class ApiLoginController {
Map
<
String
,
Object
>
user_map
=
ZhelibanUtils
.
getUserInfo
(
map
);
System
.
out
.
println
(
"UserMap是——————————————————————————————"
);
System
.
out
.
println
(
user_map
);
if
(
"6001"
.
equals
(
user_map
.
get
(
"result"
))){
return
new
Result
().
error
(
"ticket失效"
);
}
if
(
user_map
.
get
(
"idnum"
)
!=
null
){
//判断是否已经存在了这条信息
UserEntity
oldUser
=
userService
.
queryByIdnum
(
URLEncoder
.
encode
(
user_map
.
get
(
"idnum"
).
toString
(),
"UTF8"
));
...
...
@@ -94,13 +98,20 @@ public class ApiLoginController {
UserEntity
user
=
new
UserEntity
();
user
.
setUsername
(
user_map
.
get
(
"username"
).
toString
());
user
.
setMobile
(
URLEncoder
.
encode
(
user_map
.
get
(
"mobile"
).
toString
(),
"UTF8"
));
user
.
setPassword
(
URLEncoder
.
encode
(
user_map
.
get
(
"idnum"
).
toString
(
),
"UTF8"
));
user
.
setPassword
(
URLEncoder
.
encode
(
MD5
.
md5
(
user_map
.
get
(
"idnum"
).
toString
()
),
"UTF8"
));
user
.
setIdCardNo
(
URLEncoder
.
encode
(
user_map
.
get
(
"idnum"
).
toString
(),
"UTF8"
));
userService
.
insert
(
user
);
userId
=
user
.
getId
();
userMap
.
put
(
"username"
,
user
.
getUsername
());
userMap
.
put
(
"mobile"
,
user
.
getMobile
());
userMap
.
put
(
"idnum"
,
user
.
getIdCardNo
());
}
else
{
userId
=
oldUser
.
getId
();
userMap
.
put
(
"username"
,
oldUser
.
getUsername
());
userMap
.
put
(
"mobile"
,
oldUser
.
getMobile
());
userMap
.
put
(
"idnum"
,
oldUser
.
getIdCardNo
());
}
TokenEntity
tokenEntity
=
tokenService
.
createToken
(
userId
);
userMap
.
put
(
"token"
,
tokenEntity
.
getToken
());
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/controller/AppointmentOrderController.java
View file @
3e8a0fae
This diff is collapsed.
Click to expand it.
hmit-api/src/main/java/io/hmit/modules/appointment/controller/AppointmentServiceController.java
View file @
3e8a0fae
...
...
@@ -50,6 +50,7 @@ public class AppointmentServiceController {
return
new
Result
<
PageData
<
AppointmentServiceDTO
>>().
ok
(
page
);
}
@GetMapping
(
"list"
)
@ApiOperation
(
"服务树形列表"
)
public
Result
<
List
<
AppointmentServiceDTO
>>
list
()
{
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
View file @
3e8a0fae
package
io
.
hmit
.
modules
.
appointment
.
dto
;
import
io.hmit.common.utils.SerialNumberTool
;
import
io.hmit.entity.UserEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -95,7 +96,7 @@ public class AppointmentOrderDTO implements Serializable {
private
YynumberDTO
yynumberDTO
;
public
AppointmentOrderDTO
assembleAppointmentOrderDTO
(
ReservationDTO
reservationDTO
){
public
AppointmentOrderDTO
assembleAppointmentOrderDTO
(
ReservationDTO
reservationDTO
,
UserEntity
userEntity
){
AppointmentOrderDTO
dto
=
new
AppointmentOrderDTO
();
// 当天程序重启后标识位会重置,此处可以设置开始的标识位,4标识下一个生成的会是Y00004
...
...
@@ -111,13 +112,15 @@ public class AppointmentOrderDTO implements Serializable {
dto
.
setServiceName
(
reservationDTO
.
getServiceName
());
dto
.
setIsApp
(
reservationDTO
.
getIsApp
());
dto
.
setOrderQueueId
(
reservationDTO
.
getOrderQueueId
());
dto
.
setAppointmentPerson
(
reservationDTO
.
getAppointmentPerson
());
dto
.
setAppointmentPhone
(
reservationDTO
.
getAppointmentPhon
e
());
dto
.
setAppointmentIdCard
(
reservationDTO
.
getAppointmentIdCard
());
dto
.
setAppointmentPerson
(
userEntity
.
getUsername
());
dto
.
setAppointmentPhone
(
userEntity
.
getMobil
e
());
dto
.
setAppointmentIdCard
(
userEntity
.
getIdCardNo
());
dto
.
setAppointmentTime
(
reservationDTO
.
getAppointmentTime
());
dto
.
setServiceWindow
(
reservationDTO
.
getServiceWindow
());
dto
.
setRemark
(
reservationDTO
.
getRemark
());
dto
.
setCreator
(
userEntity
.
getId
());
dto
.
setUpdater
(
userEntity
.
getId
());
dto
.
setCreateDate
(
new
Date
());
dto
.
setUpdateDate
(
new
Date
());
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/dto/AppointmentOrderServiceDTO.java
View file @
3e8a0fae
package
io
.
hmit
.
modules
.
appointment
.
dto
;
import
io.hmit.entity.UserEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -43,10 +44,14 @@ public class AppointmentOrderServiceDTO implements Serializable {
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateDate
;
public
AppointmentOrderServiceDTO
assembleAppointmentOrderServiceDTO
(
AppointmentOrderDTO
orderDTO
){
public
AppointmentOrderServiceDTO
assembleAppointmentOrderServiceDTO
(
AppointmentOrderDTO
orderDTO
,
UserEntity
userEntity
){
AppointmentOrderServiceDTO
dto
=
new
AppointmentOrderServiceDTO
();
dto
.
setOrderId
(
orderDTO
.
getId
());
dto
.
setServiceId
(
orderDTO
.
getServiceId
());
dto
.
setCreator
(
userEntity
.
getId
());
dto
.
setUpdater
(
userEntity
.
getId
());
dto
.
setCreateDate
(
new
Date
());
dto
.
setUpdateDate
(
new
Date
());
return
dto
;
}
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/service/impl/AppointmentOrderServiceImpl.java
View file @
3e8a0fae
...
...
@@ -58,11 +58,13 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
String
id
=
(
String
)
params
.
get
(
"id"
);
String
userId
=
(
String
)
params
.
get
(
"userId"
);
String
flag
=
(
String
)
params
.
get
(
"flag"
);
String
status
=
(
String
)
params
.
get
(
"status"
);
QueryWrapper
<
AppointmentOrderEntity
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
wrapper
.
le
(
StringUtils
.
isNotBlank
(
flag
)
&&
"Y"
.
equals
(
flag
),
"status"
,
2
);
wrapper
.
ge
(
StringUtils
.
isNotBlank
(
flag
)
&&
"Q"
.
equals
(
flag
),
"status"
,
3
);
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
status
),
"status"
,
status
);
return
wrapper
;
...
...
@@ -88,7 +90,8 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
List
<
AppointmentOrderEntity
>
appointmentOrders
=
baseDao
.
selectList
(
new
QueryWrapper
<
AppointmentOrderEntity
>()
.
eq
(
StringUtils
.
isNotBlank
(
phone
),
"appointment_phone"
,
phone
)
.
eq
(
StringUtils
.
isNotBlank
(
idCard
),
"appointment_id_card"
,
idCard
)
.
eq
(
"status"
,
"1"
).
like
(
"appointment_time"
,
now
));
.
eq
(
"status"
,
Constant
.
ReservationStatus
.
RESERVATION
.
getValue
())
.
like
(
"appointment_time"
,
now
));
if
(
appointmentOrders
.
size
()==
0
){
return
null
;
...
...
hmit-api/src/main/resources/application-dev.yml
View file @
3e8a0fae
...
...
@@ -4,7 +4,7 @@ spring:
# driver-class-name: com.mysql.cj.jdbc.Driver
driver-class-name
:
com.mysql.jdbc.Driver
# url: jdbc:mysql://112.51.130.215:3306/security_enterprise?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai
url
:
jdbc:mysql://sh-cdb-jsrwe2i2.sql.tencentcdb.com:60548/bl_appointment?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false
url
:
jdbc:mysql://sh-cdb-jsrwe2i2.sql.tencentcdb.com:60548/bl_appointment?autoReconnect=true&useUnicode=true&characterEncoding=utf8&
serverTimezone=Asia/Shanghai&
zeroDateTimeBehavior=convertToNull&useSSL=false
username
:
root
password
:
Hmit@2020
initial-size
:
10
...
...
hmit-api/target/classes/META-INF/hmit-api.kotlin_module
deleted
100644 → 0
View file @
b6930e3c
File deleted
hmit-common/src/main/java/io/hmit/common/constant/Constant.java
View file @
3e8a0fae
...
...
@@ -93,12 +93,12 @@ public interface Constant {
String
MAIL_CONFIG_KEY
=
"MAIL_CONFIG_KEY"
;
/**
*
邮件配置KEY
*
预约时间--上午截止时间
*/
String
AM_END_TIME
=
"11:30"
;
/**
*
邮件配置KEY
*
预约时间--下午开始时间
*/
String
PM_START_TIME
=
"13:30"
;
...
...
@@ -189,4 +189,46 @@ public interface Constant {
}
}
/**
* 预约状态
*/
enum
ReservationStatus
{
/**
* 已预约
*/
RESERVATION
(
1
,
"已预约"
),
/**
* 预约已取消
*/
CANCEL
(
2
,
"预约已取消"
),
/**
* 已取号
*/
GET_NUM
(
3
,
"已取号"
),
/**
* 消除无效号码
*/
ELIMINATE_INVALID_NUM
(
4
,
"消除无效号码"
),
/**
* 爽约/失约
*/
BREAK_APPOINTMENT
(
0
,
"爽约"
);
private
int
value
;
private
String
msg
;
ReservationStatus
(
int
value
,
String
msg
)
{
this
.
value
=
value
;
this
.
msg
=
msg
;
}
public
int
getValue
()
{
return
value
;
}
public
String
getMsg
()
{
return
msg
;
}
}
}
hmit-common/src/main/java/io/hmit/common/entity/BaseEntity.java
View file @
3e8a0fae
...
...
@@ -31,4 +31,4 @@ public abstract class BaseEntity implements Serializable {
*/
@TableField
(
fill
=
FieldFill
.
INSERT
)
private
Date
createDate
;
}
\ No newline at end of file
}
hmit-common/src/main/java/io/hmit/common/utils/DateUtils.java
View file @
3e8a0fae
...
...
@@ -8,10 +8,7 @@ import org.joda.time.format.DateTimeFormatter;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.Calendar
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.*
;
/**
* 日期处理
...
...
@@ -24,6 +21,10 @@ public class DateUtils {
* 时间格式(yyyy-MM-dd)
*/
public
final
static
String
DATE_PATTERN
=
"yyyy-MM-dd"
;
/**
* 时间格式(HH:mm)
*/
public
final
static
String
HOUR_PATTERN
=
"HH:mm"
;
/**
* 时间格式(yyyy-MM-dd HH:mm:ss)
*/
...
...
@@ -267,4 +268,32 @@ public class DateUtils {
return
timeList
;
}
/**
* 将预约时间格式拆分,比较时间大小并返回
*
* @param times 开始时间 传入的时间格式:2021-02-02 08:30-09:00
* @return 当前时间是否大于传入的时间
* @throws ParseException
*/
public
static
boolean
compareTime
(
String
times
)
throws
ParseException
{
String
[]
time
=
times
.
split
(
" "
);
String
now
=
format
(
new
Date
());
if
(
now
.
compareTo
(
time
[
0
])>
0
){
System
.
out
.
println
(
"当前时间:"
+
now
+
" > 传入时间:"
+
time
[
0
]);
return
true
;
}
if
(
now
.
compareTo
(
time
[
0
])
==
0
){
String
hour
=
format
(
new
Date
(),
HOUR_PATTERN
);
String
[]
hours
=
time
[
1
].
split
(
"-"
);
if
(
hour
.
compareTo
(
hours
[
1
])
>
0
){
System
.
out
.
println
(
"当前小时:"
+
hour
+
" > 传入小时:"
+
hours
[
1
]);
}
return
true
;
}
return
false
;
}
}
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