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
1464646a
Commit
1464646a
authored
Mar 27, 2024
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
房间添加订单预定 时间
订单续费添加客服短信发送
parent
480fe45a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
107 additions
and
7 deletions
+107
-7
SmsTypeEnum.java
...-common/src/main/java/share/common/enums/SmsTypeEnum.java
+1
-0
SRoomVo.java
...-system/src/main/java/share/system/domain/vo/SRoomVo.java
+15
-0
SOrderMapper.java
...ystem/src/main/java/share/system/mapper/SOrderMapper.java
+2
-0
ISOrderService.java
...em/src/main/java/share/system/service/ISOrderService.java
+2
-0
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+5
-0
SRoomServiceImpl.java
...main/java/share/system/service/impl/SRoomServiceImpl.java
+28
-0
SmsServiceImpl.java
...c/main/java/share/system/service/impl/SmsServiceImpl.java
+9
-7
SOrderMapper.xml
...-system/src/main/resources/mapper/system/SOrderMapper.xml
+45
-0
No files found.
share-common/src/main/java/share/common/enums/SmsTypeEnum.java
View file @
1464646a
...
...
@@ -17,6 +17,7 @@ public enum SmsTypeEnum {
SMS_DEVICE_ABNORMAL_TEMP
(
7
,
"sms.device.abnormal.template"
,
"设备状态异常变更短信提醒"
),
SMS_DEVICE_GATEWAY_TEMP
(
8
,
"sms.device.gateway.template"
,
"网关设备离线提醒短信"
),
SMS_ORDER_PREDETERMINE_TEMP
(
9
,
"system.order.predetermine.template"
,
"订单预定短信提醒"
),
SMS_ORDER_RENEW_TEMP
(
10
,
"system.order.renew.template"
,
"订单续费短信提醒"
),
;
private
Integer
code
;
...
...
share-system/src/main/java/share/system/domain/vo/SRoomVo.java
View file @
1464646a
...
...
@@ -144,6 +144,21 @@ public class SRoomVo extends BaseEntity
*/
private
List
<
RoomStatusVo
>
roomStatusList
;
/**
* 当天最后预定订单时间
*/
private
Long
orderTime
;
/**
* 0-无,1-分钟,2-小时
*/
private
Integer
orderTimeType
;
/**
* 当天最后预定订单类型
*/
private
Integer
orderType
;
@Override
public
String
toString
()
{
...
...
share-system/src/main/java/share/system/mapper/SOrderMapper.java
View file @
1464646a
...
...
@@ -66,4 +66,6 @@ public interface SOrderMapper extends BaseMapper<SOrder>
List
<
SOrder
>
queryList
(
Long
roomId
);
SOrder
getInfoByEntity
(
SOrder
orderParam
);
List
<
SOrder
>
selectSOrderByMaxTime
(
SOrder
order
);
}
share-system/src/main/java/share/system/service/ISOrderService.java
View file @
1464646a
...
...
@@ -211,4 +211,6 @@ public interface ISOrderService extends IService<SOrder>
Boolean
changeRoom
(
SOrderDto
dto
);
List
<
SOrderVo
>
exportList
(
SOrder
sOrder
);
List
<
SOrder
>
selectSOrderByMaxTime
(
SOrder
orderQuery
);
}
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
1464646a
...
...
@@ -695,6 +695,11 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
return
sOrderVos
;
}
@Override
public
List
<
SOrder
>
selectSOrderByMaxTime
(
SOrder
orderQuery
)
{
return
baseMapper
.
selectSOrderByMaxTime
(
orderQuery
);
}
/**
* 新增订单
*
...
...
share-system/src/main/java/share/system/service/impl/SRoomServiceImpl.java
View file @
1464646a
package
share
.
system
.
service
.
impl
;
import
cn.hutool.core.date.DateUnit
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
...
...
@@ -21,6 +23,7 @@ import share.system.mapper.SStoreConsumerMapper;
import
share.system.service.*
;
import
java.util.*
;
import
java.util.function.Function
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -133,6 +136,14 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
wrapper
.
in
(
SOrder:
:
getRoomId
,
roomIds
);
wrapper
.
eq
(
SOrder:
:
getStatus
,
OrderStatusEnum
.
INUSE
.
getCode
());
List
<
SOrder
>
list
=
orderService
.
list
(
wrapper
);
// 查询每一个房间最后一条预定订单下单时间
Date
now
=
DateUtil
.
date
();
SOrder
orderQuery
=
new
SOrder
();
orderQuery
.
setStoreId
(
store
.
getId
());
orderQuery
.
setCreateTime
(
now
);
List
<
SOrder
>
orderList
=
orderService
.
selectSOrderByMaxTime
(
orderQuery
);
Map
<
Long
,
SOrder
>
roomOrder
=
Optional
.
ofNullable
(
orderList
).
orElse
(
new
ArrayList
<>()).
stream
().
collect
(
Collectors
.
toMap
(
SOrder:
:
getRoomId
,
Function
.
identity
()));
roomList
.
stream
().
forEach
(
sRoom
->
{
SRoomVo
vo
=
new
SRoomVo
();
BeanUtils
.
copyProperties
(
sRoom
,
vo
);
...
...
@@ -162,6 +173,23 @@ public class SRoomServiceImpl extends ServiceImpl<SRoomMapper, SRoom> implements
}
});
}
// 计算当天预定最后预定时间
SOrder
order
=
roomOrder
.
get
(
vo
.
getId
());
if
(
order
!=
null
)
{
long
betweenMinute
=
DateUtil
.
between
(
order
.
getCreateTime
(),
now
,
DateUnit
.
MINUTE
);
if
(
betweenMinute
<
60
)
{
vo
.
setOrderTimeType
(
1
);
vo
.
setOrderTime
(
betweenMinute
);
}
else
{
long
betweenHour
=
DateUtil
.
between
(
order
.
getCreateTime
(),
now
,
DateUnit
.
HOUR
);
vo
.
setOrderTimeType
(
2
);
vo
.
setOrderTime
(
betweenHour
);
}
vo
.
setOrderType
(
order
.
getOrderType
());
}
else
{
vo
.
setOrderTimeType
(
0
);
vo
.
setOrderTime
(
0L
);
}
voList
.
add
(
vo
);
});
}
...
...
share-system/src/main/java/share/system/service/impl/SmsServiceImpl.java
View file @
1464646a
...
...
@@ -13,10 +13,7 @@ import org.springframework.stereotype.Service;
import
share.common.constant.Constants
;
import
share.common.constant.SmsConts
;
import
share.common.core.redis.RedisUtil
;
import
share.common.enums.DeviceStatusEnum
;
import
share.common.enums.SmsStatusEnum
;
import
share.common.enums.SmsTypeEnum
;
import
share.common.enums.YesNoEnum
;
import
share.common.enums.*
;
import
share.common.exception.base.BaseException
;
import
share.common.utils.BaseUtil
;
import
share.common.utils.SmsUtil
;
...
...
@@ -242,13 +239,18 @@ public class SmsServiceImpl implements SmsService {
*/
@Override
public
boolean
sendSmsOrderPredetermine
(
List
<
String
>
phones
,
SOrder
order
,
SStore
store
,
SRoom
room
)
{
String
key
=
SmsTypeEnum
.
SMS_ORDER_PREDETERMINE_TEMP
.
getValue
();
Integer
code
=
SmsTypeEnum
.
SMS_ORDER_PREDETERMINE_TEMP
.
getCode
();
if
(
order
.
getOrderType
().
equals
(
OrderTypeEnum
.
RENEW
.
getCode
()))
{
key
=
SmsTypeEnum
.
SMS_ORDER_RENEW_TEMP
.
getValue
();
code
=
SmsTypeEnum
.
SMS_ORDER_RENEW_TEMP
.
getCode
();
}
// 通过配置获取短信模版
String
configValue
=
sysConfigService
.
selectConfigByKey
(
SmsTypeEnum
.
SMS_ORDER_PREDETERMINE_TEMP
.
getValue
()
);
String
configValue
=
sysConfigService
.
selectConfigByKey
(
key
);
if
(
StrUtil
.
isNotEmpty
(
configValue
))
{
String
content
=
MessageFormat
.
format
(
configValue
,
store
.
getName
(),
room
.
getName
(),
DateUtil
.
formatDateTime
(
order
.
getPreStartDate
()),
DateUtil
.
formatDateTime
(
order
.
getPreEndDate
()));
return
sendManySms
(
phones
,
SmsTypeEnum
.
SMS_ORDER_PREDETERMINE_TEMP
.
getCode
(),
content
,
store
.
getId
(),
room
.
getId
());
return
sendManySms
(
phones
,
code
,
content
,
store
.
getId
(),
room
.
getId
());
}
else
{
return
Boolean
.
FALSE
;
}
...
...
share-system/src/main/resources/mapper/system/SOrderMapper.xml
View file @
1464646a
...
...
@@ -156,6 +156,51 @@
where out_trade_no=#{outTradeNo} and consumer_id=#{consumerId}
</select>
<select
id=
"selectSOrderByMaxTime"
parameterType=
"SOrder"
resultMap=
"SOrderResult"
>
select s.id,
s.order_no,
s.out_trade_no,
s.historical_order_no,
s.order_type,
s.pay_type,
s.pay_status,
s.store_id,
s.room_id,
s.consumer_id,
s.consumer_name,
s.consumer_phone,
s.pack_id,
s.pack_price,
s.coupon_id,
s.coupon_price,
s.total_price,
s.pay_price,
s.pay_time,
s.time_long,
s.pre_start_date,
s.pre_end_date,
s.start_date,
s.end_date,
s.status,
s.refund_status,
s.refund_reason,
s.refund_reason_time,
s.refund_price,
s.is_delete,
s.create_by,
s.create_time,
s.update_by,
s.update_time,
s.arrival_time,
s.remark
from s_order s inner join (
select room_id, max(create_time) as create_time, max(id) as id from s_order
where store_id = #{storeId}
and pay_status = 1 and is_delete = 0 and refund_status = 0
and DATE_FORMAT(create_time, '%Y-%m-%d') = DATE_FORMAT(#{createTime}, '%Y-%m-%d')
group by room_id) t on t.id = s.id;
</select>
<insert
id=
"insertSOrder"
parameterType=
"SOrder"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into s_order
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
...
...
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