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
948b2602
Commit
948b2602
authored
Nov 24, 2023
by
chenzhao
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://36.40.66.175:5000/moa/amos-boot-biz
into developer
parents
ad9e7f32
6d415da2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
18 deletions
+61
-18
TDBigScreenAnalyseController.java
...le/jxiop/biz/controller/TDBigScreenAnalyseController.java
+61
-18
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 @
948b2602
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
...
@@ -2,7 +2,6 @@ package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import
static
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
.
DateUtils
.
DATE_TIME_PATTERN
;
import
static
com
.
yeejoin
.
amos
.
boot
.
biz
.
common
.
utils
.
DateUtils
.
DATE_TIME_PATTERN
;
import
java.io.UnsupportedEncodingException
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.text.DecimalFormat
;
import
java.text.DecimalFormat
;
import
java.text.ParseException
;
import
java.text.ParseException
;
...
@@ -18,8 +17,6 @@ import java.util.List;
...
@@ -18,8 +17,6 @@ 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.tdMapper2.*
;
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
;
...
@@ -32,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestParam;
...
@@ -32,6 +29,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.foundation.enumeration.UserType
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.doc.TycloudOperation
;
import
org.typroject.tyboot.core.restful.exception.instance.BadRequest
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseHelper
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
import
org.typroject.tyboot.core.restful.utils.ResponseModel
;
...
@@ -59,12 +57,22 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper;
...
@@ -59,12 +57,22 @@ import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.IdxBizPvHealthLevelMapper;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.CommonServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizFanWarningRuleSetServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.service.impl.IdxBizPvWarningRuleSetServiceImpl
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexDayMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.tdMapper2.FanHealthIndexMapper
;
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.PvHealthIndexMapper
;
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
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.text.CharSequenceUtil
;
import
cn.hutool.core.text.CharSequenceUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -1195,43 +1203,65 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -1195,43 +1203,65 @@ public class TDBigScreenAnalyseController extends BaseController {
@ApiOperation
(
value
=
"修改业务事实表的一条数据"
)
@ApiOperation
(
value
=
"修改业务事实表的一条数据"
)
@PutMapping
(
"/updateRowAndManyTable"
)
@PutMapping
(
"/updateRowAndManyTable"
)
public
ResponseModel
<
Boolean
>
updateRowAndManyTable
(
@RequestBody
Map
<
String
,
Object
>
kv
)
{
public
ResponseModel
<
Boolean
>
updateRowAndManyTable
(
@RequestBody
Map
<
String
,
Object
>
kv
)
{
String
errorMsg
=
null
;
if
(
"安全"
.
equals
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()))
{
if
(
"安全"
.
equals
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()))
{
if
((!
"100.0"
.
equals
(
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
())
if
((!
"100.0"
.
equals
(
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
())
&&
!
"100"
.
equals
(
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
())))
{
&&
!
"100"
.
equals
(
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
())))
{
throw
new
RuntimeException
(
"安全的分数
上限只能是100"
);
throw
new
BadRequest
(
"安全的
上限只能是100"
);
}
}
List
<
IdxBizFanHealthLevel
>
list
=
idxBizFanHealthLevelMapper
.
selectList
(
List
<
IdxBizFanHealthLevel
>
list
=
idxBizFanHealthLevelMapper
new
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>().
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
)));
.
selectList
(
new
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>()
Map
<
String
,
Double
>
map
=
list
.
stream
().
collect
(
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
)));
Map
<
String
,
Double
>
lmap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
IdxBizFanHealthLevel:
:
getHealthLevel
,
IdxBizFanHealthLevel:
:
getGroupLowerLimit
));
Collectors
.
toMap
(
IdxBizFanHealthLevel:
:
getHealthLevel
,
IdxBizFanHealthLevel:
:
getGroupLowerLimit
));
if
(
Double
.
valueOf
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
())
<=
map
.
get
(
"注意"
))
{
if
(
Double
.
valueOf
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
())
<=
l
map
.
get
(
"注意"
))
{
throw
new
RuntimeException
(
"安全的下限和注意的上限不能低
于注意的下限"
);
throw
new
BadRequest
(
"安全的下限和注意的上限不能低于或等
于注意的下限"
);
}
}
}
else
if
(
"注意"
.
equals
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()))
{
}
else
if
(
"注意"
.
equals
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()))
{
List
<
IdxBizFanHealthLevel
>
list
=
idxBizFanHealthLevelMapper
.
selectList
(
List
<
IdxBizFanHealthLevel
>
list
=
idxBizFanHealthLevelMapper
new
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>().
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
)));
.
selectList
(
new
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>()
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
)));
Map
<
String
,
Double
>
map
=
list
.
stream
().
collect
(
Map
<
String
,
Double
>
map
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
IdxBizFanHealthLevel:
:
getHealthLevel
,
IdxBizFanHealthLevel:
:
getGroupLowerLimit
));
Collectors
.
toMap
(
IdxBizFanHealthLevel:
:
getHealthLevel
,
IdxBizFanHealthLevel:
:
getGroupLowerLimit
));
if
(
Double
.
valueOf
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
())
<=
map
.
get
(
"警告"
))
{
if
(
Double
.
valueOf
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
())
<=
map
.
get
(
"警告"
))
{
throw
new
RuntimeException
(
"注意的下限和安全的上限不能低于安全的下限"
);
throw
new
BadRequest
(
"注意的下限和安全的上限不能低于或等于安全的下限"
);
}
Map
<
String
,
Double
>
umap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
IdxBizFanHealthLevel:
:
getHealthLevel
,
IdxBizFanHealthLevel:
:
getGroupLowerLimit
));
if
(
Double
.
valueOf
(
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
())
>=
umap
.
get
(
"安全"
))
{
throw
new
BadRequest
(
"注意的上限和安全的下限不能高于或等于安全的上限"
);
}
}
}
else
if
(
"警告"
.
equals
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()))
{
}
else
if
(
"警告"
.
equals
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()))
{
List
<
IdxBizFanHealthLevel
>
list
=
idxBizFanHealthLevelMapper
.
selectList
(
List
<
IdxBizFanHealthLevel
>
list
=
idxBizFanHealthLevelMapper
new
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>().
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
)));
.
selectList
(
new
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>()
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
)));
Map
<
String
,
Double
>
map
=
list
.
stream
().
collect
(
Map
<
String
,
Double
>
map
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
IdxBizFanHealthLevel:
:
getHealthLevel
,
IdxBizFanHealthLevel:
:
getGroupLowerLimit
));
Collectors
.
toMap
(
IdxBizFanHealthLevel:
:
getHealthLevel
,
IdxBizFanHealthLevel:
:
getGroupLowerLimit
));
if
(
Double
.
valueOf
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
())
<=
map
.
get
(
"危险"
))
{
if
(
Double
.
valueOf
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
())
<=
map
.
get
(
"危险"
))
{
throw
new
RuntimeException
(
"警告的下限和注意的上限不能低于注意的下限"
);
throw
new
BadRequest
(
"警告的下限和注意的上限不能低于或等于注意的下限"
);
}
Map
<
String
,
Double
>
umap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
IdxBizFanHealthLevel:
:
getHealthLevel
,
IdxBizFanHealthLevel:
:
getGroupLowerLimit
));
if
(
Double
.
valueOf
(
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
())
>=
umap
.
get
(
"警告"
))
{
throw
new
BadRequest
(
"警告的上限和注意的下限不能高于或等于注意的上限"
);
}
}
}
else
if
(
"危险"
.
equals
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()))
{
}
else
if
(
"危险"
.
equals
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()))
{
if
((!
"0.0"
.
equals
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
())
if
((!
"0.0"
.
equals
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
())
&&
!
"0"
.
equals
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
())))
{
&&
!
"0"
.
equals
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
())))
{
throw
new
RuntimeException
(
"危险的分数下限只能是0"
);
throw
new
BadRequest
(
"危险的下限只能是0"
);
}
List
<
IdxBizFanHealthLevel
>
list
=
idxBizFanHealthLevelMapper
.
selectList
(
new
LambdaQueryWrapper
<
IdxBizFanHealthLevel
>()
.
eq
(
IdxBizFanHealthLevel:
:
getAnalysisObjType
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
)));
Map
<
String
,
Double
>
umap
=
list
.
stream
().
collect
(
Collectors
.
toMap
(
IdxBizFanHealthLevel:
:
getHealthLevel
,
IdxBizFanHealthLevel:
:
getGroupLowerLimit
));
if
(
Double
.
valueOf
(
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
())
>=
umap
.
get
(
"危险"
))
{
throw
new
BadRequest
(
"危险的上限和警告的下限不能高于或等于警告的上限"
);
}
}
}
}
if
(
Double
.
valueOf
(
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
())
<=
Double
if
(
Double
.
valueOf
(
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
())
<=
Double
.
valueOf
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
()))
{
.
valueOf
(
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
()))
{
throw
new
RuntimeException
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()
+
"的分数上限不能小于或等于本
身下限"
);
throw
new
BadRequest
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()
+
"的上限不能低于或等于自
身下限"
);
}
}
idxBizFanHealthLevelMapper
.
updateByInfo
(
"idx_biz_pv_health_level"
,
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
(),
idxBizFanHealthLevelMapper
.
updateByInfo
(
"idx_biz_pv_health_level"
,
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
(),
...
@@ -1251,11 +1281,24 @@ public class TDBigScreenAnalyseController extends BaseController {
...
@@ -1251,11 +1281,24 @@ public class TDBigScreenAnalyseController extends BaseController {
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
(),
null
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"警告"
);
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
(),
null
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"警告"
);
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_pv_health_level"
,
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_pv_health_level"
,
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
(),
null
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"警告"
);
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
(),
null
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"警告"
);
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_fan_health_level"
,
null
,
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
(),
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"安全"
);
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_pv_health_level"
,
null
,
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
(),
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"安全"
);
}
else
if
(
"警告"
.
equals
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()))
{
}
else
if
(
"警告"
.
equals
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()))
{
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_fan_health_level"
,
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_fan_health_level"
,
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
(),
null
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"危险"
);
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
(),
null
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"危险"
);
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_pv_health_level"
,
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_pv_health_level"
,
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
(),
null
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"危险"
);
kv
.
get
(
"GROUP_LOWER_LIMIT"
).
toString
(),
null
,
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"危险"
);
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_fan_health_level"
,
null
,
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
(),
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"注意"
);
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_pv_health_level"
,
null
,
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
(),
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"注意"
);
}
else
if
(
"危险"
.
equals
(
kv
.
get
(
"HEALTH_LEVEL"
).
toString
()))
{
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_fan_health_level"
,
null
,
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
(),
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"警告"
);
idxBizFanHealthLevelMapper
.
updateByInfoIsNull
(
"idx_biz_pv_health_level"
,
null
,
kv
.
get
(
"GROUP_UPPER_LIMIT"
).
toString
(),
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
(),
"警告"
);
}
}
if
(
"测点"
.
equals
(
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
()))
{
if
(
"测点"
.
equals
(
kv
.
get
(
"ANALYSIS_OBJ_TYPE"
).
toString
()))
{
LambdaUpdateWrapper
<
IdxBizFanWarningRuleSet
>
lambda1
=
new
LambdaUpdateWrapper
<>();
LambdaUpdateWrapper
<
IdxBizFanWarningRuleSet
>
lambda1
=
new
LambdaUpdateWrapper
<>();
...
...
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