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
f44e14a4
Commit
f44e14a4
authored
Nov 28, 2023
by
YG8999
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
短信提醒代码
parent
252bbed9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
109 additions
and
12 deletions
+109
-12
Constants.java
...common/src/main/java/share/common/constant/Constants.java
+1
-1
SmsTypeEnum.java
...-common/src/main/java/share/common/enums/SmsTypeEnum.java
+38
-0
SCleanRecordsController.java
.../share/web/controller/system/SCleanRecordsController.java
+3
-2
SmsLog.java
share-system/src/main/java/share/system/domain/SmsLog.java
+1
-1
DeviceOpService.java
...m/src/main/java/share/system/service/DeviceOpService.java
+14
-0
SmsService.java
...system/src/main/java/share/system/service/SmsService.java
+25
-7
DeviceOpServiceImpl.java
...n/java/share/system/service/impl/DeviceOpServiceImpl.java
+19
-0
SCleanRecordsServiceImpl.java
...a/share/system/service/impl/SCleanRecordsServiceImpl.java
+8
-1
SmsServiceImpl.java
...c/main/java/share/system/service/impl/SmsServiceImpl.java
+0
-0
No files found.
share-common/src/main/java/share/common/constant/Constants.java
View file @
f44e14a4
...
...
@@ -54,7 +54,7 @@ public class Constants
public
static
final
int
NUM_ONE_HUNDRED
=
100
;
//验证码过期时间
public
static
final
String
CONFIG_KEY_SMS_CODE_EXPIRE
=
"
1
"
;
public
static
final
String
CONFIG_KEY_SMS_CODE_EXPIRE
=
"
5
"
;
//头部 token令牌key
...
...
share-common/src/main/java/share/common/enums/SmsTypeEnum.java
0 → 100644
View file @
f44e14a4
package
share
.
common
.
enums
;
/**
* @className: share.common.enums.SmsTypeEnum
* @description: 短信类型
* @author: lwj
* @create: 2023-11-28 16:57
*/
public
enum
SmsTypeEnum
{
SMS_CODE_TEMP
(
1
,
"sms.code.template"
,
"短信验证码"
),
SMS_CLEAN_RECORDS_TEMP
(
2
,
"sms.clean.records.template"
,
"保洁任务短信提示"
),
SMS_CLEAN_RECORDS_TEMP_15
(
3
,
"sms.clean.records.template.15"
,
"即将保洁任务短信提醒"
)
;
private
Integer
code
;
private
String
value
;
private
String
name
;
SmsTypeEnum
(
Integer
code
,
String
value
,
String
name
)
{
this
.
code
=
code
;
this
.
value
=
value
;
this
.
name
=
name
;
}
public
Integer
getCode
(){
return
code
;
}
public
String
getValue
()
{
return
value
;
}
public
String
getName
()
{
return
name
;
}
}
share-front/src/main/java/share/web/controller/system/SCleanRecordsController.java
View file @
f44e14a4
...
...
@@ -20,6 +20,7 @@ import share.common.annotation.Log;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.enums.BusinessType
;
import
share.common.enums.CleaningStatusEnum
;
import
share.system.domain.SCleanRecords
;
import
share.system.domain.SConsumer
;
import
share.system.domain.vo.FrontTokenComponent
;
...
...
@@ -105,7 +106,7 @@ public class SCleanRecordsController extends BaseController
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
sCleanRecords
.
setConsumerId
(
user
.
getId
());
sCleanRecords
.
setStartDate
(
DateUtil
.
date
());
sCleanRecords
.
setStatus
(
1
);
sCleanRecords
.
setStatus
(
CleaningStatusEnum
.
CLEANING
.
getCode
()
);
return
toAjax
(
sCleanRecordsService
.
startCleanRecords
(
sCleanRecords
));
}
...
...
@@ -120,7 +121,7 @@ public class SCleanRecordsController extends BaseController
SConsumer
user
=
FrontTokenComponent
.
getWxSConsumerEntry
();
sCleanRecords
.
setConsumerId
(
user
.
getId
());
sCleanRecords
.
setEndDate
(
DateUtil
.
date
());
sCleanRecords
.
setStatus
(
2
);
sCleanRecords
.
setStatus
(
CleaningStatusEnum
.
CLEANED
.
getCode
()
);
return
toAjax
(
sCleanRecordsService
.
updateSCleanRecords
(
sCleanRecords
));
}
...
...
share-system/src/main/java/share/system/domain/SmsLog.java
View file @
f44e14a4
...
...
@@ -43,7 +43,7 @@ public class SmsLog extends BaseEntity
/** 结果:1-成功,2-失败 */
@Excel
(
name
=
"结果:1-成功,2-失败"
)
private
Long
result
;
private
Integer
result
;
/** 返回内容 */
@Excel
(
name
=
"返回内容"
)
...
...
share-system/src/main/java/share/system/service/DeviceOpService.java
View file @
f44e14a4
package
share
.
system
.
service
;
import
share.system.domain.vo.DeviceParamVo
;
import
share.system.domain.vo.MqttxVo
;
/**
* @className: share.system.service.DeviceOpService
...
...
@@ -37,4 +38,17 @@ public interface DeviceOpService {
*/
void
addGatewayDevice
(
String
devId
,
String
userName
);
/**
* 远程语音播报
* @param roomId 房间id
* @param phone 操作用户
* @param content 语音内容
* @param startTime 开始时间
* @param endTime 结束时间
* @param number 播报次数
* @return
*/
void
actionExecute
(
Long
roomId
,
String
phone
,
String
content
,
String
startTime
,
String
endTime
,
String
number
);
}
share-system/src/main/java/share/system/service/SmsService.java
View file @
f44e14a4
...
...
@@ -12,12 +12,6 @@ import share.system.domain.SStore;
public
interface
SmsService
{
/**
* 查询短信模板接口
* @param
*/
JSONArray
queryTemplate
();
/**
* 发送短信验证码
* @param phone
* @return
...
...
@@ -25,10 +19,34 @@ public interface SmsService {
boolean
sendSmsCode
(
String
phone
);
/**
* 发送保洁
打扫
提示短信
* 发送保洁
任务
提示短信
* @param phone
* @return
*/
boolean
sendSmsCleanRecords
(
String
phone
,
SStore
store
,
SRoom
room
);
/**
* 发送即将保洁任务提示短信(订单结束前15分钟)
* @param phone
* @return
*/
boolean
sendSmsCleanRecordsRemind15
(
String
phone
,
SStore
store
,
SRoom
room
);
/**
* 发送订单即将开始提示短信(订单开始前15分钟)
* @param phone
* @return
*/
boolean
sendSmsOrderStartRemind
(
String
phone
,
SStore
store
,
SRoom
room
);
/**
* 发送订单即将结束提示短信(订单结束前15分钟)
* @param phone
* @return
*/
boolean
sendSmsOrderEndRemind
(
String
phone
,
SStore
store
,
SRoom
room
);
}
share-system/src/main/java/share/system/service/impl/DeviceOpServiceImpl.java
View file @
f44e14a4
...
...
@@ -124,6 +124,25 @@ public class DeviceOpServiceImpl implements DeviceOpService {
deviceLogService
.
addDeviceLog
(
mqttxVo
,
userName
);
}
@Override
public
void
actionExecute
(
Long
roomId
,
String
phone
,
String
content
,
String
startTime
,
String
endTime
,
String
number
)
{
SRoom
room
=
roomMapper
.
selectSRoomById
(
roomId
);
if
(
room
!=
null
)
{
Device
param
=
new
Device
();
param
.
setRoomId
(
room
.
getId
());
param
.
setDevType
(
DeviceType
.
DEVICE_0001
.
getCode
());
List
<
Device
>
list
=
deviceMapper
.
selectDeviceList
(
param
);
for
(
Device
device
:
list
)
{
// 获取mqtt的topic、payload
MqttxVo
mqttxVo
=
mqttxService
.
actionExecute
(
device
.
getDevId
(),
phone
,
content
,
startTime
,
endTime
,
number
);
// 发送mqtt消息
mqttGatewayComponent
.
sendToMqtt
(
mqttxVo
.
getTopic
(),
0
,
mqttxVo
.
getPayload
());
// 写日志记录
deviceLogService
.
addDeviceLog
(
mqttxVo
,
phone
);
}
}
}
}
share-system/src/main/java/share/system/service/impl/SCleanRecordsServiceImpl.java
View file @
f44e14a4
...
...
@@ -203,13 +203,20 @@ public class SCleanRecordsServiceImpl implements ISCleanRecordsService
@Override
public
int
startCleanRecords
(
SCleanRecords
sCleanRecords
)
{
LambdaQueryWrapper
<
SCleanRecords
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
queryWrapper
.
eq
(
SCleanRecords:
:
getStatus
,
1
);
queryWrapper
.
eq
(
SCleanRecords:
:
getStatus
,
CleaningStatusEnum
.
CLEANING
.
getCode
()
);
queryWrapper
.
eq
(
SCleanRecords:
:
getConsumerId
,
sCleanRecords
.
getConsumerId
());
queryWrapper
.
ne
(
SCleanRecords:
:
getId
,
sCleanRecords
.
getId
());
List
<
SCleanRecords
>
list
=
sCleanRecordsMapper
.
selectList
(
queryWrapper
);
if
(
list
.
size
()
>
0
)
{
throw
new
RuntimeException
(
"当前用户有未结束的保洁任务"
);
}
SCleanRecords
records
=
sCleanRecordsMapper
.
selectSCleanRecordsById
(
sCleanRecords
.
getId
());
if
(
records
==
null
)
{
throw
new
RuntimeException
(
"当前保洁任务不存在!"
);
}
if
(!
records
.
getStatus
().
equals
(
CleaningStatusEnum
.
UNCLEAN
.
getCode
()))
{
throw
new
RuntimeException
(
"当前保洁任务已开始或完成"
);
}
return
updateSCleanRecords
(
sCleanRecords
);
}
...
...
share-system/src/main/java/share/system/service/impl/SmsServiceImpl.java
View file @
f44e14a4
This diff is collapsed.
Click to expand it.
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