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
fbcf9da9
Commit
fbcf9da9
authored
Aug 22, 2023
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
业务代码新增判断兼容算法返回数据错误
parent
c7fdca2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
10 deletions
+11
-10
CommonServiceImpl.java
...boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
+11
-10
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/CommonServiceImpl.java
View file @
fbcf9da9
...
@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
...
@@ -38,7 +38,7 @@ import java.util.stream.Collectors;
@Service
@Service
public
class
CommonServiceImpl
{
public
class
CommonServiceImpl
{
private
static
final
HashMap
<
String
,
Object
>
cacheExecInfo
=
new
HashMap
<>();
private
static
final
HashMap
<
String
,
Object
>
cacheExecInfo
=
new
HashMap
<>();
//utc时间格式
//utc时间格式
public
static
final
String
FORMAT_UTC
=
"yyyy-MM-dd'T'HH:mm:ss'Z'"
;
public
static
final
String
FORMAT_UTC
=
"yyyy-MM-dd'T'HH:mm:ss'Z'"
;
public
static
final
String
FORMAT_DEFAULT
=
"yyyy-MM-dd HH:mm:ss"
;
public
static
final
String
FORMAT_DEFAULT
=
"yyyy-MM-dd HH:mm:ss"
;
...
@@ -58,7 +58,7 @@ public class CommonServiceImpl {
...
@@ -58,7 +58,7 @@ public class CommonServiceImpl {
@Value
(
"${gkblhf.key:input 1}"
)
@Value
(
"${gkblhf.key:input 1}"
)
String
gkqjhfkey
;
String
gkqjhfkey
;
//----------------工况变量相关性计算请求属性配置------------------------
//----------------工况变量相关性计算请求属性配置------------------------
@Value
(
"${gkxgxfxfan.url:
b5797e0a-d456-44d3-9f21-9528e5321b74
}"
)
@Value
(
"${gkxgxfxfan.url:
7e40b660-67d5-4678-886d-da125a3c4587
}"
)
String
gkxgxfxurlfan
;
String
gkxgxfxurlfan
;
@Value
(
"${gkxgxfxpv.url:3d583330-1b3c-4c7a-b904-9e94f3de9fc9}"
)
@Value
(
"${gkxgxfxpv.url:3d583330-1b3c-4c7a-b904-9e94f3de9fc9}"
)
String
gkxgxfxurlpv
;
String
gkxgxfxurlpv
;
...
@@ -990,14 +990,10 @@ public class CommonServiceImpl {
...
@@ -990,14 +990,10 @@ public class CommonServiceImpl {
HashMap
<
String
,
Object
>
realParams
=
new
HashMap
<>();
HashMap
<
String
,
Object
>
realParams
=
new
HashMap
<>();
realParams
.
put
(
gkzxzjskey1
,
values
);
realParams
.
put
(
gkzxzjskey1
,
values
);
String
response
=
HttpUtil
.
createPost
(
baseUrl
+
jkzsjsfjurl
).
body
(
JSON
.
toJSONString
(
realParams
)).
execute
().
body
();
String
response
=
HttpUtil
.
createPost
(
baseUrl
+
jkzsjsfjurl
).
body
(
JSON
.
toJSONString
(
realParams
)).
execute
().
body
();
logger
.
info
(
"--------------------repsonse: "
+
response
);
logger
.
info
(
"------------------------------------------调用健康指数计算算法结束----------------------------------------"
);
JSONObject
result
=
JSON
.
parseObject
(
response
).
getJSONObject
(
"result"
);
JSONObject
result
=
JSON
.
parseObject
(
response
).
getJSONObject
(
"result"
);
if
(
null
!=
result
){
if
(
null
!=
result
){
JSONArray
jsonArray
=
result
.
getJSONObject
(
"result1"
).
getJSONArray
(
"rows"
);
JSONObject
jsonObject
=
result
.
getJSONObject
(
"result1"
).
getJSONObject
(
"rows"
);
List
<
JSONObject
>
jsonObjects
=
jsonArray
.
toJavaList
(
JSONObject
.
class
);
List
<
JSONObject
>
jsonObjects
=
JSON
.
parseArray
(
JSON
.
toJSONString
(
jsonObject
),
JSONObject
.
class
);
String
s
=
JSON
.
toJSONString
(
result
.
getJSONObject
(
"result1"
).
getString
(
"rows"
));
// List<JSONObject> jsonObjects = JSON.parseArray(s, JSONObject.class);
List
<
String
>
ids
=
new
ArrayList
<>();
List
<
String
>
ids
=
new
ArrayList
<>();
jsonObjects
.
stream
().
forEach
(
e
->
ids
.
add
(
e
.
getString
(
"analysisVariableId"
)));
jsonObjects
.
stream
().
forEach
(
e
->
ids
.
add
(
e
.
getString
(
"analysisVariableId"
)));
...
@@ -1009,11 +1005,10 @@ public class CommonServiceImpl {
...
@@ -1009,11 +1005,10 @@ public class CommonServiceImpl {
for
(
JSONObject
object
:
jsonObjects
)
{
for
(
JSONObject
object
:
jsonObjects
)
{
if
(
obj
.
getSequenceNbr
().
equals
(
object
.
getString
(
"analysisVariableId"
))){
if
(
obj
.
getSequenceNbr
().
equals
(
object
.
getString
(
"analysisVariableId"
))){
IdxBizFanHealthIndex
idxBizFanHealthIndex
=
new
IdxBizFanHealthIndex
();
IdxBizFanHealthIndex
idxBizFanHealthIndex
=
new
IdxBizFanHealthIndex
();
BeanUtils
.
copyProperties
(
obj
,
idxBizFanHealthIndex
);
BeanUtils
.
copyProperties
(
idxBizFanHealthIndex
,
obj
);
idxBizFanHealthIndex
.
setHealthIndex
(
object
.
getDouble
(
"indexValue"
));
idxBizFanHealthIndex
.
setHealthIndex
(
object
.
getDouble
(
"indexValue"
));
idxBizFanHealthIndex
.
setAnalysisObjSeq
(
obj
.
getSequenceNbr
());
idxBizFanHealthIndex
.
setAnalysisObjSeq
(
obj
.
getSequenceNbr
());
idxBizFanHealthIndex
.
setRecDate
(
new
Date
());
idxBizFanHealthIndex
.
setRecDate
(
new
Date
());
idxBizFanHealthIndex
.
setSequenceNbr
(
null
);
//获取健康指数对应等级
//获取健康指数对应等级
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>
query
=
new
LambdaQueryWrapper
<>();
query
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"设备"
);
query
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
"设备"
);
...
@@ -1031,6 +1026,12 @@ public class CommonServiceImpl {
...
@@ -1031,6 +1026,12 @@ public class CommonServiceImpl {
idxBizFanHealthIndexService
.
saveBatch
(
idxBizFanHealthIndexs
);
idxBizFanHealthIndexService
.
saveBatch
(
idxBizFanHealthIndexs
);
}
}
try
{
logger
.
info
(
"--------------------repsonse: "
+
response
);
logger
.
info
(
"------------------------------------------调用健康指数计算算法结束----------------------------------------"
);
}
catch
(
Exception
e
)
{
throw
new
RuntimeException
(
e
);
}
}
}
}
}
...
...
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