Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
glinfo-api
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
林业通
glinfo-api
Commits
b2b8647d
提交
b2b8647d
authored
2月 21, 2022
作者:
林业通
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
记录、温控修改
上级
3a01765e
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
90 行增加
和
13 行删除
+90
-13
ShDeviceRecordController.java
...enbao/modules/sh/controller/ShDeviceRecordController.java
+1
-3
ShDeviceTempController.java
...o/enbao/modules/sh/controller/ShDeviceTempController.java
+65
-2
OtherShDeviceRecordDao.java
...h/glinfo/enbao/modules/sh/dao/OtherShDeviceRecordDao.java
+9
-0
ShDeviceTempForm.java
...a/tech/glinfo/enbao/modules/sh/form/ShDeviceTempForm.java
+7
-8
OtherShDeviceRecordService.java
.../enbao/modules/sh/service/OtherShDeviceRecordService.java
+2
-0
OtherShDeviceRecordServiceImpl.java
...dules/sh/service/impl/OtherShDeviceRecordServiceImpl.java
+6
-0
没有找到文件。
appapi/src/main/java/tech/glinfo/enbao/modules/sh/controller/ShDeviceRecordController.java
浏览文件 @
b2b8647d
...
...
@@ -32,9 +32,7 @@ public class ShDeviceRecordController {
if
(
StringUtils
.
isBlank
(
params
.
get
(
"deviceId"
)))
{
return
R
.
error
(
"缺少参数"
);
}
PageUtils
page
=
otherShDeviceRecordService
.
queryPage
(
params
);
return
R
.
ok
().
put
(
"page"
,
page
);
return
otherShDeviceRecordService
.
switchOutletRecord
(
params
);
}
...
...
appapi/src/main/java/tech/glinfo/enbao/modules/sh/controller/ShDeviceTempController.java
浏览文件 @
b2b8647d
...
...
@@ -104,10 +104,72 @@ public class ShDeviceTempController {
@Login
@GetMapping
(
"info/{id}"
)
@ApiOperation
(
"
定时详情(智能插座、开关、窗帘)
"
)
@ApiLog
(
"
定时
详情"
)
@ApiOperation
(
"
温控详情
"
)
@ApiLog
(
"
温控
详情"
)
public
R
info
(
@PathVariable
(
"id"
)
Integer
id
)
{
return
R
.
ok
().
put
(
"temp"
,
otherShDeviceTempService
.
getOne
(
new
QueryWrapper
<
ShDeviceTempEntity
>().
eq
(
"device_id"
,
id
)));
}
@Login
@PostMapping
(
"delete"
)
@ApiOperation
(
"智能插座删除温控"
)
@ApiLog
(
"智能插座删除温控"
)
public
R
delete
(
@RequestBody
Map
<
String
,
Object
>
params
)
{
Integer
id
=
(
Integer
)
params
.
get
(
"id"
);
Integer
deviceId
=
(
Integer
)
params
.
get
(
"deviceId"
);
if
(
StringUtils
.
isBlank
(
id
,
deviceId
))
{
return
R
.
error
(
"缺少参数"
);
}
otherShDeviceTempService
.
removeById
(
id
);
ShDeviceEntity
entity
=
otherShDeviceService
.
getById
(
deviceId
);
String
content
;
String
tempH
=
ByteUtils
.
signInt2HexString
(
"99"
,
2
);
String
tempL
=
ByteUtils
.
signInt2HexString
(
"-99"
,
2
);
content
=
tempH
+
ByteUtils
.
int2Hex
(
1
)
+
tempL
+
ByteUtils
.
int2Hex
(
1
)
+
"00000000"
;
ProtocolContent
protocol
=
new
ProtocolContent
();
protocol
.
setReceiveId
(
entity
.
getNumbering
());
protocol
.
setDeviceType
(
"03"
);
protocol
.
setCmd
(
"1A"
);
protocol
.
setContent
(
content
);
String
json
=
JSON
.
toJSONString
(
protocol
);
redisUtils
.
set
(
"device:sendtemp:"
+
entity
.
getNumbering
(),
json
);
return
R
.
ok
().
put
(
"temp"
,
otherShDeviceTempService
.
getOne
(
new
QueryWrapper
<
ShDeviceTempEntity
>().
eq
(
"device_id"
,
id
)));
}
@Login
@PostMapping
(
"delete1"
)
@ApiOperation
(
"智能开关删除温控"
)
@ApiLog
(
"智能开关删除温控"
)
public
R
delete1
(
@RequestBody
Map
<
String
,
Object
>
params
)
{
Integer
id
=
(
Integer
)
params
.
get
(
"id"
);
Integer
deviceId
=
(
Integer
)
params
.
get
(
"deviceId"
);
if
(
StringUtils
.
isBlank
(
id
,
deviceId
))
{
return
R
.
error
(
"缺少参数"
);
}
otherShDeviceTempService
.
removeById
(
id
);
ShDeviceEntity
entity
=
otherShDeviceService
.
getById
(
deviceId
);
String
content
;
String
tempH
=
ByteUtils
.
signInt2HexString
(
"99"
,
2
);
String
tempL
=
ByteUtils
.
signInt2HexString
(
"-99"
,
2
);
String
tempHT
=
ByteUtils
.
signInt2HexString
(
"99"
,
2
);
String
tempLT
=
ByteUtils
.
signInt2HexString
(
"-99"
,
2
);
content
=
tempH
+
ByteUtils
.
int2Hex
(
1
)
+
tempL
+
ByteUtils
.
int2Hex
(
1
)
+
tempHT
+
ByteUtils
.
int2Hex
(
1
)
+
tempLT
+
ByteUtils
.
int2Hex
(
1
);
ProtocolContent
protocol
=
new
ProtocolContent
();
protocol
.
setReceiveId
(
entity
.
getNumbering
());
protocol
.
setDeviceType
(
"02"
);
protocol
.
setCmd
(
"1A"
);
protocol
.
setContent
(
content
);
String
json
=
JSON
.
toJSONString
(
protocol
);
redisUtils
.
set
(
"device:sendtemp:"
+
entity
.
getNumbering
(),
json
);
return
R
.
ok
();
}
}
\ No newline at end of file
appapi/src/main/java/tech/glinfo/enbao/modules/sh/dao/OtherShDeviceRecordDao.java
浏览文件 @
b2b8647d
...
...
@@ -30,6 +30,15 @@ public interface OtherShDeviceRecordDao extends BaseMapper<ShDeviceRecordEntity>
" </script>"
)
List
<
Map
<
String
,
Object
>>
list
(
Page
<
Map
<
String
,
Object
>>
page
,
Map
<
String
,
Object
>
params
);
@Select
(
"<script>"
+
"SELECT a.create_time createTime, a.action FROM sh_device_record a WHERE a.device_id = ${deviceId}"
+
" <if test='start != null and start != \"\" and end != null and end != \"\"' > "
+
" and <![CDATA[ a.create_time >= #{start} and a.create_time <= #{end} ]]> "
+
" </if>"
+
"ORDER BY a.id DESC"
+
" </script>"
)
List
<
Map
<
String
,
Object
>>
list1
(
Map
<
String
,
Object
>
params
);
@Update
(
"update sh_device_record set remark = '' WHERE device_id = ${deviceId}"
)
void
clearRemark
(
Integer
deviceId
);
}
appapi/src/main/java/tech/glinfo/enbao/modules/sh/form/ShDeviceTempForm.java
浏览文件 @
b2b8647d
...
...
@@ -43,26 +43,25 @@ public class ShDeviceTempForm {
private
Integer
statusL
;
/**
* 高温
*/
@ApiModelProperty(value = "高温")
@NotNull
(
message
=
"高温不能为空"
)
@NotNull(message="高温不能为空")
*/
private
Integer
tempHT
;
/**
* 状态 1开 2关
*/
@ApiModelProperty(value = "状态")
@NotNull
(
message
=
"状态不能为空"
)
@NotNull(message="状态不能为空")
*/
private
Integer
statusHT
;
/**
* 高温
*/
@ApiModelProperty(value = "高温")
@NotNull
(
message
=
"高温不能为空"
)
@NotNull(message="高温不能为空")
*/
private
Integer
tempLT
;
/**
* 状态 1开 2关
*/
@ApiModelProperty(value = "状态")
@NotNull
(
message
=
"状态不能为空"
)
@NotNull(message="状态不能为空")
*/
private
Integer
statusLT
;
}
appapi/src/main/java/tech/glinfo/enbao/modules/sh/service/OtherShDeviceRecordService.java
浏览文件 @
b2b8647d
...
...
@@ -18,6 +18,8 @@ public interface OtherShDeviceRecordService extends IService<ShDeviceRecordEntit
PageUtils
queryPage
(
Map
<
String
,
Object
>
params
);
R
switchOutletRecord
(
Map
<
String
,
Object
>
params
);
R
clearRemark
(
Integer
deviceId
);
}
appapi/src/main/java/tech/glinfo/enbao/modules/sh/service/impl/OtherShDeviceRecordServiceImpl.java
浏览文件 @
b2b8647d
...
...
@@ -28,6 +28,12 @@ public class OtherShDeviceRecordServiceImpl extends ServiceImpl<OtherShDeviceRec
return
new
PageUtils
(
page
);
}
@Override
public
R
switchOutletRecord
(
Map
<
String
,
Object
>
params
)
{
List
<
Map
<
String
,
Object
>>
list
=
this
.
baseMapper
.
list1
(
params
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
@Override
public
R
clearRemark
(
Integer
deviceId
)
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论