Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
Overview
Overview
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
pseer
gxpt_ht
Commits
ca433f57
Commit
ca433f57
authored
Oct 19, 2023
by
wuwenlong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
room status opt;
parent
99234a00
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
19 additions
and
15 deletions
+19
-15
DateUtils.java
share-common/src/main/java/share/common/utils/DateUtils.java
+3
-2
SStoreController.java
...in/java/share/web/controller/system/SStoreController.java
+1
-1
WebConfig.java
...-front/src/main/java/share/web/core/config/WebConfig.java
+1
-0
RoomStatusServiceImpl.java
...java/share/system/service/impl/RoomStatusServiceImpl.java
+11
-8
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+3
-4
No files found.
share-common/src/main/java/share/common/utils/DateUtils.java
View file @
ca433f57
...
@@ -31,9 +31,10 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
...
@@ -31,9 +31,10 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils
public
static
String
YYYY_MM_DD_HH_MM_SS
=
"yyyy-MM-dd HH:mm:ss"
;
public
static
String
YYYY_MM_DD_HH_MM_SS
=
"yyyy-MM-dd HH:mm:ss"
;
private
static
String
[]
parsePatterns
=
{
private
static
String
[]
parsePatterns
=
{
"yyyy-MM-dd"
,
"yyyy-MM-dd HH:mm:ss"
,
"yyyy-MM-dd HH:mm"
,
"yyyy-MM
"
,
"yyyy-MM-dd"
,
"yyyy-MM-dd HH:mm:ss"
,
"yyyy-MM-dd HH:mm"
,
"yyyy-MM
-dd HH"
,
"yyyy-MM"
,
"yyyy/MM/dd"
,
"yyyy/MM/dd HH:mm:ss"
,
"yyyy/MM/dd HH:mm"
,
"yyyy/MM"
,
"yyyy/MM/dd"
,
"yyyy/MM/dd HH:mm:ss"
,
"yyyy/MM/dd HH:mm"
,
"yyyy/MM"
,
"yyyy.MM.dd"
,
"yyyy.MM.dd HH:mm:ss"
,
"yyyy.MM.dd HH:mm"
,
"yyyy.MM"
};
"yyyy.MM.dd"
,
"yyyy.MM.dd HH:mm:ss"
,
"yyyy.MM.dd HH:mm"
,
"yyyy.MM"
};
/**
/**
* 获取当前Date型日期
* 获取当前Date型日期
...
...
share-front/src/main/java/share/web/controller/system/SStoreController.java
View file @
ca433f57
...
@@ -62,7 +62,7 @@ public class SStoreController extends BaseController
...
@@ -62,7 +62,7 @@ public class SStoreController extends BaseController
*/
*/
@ApiOperation
(
value
=
"按距离排序查询门店列表"
)
@ApiOperation
(
value
=
"按距离排序查询门店列表"
)
@RequestMapping
(
value
=
"/listVo"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/listVo"
,
method
=
RequestMethod
.
POST
)
public
R
<
List
<
SStoreVo
>>
list
ByDistance
(
@RequestBody
SStoreRequest
request
)
public
R
<
List
<
SStoreVo
>>
list
Vo
(
@RequestBody
SStoreRequest
request
)
{
{
startPage
();
startPage
();
return
R
.
ok
(
sStoreService
.
listVo
(
request
));
return
R
.
ok
(
sStoreService
.
listVo
(
request
));
...
...
share-front/src/main/java/share/web/core/config/WebConfig.java
View file @
ca433f57
...
@@ -64,6 +64,7 @@ public class WebConfig implements WebMvcConfigurer {
...
@@ -64,6 +64,7 @@ public class WebConfig implements WebMvcConfigurer {
"/front/wechat/**"
,
"/front/wechat/**"
,
"/front/login/**"
,
"/front/login/**"
,
"/front/store/**"
,
"/front/store/**"
,
"/front/room/**"
,
"**"
"**"
).
addPathPatterns
(
"/**"
);
).
addPathPatterns
(
"/**"
);
}
}
...
...
share-system/src/main/java/share/system/service/impl/RoomStatusServiceImpl.java
View file @
ca433f57
...
@@ -78,31 +78,34 @@ public class RoomStatusServiceImpl implements RoomStatusService {
...
@@ -78,31 +78,34 @@ public class RoomStatusServiceImpl implements RoomStatusService {
//设置时间段房间可预约状态(可预约:大于营业开始时间,小于营业结束时间,大于当前时间,当前时间没有订单)
//设置时间段房间可预约状态(可预约:大于营业开始时间,小于营业结束时间,大于当前时间,当前时间没有订单)
private
void
setTimeHourStatus
(
RoomStatusVo
vo
,
Date
timeHourDate
,
SStore
store
,
List
<
SOrder
>
orderList
,
String
day
,
String
finalNowTime
){
private
void
setTimeHourStatus
(
RoomStatusVo
vo
,
Date
timeHourDate
,
SStore
store
,
List
<
SOrder
>
orderList
,
String
day
,
String
finalNowTime
){
vo
.
setStatus
(
RoomStatusEnum
.
FREE
.
getValue
());
vo
.
setStatus
(
RoomStatusEnum
.
FREE
.
getValue
());
//门店存在营业时间
if
(
StringUtils
.
isNotBlank
(
store
.
getOpenStartTime
()))
{
//当前时段小于营业开始时间
//当前时段小于营业开始时间
if
(
timeHourDate
.
compareTo
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenStartTime
()))==-
1
)
{
if
(
timeHourDate
.
compareTo
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenStartTime
()))
==
-
1
)
{
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
vo
.
setStartHoldTime
(
timeHourDate
);
vo
.
setStartHoldTime
(
timeHourDate
);
//判断是否是同一个小时,如果是同一个小时,占用结束时间为营业开始时间
//判断是否是同一个小时,如果是同一个小时,占用结束时间为营业开始时间
if
(
timeHourDate
.
compareTo
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenStartTime
().
split
(
":"
)[
0
]))
==
0
)
{
if
(
timeHourDate
.
compareTo
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenStartTime
().
split
(
":"
)[
0
]))
==
0
)
{
vo
.
setEndHoldTime
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenStartTime
()));
vo
.
setEndHoldTime
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenStartTime
()));
}
else
{
}
else
{
//占用结束时间为当前时段59分59秒
//占用结束时间为当前时段59分59秒
vo
.
setEndHoldTime
(
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
));
vo
.
setEndHoldTime
(
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
));
}
}
}
}
//当前时段大于营业结束时间
//当前时段大于营业结束时间
if
(
timeHourDate
.
compareTo
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenEndTime
()))==
1
)
{
if
(
timeHourDate
.
compareTo
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenEndTime
()))
==
1
)
{
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
//占用结束时间为当前时段59分59秒
//占用结束时间为当前时段59分59秒
vo
.
setEndHoldTime
(
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
));
vo
.
setEndHoldTime
(
DateUtils
.
addSeconds
(
timeHourDate
,
59
*
60
+
59
));
//判断是否是同一个小时,如果是同一个小时,占用开始时间为营业结束时间
//判断是否是同一个小时,如果是同一个小时,占用开始时间为营业结束时间
if
(
timeHourDate
.
compareTo
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenEndTime
().
split
(
":"
)[
0
]))
==
0
)
{
if
(
timeHourDate
.
compareTo
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenEndTime
().
split
(
":"
)[
0
]))
==
0
)
{
vo
.
setStartHoldTime
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenEndTime
()));
vo
.
setStartHoldTime
(
DateUtils
.
parseDate
(
day
+
" "
+
store
.
getOpenEndTime
()));
}
else
{
}
else
{
//占用开始时间为当前时段0分0秒
//占用开始时间为当前时段0分0秒
vo
.
setStartHoldTime
(
timeHourDate
);
vo
.
setStartHoldTime
(
timeHourDate
);
}
}
}
}
}
//当前时段小于当前时间
//当前时段小于当前时间
if
(
timeHourDate
.
compareTo
(
DateUtils
.
parseDate
(
day
+
" "
+
finalNowTime
))==-
1
){
if
(
timeHourDate
.
compareTo
(
DateUtils
.
parseDate
(
day
+
" "
+
finalNowTime
))==-
1
){
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
vo
.
setStatus
(
RoomStatusEnum
.
HOLD
.
getValue
());
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
ca433f57
...
@@ -102,14 +102,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
...
@@ -102,14 +102,13 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper,SOrder> implemen
@Override
@Override
public
List
<
SOrder
>
listByRoomInfo
(
Long
storeId
,
Long
roomId
,
Date
day
)
{
public
List
<
SOrder
>
listByRoomInfo
(
Long
storeId
,
Long
roomId
,
Date
day
)
{
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
SOrder
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
//TODO order表待调整
queryWrapper
.
eq
(
SOrder:
:
getStoreId
,
storeId
);
queryWrapper
.
eq
(
SOrder:
:
getStoreId
,
storeId
);
queryWrapper
.
eq
(
SOrder:
:
getRoomId
,
roomId
);
queryWrapper
.
eq
(
SOrder:
:
getRoomId
,
roomId
);
String
nowDayStr
=
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
day
);
String
nowDayStr
=
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
day
);
String
nextDayStr
=
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
DateUtils
.
addDays
(
day
,
1
));
String
nextDayStr
=
DateUtils
.
parseDateToStr
(
DateUtils
.
YYYY_MM_DD
,
DateUtils
.
addDays
(
day
,
1
));
queryWrapper
.
apply
(
"(DATE_FORMAT(IFNULL(start_date,p
er
_start_date), '%Y-%m-%d') = '"
+
nowDayStr
+
"' "
+
queryWrapper
.
apply
(
"(DATE_FORMAT(IFNULL(start_date,p
re
_start_date), '%Y-%m-%d') = '"
+
nowDayStr
+
"' "
+
" OR DATE_FORMAT(IFNULL(start_date,p
er
_start_date), '%Y-%m-%d') = '"
+
nextDayStr
+
"')"
);
" OR DATE_FORMAT(IFNULL(start_date,p
re
_start_date), '%Y-%m-%d') = '"
+
nextDayStr
+
"')"
);
queryWrapper
.
apply
(
"ORDER BY IFNULL(start_date,per
_start_date) "
);
queryWrapper
.
last
(
"ORDER BY IFNULL(start_date,pre
_start_date) "
);
return
list
(
queryWrapper
);
return
list
(
queryWrapper
);
}
}
}
}
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