Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
amos-boot-biz
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
项目统一框架
amos-boot-biz
Commits
d742240b
Commit
d742240b
authored
Dec 14, 2023
by
zhangsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
工具API
parent
2103ab89
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
5 deletions
+50
-5
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+50
-5
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TDBigScreenAnalyseController.java
View file @
d742240b
...
@@ -17,6 +17,7 @@ import java.util.List;
...
@@ -17,6 +17,7 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.*
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.apache.commons.lang3.ObjectUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -63,11 +64,6 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper;
...
@@ -63,11 +64,6 @@ import com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanWaringRecordMapper;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexDayMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexDayMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvHealthIndexMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.PvWaringRecordMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanHealthIndexDay
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.FanWarningRecord
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndex
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdengine.PvHealthIndexDay
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdmapper.IndicatorDataMapper
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
import
com.yeejoin.amos.feign.privilege.Privilege
;
...
@@ -1543,4 +1539,53 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -1543,4 +1539,53 @@ public class TDBigScreenAnalyseController extends BaseController {
return
ResponseHelper
.
buildResponse
(
stringStringHashMap
);
return
ResponseHelper
.
buildResponse
(
stringStringHashMap
);
}
}
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@ApiOperation
(
httpMethod
=
"GET"
,
value
=
"字段修改 处置 改为 确认"
,
notes
=
"字段修改 处置 改为 确认"
)
@GetMapping
(
value
=
"/updateState"
)
public
ResponseModel
updateState
()
{
List
<
FanWarningRecord
>
list
=
fanWaringRecordMapper
.
selectList
(
null
);
list
.
forEach
(
item
->
{
if
(
"未处置"
.
equals
(
item
.
getDisposotionState
()))
{
item
.
setDisposotionState
(
"待确认"
);
}
else
if
(
"已处置"
.
equals
(
item
.
getDisposotionState
()))
{
item
.
setDisposotionState
(
"已确认"
);
}
});
ArrayList
<
FanWarningRecord
>
newList
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
//分批次处理
newList
.
add
(
list
.
get
(
i
));
//循环将数据填入载体list
if
(
500
==
newList
.
size
()
||
i
==
list
.
size
()
-
1
)
{
//载体list达到要求,进行批量操作
//调用批量插入
fanWaringRecordMapper
.
saveBatchWarningRecords
(
newList
);
newList
.
clear
();
//每次批量操作后,清空载体list,等待下次的数据填入
}
}
List
<
PvWarningRecord
>
list2
=
pvWaringRecordMapper
.
selectList
(
null
);
list2
.
forEach
(
item
->
{
if
(
"未处置"
.
equals
(
item
.
getDisposotionState
()))
{
item
.
setDisposotionState
(
"待确认"
);
}
else
if
(
"已处置"
.
equals
(
item
.
getDisposotionState
()))
{
item
.
setDisposotionState
(
"已确认"
);
}
});
ArrayList
<
PvWarningRecord
>
newList2
=
new
ArrayList
<>();
for
(
int
i
=
0
;
i
<
list2
.
size
();
i
++)
{
//分批次处理
newList2
.
add
(
list2
.
get
(
i
));
//循环将数据填入载体list
if
(
500
==
newList2
.
size
()
||
i
==
list2
.
size
()
-
1
)
{
//载体list达到要求,进行批量操作
//调用批量插入
pvWaringRecordMapper
.
saveBatchWarningRecords
(
newList2
);
newList2
.
clear
();
//每次批量操作后,清空载体list,等待下次的数据填入
}
}
return
ResponseHelper
.
buildResponse
(
null
);
}
}
}
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