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
94ad2118
Commit
94ad2118
authored
Mar 04, 2021
by
lings
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' into lings
parents
6d37d496
1282ba88
Show whitespace changes
Inline
Side-by-side
Showing
38 changed files
with
747 additions
and
47 deletions
+747
-47
.gitignore
hmit-admin/.gitignore
+1
-0
AppointmentOrderController.java
...es/appointment/controller/AppointmentOrderController.java
+2
-0
AppointmentOrderDTO.java
.../io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
+2
-2
AppointmentServiceDTO.java
...o/hmit/modules/appointment/dto/AppointmentServiceDTO.java
+3
-0
AppointmentOrderEntity.java
...it/modules/appointment/entity/AppointmentOrderEntity.java
+2
-2
AppointmentServiceEntity.java
.../modules/appointment/entity/AppointmentServiceEntity.java
+4
-0
AppointmentOrderExcel.java
...hmit/modules/appointment/excel/AppointmentOrderExcel.java
+2
-2
AppointmentServiceExcel.java
...it/modules/appointment/excel/AppointmentServiceExcel.java
+2
-0
AppointmentServiceDao.xml
...in/resources/mapper/appointment/AppointmentServiceDao.xml
+3
-2
AppointmentOrderController.java
...es/appointment/controller/AppointmentOrderController.java
+43
-19
AppointmentTimeManageController.java
...pointment/controller/AppointmentTimeManageController.java
+14
-0
CalendarController.java
...it/modules/appointment/controller/CalendarController.java
+54
-0
AppointmentOrderDao.java
.../io/hmit/modules/appointment/dao/AppointmentOrderDao.java
+3
-1
CalendarDao.java
...ain/java/io/hmit/modules/appointment/dao/CalendarDao.java
+16
-0
AppointmentOrderDTO.java
.../io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
+18
-13
AppointmentServiceDTO.java
...o/hmit/modules/appointment/dto/AppointmentServiceDTO.java
+7
-0
AppointmentTimeManageDTO.java
...mit/modules/appointment/dto/AppointmentTimeManageDTO.java
+3
-0
CalendarDTO.java
...ain/java/io/hmit/modules/appointment/dto/CalendarDTO.java
+35
-0
ReservationDTO.java
.../java/io/hmit/modules/appointment/dto/ReservationDTO.java
+1
-1
ReservationOrderInfoDTO.java
...hmit/modules/appointment/dto/ReservationOrderInfoDTO.java
+51
-0
ReservationSuccessDTO.java
...o/hmit/modules/appointment/dto/ReservationSuccessDTO.java
+31
-0
ReservationTimeDTO.java
...a/io/hmit/modules/appointment/dto/ReservationTimeDTO.java
+28
-0
UpdateInfoDTO.java
...n/java/io/hmit/modules/appointment/dto/UpdateInfoDTO.java
+38
-0
AppointmentOrderEntity.java
...it/modules/appointment/entity/AppointmentOrderEntity.java
+17
-2
AppointmentServiceEntity.java
.../modules/appointment/entity/AppointmentServiceEntity.java
+5
-0
CalendarEntity.java
...va/io/hmit/modules/appointment/entity/CalendarEntity.java
+34
-0
AppointmentOrderService.java
.../modules/appointment/service/AppointmentOrderService.java
+5
-1
AppointmentTimeManageService.java
...les/appointment/service/AppointmentTimeManageService.java
+5
-0
CalendarService.java
.../io/hmit/modules/appointment/service/CalendarService.java
+18
-0
AppointmentOrderServiceImpl.java
...appointment/service/impl/AppointmentOrderServiceImpl.java
+47
-1
AppointmentTimeManageServiceImpl.java
...ntment/service/impl/AppointmentTimeManageServiceImpl.java
+54
-0
CalendarServiceImpl.java
...modules/appointment/service/impl/CalendarServiceImpl.java
+46
-0
AppointmentOrderDao.xml
...main/resources/mapper/appointment/AppointmentOrderDao.xml
+2
-0
AppointmentServiceDao.xml
...in/resources/mapper/appointment/AppointmentServiceDao.xml
+1
-0
CalendarDao.xml
...api/src/main/resources/mapper/appointment/CalendarDao.xml
+14
-0
Constant.java
...ommon/src/main/java/io/hmit/common/constant/Constant.java
+12
-1
DateUtils.java
...-common/src/main/java/io/hmit/common/utils/DateUtils.java
+35
-0
SerialNumberTool.java
.../src/main/java/io/hmit/common/utils/SerialNumberTool.java
+89
-0
No files found.
hmit-admin/.gitignore
0 → 100644
View file @
94ad2118
# Created by .ignore support plugin (hsz.mobi)
hmit-admin/src/main/java/io/hmit/modules/appointment/controller/AppointmentOrderController.java
View file @
94ad2118
...
...
@@ -80,6 +80,7 @@ public class AppointmentOrderController {
/*
@GetMapping(value = "/signin/{appointmentOrderId}")
@ApiOperation("签到")
@LogOperation("签到")
...
...
@@ -96,6 +97,7 @@ public class AppointmentOrderController {
return new Result();
}
*/
@DeleteMapping
@ApiOperation
(
"删除"
)
...
...
hmit-admin/src/main/java/io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
View file @
94ad2118
...
...
@@ -56,7 +56,7 @@ public class AppointmentOrderDTO implements Serializable {
private
String
appointmentIdCard
;
@ApiModelProperty
(
value
=
"预约时间"
)
private
Date
appointmentTime
;
private
String
appointmentTime
;
@ApiModelProperty
(
value
=
"服务办事窗口"
)
private
String
serviceWindow
;
...
...
hmit-admin/src/main/java/io/hmit/modules/appointment/dto/AppointmentServiceDTO.java
View file @
94ad2118
...
...
@@ -28,6 +28,9 @@ public class AppointmentServiceDTO implements Serializable {
@ApiModelProperty
(
value
=
"服务事项父类id"
)
private
Long
pid
;
@ApiModelProperty
(
value
=
"取号机系统服务id"
)
private
String
sid
;
@ApiModelProperty
(
value
=
"排序"
)
private
Integer
sort
;
...
...
hmit-admin/src/main/java/io/hmit/modules/appointment/entity/AppointmentOrderEntity.java
View file @
94ad2118
...
...
@@ -66,7 +66,7 @@ public class AppointmentOrderEntity extends BaseEntity {
/**
* 预约时间
*/
private
Date
appointmentTime
;
private
String
appointmentTime
;
/**
* 服务办事窗口
*/
...
...
hmit-admin/src/main/java/io/hmit/modules/appointment/entity/AppointmentServiceEntity.java
View file @
94ad2118
...
...
@@ -27,6 +27,10 @@ public class AppointmentServiceEntity extends BaseEntity {
* 服务事项父类id
*/
private
Long
pid
;
/**
* 取号机系统服务id
*/
private
String
sid
;
/**
* 排序
*/
...
...
hmit-admin/src/main/java/io/hmit/modules/appointment/excel/AppointmentOrderExcel.java
View file @
94ad2118
...
...
@@ -38,7 +38,7 @@ public class AppointmentOrderExcel {
@Excel
(
name
=
"预约人身份证号码"
)
private
String
appointmentIdCard
;
@Excel
(
name
=
"预约时间"
)
private
Date
appointmentTime
;
private
String
appointmentTime
;
@Excel
(
name
=
"服务办事窗口"
)
private
String
serviceWindow
;
@Excel
(
name
=
"备注"
)
...
...
hmit-admin/src/main/java/io/hmit/modules/appointment/excel/AppointmentServiceExcel.java
View file @
94ad2118
...
...
@@ -19,6 +19,8 @@ public class AppointmentServiceExcel {
private
String
serviceName
;
@Excel
(
name
=
"服务事项父类id"
)
private
Long
pid
;
@Excel
(
name
=
"取号机系统服务id"
)
private
String
sid
;
@Excel
(
name
=
"排序"
)
private
Integer
sort
;
@Excel
(
name
=
"首页图标地址"
)
...
...
hmit-admin/src/main/resources/mapper/appointment/AppointmentServiceDao.xml
View file @
94ad2118
...
...
@@ -6,7 +6,8 @@
<resultMap
type=
"io.hmit.modules.appointment.entity.AppointmentServiceEntity"
id=
"appointmentServiceMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"serviceName"
column=
"service_name"
/>
<result
property=
"serviceParentId"
column=
"service_parent_id"
/>
<result
property=
"pid"
column=
"pid"
/>
<result
property=
"sid"
column=
"sid"
/>
<result
property=
"sort"
column=
"sort"
/>
<result
property=
"icon"
column=
"icon"
/>
<result
property=
"remark"
column=
"remark"
/>
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/controller/AppointmentOrderController.java
View file @
94ad2118
...
...
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
import
com.google.gson.JsonObject
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.DateUtils
;
import
io.hmit.common.utils.HttpRequestUtil
;
import
io.hmit.common.utils.MD5
;
...
...
@@ -13,9 +14,8 @@ import io.hmit.common.validator.ValidatorUtils;
import
io.hmit.common.validator.group.AddGroup
;
import
io.hmit.common.validator.group.DefaultGroup
;
import
io.hmit.common.validator.group.UpdateGroup
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.dto.AppointmentOrderServiceDTO
;
import
io.hmit.modules.appointment.dto.ReservationDTO
;
import
io.hmit.modules.appointment.dto.*
;
import
io.hmit.modules.appointment.entity.AppointmentOrderEntity
;
import
io.hmit.modules.appointment.service.AppointmentOrderService
;
import
io.hmit.modules.appointment.service.AppointmentOrderServiceService
;
import
io.swagger.annotations.Api
;
...
...
@@ -28,7 +28,9 @@ import org.springframework.web.bind.annotation.*;
import
org.springframework.web.client.RestTemplate
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Arrays
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -70,24 +72,24 @@ public class AppointmentOrderController {
return
new
Result
<
AppointmentOrderDTO
>().
ok
(
data
);
}
@GetMapping
(
"
identity/{identity}
"
)
@GetMapping
(
"
orderInfo
"
)
@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
);
public
Result
<
List
<
ReservationOrderInfoDTO
>>
queryInfo
(
String
identity
){
// PageData<AppointmentOrderDTO> pageData = appointmentOrderService.getAppointmentInfoPage(params, identity);
List
<
ReservationOrderInfoDTO
>
data
=
appointmentOrderService
.
getAppointmentInfoPage
(
identity
);
return
new
Result
<
PageData
<
AppointmentOrderDTO
>>().
ok
(
pageData
);
if
(
data
==
null
){
return
new
Result
<
List
<
ReservationOrderInfoDTO
>>().
error
(
1
,
"没有查询到此用户的预约信息"
);
}
if
(
data
.
size
()==
0
){
return
new
Result
<
List
<
ReservationOrderInfoDTO
>>().
error
(
2
,
"当前时段没有此用户的预约信息"
);
}
return
new
Result
<
List
<
ReservationOrderInfoDTO
>>().
ok
(
data
);
}
@PostMapping
@ApiOperation
(
"预约保存"
)
public
Result
save
(
@RequestBody
ReservationDTO
dto
){
public
Result
<
ReservationSuccessDTO
>
save
(
@RequestBody
ReservationDTO
dto
){
//校验数据
ValidatorUtils
.
validateEntity
(
dto
,
AddGroup
.
class
,
DefaultGroup
.
class
);
...
...
@@ -95,10 +97,34 @@ public class AppointmentOrderController {
appointmentOrderService
.
save
(
appointmentOrderDTO
);
ReservationSuccessDTO
successData
=
ConvertUtils
.
sourceToTarget
(
appointmentOrderDTO
,
ReservationSuccessDTO
.
class
);
AppointmentOrderServiceDTO
orderServiceDTO
=
new
AppointmentOrderServiceDTO
().
assembleAppointmentOrderServiceDTO
(
appointmentOrderDTO
);
appointmentOrderServiceService
.
save
(
orderServiceDTO
);
return
new
Result
().
ok
(
successData
);
}
@PostMapping
(
"/updateReservationInfo"
)
@ApiOperation
(
"更新预约人取号信息"
)
public
Result
updateReservationInfo
(
@RequestBody
UpdateInfoDTO
dto
){
AppointmentOrderEntity
appointmentOrderEntity
=
appointmentOrderService
.
selectById
(
dto
.
getOrderId
());
if
(
appointmentOrderEntity
==
null
){
return
new
Result
().
error
(
1
,
"当前预约id: "
+
dto
.
getOrderId
()+
" 的预约信息不存在!"
);
}
appointmentOrderEntity
.
setAppointmentNum
(
dto
.
getAppointmentNum
());
appointmentOrderEntity
.
setWaitNum
(
dto
.
getWaitNum
());
appointmentOrderEntity
.
setServiceWindow
(
String
.
join
(
","
,
dto
.
getListWin
()));
appointmentOrderEntity
.
setTicketDate
(
dto
.
getTicketDate
());
//取号机生成取号码则设置取号预约状态为:完成
appointmentOrderEntity
.
setStatus
(
2
);
appointmentOrderEntity
.
setStatusName
(
"已完成"
);
appointmentOrderService
.
updateById
(
appointmentOrderEntity
);
return
new
Result
();
}
...
...
@@ -114,7 +140,7 @@ public class AppointmentOrderController {
return
new
Result
();
}
/*
@GetMapping(value = "/signin/{appointmentOrderId}")
@ApiOperation("签到")
public Result signin(@PathVariable(value = "appointmentOrderId") Long appointmentOrderId){
...
...
@@ -164,12 +190,10 @@ public class AppointmentOrderController {
//获取当前订单预约时间
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
){
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/controller/AppointmentTimeManageController.java
View file @
94ad2118
...
...
@@ -3,6 +3,7 @@ package io.hmit.modules.appointment.controller;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
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
;
...
...
@@ -10,6 +11,7 @@ import io.hmit.common.validator.group.AddGroup;
import
io.hmit.common.validator.group.DefaultGroup
;
import
io.hmit.common.validator.group.UpdateGroup
;
import
io.hmit.modules.appointment.dto.AppointmentTimeManageDTO
;
import
io.hmit.modules.appointment.dto.ReservationTimeDTO
;
import
io.hmit.modules.appointment.entity.AppointmentTimeManageEntity
;
import
io.hmit.modules.appointment.service.AppointmentTimeManageService
;
import
io.swagger.annotations.Api
;
...
...
@@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.*;
import
springfox.documentation.annotations.ApiIgnore
;
import
javax.servlet.http.HttpServletResponse
;
import
java.text.ParseException
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -45,4 +48,15 @@ public class AppointmentTimeManageController {
return
new
Result
<
AppointmentTimeManageDTO
>().
ok
(
data
);
}
@GetMapping
(
"getReservationTime"
)
@ApiOperation
(
"获取预约时间 今天往后7天的可预约时间"
)
public
Result
<
List
<
ReservationTimeDTO
>>
getReservationTime
()
throws
ParseException
{
List
<
ReservationTimeDTO
>
data
=
appointmentTimeManageService
.
getReservationTimeList
();
return
new
Result
<
List
<
ReservationTimeDTO
>>().
ok
(
data
);
}
}
hmit-api/src/main/java/io/hmit/modules/appointment/controller/CalendarController.java
0 → 100644
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
controller
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.utils.Result
;
import
io.hmit.modules.appointment.dto.CalendarDTO
;
import
io.hmit.modules.appointment.service.CalendarService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
springfox.documentation.annotations.ApiIgnore
;
import
java.util.Map
;
/**
* 日历表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-04
*/
@RestController
@RequestMapping
(
"appointment/calendar"
)
@Api
(
tags
=
"日历表"
)
public
class
CalendarController
{
@Autowired
private
CalendarService
calendarService
;
@GetMapping
(
"page"
)
@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
<
CalendarDTO
>>
page
(
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
PageData
<
CalendarDTO
>
page
=
calendarService
.
page
(
params
);
return
new
Result
<
PageData
<
CalendarDTO
>>().
ok
(
page
);
}
@GetMapping
(
"{id}"
)
@ApiOperation
(
"信息"
)
public
Result
<
CalendarDTO
>
get
(
@PathVariable
(
"id"
)
Long
id
){
CalendarDTO
data
=
calendarService
.
get
(
id
);
return
new
Result
<
CalendarDTO
>().
ok
(
data
);
}
}
hmit-api/src/main/java/io/hmit/modules/appointment/dao/AppointmentOrderDao.java
View file @
94ad2118
...
...
@@ -16,7 +16,9 @@ import org.apache.ibatis.annotations.Param;
@Mapper
public
interface
AppointmentOrderDao
extends
BaseDao
<
AppointmentOrderEntity
>
{
IPage
<
AppointmentOrderDTO
>
getAppointmentInfo
(
IPage
<
AppointmentOrderEntity
>
page
,
String
phone
,
String
idCard
);
// Page版本V1.0
// IPage<AppointmentOrderDTO> getAppointmentInfo(IPage<AppointmentOrderEntity> page, String phone, String idCard);
AppointmentOrderDTO
getAppointmentInfo
(
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/dao/CalendarDao.java
0 → 100644
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
dao
;
import
io.hmit.common.dao.BaseDao
;
import
io.hmit.modules.appointment.entity.CalendarEntity
;
import
org.apache.ibatis.annotations.Mapper
;
/**
* 日历表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-04
*/
@Mapper
public
interface
CalendarDao
extends
BaseDao
<
CalendarEntity
>
{
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/appointment/dto/AppointmentOrderDTO.java
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
dto
;
import
io.hmit.common.utils.SerialNumberTool
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -57,8 +58,8 @@ public class AppointmentOrderDTO implements Serializable {
@ApiModelProperty
(
value
=
"预约人身份证号码"
)
private
String
appointmentIdCard
;
@ApiModelProperty
(
value
=
"预约时间"
)
private
Date
appointmentTime
;
@ApiModelProperty
(
value
=
"预约时间
段
"
)
private
String
appointmentTime
;
@ApiModelProperty
(
value
=
"服务办事窗口"
)
private
String
serviceWindow
;
...
...
@@ -78,24 +79,28 @@ public class AppointmentOrderDTO implements Serializable {
@ApiModelProperty
(
value
=
"订单发起人联系电话"
)
private
String
creatorTel
;
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createDate
;
@ApiModelProperty
(
value
=
"更新者"
)
private
Long
updater
;
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateDate
;
public
AppointmentOrderDTO
assembleAppointmentOrderDTO
(
ReservationDTO
reservationDTO
){
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createDate
;
@ApiModelProperty
(
value
=
"取号时间"
)
private
String
ticketDate
;
@ApiModelProperty
(
value
=
"等候人数"
)
private
Integer
waitNum
;
public
AppointmentOrderDTO
assembleAppointmentOrderDTO
(
ReservationDTO
reservationDTO
){
AppointmentOrderDTO
dto
=
new
AppointmentOrderDTO
();
Date
dt
=
new
Date
();
SimpleDateFormat
sf
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
String
strDate
=
sf
.
format
(
dt
);
UUID
uuid
=
UUID
.
randomUUID
();
String
[]
strSequence
=
uuid
.
toString
().
split
(
"-"
);
dto
.
setOrderNum
(
"YUYUE-"
+
strDate
+
"-"
+
strSequence
[
1
]);
// 当天程序重启后标识位会重置,此处可以设置开始的标识位,4标识下一个生成的会是Y00004
// SerialNumberTool.getInstance().operateFlag(4);
//内存保存流水号增长标记,按天重置标识位(程序重启后会重置),格式为:Y00001
dto
.
setOrderNum
(
"Y"
+
SerialNumberTool
.
getInstance
().
generaterNextNumber
(
5
));
dto
.
setAppointmentNum
(
reservationDTO
.
getAppointmentNum
());
dto
.
setStatus
(
1
);
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/dto/AppointmentServiceDTO.java
View file @
94ad2118
...
...
@@ -26,6 +26,9 @@ public class AppointmentServiceDTO extends TreeNode<AppointmentServiceDTO> imple
@ApiModelProperty
(
value
=
"服务事项名称"
)
private
String
serviceName
;
@ApiModelProperty
(
value
=
"取号机系统服务id"
)
private
String
sid
;
@ApiModelProperty
(
value
=
"服务事项父类id"
)
private
Long
pid
;
...
...
@@ -53,5 +56,9 @@ public class AppointmentServiceDTO extends TreeNode<AppointmentServiceDTO> imple
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateDate
;
@ApiModelProperty
(
value
=
"取号时间"
)
private
String
ticketDate
;
@ApiModelProperty
(
value
=
"等候人数,包含本次"
)
private
Integer
waitNum
;
}
hmit-api/src/main/java/io/hmit/modules/appointment/dto/AppointmentTimeManageDTO.java
View file @
94ad2118
...
...
@@ -37,5 +37,8 @@ public class AppointmentTimeManageDTO implements Serializable {
@ApiModelProperty
(
value
=
"使用状态 1 正在使用; 2 未使用"
)
private
String
useState
;
@ApiModelProperty
(
value
=
"预约时间段,返回时使用"
)
private
String
reservationTime
;
}
hmit-api/src/main/java/io/hmit/modules/appointment/dto/CalendarDTO.java
0 → 100644
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 日历表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-04
*/
@Data
@ApiModel
(
value
=
"日历表"
)
public
class
CalendarDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
""
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"日期"
)
private
String
day
;
@ApiModelProperty
(
value
=
"是否节假日 0 正常工作日 1,周末 2,法定节假日 3调休"
)
private
Integer
holiday
;
@ApiModelProperty
(
value
=
"星期"
)
private
Integer
dow
;
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/appointment/dto/ReservationDTO.java
View file @
94ad2118
...
...
@@ -44,7 +44,7 @@ public class ReservationDTO implements Serializable {
private
String
appointmentIdCard
;
@ApiModelProperty
(
value
=
"预约时间"
)
private
Date
appointmentTime
;
private
String
appointmentTime
;
@ApiModelProperty
(
value
=
"服务办事窗口"
)
private
String
serviceWindow
;
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/dto/ReservationOrderInfoDTO.java
0 → 100644
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
import
java.util.UUID
;
/**
* 预约订单表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-13
*/
@Data
@ApiModel
(
value
=
"预约订单表"
)
public
class
ReservationOrderInfoDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"取号机系统服务id"
)
private
String
sid
;
@ApiModelProperty
(
value
=
"预约工单状态 0未预约 ,1已预约 2已完成 3已取消"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"预约工单状态名称"
)
private
String
statusName
;
@ApiModelProperty
(
value
=
"预约人"
)
private
String
appointmentPerson
;
@ApiModelProperty
(
value
=
"预约人电话"
)
private
String
appointmentPhone
;
@ApiModelProperty
(
value
=
"预约人身份证号码"
)
private
String
appointmentIdCard
;
@ApiModelProperty
(
value
=
"预约时间"
)
private
String
appointmentTime
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
}
hmit-api/src/main/java/io/hmit/modules/appointment/dto/ReservationSuccessDTO.java
0 → 100644
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* 预约订单表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-13
*/
@Data
@ApiModel
(
value
=
"预约成功返回"
)
public
class
ReservationSuccessDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"预约工单编号(自己系统留痕用)"
)
private
String
orderNum
;
@ApiModelProperty
(
value
=
"预约时间段"
)
private
String
appointmentTime
;
@ApiModelProperty
(
value
=
"预约所属的服务事项名称"
)
private
String
serviceName
;
}
hmit-api/src/main/java/io/hmit/modules/appointment/dto/ReservationTimeDTO.java
0 → 100644
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 预约订单表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-13
*/
@Data
@ApiModel
(
value
=
"预约信息表"
)
public
class
ReservationTimeDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"预约时间"
)
private
String
reservationTime
;
@ApiModelProperty
(
value
=
"备注"
)
private
List
<
AppointmentTimeManageDTO
>
periods
;
}
hmit-api/src/main/java/io/hmit/modules/appointment/dto/UpdateInfoDTO.java
0 → 100644
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
dto
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* 预约订单表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-02-13
*/
@Data
@ApiModel
(
value
=
"更新预约取号信息DTO"
)
public
class
UpdateInfoDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"预约信息唯一ID"
)
private
Long
orderId
;
@ApiModelProperty
(
value
=
"取号机生成的ID"
)
private
String
appointmentNum
;
@ApiModelProperty
(
value
=
"等候人数"
)
private
Integer
waitNum
;
@ApiModelProperty
(
value
=
"取号时间"
)
private
String
ticketDate
;
@ApiModelProperty
(
value
=
"办理窗口"
)
private
String
[]
listWin
;
}
hmit-api/src/main/java/io/hmit/modules/appointment/entity/AppointmentOrderEntity.java
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.hmit.common.entity.BaseEntity
;
import
lombok.Data
;
...
...
@@ -66,7 +67,7 @@ public class AppointmentOrderEntity extends BaseEntity {
/**
* 预约时间
*/
private
Date
appointmentTime
;
private
String
appointmentTime
;
/**
* 服务办事窗口
*/
...
...
@@ -95,4 +96,18 @@ public class AppointmentOrderEntity extends BaseEntity {
* 更新时间
*/
private
Date
updateDate
;
/**
* 更新时间
*/
@TableField
(
exist
=
false
)
private
String
sid
;
/**
* 取号时间
*/
private
String
ticketDate
;
/**
* 等候人数
*/
private
Integer
waitNum
;
}
hmit-api/src/main/java/io/hmit/modules/appointment/entity/AppointmentServiceEntity.java
View file @
94ad2118
...
...
@@ -27,6 +27,10 @@ public class AppointmentServiceEntity extends BaseEntity {
* 服务事项父类id
*/
private
Long
pid
;
/**
* 取号机系统服务id
*/
private
String
sid
;
/**
* 排序
*/
...
...
@@ -51,4 +55,5 @@ public class AppointmentServiceEntity extends BaseEntity {
* 更新时间
*/
private
Date
updateDate
;
}
hmit-api/src/main/java/io/hmit/modules/appointment/entity/CalendarEntity.java
0 → 100644
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
entity
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.hmit.common.entity.BaseEntity
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
java.util.Date
;
/**
* 日历表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-04
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@TableName
(
"calendar"
)
public
class
CalendarEntity
extends
BaseEntity
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 日期
*/
private
String
day
;
/**
* 是否节假日 0 正常工作日 1,周末 2,法定节假日 3调休
*/
private
Integer
holiday
;
/**
* 星期
*/
private
Integer
dow
;
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/appointment/service/AppointmentOrderService.java
View file @
94ad2118
...
...
@@ -3,8 +3,10 @@ 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.dto.ReservationOrderInfoDTO
;
import
io.hmit.modules.appointment.entity.AppointmentOrderEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -15,7 +17,9 @@ import java.util.Map;
*/
public
interface
AppointmentOrderService
extends
CrudService
<
AppointmentOrderEntity
,
AppointmentOrderDTO
>
{
PageData
<
AppointmentOrderDTO
>
getAppointmentInfoPage
(
Map
<
String
,
Object
>
params
,
String
identity
);
// Page版本V1.0
// PageData<AppointmentOrderDTO> getAppointmentInfoPage(Map<String, Object> params, String identity);
List
<
ReservationOrderInfoDTO
>
getAppointmentInfoPage
(
String
identity
);
Integer
waitingNum
(
String
appointmentTime
);
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/service/AppointmentTimeManageService.java
View file @
94ad2118
...
...
@@ -2,8 +2,12 @@ package io.hmit.modules.appointment.service;
import
io.hmit.common.service.CrudService
;
import
io.hmit.modules.appointment.dto.AppointmentTimeManageDTO
;
import
io.hmit.modules.appointment.dto.ReservationTimeDTO
;
import
io.hmit.modules.appointment.entity.AppointmentTimeManageEntity
;
import
java.text.ParseException
;
import
java.util.List
;
/**
* 预约时间管理
*
...
...
@@ -13,5 +17,6 @@ import io.hmit.modules.appointment.entity.AppointmentTimeManageEntity;
public
interface
AppointmentTimeManageService
extends
CrudService
<
AppointmentTimeManageEntity
,
AppointmentTimeManageDTO
>
{
AppointmentTimeManageDTO
getByUseState
();
List
<
ReservationTimeDTO
>
getReservationTimeList
()
throws
ParseException
;
}
hmit-api/src/main/java/io/hmit/modules/appointment/service/CalendarService.java
0 → 100644
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
service
;
import
io.hmit.common.service.CrudService
;
import
io.hmit.modules.appointment.dto.CalendarDTO
;
import
io.hmit.modules.appointment.entity.CalendarEntity
;
import
java.util.List
;
/**
* 日历表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-04
*/
public
interface
CalendarService
extends
CrudService
<
CalendarEntity
,
CalendarDTO
>
{
List
<
CalendarDTO
>
weekDayList
();
}
hmit-api/src/main/java/io/hmit/modules/appointment/service/impl/AppointmentOrderServiceImpl.java
View file @
94ad2118
...
...
@@ -6,15 +6,18 @@ 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.common.utils.DateUtils
;
import
io.hmit.modules.appointment.dao.AppointmentOrderDao
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.dto.ReservationOrderInfoDTO
;
import
io.hmit.modules.appointment.entity.AppointmentOrderEntity
;
import
io.hmit.modules.appointment.service.AppointmentOrderService
;
import
io.hmit.modules.appointment.service.AppointmentServiceService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.
Map
;
import
java.util.
*
;
/**
* 预约订单表
...
...
@@ -28,6 +31,9 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
@Resource
private
AppointmentOrderDao
appointmentOrderDao
;
@Resource
private
AppointmentServiceService
appointmentServiceService
;
/**
* 电话号码校验(不包含港澳台手机号)
*/
...
...
@@ -48,6 +54,45 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
return
wrapper
;
}
@Override
public
List
<
ReservationOrderInfoDTO
>
getAppointmentInfoPage
(
String
identity
)
{
String
phone
=
null
;
String
idCard
=
null
;
if
(
identity
.
matches
(
VALIDATE_PHONE
))
{
phone
=
identity
;
}
if
(
identity
.
matches
(
ID_NUMBER
))
{
idCard
=
identity
;
}
String
now
=
DateUtils
.
format
(
new
Date
());
String
hour
=
DateUtils
.
format
(
new
Date
(),
"HH:mm:ss"
);
List
<
AppointmentOrderEntity
>
appointmentOrderEntities
=
new
ArrayList
<>();
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
));
if
(
appointmentOrders
.
size
()==
0
){
return
null
;
}
appointmentOrders
.
stream
().
forEach
(
item
->{
List
<
String
>
hours
=
new
ArrayList
<>();
Arrays
.
stream
(
item
.
getAppointmentTime
().
substring
(
11
).
split
(
"-"
))
.
forEach
(
time
->
hours
.
add
(
time
));
if
(
hours
.
get
(
0
).
compareTo
(
hour
)<
0
&&
hours
.
get
(
1
).
compareTo
(
hour
)>
0
){
item
.
setSid
(
appointmentServiceService
.
selectById
(
item
.
getServiceId
()).
getSid
());
appointmentOrderEntities
.
add
(
item
);
}
});
return
ConvertUtils
.
sourceToTarget
(
appointmentOrderEntities
,
ReservationOrderInfoDTO
.
class
);
}
/*
//Page版本V1.0
@Override
public PageData<AppointmentOrderDTO> getAppointmentInfoPage(Map<String, Object> params, String identity) {
String phone = null;
...
...
@@ -63,6 +108,7 @@ public class AppointmentOrderServiceImpl extends CrudServiceImpl<AppointmentOrde
return getPageData(appointmentOrderDTOIPage, AppointmentOrderDTO.class);
}
*/
@Override
public
Integer
waitingNum
(
String
appointmentTime
)
{
...
...
hmit-api/src/main/java/io/hmit/modules/appointment/service/impl/AppointmentTimeManageServiceImpl.java
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
io.hmit.common.constant.Constant
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.DateUtils
;
import
io.hmit.modules.appointment.dao.AppointmentTimeManageDao
;
import
io.hmit.modules.appointment.dto.AppointmentOrderDTO
;
import
io.hmit.modules.appointment.dto.AppointmentTimeManageDTO
;
import
io.hmit.modules.appointment.dto.CalendarDTO
;
import
io.hmit.modules.appointment.dto.ReservationTimeDTO
;
import
io.hmit.modules.appointment.entity.AppointmentTimeManageEntity
;
import
io.hmit.modules.appointment.service.AppointmentTimeManageService
;
import
io.hmit.modules.appointment.service.CalendarService
;
import
net.sf.jsqlparser.statement.create.table.CreateTable
;
import
org.apache.commons.lang3.Conversion
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.text.ParseException
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -23,6 +34,12 @@ import java.util.Map;
@Service
public
class
AppointmentTimeManageServiceImpl
extends
CrudServiceImpl
<
AppointmentTimeManageDao
,
AppointmentTimeManageEntity
,
AppointmentTimeManageDTO
>
implements
AppointmentTimeManageService
{
@Autowired
private
CalendarService
calendarService
;
@Autowired
private
AppointmentTimeManageService
appointmentTimeManageService
;
@Override
public
QueryWrapper
<
AppointmentTimeManageEntity
>
getWrapper
(
Map
<
String
,
Object
>
params
){
String
id
=
(
String
)
params
.
get
(
"id"
);
...
...
@@ -43,4 +60,41 @@ public class AppointmentTimeManageServiceImpl extends CrudServiceImpl<Appointmen
return
ConvertUtils
.
sourceToTarget
(
entity
,
AppointmentTimeManageDTO
.
class
);
}
@Override
public
List
<
ReservationTimeDTO
>
getReservationTimeList
()
throws
ParseException
{
AppointmentTimeManageDTO
timeManageDTO
=
appointmentTimeManageService
.
getByUseState
();
String
startTime
=
timeManageDTO
.
getStartTime
();
String
endTime
=
timeManageDTO
.
getEndTime
();
String
period
=
timeManageDTO
.
getPeriod
();
List
<
AppointmentTimeManageDTO
>
timeManageDTOS
=
new
ArrayList
<>();
List
<
String
>
timePeriods
=
new
ArrayList
<>();
List
<
String
>
amLists
=
DateUtils
.
getTimePeriod
(
startTime
,
Constant
.
AM_END_TIME
,
period
);
List
<
String
>
pmLists
=
DateUtils
.
getTimePeriod
(
Constant
.
PM_START_TIME
,
endTime
,
period
);
timePeriods
.
addAll
(
amLists
);
timePeriods
.
addAll
(
pmLists
);
timePeriods
.
stream
().
forEach
(
item
->{
AppointmentTimeManageDTO
dto
=
new
AppointmentTimeManageDTO
();
dto
.
setReservationTime
(
item
);
timeManageDTOS
.
add
(
dto
);
});
List
<
ReservationTimeDTO
>
reservationTimeDTOList
=
new
ArrayList
<>();
List
<
CalendarDTO
>
dayLists
=
calendarService
.
weekDayList
().
subList
(
0
,
6
);
dayLists
.
stream
().
forEach
(
item
->{
ReservationTimeDTO
reservationTime
=
new
ReservationTimeDTO
();
reservationTime
.
setReservationTime
(
item
.
getDay
());
reservationTime
.
setPeriods
(
timeManageDTOS
);
reservationTimeDTOList
.
add
(
reservationTime
);
});
return
reservationTimeDTOList
;
}
}
hmit-api/src/main/java/io/hmit/modules/appointment/service/impl/CalendarServiceImpl.java
0 → 100644
View file @
94ad2118
package
io
.
hmit
.
modules
.
appointment
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.DateUtils
;
import
io.hmit.modules.appointment.dao.CalendarDao
;
import
io.hmit.modules.appointment.dto.CalendarDTO
;
import
io.hmit.modules.appointment.entity.CalendarEntity
;
import
io.hmit.modules.appointment.service.CalendarService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* 日历表
*
* @author zsh 408538940@qq.com
* @since 1.0.0 2021-03-04
*/
@Service
public
class
CalendarServiceImpl
extends
CrudServiceImpl
<
CalendarDao
,
CalendarEntity
,
CalendarDTO
>
implements
CalendarService
{
@Override
public
QueryWrapper
<
CalendarEntity
>
getWrapper
(
Map
<
String
,
Object
>
params
){
String
id
=
(
String
)
params
.
get
(
"id"
);
QueryWrapper
<
CalendarEntity
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
StringUtils
.
isNotBlank
(
id
),
"id"
,
id
);
return
wrapper
;
}
@Override
public
List
<
CalendarDTO
>
weekDayList
()
{
String
now
=
DateUtils
.
format
(
new
Date
());
List
<
CalendarEntity
>
calendarList
=
baseDao
.
selectList
(
new
QueryWrapper
<
CalendarEntity
>().
gt
(
"day"
,
now
)
.
ne
(
"holiday"
,
1
).
ne
(
"holiday"
,
2
));
return
ConvertUtils
.
sourceToTarget
(
calendarList
,
CalendarDTO
.
class
);
}
}
hmit-api/src/main/resources/mapper/appointment/AppointmentOrderDao.xml
View file @
94ad2118
...
...
@@ -26,6 +26,8 @@
<result
property=
"createDate"
column=
"create_date"
/>
<result
property=
"updater"
column=
"updater"
/>
<result
property=
"updateDate"
column=
"update_date"
/>
<result
property=
"waitNum"
column=
"wait_num"
/>
<result
property=
"ticketDate"
column=
"ticket_date"
/>
</resultMap>
<select
id=
"getAppointmentInfo"
resultType=
"io.hmit.modules.appointment.dto.AppointmentOrderDTO"
>
...
...
hmit-api/src/main/resources/mapper/appointment/AppointmentServiceDao.xml
View file @
94ad2118
...
...
@@ -7,6 +7,7 @@
<result
property=
"id"
column=
"id"
/>
<result
property=
"serviceName"
column=
"service_name"
/>
<result
property=
"pid"
column=
"pid"
/>
<result
property=
"sid"
column=
"sid"
/>
<result
property=
"sort"
column=
"sort"
/>
<result
property=
"icon"
column=
"icon"
/>
<result
property=
"remark"
column=
"remark"
/>
...
...
hmit-api/src/main/resources/mapper/appointment/CalendarDao.xml
0 → 100644
View file @
94ad2118
<?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">
<mapper
namespace=
"io.hmit.modules.appointment.dao.CalendarDao"
>
<resultMap
type=
"io.hmit.modules.appointment.entity.CalendarEntity"
id=
"calendarMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"day"
column=
"day"
/>
<result
property=
"holiday"
column=
"holiday"
/>
<result
property=
"dow"
column=
"dow"
/>
</resultMap>
</mapper>
\ No newline at end of file
hmit-common/src/main/java/io/hmit/common/constant/Constant.java
View file @
94ad2118
...
...
@@ -92,6 +92,16 @@ public interface Constant {
*/
String
MAIL_CONFIG_KEY
=
"MAIL_CONFIG_KEY"
;
/**
* 邮件配置KEY
*/
String
AM_END_TIME
=
"11:30"
;
/**
* 邮件配置KEY
*/
String
PM_START_TIME
=
"13:30"
;
/**
* 定时任务状态
*/
...
...
@@ -178,4 +188,5 @@ public interface Constant {
return
value
;
}
}
}
hmit-common/src/main/java/io/hmit/common/utils/DateUtils.java
View file @
94ad2118
...
...
@@ -8,7 +8,10 @@ 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
;
/**
* 日期处理
...
...
@@ -192,4 +195,36 @@ public class DateUtils {
DateTime
dateTime
=
new
DateTime
(
date
);
return
dateTime
.
plusYears
(
years
).
toDate
();
}
/**
* 将一段时间段拆分成子区间 按照时间间隔拆分
*
* @param startTime 开始时间
* @param endTime 结束时间
* @param period 时间间隔 单位:分钟
* @return 按时间间隔划分的子时间区间List
* @throws ParseException
*/
public
static
List
<
String
>
getTimePeriod
(
String
startTime
,
String
endTime
,
String
period
)
throws
ParseException
{
SimpleDateFormat
sf
=
new
SimpleDateFormat
(
"HH:mm"
);
List
<
String
>
timeList
=
new
ArrayList
<>();
while
(
startTime
.
compareTo
(
endTime
)<
0
){
Calendar
c
=
Calendar
.
getInstance
();
c
.
setTime
(
sf
.
parse
(
startTime
));
long
sec
=
c
.
getTimeInMillis
();
sec
+=
Integer
.
parseInt
(
period
)
*
60
*
1000
;
Date
data
=
new
Date
(
sec
);
String
time21
=
sf
.
format
(
data
);
if
(
time21
.
compareTo
(
endTime
)>
0
){
time21
=
endTime
;
}
System
.
out
.
println
(
startTime
+
"-"
+
time21
);
timeList
.
add
(
startTime
+
"-"
+
time21
);
startTime
=
time21
;
}
return
timeList
;
}
}
hmit-common/src/main/java/io/hmit/common/utils/SerialNumberTool.java
0 → 100644
View file @
94ad2118
package
io
.
hmit
.
common
.
utils
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
/**
* @author Eve
* @email mengmengeve@gmail.com
* @create 2021/3/1
*/
/**
* 流水号生成类 :内存保存流水号增长标记,按天重置标识位
*/
public
class
SerialNumberTool
{
private
static
SerialNumberTool
serialNumberTool
=
null
;
private
static
SimpleDateFormat
yMd
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
//用于自增长的标识
private
Integer
flag
;
//用于记录日期
private
Date
date
;
private
SerialNumberTool
()
{
if
(
date
==
null
||
!(
yMd
.
format
(
new
Date
()).
equals
(
yMd
.
format
(
date
)))){
date
=
new
Date
();
flag
=
1
;
}
}
/**
* 判断是否改变
*/
private
void
checkChangeDay
(){
if
(
date
==
null
||
!(
yMd
.
format
(
new
Date
()).
equals
(
yMd
.
format
(
date
)))){
date
=
new
Date
();
flag
=
1
;
}
}
/**
* 取得PrimaryGenerater的单例实现
*
* @return
*/
public
static
SerialNumberTool
getInstance
()
{
if
(
serialNumberTool
==
null
)
{
synchronized
(
SerialNumberTool
.
class
)
{
if
(
serialNumberTool
==
null
)
{
serialNumberTool
=
new
SerialNumberTool
();
}
}
}
return
serialNumberTool
;
}
/**
* 生成下一个编号,前缀自动补全 0
* params:
* 2.places 需要补全的总位数
*
*/
public
synchronized
String
generaterNextNumber
(
int
places
)
{
checkChangeDay
();
StringBuffer
stringBuffer
=
new
StringBuffer
();
int
numPlaces
=
flag
.
toString
().
length
();
//数字位数小于需要补全的总位数,需要补全0
if
(
numPlaces
<
places
){
for
(
int
i
=
0
;
i
<
places
-
numPlaces
;
i
++)
{
stringBuffer
.
append
(
"0"
);
}
stringBuffer
.
append
(
flag
);
}
else
stringBuffer
.
append
(
flag
.
toString
());
flag
++;
return
stringBuffer
.
toString
();
}
/**
* 避免当断网后重连或者服务器重启时导致标识flag清0,可以手动设置flag的开始点
* @param position
*/
public
void
operateFlag
(
int
position
){
this
.
flag
=
position
;
}
}
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