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
fd3720bb
Commit
fd3720bb
authored
Jan 27, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into dev-lms
parents
59ebac6c
c6c33481
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
22 deletions
+15
-22
DeviceController.java
...in/java/share/web/controller/system/DeviceController.java
+6
-17
SCleanRecordsServiceImpl.java
...a/share/system/service/impl/SCleanRecordsServiceImpl.java
+3
-0
SConsumerServiceImpl.java
.../java/share/system/service/impl/SConsumerServiceImpl.java
+1
-1
SOrderServiceImpl.java
...ain/java/share/system/service/impl/SOrderServiceImpl.java
+4
-3
DeviceMapper.xml
...-system/src/main/resources/mapper/system/DeviceMapper.xml
+1
-1
No files found.
share-front/src/main/java/share/web/controller/system/DeviceController.java
View file @
fd3720bb
...
...
@@ -9,6 +9,7 @@ import share.common.core.controller.BaseController;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.page.TableDataInfo
;
import
share.common.enums.BusinessType
;
import
share.common.enums.OpTypeEnum
;
import
share.common.enums.PositionEnum
;
import
share.common.enums.RoleTypeEnum
;
import
share.common.utils.SecurityUtils
;
...
...
@@ -20,10 +21,7 @@ import share.system.domain.vo.FrontTokenComponent;
import
share.system.domain.vo.MqttxVo
;
import
share.system.mapper.SStoreConsumerMapper
;
import
share.system.mqtt.MqttGatewayComponent
;
import
share.system.service.DeviceLogService
;
import
share.system.service.DeviceService
;
import
share.system.service.MqttxService
;
import
share.system.service.SConsumerService
;
import
share.system.service.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
...
...
@@ -38,15 +36,12 @@ import java.util.List;
@RequestMapping
(
"/device"
)
public
class
DeviceController
extends
BaseController
{
@Autowired
private
MqttxService
mqttxService
;
@Autowired
private
DeviceLogService
deviceLogService
;
@Autowired
private
MqttGatewayComponent
mqttGatewayComponent
;
private
DeviceOpService
deviceOpService
;
@Autowired
private
SConsumerService
consumerService
;
@Autowired
private
SStoreConsumerMapper
storeConsumerMapper
;
private
static
final
long
FIVE
=
5
;
/**
...
...
@@ -62,14 +57,8 @@ public class DeviceController extends BaseController {
if
(
CollectionUtils
.
isEmpty
(
longs
))
{
throw
new
RuntimeException
(
"当前用户不是管理员"
);
}
// 获取mqtt的topic、payload
MqttxVo
mqttxVo
=
mqttxService
.
openOrCloseDevice
(
deviceParam
.
getDevId
(),
user
.
getAccount
(),
deviceParam
.
getOpType
());
// 发送mqtt消息
mqttGatewayComponent
.
sendToMqtt
(
mqttxVo
.
getTopic
(),
0
,
mqttxVo
.
getPayload
());
// 写日志记录
int
result
=
deviceLogService
.
addDeviceLog
(
mqttxVo
,
user
.
getAccount
());
return
toAjax
(
result
);
deviceOpService
.
openOrCloseDevice
(
deviceParam
.
getRoomId
(),
user
.
getPhone
(),
deviceParam
.
getOpType
(),
true
,
FIVE
);
return
toAjax
(
true
);
}
}
share-system/src/main/java/share/system/service/impl/SCleanRecordsServiceImpl.java
View file @
fd3720bb
...
...
@@ -407,6 +407,9 @@ public class SCleanRecordsServiceImpl extends ServiceImpl<SCleanRecordsMapper,SC
@Override
public
List
<
SCleanRecords
>
unCleanedListByRoomIds
(
List
<
Long
>
roomIds
)
{
LambdaQueryWrapper
<
SCleanRecords
>
queryWrapper
=
new
LambdaQueryWrapper
<>();
if
(
CollectionUtils
.
isEmpty
(
roomIds
))
{
return
new
ArrayList
<>();
}
queryWrapper
.
in
(
SCleanRecords:
:
getRoomId
,
roomIds
);
queryWrapper
.
ne
(
SCleanRecords:
:
getStatus
,
CleaningStatusEnum
.
CLEANED
.
getCode
());
queryWrapper
.
orderByDesc
(
SCleanRecords:
:
getStartDate
);
...
...
share-system/src/main/java/share/system/service/impl/SConsumerServiceImpl.java
View file @
fd3720bb
...
...
@@ -288,7 +288,7 @@ public class SConsumerServiceImpl extends ServiceImpl<SConsumerMapper, SConsumer
List
<
Long
>
idList
=
ListUtil
.
toList
(
ids
);
List
<
SConsumer
>
list
=
baseMapper
.
selectBatchIds
(
idList
);
//解除所有门店关联
storeConsumerMapper
.
delete
BatchIds
(
idList
);
storeConsumerMapper
.
delete
(
new
LambdaQueryWrapper
<
SStoreConsumer
>().
in
(
SStoreConsumer:
:
getConsumerId
,
idList
)
);
list
.
stream
().
forEach
(
sConsumer
->
{
sConsumer
.
setRoleType
(
RoleTypeEnum
.
MEMBRO
.
getCode
());
});
...
...
share-system/src/main/java/share/system/service/impl/SOrderServiceImpl.java
View file @
fd3720bb
...
...
@@ -314,6 +314,10 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
throw
new
BaseException
(
"您的登录已过期,请先登录"
);
}
SStore
sStore
=
storeService
.
getById
(
request
.
getStoreId
());
SRoom
room
=
roomService
.
getById
(
request
.
getRoomId
());
if
(
ObjectUtil
.
isNotEmpty
(
room
)
&&
room
.
getIsDirtyRoom
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
throw
new
BaseException
(
"当前房间未保洁,请选择其他房间"
);
}
//生成订单
SOrder
sOrder
=
generatSOrder
(
request
,
user
);
//校验订单金额
...
...
@@ -1095,9 +1099,6 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
// 计算各种价格
ComputedOrderPriceResponse
priceResponse
=
new
ComputedOrderPriceResponse
();
SRoom
room
=
roomService
.
getById
(
request
.
getRoomId
());
if
(
ObjectUtil
.
isNotEmpty
(
room
)
&&
room
.
getIsDirtyRoom
().
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
throw
new
BaseException
(
"当前房间未保洁,请选择其他房间"
);
}
BigDecimal
totalPrice
=
computeTotalPrice
(
room
.
getPrice
(),
request
.
getPreStartDate
(),
request
.
getPreEndDate
());
BigDecimal
payPrice
;
BuyTypeEnum
buyTypeEnum
=
BuyTypeEnum
.
getEnumByCode
(
request
.
getBuyType
());
...
...
share-system/src/main/resources/mapper/system/DeviceMapper.xml
View file @
fd3720bb
...
...
@@ -34,7 +34,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
voltage, signal_value, room_id from s_device
</sql>
<select
id=
"selectDeviceList"
parameterType=
"Device"
resultMap=
"DeviceResult"
>
<select
id=
"selectDeviceList"
parameterType=
"Device
Dto
"
resultMap=
"DeviceResult"
>
select
t1.id,
t1.dev_name,
...
...
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