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
42753a79
Commit
42753a79
authored
Feb 28, 2024
by
caotao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
智能分析指标权限配置权限过滤问题处理
parent
357809bf
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
3 deletions
+62
-3
TdInfoQueryController.java
...ot/module/jxiop/biz/controller/TdInfoQueryController.java
+25
-2
FanHealthIndexDto.java
...oin/amos/boot/module/jxiop/biz/dto/FanHealthIndexDto.java
+1
-0
PvHealthIndexDto.java
...join/amos/boot/module/jxiop/biz/dto/PvHealthIndexDto.java
+1
-0
HealthStatusIndicatorServiceImpl.java
...op/biz/service/impl/HealthStatusIndicatorServiceImpl.java
+2
-0
IdxBizPvHealthIndexMapper.xml
...in/resources/mapper/cluster/IdxBizPvHealthIndexMapper.xml
+3
-1
FanHealthIndex.xml
...iz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
+6
-0
PvHealthIndex.xml
...biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
+11
-0
JxiopServiceFeignClient.java
.../boot/module/jxiop/api/feign/JxiopServiceFeignClient.java
+13
-0
No files found.
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/controller/TdInfoQueryController.java
View file @
42753a79
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
biz
.
controller
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.fasterxml.jackson.core.type.TypeReference
;
import
cn.hutool.core.text.CharSequenceUtil
;
import
cn.hutool.core.util.StrUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
import
com.yeejoin.amos.boot.biz.common.bo.ReginParams
;
import
com.yeejoin.amos.boot.biz.common.controller.BaseController
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.boot.module.jxiop.biz.amosprojectentity.StdUserEmpower
;
import
com.yeejoin.amos.boot.module.jxiop.biz.amosprojectmapper.UserEmpowerMapper
;
import
com.yeejoin.amos.boot.module.jxiop.biz.core.framework.GatewayIdAutowired
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FanHealthIndexDto
;
import
com.yeejoin.amos.boot.module.jxiop.biz.dto.FullViewRecallDataDTO
;
...
...
@@ -44,7 +49,7 @@ import static com.yeejoin.amos.boot.biz.common.utils.DateUtils.DATE_TIME_PATTERN
@RestController
@Api
(
tags
=
"智能分析相关API - TD数据源"
)
@RequestMapping
(
value
=
"/tdInfoQueryApi"
)
public
class
TdInfoQueryController
{
public
class
TdInfoQueryController
extends
BaseController
{
@Autowired
private
FanHealthIndexMapper
fanHealthIndexMapper
;
...
...
@@ -67,13 +72,23 @@ public class TdInfoQueryController {
@Autowired
IdxBizFanHealthIndexMapper
idxBizFanHealthIndexMapper
;
public
final
DecimalFormat
df
=
new
DecimalFormat
(
"#.0"
);
@Autowired
UserEmpowerMapper
userEmpowerMapper
;
@TycloudOperation
(
ApiLevel
=
UserType
.
AGENCY
,
needAuth
=
false
)
@PostMapping
(
value
=
"/getFanHealthIndexInfo"
)
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"分页查询健康指数信息 - 风电"
,
notes
=
"分页查询健康指数信息 - 风电"
)
@GatewayIdAutowired
public
ResponseModel
<
Page
<
FanHealthIndex
>>
getFanHealthIndexInfo
(
@RequestBody
FanHealthIndexDto
dto
)
throws
ParseException
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
).
eq
(
"permission_type"
,
"YTH"
));
String
orgCode
=
"86"
;
if
(!
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
orgCode
=
stdUserEmpower
.
getAmosOrgCode
().
get
(
0
);
}
dto
.
setOrgCode
(
orgCode
);
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getStartDate
()))
{
String
startDate
=
dto
.
getStartDate
();
Date
date
=
DateUtils
.
dateParse
(
startDate
,
DATE_TIME_PATTERN
);
...
...
@@ -142,6 +157,14 @@ public class TdInfoQueryController {
@ApiOperation
(
httpMethod
=
"POST"
,
value
=
"分页查询健康指数信息 - 光伏"
,
notes
=
"分页查询健康指数信息 - 光伏"
)
@GatewayIdAutowired
public
ResponseModel
<
Page
<
PvHealthIndex
>>
getPvHealthIndexInfo
(
@RequestBody
PvHealthIndexDto
dto
)
throws
ParseException
{
ReginParams
reginParams
=
getSelectedOrgInfo
();
String
userId
=
reginParams
.
getUserModel
().
getUserId
();
StdUserEmpower
stdUserEmpower
=
userEmpowerMapper
.
selectOne
(
new
QueryWrapper
<
StdUserEmpower
>().
eq
(
"amos_user_id"
,
userId
).
eq
(
"permission_type"
,
"YTH"
));
String
orgCode
=
"86"
;
if
(!
ObjectUtils
.
isEmpty
(
stdUserEmpower
))
{
orgCode
=
stdUserEmpower
.
getAmosOrgCode
().
get
(
0
);
}
dto
.
setOrgCode
(
orgCode
);
if
(
CharSequenceUtil
.
isNotEmpty
(
dto
.
getStartDate
()))
{
String
startDate
=
dto
.
getStartDate
();
Date
date
=
DateUtils
.
dateParse
(
startDate
,
DATE_TIME_PATTERN
);
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/FanHealthIndexDto.java
View file @
42753a79
...
...
@@ -44,5 +44,6 @@ public class FanHealthIndexDto implements Serializable {
private
String
subarray
;
private
String
sortOne
;
private
String
sortsString
;
private
String
orgCode
;
private
List
<
String
>
gatewayIds
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/dto/PvHealthIndexDto.java
View file @
42753a79
...
...
@@ -45,5 +45,6 @@ public class PvHealthIndexDto {
private
String
orderColumns
;
private
String
sortOne
;
private
String
sortsString
;
private
String
orgCode
;
private
List
<
String
>
gatewayIds
;
}
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/java/com/yeejoin/amos/boot/module/jxiop/biz/service/impl/HealthStatusIndicatorServiceImpl.java
View file @
42753a79
...
...
@@ -470,6 +470,7 @@ public class HealthStatusIndicatorServiceImpl {
pvWarningRecord
.
setRecDate
(
format
);
pvWarningRecord
.
setTs
(
timestamp
);
pvWarningRecord
.
setHealthIndex
(
String
.
format
(
CommonConstans
.
Onedecimalplaces
,
idxBizPvHealthIndices
.
get
(
0
).
getHealthIndex
()));
pvWarningRecord
.
setOrgCode
(
idxBizPvHealthIndices
.
get
(
0
).
getOrgCode
());
tdPvWarningRecordList
.
add
(
pvWarningRecord
);
}
}
...
...
@@ -635,6 +636,7 @@ public class HealthStatusIndicatorServiceImpl {
pvWarningRecord
.
setRecDate
(
format
);
pvWarningRecord
.
setTs
(
timestamp
);
pvWarningRecord
.
setHealthIndex
(
String
.
format
(
CommonConstans
.
Onedecimalplaces
,
idxBizPvHealthIndices
.
get
(
0
).
getHealthIndex
()));
pvWarningRecord
.
setOrgCode
(
idxBizPvHealthIndices
.
get
(
0
).
getOrgCode
());
tdPvWarningRecordList
.
add
(
pvWarningRecord
);
}
}
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/cluster/IdxBizPvHealthIndexMapper.xml
View file @
42753a79
...
...
@@ -416,7 +416,8 @@
`ANOMALY`,
`POINT_NAME`,
`ANALYSIS_TIME`,
`KKS`
`KKS`,
`ORG_CODE`
)
values
<foreach
collection=
"list"
separator=
","
item=
"item"
index=
"index"
>
...
...
@@ -442,6 +443,7 @@
#{item.pointName, jdbcType=VARCHAR},
#{item.analysisTime, jdbcType=VARCHAR},
#{item.kks, jdbcType=VARCHAR}
#{item.orgCode, jdbcType=VARCHAR}
)
</foreach>
</insert>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/FanHealthIndex.xml
View file @
42753a79
...
...
@@ -177,6 +177,9 @@
<if
test=
"dto.equipmentName!= null and dto.equipmentName!= ''"
>
AND equipment_name = #{dto.equipmentName}
</if>
</where>
<if
test=
"dto.orgCode != null and dto.orgCode != ''"
>
org_code like CONCAT(#{dto.orgCode},'%')
</if>
<if
test=
"dto.orderColumns != null and dto.orderColumns != ''"
>
order by ${dto.orderColumns}
</if>
...
...
@@ -202,6 +205,9 @@
<if
test=
"dto.equipmentName!= null and dto.equipmentName!= ''"
>
AND equipment_name = #{dto.equipmentName}
</if>
</where>
<if
test=
"dto.orgCode != null and dto.orgCode != ''"
>
org_code like CONCAT(#{dto.orgCode},'%')
</if>
</select>
<select
id=
"saveBatchHealthIndexLatestInfo"
resultType=
"int"
>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-analyse-biz/src/main/resources/mapper/tdengine2/PvHealthIndex.xml
View file @
42753a79
...
...
@@ -115,6 +115,7 @@
subarray,
equipment_name,
avg(anomaly) as anomaly,
org_code,
AVG(health_index) as health_index
from
#{tableName}
...
...
@@ -138,6 +139,7 @@
area,
subarray,
avg(anomaly) as anomaly,
org_code,
AVG(health_index) as health_index
from
#{tableName}
...
...
@@ -159,6 +161,7 @@
'场站' as analysis_obj_type,
area,
avg(anomaly) as anomaly,
org_code,
AVG(health_index) as health_index
from
#{tableName}
...
...
@@ -177,6 +180,7 @@
'片区' as analysis_obj_type,
area,
avg(anomaly) as anomaly,
org_code,
AVG(health_index) as health_index
from
#{tableName}
...
...
@@ -203,6 +207,9 @@
<if
test=
"dto.equipmentName!= null and dto.equipmentName!= ''"
>
AND equipment_name = #{dto.equipmentName}
</if>
</where>
<if
test=
"dto.orgCode != null and dto.orgCode != ''"
>
org_code like CONCAT(#{dto.orgCode},'%')
</if>
<if
test=
"dto.orderColumns != null and dto.orderColumns != ''"
>
order by ${dto.orderColumns}
</if>
...
...
@@ -227,6 +234,9 @@
<if
test=
"dto.equipmentName!= null and dto.equipmentName!= ''"
>
AND equipment_name = #{dto.equipmentName}
</if>
</where>
<if
test=
"dto.orgCode != null and dto.orgCode != ''"
>
org_code like CONCAT(#{dto.orgCode},'%')
</if>
</select>
<select
id=
"saveBatchHealthIndexLatestInfo"
resultType=
"int"
>
...
...
@@ -255,6 +265,7 @@
#{item.pointName, jdbcType=VARCHAR},
#{item.analysisTime, jdbcType=VARCHAR},
#{item.kks, jdbcType=VARCHAR}
#{item.orgCode, jdbcType=VARCHAR}
)
</foreach>
</select>
...
...
amos-boot-system-jxiop/amos-boot-module-jxiop-api/src/main/java/com/yeejoin/amos/boot/module/jxiop/api/feign/JxiopServiceFeignClient.java
0 → 100644
View file @
42753a79
package
com
.
yeejoin
.
amos
.
boot
.
module
.
jxiop
.
api
.
feign
;
import
com.yeejoin.amos.component.feign.config.InnerInvokException
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
org.springframework.cloud.openfeign.FeignClient
;
import
org.springframework.web.bind.annotation.GetMapping
;
@FeignClient
(
name
=
"${amos.jxiop.name:AMOS-JXIOP}"
,
path
=
"jxiop"
,
configuration
=
{
FeignConfiguration
.
class
})
public
interface
JxiopServiceFeignClient
{
@GetMapping
(
value
=
"/auth/getJxiopOrgCode"
)
FeignClientResult
<
String
>
getJxiopOrgCode
()
throws
InnerInvokException
;
}
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