Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety-progress
Project
Project
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
耿迪迪
gassafety-progress
Commits
4edd8300
Commit
4edd8300
authored
Apr 08, 2022
by
王晓倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
泽宏云定时推送设备状态接口停用
parent
8b77de02
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
42 deletions
+37
-42
TDetectorReportController.java
...g/web/controller/supervise/TDetectorReportController.java
+37
-42
No files found.
gassafetyprogress-admin/src/main/java/com/zehong/web/controller/supervise/TDetectorReportController.java
View file @
4edd8300
...
...
@@ -303,51 +303,46 @@ public class TDetectorReportController extends BaseController
return
AjaxResult
.
success
();
}
@ApiOperation
(
value
=
"泽宏报警器更新数据推送接口"
)
@PostMapping
(
"/reportZHDeviceStatus"
)
public
AjaxResult
reportZHDeviceStatus
(
@RequestBody
List
<
TDetectorInfoDTO
>
tDetectorInfoDTOList
){
log
.
info
(
tDetectorInfoDTOList
.
toString
());
List
<
TDetectorInfo
>
list
=
new
ArrayList
<>();
try
{
for
(
TDetectorInfoDTO
dto
:
tDetectorInfoDTOList
){
TDetectorInfo
tDetectorInfo
=
new
TDetectorInfo
();
tDetectorInfo
.
setDetectorCode
(
dto
.
getDeviceCode
());
// 1探测器
if
(!
StringUtils
.
isEmpty
(
dto
.
getDeviceType
())
&&
dto
.
getDeviceType
().
equals
(
"1"
))
{
if
(!
StringUtils
.
isEmpty
(
dto
.
getDeviceStatus
())
&&
dto
.
getDeviceStatus
().
equals
(
"1"
))
{
tDetectorInfo
.
setDetectorStatus
(
"0"
);
tDetectorInfo
.
setAlarmTime
(
null
);
}
else
if
(
new
ArrayList
<
String
>(
Arrays
.
asList
(
"7"
,
"9"
)).
contains
(
dto
.
getDeviceStatus
()))
{
tDetectorInfo
.
setDetectorStatus
(
"1"
);
tDetectorInfo
.
setAlarmTime
(
dto
.
getAlarmTime
());
}
else
{
tDetectorInfo
.
setDetectorStatus
(
"2"
);
tDetectorInfo
.
setAlarmTime
(
dto
.
getAlarmTime
());
}
tDetectorInfo
.
setUpdateTime
(
new
Date
());
}
// else{
// if(!StringUtils.isEmpty(dto.getDetectorStatus()) && dto.getDetectorStatus().equals("0")){
// @ApiOperation(value = "泽宏报警器更新数据推送接口")
// @PostMapping("/reportZHDeviceStatus")
// public AjaxResult reportZHDeviceStatus(@RequestBody List<TDetectorInfoDTO> tDetectorInfoDTOList){
//
// log.info(tDetectorInfoDTOList.toString());
//
// List<TDetectorInfo> list = new ArrayList<>();
//
// try {
// for(TDetectorInfoDTO dto : tDetectorInfoDTOList){
// TDetectorInfo tDetectorInfo = new TDetectorInfo();
// tDetectorInfo.setDetectorCode(dto.getDeviceCode());
//
// // 1探测器
// if(!StringUtils.isEmpty(dto.getDeviceType()) && dto.getDeviceType().equals("1")) {
// if (!StringUtils.isEmpty(dto.getDeviceStatus()) && dto.getDeviceStatus().equals("1")) {
// tDetectorInfo.setDetectorStatus("0");
// tDetectorInfo.setAlarmTime(null);
// } else if (new ArrayList<String>(Arrays.asList("7", "9")).contains(dto.getDeviceStatus())) {
// tDetectorInfo.setDetectorStatus("1");
// tDetectorInfo.setAlarmTime(dto.getAlarmTime());
// } else {
// tDetectorInfo.setDetectorStatus("2");
// tDetectorInfo.setAlarmTime(dto.getAlarmTime());
// }
// tDetectorInfo.setUpdateTime(new Date());
// }
//
// list.add(tDetectorInfo);
// }
//
// tDetectorInfoService.updateBatch(list);
// } catch (Exception e) {
// e.printStackTrace();
// log.error("【泽宏设备状态】操作出错,error={}",e.getMessage());
// throw new IOCException(ResultEnum.OPERATION_FAIL);
// }
//
// return AjaxResult.success();
// }
list
.
add
(
tDetectorInfo
);
}
tDetectorInfoService
.
updateBatch
(
list
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
log
.
error
(
"【泽宏设备状态】操作出错,error={}"
,
e
.
getMessage
());
throw
new
IOCException
(
ResultEnum
.
OPERATION_FAIL
);
}
return
AjaxResult
.
success
();
}
@ApiOperation
(
value
=
"泽宏设备预警数据推送接口"
)
@PostMapping
(
"/reportZHDeviceAlarmData"
)
...
...
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